Commits

Gary Oberbrunner committed 83eee45 Merge

Merged in techtonik/scons (pull request #112), improve doc for Textfile. (with additional cleanups.)

Comments (0)

Files changed (2)

     - Test harness: fail_test() can now print a message to help debugging.
 
   From Anatoly Techtonik:
-    - require rpmbuild when building SCons package.
-    - print full stack on certain errors, for debugging.
+    - Require rpmbuild when building SCons package.
+    - Print full stack on certain errors, for debugging.
+    - Improve documentation for Textfile builder.
 
   From William Deegan:
     - VS2012 & VS2010 Resolve initialization issues by adding path to reg.exe

src/engine/SCons/Tool/textfile.xml

 <para>
 The &b-Textfile; builder generates a single text file.
 The source strings constitute the lines;
-nested lists of sources are flattened. 
+nested lists of sources are flattened.
 &cv-LINESEPARATOR; is used to separate the strings.
 </para>
 
              LINESEPARATOR='|*')
 
 # nested lists are flattened automatically
-env.Textfile(target = 'blob', 
+env.Textfile(target = 'blob',
              source = ['lalala', ['Goethe', 42 'Schiller'], 'tanteratei'])
 
 # files may be used as input by wraping them in File()
 <builder name="Substfile">
 <summary>
 <para>
-The &b-Substfile; builder generates a single text file
-by concatenating the source files.
-Nested lists of sources are flattened. 
-&cv-LINESEPARATOR; is used to separate the source files;
-see the description of &b-Textfile; for details.
+The &b-Substfile; builder creates a single text file from another file or set of
+files by concatenating them with &cv-LINESEPARATOR; and replacing text
+using the &cv-SUBST_DICT; construction variable. Nested lists of source files
+are flattened. See also &b-Textfile;.
 </para>
 
 <para>
 <para>
 If a construction variable named &cv-SUBST_DICT; is present,
 it may be either a Python dictionary or a sequence of (key,value) tuples.
-If the former,
-the dictionary is converted into a list of tuples in an arbitrary order,
+If it is a dictionary it is converted into a list of tuples in an arbitrary order,
 so if one key is a prefix of another key
 or if one substitution could be further expanded by another subsitition,
-it is unpredictible whether the expansion will occur.
+it is unpredictable whether the expansion will occur.
 </para>
 
 <para>
-Any occurences in the source of a key
+Any occurrences of a key in the source
 are replaced by the corresponding value,
 which may be a Python callable function or a string.
-If a value is a function,
-it is first called (with no arguments) to produce a string.
-The string is <emphasis>subst</emphasis>-expanded
+If the value is a callable, it is called with no arguments to get a string.
+Strings are <emphasis>subst</emphasis>-expanded
 and the result replaces the key.
 </para>
 
 </summary>
 </cvar>
 
-</sconsdoc>
+</sconsdoc>