dbapi._iter_match: remove redundant myrepo args
authorZac Medico <zmedico@gentoo.org>
Sun, 5 Jun 2011 08:14:07 +0000 (01:14 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 5 Jun 2011 08:14:07 +0000 (01:14 -0700)
The myrepo arguments are redundant since the Atom.repo attribute
carries the same information.

pym/portage/dbapi/__init__.py
pym/portage/dbapi/porttree.py

index 40631e0bd911626bae9729850590f2ec26326f18..e386faae5b2c4e95f933fc824af07010b01fa610 100644 (file)
@@ -123,33 +123,33 @@ class dbapi(object):
                return list(self._iter_match(mydep,
                        self.cp_list(mydep.cp, use_cache=use_cache)))
 
-       def _iter_match(self, atom, cpv_iter, myrepo=None):
+       def _iter_match(self, atom, cpv_iter):
                cpv_iter = iter(match_from_list(atom, cpv_iter))
                if atom.slot:
-                       cpv_iter = self._iter_match_slot(atom, cpv_iter, myrepo)
+                       cpv_iter = self._iter_match_slot(atom, cpv_iter)
                if atom.unevaluated_atom.use:
-                       cpv_iter = self._iter_match_use(atom, cpv_iter, myrepo)
+                       cpv_iter = self._iter_match_use(atom, cpv_iter)
                if atom.repo:
-                       cpv_iter = self._iter_match_repo(atom, cpv_iter, myrepo)
+                       cpv_iter = self._iter_match_repo(atom, cpv_iter)
                return cpv_iter
 
-       def _iter_match_repo(self, atom, cpv_iter, myrepo=None):
+       def _iter_match_repo(self, atom, cpv_iter):
                for cpv in cpv_iter:
                        try:
-                               if self.aux_get(cpv, ["repository"], myrepo=myrepo)[0] == atom.repo:
+                               if self.aux_get(cpv, ["repository"], myrepo=atom.repo)[0] == atom.repo:
                                        yield cpv
                        except KeyError:
                                continue
 
-       def _iter_match_slot(self, atom, cpv_iter, myrepo=None):
+       def _iter_match_slot(self, atom, cpv_iter):
                for cpv in cpv_iter:
                        try:
-                               if self.aux_get(cpv, ["SLOT"], myrepo=myrepo)[0] == atom.slot:
+                               if self.aux_get(cpv, ["SLOT"], myrepo=atom.repo)[0] == atom.slot:
                                        yield cpv
                        except KeyError:
                                continue
 
-       def _iter_match_use(self, atom, cpv_iter, myrepo = None):
+       def _iter_match_use(self, atom, cpv_iter):
                """
                1) Check for required IUSE intersection (need implicit IUSE here).
                2) Check enabled/disabled flag states.
@@ -158,7 +158,7 @@ class dbapi(object):
                iuse_implicit_match = self.settings._iuse_implicit_match
                for cpv in cpv_iter:
                        try:
-                               iuse, slot, use = self.aux_get(cpv, ["IUSE", "SLOT", "USE"], myrepo=myrepo)
+                               iuse, slot, use = self.aux_get(cpv, ["IUSE", "SLOT", "USE"], myrepo=atom.repo)
                        except KeyError:
                                continue
                        iuse = frozenset(x.lstrip('+-') for x in iuse.split())
index a30c9d7b4dcad494b743c9d01d2a4f4ead4b67c2..f971468a632e310edd802b2a2d2a86446cf9a3f5 100644 (file)
@@ -904,13 +904,13 @@ class portdbapi(dbapi):
                        #dep match -- find all visible matches
                        #get all visible packages, then get the matching ones
                        myval = list(self._iter_match(mydep,
-                               self.xmatch("list-visible", mykey, mydep=mykey, mykey=mykey), myrepo=mydep.repo))
+                               self.xmatch("list-visible", mykey, mydep=mykey, mykey=mykey)))
                elif level == "match-all":
                        #match *all* visible *and* masked packages
                        if mydep == mykey:
                                myval = self.cp_list(mykey)
                        else:
-                               myval = list(self._iter_match(mydep, self.cp_list(mykey), myrepo = mydep.repo))
+                               myval = list(self._iter_match(mydep, self.cp_list(mykey)))
                else:
                        raise AssertionError(
                                "Invalid level argument: '%s'" % level)