diff options
Diffstat (limited to 'test/DVIPS')
-rw-r--r-- | test/DVIPS/DVIPS.py | 12 | ||||
-rw-r--r-- | test/DVIPS/DVIPSFLAGS.py | 12 |
2 files changed, 16 insertions, 8 deletions
diff --git a/test/DVIPS/DVIPS.py b/test/DVIPS/DVIPS.py index 490ac95..882cb6a 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 635acb0..4b70e41 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': |