* [gentoo-commits] portage r12837 - main/branches/2.1.6/pym/portage
@ 2009-03-11 3:24 Zac Medico (zmedico)
0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2009-03-11 3:24 UTC (permalink / raw
To: gentoo-commits
Author: zmedico
Date: 2009-03-11 03:24:21 +0000 (Wed, 11 Mar 2009)
New Revision: 12837
Modified:
main/branches/2.1.6/pym/portage/__init__.py
Log:
Add an ignore_priority parameter to digraph.parent_nodes(). (trunk r12551)
Modified: main/branches/2.1.6/pym/portage/__init__.py
===================================================================
--- main/branches/2.1.6/pym/portage/__init__.py 2009-03-11 03:23:58 UTC (rev 12836)
+++ main/branches/2.1.6/pym/portage/__init__.py 2009-03-11 03:24:21 UTC (rev 12837)
@@ -459,16 +459,22 @@
def child_nodes(self, node, ignore_priority=None):
"""Return all children of the specified node"""
if ignore_priority is None:
- return self.nodes[node][0].keys()
+ return list(self.nodes[node][0])
children = []
for child, priority in self.nodes[node][0].iteritems():
if priority > ignore_priority:
children.append(child)
return children
- def parent_nodes(self, node):
+ def parent_nodes(self, node, ignore_priority=None):
"""Return all parents of the specified node"""
- return self.nodes[node][1].keys()
+ if ignore_priority is None:
+ return list(self.nodes[node][1])
+ parents = []
+ for parent, priority in self.nodes[node][1].iteritems():
+ if priority > ignore_priority:
+ parents.append(parent)
+ return parents
def leaf_nodes(self, ignore_priority=None):
"""Return all nodes that have no children
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-03-11 3:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-11 3:24 [gentoo-commits] portage r12837 - main/branches/2.1.6/pym/portage Zac Medico (zmedico)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox