[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] add details method to Suite



Signed-off-by: Mark Hymers <mhy@debian.org>
---
 daklib/dbconn.py |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/daklib/dbconn.py b/daklib/dbconn.py
index 6e11842..d2f4b59 100755
--- a/daklib/dbconn.py
+++ b/daklib/dbconn.py
@@ -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):
-- 
1.5.6.5



Reply to: