diff options
author | Steven Knight <knight@baldmt.com> | 2005-02-13 13:05:22 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2005-02-13 13:05:22 (GMT) |
commit | 28c5194366b0f6a08b6b0b30fe1ec438a4ac3498 (patch) | |
tree | 71e69e51423a35771427ba095d28a6f323086f7a /src/engine/SCons/Node/__init__.py | |
parent | fdaf65d36261a72883e6ed72336dff967a535e62 (diff) | |
download | SCons-28c5194366b0f6a08b6b0b30fe1ec438a4ac3498.zip SCons-28c5194366b0f6a08b6b0b30fe1ec438a4ac3498.tar.gz SCons-28c5194366b0f6a08b6b0b30fe1ec438a4ac3498.tar.bz2 |
Refactor Environment/Executor/Node scanner interaction a little. Put --debug={dtree,includes,stree,tree} in separate tests.
Diffstat (limited to 'src/engine/SCons/Node/__init__.py')
-rw-r--r-- | src/engine/SCons/Node/__init__.py | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index c7167a3..96a78ca 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -425,6 +425,8 @@ class Node: """ return self.builder.source_factory(path) + def get_scanner(self, env, kw={}): + return env.get_scanner(self.scanner_key()) def get_source_scanner(self, node): """Fetch the source scanner for the specified node @@ -447,7 +449,7 @@ class Node: # The builder didn't have an explicit scanner, so go look up # a scanner from env['SCANNERS'] based on the node's scanner # key (usually the file extension). - scanner = self.get_build_env().get_scanner(node.scanner_key()) + scanner = self.get_scanner(self.get_build_env()) if scanner: scanner = scanner.select(node) return scanner @@ -758,22 +760,7 @@ class Node: def do_not_ignore(self, node): return node not in self.ignore - def _children_get(self): - "__cacheable__" - children = self.all_children(scan=0) - if self.ignore: - children = filter(self.do_not_ignore, children) - return children - - def children(self, scan=1): - """Return a list of the node's direct children, minus those - that are ignored by this node.""" - if scan: - self.scan() - return self._children_get() - - def all_children(self, scan=1): - """Return a list of all the node's direct children.""" + def _all_children_get(self): # The return list may contain duplicate Nodes, especially in # source trees where there are a lot of repeated #includes # of a tangle of .h files. Profiling shows, however, that @@ -791,13 +778,31 @@ class Node: # using dictionary keys, lose the order, and the only ordered # dictionary patterns I found all ended up using "not in" # internally anyway...) - if scan: - self.scan() if self.implicit is None: return self.sources + self.depends else: return self.sources + self.depends + self.implicit + def _children_get(self): + "__cacheable__" + children = self._all_children_get() + if self.ignore: + children = filter(self.do_not_ignore, children) + return children + + def all_children(self, scan=1): + """Return a list of all the node's direct children.""" + if scan: + self.scan() + return self._all_children_get() + + def children(self, scan=1): + """Return a list of the node's direct children, minus those + that are ignored by this node.""" + if scan: + self.scan() + return self._children_get() + def set_state(self, state): self.state = state |