From: Mark Hymers Date: Sun, 31 May 2009 11:08:54 +0000 (+0100) Subject: add details method to Suite X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=6f4eabfe1cf8f3794e81e7500752dc0720ce2838;p=dak.git add details method to Suite Signed-off-by: Mark Hymers --- diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 6e118427..d2f4b594 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 '' % 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):