# dynamic relocation, for GUB binaries.
bindir = os.path.abspath (os.path.split (sys.argv[0])[0])
+
+os.environ['PATH'] = bindir + ':' + os.environ['PATH']
for p in ['share', 'lib']:
datadir = os.path.abspath (bindir + '/../%s/lilypond/current/python/' % p)
sys.path.insert (0, datadir)
p.add_option ('-f', '--format',
help=_('''use output format FORMAT (texi [default], texi-html, latex, html)'''),
action='store')
+
p.add_option ("-I", '--include', help=_('add DIR to include path'),
metavar="DIR",
action='append', dest='include_path',
LATEX: {
OUTPUT: r'''{%%
\parindent 0pt%%
-\catcode`\@=12%%
\ifx\preLilyPondExample \undefined%%
\relax%%
\else%%
self.do_options (os, self.type)
def ly (self):
- return self.substring ('code')
+ contents = self.substring ('code')
+ return ('\\sourcefileline %d\n%s'
+ % (self.line_number - 1, contents))
def full_ly (self):
s = self.ly ()
options = split_options (option_string)
for i in options:
- if string.find (i, '=') > 0:
+ if '=' in i:
(key, value) = re.split ('\s*=\s*', i)
self.option_dict[key] = value
else:
## strip version string to make automated regtest comparisons
## across versions easier.
contents = re.sub (r'\\version *"[^"]*"', '', contents)
-
- return ('\\sourcefilename \"%s\"\n%s'
+
+ return ('\\sourcefilename \"%s\"\n\\sourcefileline 0\n%s'
% (name, contents))
snippet_type_to_class = {
status = 0
def my_system (cmd):
status = ly.system (cmd,
- be_verbose=global_options.verbose,
- progress_p=1)
+ be_verbose=global_options.verbose,
+ progress_p=1)
if global_options.format in (HTML, TEXINFO):
cmd += ' --formats=png '
my_system ('latex %s.texstr' % l)
if ly_names:
- my_system (string.join ([cmd, 'snippet-map.ly'] + ly_names))
+ open ('snippet-names', 'w').write ('\n'.join (['snippet-map.ly']
+ + ly_names))
+
+ my_system (string.join ([cmd, 'snippet-names']))
+
LATEX_INSPECTION_DOCUMENT = r'''
\nonstopmode
#(ly:add-file-name-alist '(
""")
for ly in lys:
- snippet_map.write ('("%s.ly" . "%s:%d (%s.ly)")\n'
+ snippet_map.write ('("%s.ly" . "%s")\n'
% (ly.basename (),
- name,
- ly.line_number,
- ly.basename ()))
+ name))
snippet_map.write ('))\n')
+ ' --formats=%s --backend eps ' % formats)
if global_options.process_cmd:
- global_options.process_cmd += string.join ([(' -I %s' % commands.mkarg (p))
+ global_options.process_cmd += string.join ([(' -I %s' % ly.mkarg (p))
for p in global_options.include_path])
+ if global_options.format in (TEXINFO, LATEX):
+ ## prevent PDF from being switched on by default.
+ global_options.process_cmd += ' --formats=eps '
+
if (global_options.format in (TEXINFO, LATEX)
and global_options.create_pdf):
- global_options.process_cmd += "--pdf -deps-font-include -dgs-font-load "
+ global_options.process_cmd += "--pdf -dinclude-eps-fonts -dgs-load-fonts "
+
+
if global_options.verbose:
global_options.process_cmd += " --verbose "
+
+ global_options.process_cmd += " -dread-file-list -dpad-eps-boxes "
+
identify ()
try: