From 6f4eabfe1cf8f3794e81e7500752dc0720ce2838 Mon Sep 17 00:00:00 2001 From: Mark Hymers Date: Sun, 31 May 2009 12:08:54 +0100 Subject: [PATCH] add details method to Suite Signed-off-by: Mark Hymers --- daklib/dbconn.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) 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): -- 2.39.5