RELEASE 0.06 -
+ From Stephen Kennedy:
+
+ - Performance: Use a dictionary, not a list, for a Node's parents.
+
From Steven Knight:
- Add .zip files to the packages we build.
assert five in kids
assert six in kids
- def test_add_parent(self):
- """Test adding parents to a Node."""
- node = SCons.Node.Node()
- parent = SCons.Node.Node()
- node._add_parent(parent)
- assert node.get_parents() == [parent]
- node._add_parent(parent)
- assert node.get_parents() == [parent]
-
def test_state(self):
"""Test setting and getting the state of a node
"""
self.depends = [] # explicit dependencies (from Depends)
self.implicit = {} # implicit (scanned) dependencies
self.ignore = [] # dependencies to ignore
- self.parents = []
+ self.parents = {}
self.wkids = None # Kids yet to walk, when it's an array
self.builder = None
self.scanners = []
collection.extend(child)
for c in child:
- c._add_parent(self)
-
- def _add_parent(self, parent):
- """Adds 'parent' to the list of parents of this node"""
-
- if parent not in self.parents: self.parents.append(parent)
+ c.parents[self] = 1
def add_wkid(self, wkid):
"""Add a node to the list of kids waiting to be evaluated"""
+ reduce(lambda x, y: x + y, self.implicit.values(), [])
def get_parents(self):
- return self.parents
+ return self.parents.keys()
def set_state(self, state):
self.state = state