2003-08-26 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ * python/lilylib.py (command_name): robustification
+
+ * scripts/lilypond-book.py: idem.
+
+ * scripts/ly2dvi.py: backport latex redirect fix.
+
* Documentation/bibliography/engraving.bib (year): typos.
2003-08-25 Han-Wen Nienhuys <hanwen@cs.uu.nl>
return __main__.temp_dir
def command_name (cmd):
- return re.match ('^[ \t]*([^ \t]*)', cmd).group (1)
+ return re.match ('^[^a-z0-9_-]*([a-z0-9_-]*)', cmd).group (1)
def error_log (name):
- name = re.sub('[/:]','x',name)
+ name = re.sub('[^a-z]','x',name)
return tempfile.mktemp ('%s.errorlog' % name)
def read_pipe (cmd, mode = 'r'):
cmd = "latex '\\nonstopmode \input %s'" % fname
# Ugh. (La)TeX writes progress and error messages on stdout
# Redirect to stderr
- cmd += ' 1>/dev/stderr'
+ cmd = '(( %s >&2 ) >&- )' % cmd
status = ly.system (cmd, ignore_error = 1)
signal = 0xf & status
exit_status = status >> 8
}
'''
+ orig_name = ''
for o in opts:
m= re.search ('relative(.*)', o)
v = 0
pitch = pitch + '\'' * v
body = '\\relative %s { %s }' % (pitch, body)
-
+ m =re.search ("filename=(.*)", o)
+ if m:
+ orig_name = m.group (1)
+
if is_fragment:
body = r'''
\score {
}
''' % (optstring, music_size, linewidth, indent, notime) + body
+ if orig_name:
+ body = '\\renameinput \"%s\"\n%s' % (orig_name, body)
+
+
# ughUGH not original options
return body
cmd = r"latex '\nonstopmode \input %s'" % file
# Ugh. (La)TeX writes progress and error messages on stdout
# Redirect to stderr
- cmd += ' 1>/dev/stderr'
+ cmd = '(( %s >&2 ) >&- )' % cmd
+
ly.system (cmd)
ly.system ("dvips -E -o %s.eps %s" % (file, file))
map (to_eps, eps)
f.close ()
cmd = latex_cmd + ' \\\\nonstopmode \\\\input %s' % latex_fn
+
# Ugh. (La)TeX writes progress and error messages on stdout
# Redirect to stderr
- cmd += ' 1>/dev/stderr'
+ cmd = '(( %s >&2 ) >&- )' % cmd
status = ly.system (cmd, ignore_error = 1)
signal = 0xf & status
- exit_status = status >> 8
+ exit_status = status >> 8
if exit_status: