X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fdbconn.py;h=1fa7974f5d0f5e2f2cdd4101c1621722bf86a731;hb=adcc4dcadd87c31ca52c4ec6b485375b56579e46;hp=7e9ff53931185fe8ce499654d4559bae3180e05c;hpb=e5bc0b3dccd5874054ad585157cbe2b05758b654;p=dak.git diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 7e9ff539..1fa7974f 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -2491,6 +2491,9 @@ class DBSource(ORMObject): metadata = association_proxy('key', 'value') + def get_component_name(self): + return self.poolfile.location.component.component_name + def scan_contents(self): ''' Returns a set of names for non directories. The path names are @@ -3005,11 +3008,11 @@ __all__.append('get_suite') ################################################################################ -# TODO: should be removed because the implementation is too trivial @session_wrapper def get_suite_architectures(suite, skipsrc=False, skipall=False, session=None): """ - Returns list of Architecture objects for given C{suite} name + Returns list of Architecture objects for given C{suite} name. The list is + empty if suite does not exist. @type suite: str @param suite: Suite name to search for @@ -3030,7 +3033,10 @@ def get_suite_architectures(suite, skipsrc=False, skipall=False, session=None): @return: list of Architecture objects for the given name (may be empty) """ - return get_suite(suite, session).get_architectures(skipsrc, skipall) + try: + return get_suite(suite, session).get_architectures(skipsrc, skipall) + except AttributeError: + return [] __all__.append('get_suite_architectures')