OLD | NEW |
1 """SCons.Node | 1 """SCons.Node |
2 | 2 |
3 The Node package for the SCons software construction utility. | 3 The Node package for the SCons software construction utility. |
4 | 4 |
5 This is, in many ways, the heart of SCons. | 5 This is, in many ways, the heart of SCons. |
6 | 6 |
7 A Node is where we encapsulate all of the dependency information about | 7 A Node is where we encapsulate all of the dependency information about |
8 any thing that SCons can build, or about any thing which SCons can use | 8 any thing that SCons can build, or about any thing which SCons can use |
9 to build some other thing. The canonical "thing," of course, is a file, | 9 to build some other thing. The canonical "thing," of course, is a file, |
10 but a Node can also represent something remote (like a web page) or | 10 but a Node can also represent something remote (like a web page) or |
(...skipping 24 matching lines...) Expand all Loading... |
35 # | 35 # |
36 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY | 36 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY |
37 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE | 37 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE |
38 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | 38 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
39 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | 39 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
40 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | 40 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
41 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | 41 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
42 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | 42 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
43 # | 43 # |
44 | 44 |
45 __revision__ = "src/engine/SCons/Node/__init__.py 3603 2008/10/10 05:46:45 scons
" | 45 __revision__ = "src/engine/SCons/Node/__init__.py 3842 2008/12/20 22:59:52 scons
" |
46 | 46 |
47 import copy | 47 import copy |
48 from itertools import chain, izip | 48 from itertools import chain, izip |
49 import string | 49 import string |
50 import UserList | 50 import UserList |
51 | 51 |
52 from SCons.Debug import logInstanceCreation | 52 from SCons.Debug import logInstanceCreation |
53 import SCons.Executor | 53 import SCons.Executor |
54 import SCons.Memoize | 54 import SCons.Memoize |
55 import SCons.Util | 55 import SCons.Util |
(...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1097 | 1097 |
1098 def render_include_tree(self): | 1098 def render_include_tree(self): |
1099 """ | 1099 """ |
1100 Return a text representation, suitable for displaying to the | 1100 Return a text representation, suitable for displaying to the |
1101 user, of the include tree for the sources of this node. | 1101 user, of the include tree for the sources of this node. |
1102 """ | 1102 """ |
1103 if self.is_derived() and self.env: | 1103 if self.is_derived() and self.env: |
1104 env = self.get_build_env() | 1104 env = self.get_build_env() |
1105 for s in self.sources: | 1105 for s in self.sources: |
1106 scanner = self.get_source_scanner(s) | 1106 scanner = self.get_source_scanner(s) |
1107 path = self.get_build_scanner_path(scanner) | 1107 if scanner: |
| 1108 path = self.get_build_scanner_path(scanner) |
| 1109 else: |
| 1110 path = None |
1108 def f(node, env=env, scanner=scanner, path=path): | 1111 def f(node, env=env, scanner=scanner, path=path): |
1109 return node.get_found_includes(env, scanner, path) | 1112 return node.get_found_includes(env, scanner, path) |
1110 return SCons.Util.render_tree(s, f, 1) | 1113 return SCons.Util.render_tree(s, f, 1) |
1111 else: | 1114 else: |
1112 return None | 1115 return None |
1113 | 1116 |
1114 def get_abspath(self): | 1117 def get_abspath(self): |
1115 """ | 1118 """ |
1116 Return an absolute path to the Node. This will return simply | 1119 Return an absolute path to the Node. This will return simply |
1117 str(Node) by default, but for Node types that have a concept of | 1120 str(Node) by default, but for Node types that have a concept of |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1318 parent = None | 1321 parent = None |
1319 self.eval_func(node, parent) | 1322 self.eval_func(node, parent) |
1320 return node | 1323 return node |
1321 return None | 1324 return None |
1322 | 1325 |
1323 def is_done(self): | 1326 def is_done(self): |
1324 return not self.stack | 1327 return not self.stack |
1325 | 1328 |
1326 | 1329 |
1327 arg2nodes_lookups = [] | 1330 arg2nodes_lookups = [] |
OLD | NEW |