X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fdbconn.py;h=637301871a6bf4495036d8a004d7d3d8086f7fa2;hb=721447422c79c1150399824fa74dc0bcadd4d420;hp=7e9ff53931185fe8ce499654d4559bae3180e05c;hpb=e5bc0b3dccd5874054ad585157cbe2b05758b654;p=dak.git diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 7e9ff539..63730187 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -81,6 +81,9 @@ import warnings warnings.filterwarnings('ignore', \ "The SQLAlchemy PostgreSQL dialect has been renamed from 'postgres' to 'postgresql'.*", \ SADeprecationWarning) +warnings.filterwarnings('ignore', \ + "Predicate of partial index .* ignored during reflection", \ + SAWarning) ################################################################################ @@ -2491,6 +2494,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 +3011,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 +3036,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')