diff options
author | Greg Noel <GregNoel@tigris.org> | 2010-03-25 04:14:28 (GMT) |
---|---|---|
committer | Greg Noel <GregNoel@tigris.org> | 2010-03-25 04:14:28 (GMT) |
commit | 22d352500f1cd6bd0c53d788a5dc44a1fefa676e (patch) | |
tree | 0984fd581082c27cfbfbb7f94d5751b0e6fd2741 /test/TEX | |
parent | 75ac32ac8e32076e25b72a19eb56340cc585fa4e (diff) | |
download | SCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.zip SCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.tar.gz SCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.tar.bz2 |
Move 2.0 changes collected in branches/pending back to trunk for further
development. Note that this set of changes is NOT backward-compatible;
the trunk no longer works with Python 1.5.2, 2.0, or 2.1.
Diffstat (limited to 'test/TEX')
-rw-r--r-- | test/TEX/LATEX.py | 7 | ||||
-rw-r--r-- | test/TEX/LATEXCOM.py | 2 | ||||
-rw-r--r-- | test/TEX/LATEXCOMSTR.py | 2 | ||||
-rw-r--r-- | test/TEX/LATEXFLAGS.py | 6 | ||||
-rw-r--r-- | test/TEX/PDFLATEX.py | 7 | ||||
-rw-r--r-- | test/TEX/PDFLATEXCOM.py | 2 | ||||
-rw-r--r-- | test/TEX/PDFLATEXCOMSTR.py | 2 | ||||
-rw-r--r-- | test/TEX/PDFLATEXFLAGS.py | 6 | ||||
-rw-r--r-- | test/TEX/PDFTEX.py | 7 | ||||
-rw-r--r-- | test/TEX/PDFTEXCOM.py | 2 | ||||
-rw-r--r-- | test/TEX/PDFTEXCOMSTR.py | 2 | ||||
-rw-r--r-- | test/TEX/PDFTEXFLAGS.py | 6 | ||||
-rw-r--r-- | test/TEX/TEX.py | 18 | ||||
-rw-r--r-- | test/TEX/TEXCOM.py | 2 | ||||
-rw-r--r-- | test/TEX/TEXCOMSTR.py | 2 | ||||
-rw-r--r-- | test/TEX/TEXFLAGS.py | 6 |
16 files changed, 30 insertions, 49 deletions
diff --git a/test/TEX/LATEX.py b/test/TEX/LATEX.py index 2316770..03d3a00 100644 --- a/test/TEX/LATEX.py +++ b/test/TEX/LATEX.py @@ -30,8 +30,6 @@ the produced .dvi, .aux and .log files get removed by the -c option, and that we can use this to wrap calls to the real latex utility. """ -import string - import TestSCons _python_ = TestSCons._python_ @@ -99,11 +97,10 @@ latex = test.where_is('latex') if latex: test.write("wrapper.py", """import os -import string import sys open('%s', 'wb').write("wrapper.py\\n") -os.system(string.join(sys.argv[1:], " ")) -""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\')) +os.system(" ".join(sys.argv[1:])) +""" % test.workpath('wrapper.out').replace('\\', '\\\\')) test.write('SConstruct', """ import os diff --git a/test/TEX/LATEXCOM.py b/test/TEX/LATEXCOM.py index 9d65134..2c63864 100644 --- a/test/TEX/LATEXCOM.py +++ b/test/TEX/LATEXCOM.py @@ -41,7 +41,7 @@ test.write('mylatex.py', r""" import sys outfile = open(sys.argv[1], 'wb') infile = open(sys.argv[2], 'rb') -for l in filter(lambda l: l != '/*latex*/\n', infile.readlines()): +for l in [l for l in infile.readlines() if l != '/*latex*/\n']: outfile.write(l) sys.exit(0) """) diff --git a/test/TEX/LATEXCOMSTR.py b/test/TEX/LATEXCOMSTR.py index 9383e87..4e1b93c 100644 --- a/test/TEX/LATEXCOMSTR.py +++ b/test/TEX/LATEXCOMSTR.py @@ -42,7 +42,7 @@ test.write('mylatex.py', r""" import sys outfile = open(sys.argv[1], 'wb') infile = open(sys.argv[2], 'rb') -for l in filter(lambda l: l != '/*latex*/\n', infile.readlines()): +for l in [l for l in infile.readlines() if l != '/*latex*/\n']: outfile.write(l) sys.exit(0) """) diff --git a/test/TEX/LATEXFLAGS.py b/test/TEX/LATEXFLAGS.py index 8c4e707..f693970 100644 --- a/test/TEX/LATEXFLAGS.py +++ b/test/TEX/LATEXFLAGS.py @@ -25,7 +25,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os -import string import TestSCons @@ -82,11 +81,10 @@ latex = test.where_is('latex') if latex: test.write("wrapper.py", """import os -import string import sys open('%s', 'wb').write("wrapper.py\\n") -os.system(string.join(sys.argv[1:], " ")) -""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\')) +os.system(" ".join(sys.argv[1:])) +""" % test.workpath('wrapper.out').replace('\\', '\\\\')) test.write('SConstruct', """ import os diff --git a/test/TEX/PDFLATEX.py b/test/TEX/PDFLATEX.py index a7320a1..dbae623 100644 --- a/test/TEX/PDFLATEX.py +++ b/test/TEX/PDFLATEX.py @@ -30,8 +30,6 @@ the produced .dvi, .aux and .log files get removed by the -c option, and that we can use this to wrap calls to the real latex utility. """ -import string - import TestSCons _python_ = TestSCons._python_ @@ -99,11 +97,10 @@ pdflatex = test.where_is('pdflatex') if pdflatex: test.write("wrapper.py", """import os -import string import sys open('%s', 'wb').write("wrapper.py\\n") -os.system(string.join(sys.argv[1:], " ")) -""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\')) +os.system(" ".join(sys.argv[1:])) +""" % test.workpath('wrapper.out').replace('\\', '\\\\')) test.write('SConstruct', """ import os diff --git a/test/TEX/PDFLATEXCOM.py b/test/TEX/PDFLATEXCOM.py index 36372a8..09283f3 100644 --- a/test/TEX/PDFLATEXCOM.py +++ b/test/TEX/PDFLATEXCOM.py @@ -41,7 +41,7 @@ test.write('mypdflatex.py', r""" import sys outfile = open(sys.argv[1], 'wb') infile = open(sys.argv[2], 'rb') -for l in filter(lambda l: l != '/*latex*/\n', infile.readlines()): +for l in [l for l in infile.readlines() if l != '/*latex*/\n']: outfile.write(l) sys.exit(0) """) diff --git a/test/TEX/PDFLATEXCOMSTR.py b/test/TEX/PDFLATEXCOMSTR.py index e91ba87..c751e8e 100644 --- a/test/TEX/PDFLATEXCOMSTR.py +++ b/test/TEX/PDFLATEXCOMSTR.py @@ -43,7 +43,7 @@ test.write('mypdflatex.py', r""" import sys outfile = open(sys.argv[1], 'wb') infile = open(sys.argv[2], 'rb') -for l in filter(lambda l: l != '/*latex*/\n', infile.readlines()): +for l in [l for l in infile.readlines() if l != '/*latex*/\n']: outfile.write(l) sys.exit(0) """) diff --git a/test/TEX/PDFLATEXFLAGS.py b/test/TEX/PDFLATEXFLAGS.py index 19c7e5a..deee9ed 100644 --- a/test/TEX/PDFLATEXFLAGS.py +++ b/test/TEX/PDFLATEXFLAGS.py @@ -25,7 +25,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os -import string import TestSCons @@ -82,11 +81,10 @@ pdflatex = test.where_is('pdflatex') if pdflatex: test.write("wrapper.py", """import os -import string import sys open('%s', 'wb').write("wrapper.py\\n") -os.system(string.join(sys.argv[1:], " ")) -""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\')) +os.system(" ".join(sys.argv[1:])) +""" % test.workpath('wrapper.out').replace('\\', '\\\\')) test.write('SConstruct', """ import os diff --git a/test/TEX/PDFTEX.py b/test/TEX/PDFTEX.py index e9b547d..321a58a 100644 --- a/test/TEX/PDFTEX.py +++ b/test/TEX/PDFTEX.py @@ -30,8 +30,6 @@ the produced .dvi, .aux and .log files get removed by the -c option, and that we can use this to wrap calls to the real latex utility. """ -import string - import TestSCons _python_ = TestSCons._python_ @@ -86,11 +84,10 @@ pdftex = test.where_is('pdftex') if pdftex: test.write("wrapper.py", """import os -import string import sys open('%s', 'wb').write("wrapper.py\\n") -os.system(string.join(sys.argv[1:], " ")) -""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\')) +os.system(" ".join(sys.argv[1:])) +""" % test.workpath('wrapper.out').replace('\\', '\\\\')) test.write('SConstruct', """ import os diff --git a/test/TEX/PDFTEXCOM.py b/test/TEX/PDFTEXCOM.py index 6d57f2c..8c31da3 100644 --- a/test/TEX/PDFTEXCOM.py +++ b/test/TEX/PDFTEXCOM.py @@ -41,7 +41,7 @@ test.write('mypdftex.py', r""" import sys outfile = open(sys.argv[1], 'wb') infile = open(sys.argv[2], 'rb') -for l in filter(lambda l: l != '/*tex*/\n', infile.readlines()): +for l in [l for l in infile.readlines() if l != '/*tex*/\n']: outfile.write(l) sys.exit(0) """) diff --git a/test/TEX/PDFTEXCOMSTR.py b/test/TEX/PDFTEXCOMSTR.py index 8caa4e3..13abe7a 100644 --- a/test/TEX/PDFTEXCOMSTR.py +++ b/test/TEX/PDFTEXCOMSTR.py @@ -43,7 +43,7 @@ test.write('mypdftex.py', r""" import sys outfile = open(sys.argv[1], 'wb') infile = open(sys.argv[2], 'rb') -for l in filter(lambda l: l != '/*tex*/\n', infile.readlines()): +for l in [l for l in infile.readlines() if l != '/*tex*/\n']: outfile.write(l) sys.exit(0) """) diff --git a/test/TEX/PDFTEXFLAGS.py b/test/TEX/PDFTEXFLAGS.py index d1b82fe..ce27e82 100644 --- a/test/TEX/PDFTEXFLAGS.py +++ b/test/TEX/PDFTEXFLAGS.py @@ -25,7 +25,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os -import string import TestSCons @@ -75,11 +74,10 @@ pdftex = test.where_is('pdftex') if pdftex: test.write("wrapper.py", """import os -import string import sys open('%s', 'wb').write("wrapper.py\\n") -os.system(string.join(sys.argv[1:], " ")) -""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\')) +os.system(" ".join(sys.argv[1:])) +""" % test.workpath('wrapper.out').replace('\\', '\\\\')) test.write('SConstruct', """ import os diff --git a/test/TEX/TEX.py b/test/TEX/TEX.py index 58ec40d..0de3458 100644 --- a/test/TEX/TEX.py +++ b/test/TEX/TEX.py @@ -21,6 +21,7 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # +from __future__ import generators ### KEEP FOR COMPATIBILITY FIXERS __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -30,8 +31,6 @@ the produced .dvi, .aux and .log files get removed by the -c option, and that we can use this to wrap calls to the real latex utility. """ -import string - import TestSCons _python_ = TestSCons._python_ @@ -86,11 +85,10 @@ tex = test.where_is('tex') if tex: test.write("wrapper.py", """import os -import string import sys open('%s', 'wb').write("wrapper.py\\n") -os.system(string.join(sys.argv[1:], " ")) -""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\')) +os.system(" ".join(sys.argv[1:])) +""" % test.workpath('wrapper.out').replace('\\', '\\\\')) test.write('SConstruct', """ import os @@ -173,18 +171,18 @@ Run \texttt{latex}, then \texttt{bibtex}, then \texttt{latex} twice again \cite{ test.must_exist('bar-latex.dvi') test.run(stderr = None) - output_lines = string.split(test.stdout(), '\n') + output_lines = test.stdout().split('\n') - reruns = filter(lambda x: string.find(x, 'latex -interaction=nonstopmode -recorder rerun.tex') != -1, output_lines) + reruns = [x for x in output_lines if x.find('latex -interaction=nonstopmode -recorder rerun.tex') != -1] if len(reruns) != 2: print "Expected 2 latex calls, got %s:" % len(reruns) - print string.join(reruns, '\n') + print '\n'.join(reruns) test.fail_test() - bibtex = filter(lambda x: string.find(x, 'bibtex bibtex-test') != -1, output_lines) + bibtex = [x for x in output_lines if x.find('bibtex bibtex-test') != -1] if len(bibtex) != 1: print "Expected 1 bibtex call, got %s:" % len(bibtex) - print string.join(bibtex, '\n') + print '\n'.join(bibtex) test.fail_test() test.pass_test() diff --git a/test/TEX/TEXCOM.py b/test/TEX/TEXCOM.py index 6336730..1cadd63 100644 --- a/test/TEX/TEXCOM.py +++ b/test/TEX/TEXCOM.py @@ -41,7 +41,7 @@ test.write('mytex.py', r""" import sys outfile = open(sys.argv[1], 'wb') infile = open(sys.argv[2], 'rb') -for l in filter(lambda l: l != '/*tex*/\n', infile.readlines()): +for l in [l for l in infile.readlines() if l != '/*tex*/\n']: outfile.write(l) sys.exit(0) """) diff --git a/test/TEX/TEXCOMSTR.py b/test/TEX/TEXCOMSTR.py index d4ebe57..f1ead7f 100644 --- a/test/TEX/TEXCOMSTR.py +++ b/test/TEX/TEXCOMSTR.py @@ -42,7 +42,7 @@ test.write('mytex.py', r""" import sys outfile = open(sys.argv[1], 'wb') infile = open(sys.argv[2], 'rb') -for l in filter(lambda l: l != '/*tex*/\n', infile.readlines()): +for l in [l for l in infile.readlines() if l != '/*tex*/\n']: outfile.write(l) sys.exit(0) """) diff --git a/test/TEX/TEXFLAGS.py b/test/TEX/TEXFLAGS.py index efb6606..7ae86ff 100644 --- a/test/TEX/TEXFLAGS.py +++ b/test/TEX/TEXFLAGS.py @@ -25,7 +25,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os -import string import TestSCons @@ -75,11 +74,10 @@ tex = test.where_is('tex') if tex: test.write("wrapper.py", """import os -import string import sys open('%s', 'wb').write("wrapper.py\\n") -os.system(string.join(sys.argv[1:], " ")) -""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\')) +os.system(" ".join(sys.argv[1:])) +""" % test.workpath('wrapper.out').replace('\\', '\\\\')) test.write('SConstruct', """ import os |