]> err.no Git - dak/commitdiff
add details method to Suite
authorMark Hymers <mhy@debian.org>
Sun, 31 May 2009 11:08:54 +0000 (12:08 +0100)
committerMark Hymers <mhy@debian.org>
Sun, 9 Aug 2009 15:49:25 +0000 (16:49 +0100)
Signed-off-by: Mark Hymers <mhy@debian.org>
daklib/dbconn.py

index 6e1184271ad02ef7493178515d8bf4afbce2a2cf..d2f4b594d00b60c320cb57045679785216671ef9 100755 (executable)
@@ -951,6 +951,26 @@ __all__.append('SrcUploader')
 
 ################################################################################
 
+SUITE_FIELDS = [ ('SuiteName', 'suite_name'),
+                 ('SuiteID', 'suite_id'),
+                 ('Version', 'version'),
+                 ('Origin', 'origin'),
+                 ('Label', 'label'),
+                 ('Description', 'description'),
+                 ('Untouchable', 'untouchable'),
+                 ('Announce', 'announce'),
+                 ('Codename', 'codename'),
+                 ('OverrideCodename', 'overridecodename'),
+                 ('ValidTime', 'validtime'),
+                 ('Priority', 'priority'),
+                 ('NotAutomatic', 'notautomatic'),
+                 ('CopyChanges', 'copychanges'),
+                 ('CopyDotDak', 'copydotdak'),
+                 ('CommentsDir', 'commentsdir'),
+                 ('OverrideSuite', 'overridesuite'),
+                 ('ChangelogBase', 'changelogbase')]
+
+
 class Suite(object):
     def __init__(self, *args, **kwargs):
         pass
@@ -958,6 +978,15 @@ class Suite(object):
     def __repr__(self):
         return '<Suite %s>' % self.suite_name
 
+    def details(self):
+        ret = []
+        for disp, field in SUITE_FIELDS:
+            val = getattr(self, field, None)
+            if val is not None:
+                ret.append("%s: %s" % (disp, val))
+
+        return "\n".join(ret)
+
 __all__.append('Suite')
 
 def get_suite_architecture(suite, architecture, session=None):