]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/lilypond-latex.py
*** empty log message ***
[lilypond.git] / scripts / lilypond-latex.py
index 67adc7f4c5180747eae90f93120e1beb9477b3c4..c9740db4951532f1834213002d61a0bf495830c2 100644 (file)
@@ -3,7 +3,7 @@
 #
 # source file of the GNU LilyPond music typesetter
 # 
-# (c) 1998--2004  Han-Wen Nienhuys <hanwen@cs.uu.nl>
+# (c) 1998--2005  Han-Wen Nienhuys <hanwen@cs.uu.nl>
 #                 Jan Nieuwenhuizen <janneke@gnu.org>
 #
 # Run lilypond, generate printable document
@@ -82,7 +82,7 @@ global _;_=ly._
 global re;re = ly.re
 
 # lilylib globals
-program_name = 'lilypond-latex'
+program_name = os.path.split (sys.argv[0])[1]
 program_version = '@TOPLEVEL_VERSION@'
 # input without \book, use classic latex definitions
 classic_p = 0
@@ -118,9 +118,9 @@ option_definitions = [
        #junkme?
        ('', '', 'no-lily', _ ("don't run LilyPond")),
        #junkme? 
-       ('', 'm', 'no-paper', _ ("produce MIDI output only")),
+       ('', 'm', 'no-layout', _ ("produce MIDI output only")),
        
-       (_ ("FILE"), 'o', 'output', _ ("write output to FILE")),
+       (_ ("FILE"), 'o', 'output', _ ("write output to FILE (suffix will be added)")),
        (_ ('RES'), '', 'preview-resolution',
         _ ("set the resolution of the preview to RES")),
        ('', 'p', 'pdf', _ ("generate PDF output")),
@@ -174,7 +174,7 @@ extra_init = {
 header_fields = extra_init.keys ()
 
 include_path = ['.']
-paper_p = 1
+layout_p = 1
 
 output_name = ''
 
@@ -217,11 +217,11 @@ def run_lilypond (files, dep_prefix):
        ## UGHr
        if pseudo_filter_p:
                opts += ' --output=lelie'
-       if paper_p:
+       if layout_p:
                opts += ' ' + string.join (map (lambda x : '--header=' + x,
                                                header_fields))
        else:
-               opts = opts + ' --no-paper'
+               opts = opts + ' --no-layout'
        if safe_mode_p:
                opts = opts + ' --safe-mode'
 
@@ -273,7 +273,7 @@ def analyse_lilypond_output (filename, extra):
        # search only the first 10k
        s = s[:10240]
        for x in header_fields:
-               m = re.search (r'\\def\\lilypondpaper%s{([^}]*)}' % x, s)
+               m = re.search (r'\\def\\lilypondlayout%s{([^}]*)}' % x, s)
                if m:
                        set_setting (extra, x, m.group (1))
 
@@ -618,9 +618,9 @@ for opt in options:
                        targets.append ('PNG')
        elif o == '--preview-resolution':
                preview_resolution = string.atoi (a)
-       elif o == '--no-paper' or o == '-m':
+       elif o == '--no-layout' or o == '-m':
                targets = ['MIDI'] 
-               paper_p = 0
+               layout_p = 0
        elif o == '--output' or o == '-o':
                output_name = a
        elif o == '--safe-mode' or o == '-s':