Don't import the portage.dbapi.dbapi class as portage.dbapi anymore, since
authorZac Medico <zmedico@gentoo.org>
Mon, 22 Feb 2010 01:49:55 +0000 (01:49 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 22 Feb 2010 01:49:55 +0000 (01:49 -0000)
it results in a strange namespace collision (portage.dbapi is both a class
and a module). Hopefully this won't break any api consumers since it's a pure
virtual class anyway.

svn path=/main/trunk/; revision=15420

pym/portage/__init__.py
pym/portage/glsa.py

index 694062a627f7922e7f6145a49ca24691c0484243..7b37cb962988f1055dc7e7135df5b81e63ec191d 100644 (file)
@@ -83,7 +83,7 @@ try:
                'portage.data',
                'portage.data:lchown,ostype,portage_gid,portage_uid,secpass,' + \
                        'uid,userland,userpriv_groups,wheelgid',
-               'portage.dbapi:dbapi',
+               'portage.dbapi',
                'portage.dbapi.bintree:bindbapi,binarytree',
                'portage.dbapi.porttree:close_portdbapi_caches,FetchlistDict,' + \
                        'portagetree,portdbapi',
@@ -2102,9 +2102,10 @@ class config(object):
 
                        #getting categories from an external file now
                        categories = [grabfile(os.path.join(x, "categories")) for x in locations]
+                       category_re = dbapi.dbapi._category_re
                        self.categories = tuple(sorted(
                                x for x in stack_lists(categories, incremental=1)
-                               if dbapi._category_re.match(x) is not None))
+                               if category_re.match(x) is not None))
                        del categories
 
                        archlist = [grabfile(os.path.join(x, "arch.list")) for x in locations]
index 98602e4cc081d46f7389815f5601b5ce4a749a19..38b07ad32be07988d71822b29ef4dffeadc35db5 100644 (file)
@@ -268,12 +268,12 @@ def makeVersion(versionNode):
 
 def match(atom, dbapi, match_type="default"):
        """
-       wrapper that calls revisionMatch() or portage.dbapi.match() depending on 
+       wrapper that calls revisionMatch() or portage.dbapi.dbapi.match() depending on 
        the given atom.
        
        @type   atom: string
        @param  atom: a <~ or >~ atom or a normal portage atom that contains the atom to match against
-       @type   dbapi: portage.dbapi
+       @type   dbapi: portage.dbapi.dbapi
        @param  dbapi: one of the portage databases to use as information source
        @type   match_type: string
        @param  match_type: if != "default" passed as first argument to dbapi.xmatch 
@@ -297,7 +297,7 @@ def revisionMatch(revisionAtom, dbapi, match_type="default"):
        
        @type   revisionAtom: string
        @param  revisionAtom: a <~ or >~ atom that contains the atom to match against
-       @type   dbapi: portage.dbapi
+       @type   dbapi: portage.dbapi.dbapi
        @param  dbapi: one of the portage databases to use as information source
        @type   match_type: string
        @param  match_type: if != "default" passed as first argument to portdb.xmatch