1 |
Author: zmedico |
2 |
Date: 2009-01-22 22:26:49 +0000 (Thu, 22 Jan 2009) |
3 |
New Revision: 12551 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/portage/__init__.py |
7 |
Log: |
8 |
Add an ignore_priority parameter to digraph.parent_nodes(). |
9 |
|
10 |
|
11 |
Modified: main/trunk/pym/portage/__init__.py |
12 |
=================================================================== |
13 |
--- main/trunk/pym/portage/__init__.py 2009-01-22 22:00:24 UTC (rev 12550) |
14 |
+++ main/trunk/pym/portage/__init__.py 2009-01-22 22:26:49 UTC (rev 12551) |
15 |
@@ -459,16 +459,22 @@ |
16 |
def child_nodes(self, node, ignore_priority=None): |
17 |
"""Return all children of the specified node""" |
18 |
if ignore_priority is None: |
19 |
- return self.nodes[node][0].keys() |
20 |
+ return list(self.nodes[node][0]) |
21 |
children = [] |
22 |
for child, priority in self.nodes[node][0].iteritems(): |
23 |
if priority > ignore_priority: |
24 |
children.append(child) |
25 |
return children |
26 |
|
27 |
- def parent_nodes(self, node): |
28 |
+ def parent_nodes(self, node, ignore_priority=None): |
29 |
"""Return all parents of the specified node""" |
30 |
- return self.nodes[node][1].keys() |
31 |
+ if ignore_priority is None: |
32 |
+ return list(self.nodes[node][1]) |
33 |
+ parents = [] |
34 |
+ for parent, priority in self.nodes[node][1].iteritems(): |
35 |
+ if priority > ignore_priority: |
36 |
+ parents.append(parent) |
37 |
+ return parents |
38 |
|
39 |
def leaf_nodes(self, ignore_priority=None): |
40 |
"""Return all nodes that have no children |