From 75556755c21f78bb3aa66e0ab777bd739fa3b425 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 8 Apr 2008 03:54:22 +0000 Subject: Remove the depgraph._get_arg_for_pkg() method since _iter_atoms_for_pkg() does the job. svn path=/main/trunk/; revision=9745 --- pym/_emerge/__init__.py | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 86f09af39..ed0b8aafa 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -1734,7 +1734,9 @@ class depgraph(object): myarg = None if dep.root == self.target_root: try: - myarg = self._get_arg_for_pkg(dep_pkg) + myarg = self._iter_atoms_for_pkg(dep_pkg).next() + except StopIteration: + pass except portage.exception.InvalidDependString: if not dep_pkg.installed: # This shouldn't happen since the package @@ -2026,21 +2028,6 @@ class depgraph(object): continue yield arg, atom - def _get_arg_for_pkg(self, pkg): - """ - Return a matching DependencyArg instance for the given Package if - any exist, otherwise None. An attempt will be made to return the most - specific match (PackageArg type is the most specific). - - This will raise an InvalidDependString exception if PROVIDE is invalid. - """ - any_arg = None - for arg, atom in self._iter_atoms_for_pkg(pkg): - if isinstance(arg, PackageArg): - return arg - any_arg = arg - return any_arg - def select_files(self, myfiles): """Given a list of .tbz2s, .ebuilds sets, and deps, create the appropriate depgraph and return a favorite list.""" -- cgit v1.2.3-1-g7c22