From 1918fab7ca70941ff228d42194c6183bdc1ceb26 Mon Sep 17 00:00:00 2001 From: GregNoel Date: Wed, 22 Apr 2009 21:50:58 +0000 Subject: [PATCH] Editing changes for textfile.xml and credit to Hartmut Goebel git-svn-id: http://scons.tigris.org/svn/scons/trunk@4120 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/CHANGES.txt | 6 +++++- src/engine/SCons/Tool/textfile.xml | 21 +++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 94405dd8..846a57b8 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -17,6 +17,10 @@ RELEASE X.X.X - XXX - An option name and aliases can now be specified as a tuple. + From Hartmut Goebel: + + - Textfile builder. + From Jim Hunziker: - Avoid adding -gphobos to a command line multiple times @@ -50,7 +54,7 @@ RELEASE X.X.X - XXX - Restructure a test that occasionally hung so that the test would detect when it was stuck and fail instead. - - Add the Textfile and Substfile builders. + - Substfile builder. From Gary Oberbrunner: diff --git a/src/engine/SCons/Tool/textfile.xml b/src/engine/SCons/Tool/textfile.xml index d1026ec3..54e801c4 100644 --- a/src/engine/SCons/Tool/textfile.xml +++ b/src/engine/SCons/Tool/textfile.xml @@ -36,6 +36,7 @@ and &cv-TEXTFILESUFFIX; construction variables (the null string and .txt by default, respectively) are automatically added to the target if they are not already present. Examples: + # builds/writes foo.txt env.Textfile(target = 'foo.txt', source = ['Goethe', 42, 'Schiller']) @@ -56,25 +57,25 @@ env.Textfile(target = 'concat', # concatenate files with a marker between Results are: foo.txt - ....8<---- + ....8<---- Goethe 42 Schiller - ....8<---- (no linefeed at the end) + ....8<---- (no linefeed at the end) bar.txt: - ....8<---- + ....8<---- lalala|*tanteratei - ....8<---- (no linefeed at the end) + ....8<---- (no linefeed at the end) -blog.txt - ....8<---- +blob.txt + ....8<---- lalala Goethe 42 Schiller tanteratei - ....8<---- (no linefeed at the end) + ....8<---- (no linefeed at the end) @@ -108,7 +109,8 @@ 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 &subst;-expanded and the result is substituted. +The string is subst-expanded +and the result replaces the key. env = Environment(tools = ['default', 'textfile']) @@ -125,7 +127,7 @@ bad_foo = {'$foo': '$foo', '$foobar': '$foobar'} env.Substfile('foo.in', SUBST_DICT = bad_foo) # PREDICTABLE - keys are applied longest first -good_foo = ['$foobar': '$foobar', '$foo': '$foo'] +good_foo = [('$foobar', '$foobar'), ('$foo', '$foo')] env.Substfile('foo.in', SUBST_DICT = good_foo) # UNPREDICTABLE - one substitution could be futher expanded @@ -185,7 +187,6 @@ the null string by default. The suffix used for &b-Substfile; file names, the null string by default. - -- 2.26.2