summaryrefslogtreecommitdiff
path: root/test/DVIPS
diff options
context:
space:
mode:
authorRobert Managan <managan1@llnl.gov>2008-09-04 18:05:49 +0000
committerRobert Managan <managan1@llnl.gov>2008-09-04 18:05:49 +0000
commit70927b0e46887ba8de91113960367889767c8b7d (patch)
tree5fcab134f7685c3c589cd2b701d811b6cbc12131 /test/DVIPS
parent5843977edada1edbdb15987799461f79d4ad3482 (diff)
downloadscons-70927b0e46887ba8de91113960367889767c8b7d.tar.gz
Added a strfunction to the various tex builders. Since the sub-actions report
their commands as they build the strfunction only returns a string for GetOption("no_exec") which covers --dry-run. Therefore --dry-run now gets output, the first command to be run plus " ..." to indicate that the ral builder may repeat or run bibtex, makeindex,... Also updating the flags to pass -interaction=nonstopmode This prevents errors in the .tex files from stopping the build while Latex asks for input. Updated several tests to handle this new flag by switching to getopt module
Diffstat (limited to 'test/DVIPS')
-rw-r--r--test/DVIPS/DVIPS.py12
-rw-r--r--test/DVIPS/DVIPSFLAGS.py12
2 files changed, 16 insertions, 8 deletions
diff --git a/test/DVIPS/DVIPS.py b/test/DVIPS/DVIPS.py
index 490ac953..882cb6a2 100644
--- a/test/DVIPS/DVIPS.py
+++ b/test/DVIPS/DVIPS.py
@@ -39,8 +39,10 @@ test = TestSCons.TestSCons()
test.write('mytex.py', r"""
import os
import sys
-base_name = os.path.splitext(sys.argv[1])[0]
-infile = open(sys.argv[1], 'rb')
+import getopt
+cmd_opts, arg = getopt.getopt(sys.argv[1:], 'i:', [])
+base_name = os.path.splitext(arg[0])[0]
+infile = open(arg[0], 'rb')
out_file = open(base_name+'.dvi', 'wb')
for l in infile.readlines():
if l[:4] != '#tex':
@@ -51,8 +53,10 @@ sys.exit(0)
test.write('mylatex.py', r"""
import os
import sys
-base_name = os.path.splitext(sys.argv[1])[0]
-infile = open(sys.argv[1], 'rb')
+import getopt
+cmd_opts, arg = getopt.getopt(sys.argv[1:], 'i:', [])
+base_name = os.path.splitext(arg[0])[0]
+infile = open(arg[0], 'rb')
out_file = open(base_name+'.dvi', 'wb')
for l in infile.readlines():
if l[:6] != '#latex':
diff --git a/test/DVIPS/DVIPSFLAGS.py b/test/DVIPS/DVIPSFLAGS.py
index 635acb0b..4b70e412 100644
--- a/test/DVIPS/DVIPSFLAGS.py
+++ b/test/DVIPS/DVIPSFLAGS.py
@@ -39,8 +39,10 @@ test = TestSCons.TestSCons()
test.write('mytex.py', r"""
import os
import sys
-base_name = os.path.splitext(sys.argv[1])[0]
-infile = open(sys.argv[1], 'rb')
+import getopt
+cmd_opts, arg = getopt.getopt(sys.argv[1:], 'i:', [])
+base_name = os.path.splitext(arg[0])[0]
+infile = open(arg[0], 'rb')
out_file = open(base_name+'.dvi', 'wb')
for l in infile.readlines():
if l[:4] != '#tex':
@@ -51,8 +53,10 @@ sys.exit(0)
test.write('mylatex.py', r"""
import os
import sys
-base_name = os.path.splitext(sys.argv[1])[0]
-infile = open(sys.argv[1], 'rb')
+import getopt
+cmd_opts, arg = getopt.getopt(sys.argv[1:], 'i:', [])
+base_name = os.path.splitext(arg[0])[0]
+infile = open(arg[0], 'rb')
out_file = open(base_name+'.dvi', 'wb')
for l in infile.readlines():
if l[:6] != '#latex':