aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Kuhnert2008-08-22 08:11:11 +0000
committerSebastian Kuhnert2008-08-22 08:11:11 +0000
commit9c4697ed822dbf33bba5bdb67907f4765c25a4aa (patch)
tree7a9b65ef9f711ae79b054703121796ff910ca687
parent4ae9e80cea07c14f6fee7e89d09ff41dc0ede3fc (diff)
downloadexercisesheets-9c4697ed822dbf33bba5bdb67907f4765c25a4aa.tar.gz
exercisesheets-9c4697ed822dbf33bba5bdb67907f4765c25a4aa.tar.bz2
exercisesheets-9c4697ed822dbf33bba5bdb67907f4765c25a4aa.zip
texall script: better options, better rmligs behaviour
-rwxr-xr-xtexall14
1 files changed, 6 insertions, 8 deletions
diff --git a/texall b/texall
index 4b7b2f8..f5c4719 100755
--- a/texall
+++ b/texall
@@ -9,7 +9,7 @@ import subprocess
parser = OptionParser(usage="%prog [options] DIR/FILE",
version="%prog $Id: $",
- description="Call LaTeX and friends to typeset all tex files in DIR/FILE. By default up-to-date files are skipped. Care is taken to run all required commands until the result is stable. By default, pdflatex is used, but use of pstricks forces dvi->ps->pdf. The utility program rmligs ist used to improve output for german language texts. Use -Sqvvvf to simulate the behaviour of (pdf)latex in non-interactive mode (useful for emacs).")
+ description="Call LaTeX and friends to typeset all tex files in DIR/FILE. By default up-to-date files are skipped. Care is taken to run all required commands until the result is stable. By default, pdflatex is used, but use of pstricks forces dvi->ps->pdf. The utility program rmligs ist used to improve output for german language texts. Use \"texall -Sqfi batchmode file.tex\" to simulate the behaviour of (pdf)latex in non-interactive mode (useful for emacs).")
parser.add_option("-n", "--dry-run",
action="store_false", dest="act", default=True,
help="do not run any program")
@@ -26,7 +26,7 @@ parser.add_option("-v", "--verbose",
action="count", dest="verbosity", default=1,
help="explain what is going on")
parser.add_option("-q", "--quiet",
- action="store_false", dest="progress", default=True,
+ action="store_const", dest="verbosity", const=0,
help="suppress progress reports")
parser.add_option("-i", "--interaction",
dest="interactionmode", choices=("batchmode", "nonstopmode", "scrollmode", "errorstopmode"), default="batchmode",
@@ -59,7 +59,7 @@ procfiles = []
errstr = {False: "ERROR", True: "WARNING"}
def error(file, desc, warning=False):
msg = "%s: %s: %s"%(errstr[warning], os.path.normpath(file), desc)
- if options.progress:
+ if options.verbosity:
print msg
errors.append(msg)
@@ -264,7 +264,7 @@ MAXRUNS=5
def processtexfiles(args):
for dirname, texname, reason in outdatedtexfiles(args):
procfiles.append(os.path.normpath(os.path.join(dirname,texname)))
- if options.progress:
+ if options.verbosity:
print "processing %s%s..."%(os.path.normpath(os.path.join(dirname,texname)),reason)
# list of temporary files to be removed later
@@ -385,7 +385,7 @@ def rmtempfile(filename, dirname):
if options.deletetempfiles:
if not isinstance(filename, list):
filename = [filename]
- if options.progress and options.verbosity > 1:
+ if options.verbosity > 1:
print " removing %s"%(", ".join(filename))
if options.act:
for f in filename:
@@ -403,7 +403,7 @@ def run(arglist, dirname, reason="", stdin=None, stdout=None):
output=null
if not stdout:
stdout=output
- if options.progress:
+ if options.verbosity:
print " running %s%s..."%(" ".join(arglist), reason)
if options.act:
ret = subprocess.call(arglist, stdin=stdin, stdout=stdout, stderr=output, cwd=dirname)
@@ -412,8 +412,6 @@ def run(arglist, dirname, reason="", stdin=None, stdout=None):
def preparermligs(texname, dirname, tmplist):
jobname=texname[:-4]
- if options.progress and options.verbosity > 1:
- print " running rmligs on %s..."%texname
try:
texfile = open(os.path.join(dirname, texname))
except IOError, (errno, strerror):