diff options
author | Steven Knight <knight@baldmt.com> | 2009-01-29 17:06:51 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2009-01-29 17:06:51 (GMT) |
commit | 547744d13edc993d1357a1f7b692867b0e25f49d (patch) | |
tree | cf939cad2fefdf7135ee8522740705adafbe55aa /doc/user/nodes.xml | |
parent | 1498b1e8c83c6aced5e96a72b28a64ef2bdf2ffd (diff) | |
download | SCons-547744d13edc993d1357a1f7b692867b0e25f49d.zip SCons-547744d13edc993d1357a1f7b692867b0e25f49d.tar.gz SCons-547744d13edc993d1357a1f7b692867b0e25f49d.tar.bz2 |
User's Guide updates: fix typos, clarify various things. (Robert P. J. Day)
Diffstat (limited to 'doc/user/nodes.xml')
-rw-r--r-- | doc/user/nodes.xml | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/doc/user/nodes.xml b/doc/user/nodes.xml index 28af973..8f3436a 100644 --- a/doc/user/nodes.xml +++ b/doc/user/nodes.xml @@ -44,7 +44,7 @@ &Node; objects that identify the target file or files that will be built. These returned &Nodes; can be passed - as source files to other builder methods, + as arguments to other builder methods. </para> @@ -81,7 +81,7 @@ <para> - The problem with listing the names as strings + The problem with specifying the names as strings is that our &SConstruct; file is no longer portable across operating systems. It won't, for example, work on Windows @@ -153,7 +153,7 @@ between Nodes that represent files and Nodes that represent directories. &SCons; supports &File; and &Dir; - functions that, repectively, + functions that, respectively, return a file or directory Node: </para> @@ -227,6 +227,11 @@ One of the most common things you can do with a Node is use it to print the file name that the node represents. + Keep in mind, though, that because the object + returned by a builder call + is a <emphasis>list</emphasis> of Nodes, + you must use Python subscripts + to fetch individual Nodes from the list. For example, the following &SConstruct; file: </para> @@ -272,6 +277,17 @@ link /nologo /OUT:hello.exe hello.obj </screen> + <para> + + Note that in the above example, + the <literal>object_list[0]</literal> + extracts an actual Node <emphasis>object</emphasis> + from the list, + and the Python <literal>print</literal> statement + converts the object to a string for printing. + + </para> + </section> <section> @@ -281,7 +297,7 @@ Printing a &Node;'s name as described in the previous section - works because the string representation of a &Node; + works because the string representation of a &Node; object is the name of the file. If you want to do something other than print the name of the file, |