]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/lilypond-book.py
Fix #483.
[lilypond.git] / scripts / lilypond-book.py
index 6a8fcc1963eff910910707d0226c6addcd3dbb12..5b9c0d738f9b9669ee43eba424060a7b9a3cb423 100644 (file)
@@ -37,23 +37,9 @@ import sys
 import re
 import md5
 
-################
-# RELOCATION
-################
-
-
-for d in ['@lilypond_datadir@',
-          '@lilypond_libdir@']:
-    sys.path.insert (0, os.path.join (d, 'python'))
-
-# dynamic relocation, for GUB binaries.
-bindir = os.path.abspath (os.path.split (sys.argv[0])[0])
-
-os.environ['PATH'] = bindir + os.pathsep + os.environ['PATH']
-for p in ['share', 'lib']:
-    datadir = os.path.abspath (bindir + '/../%s/lilypond/current/python/' % p)
-    sys.path.insert (0, datadir)
-
+"""
+@relocate-preamble@
+"""
 
 import lilylib as ly
 import fontextract
@@ -115,7 +101,7 @@ def warranty ():
 
 %s
 %s
-''' % ( _ ('Copyright (c) %s by') % '2001--2006',
+''' % ( _ ('Copyright (c) %s by') % '2001--2007',
     ' '.join (authors),
    _ ("Distributed under terms of the GNU General Public License."),
    _ ("It comes with NO WARRANTY.")))
@@ -154,7 +140,7 @@ def get_option_parser ():
     p.add_option ('-P', '--process', metavar=_ ("COMMAND"),
                   help = _ ("process ly_files using COMMAND FILE..."),
                   action='store', 
-                  dest='process_cmd', default='lilypond -eps')
+                  dest='process_cmd', default='lilypond -dbackend=eps')
     p.add_option ('--pdf',
                   action="store_true",
                   dest="create_pdf",
@@ -690,17 +676,14 @@ if 0:
 PREAMBLE_LY = '''%%%% Generated by %(program_name)s
 %%%% Options: [%(option_string)s]
 \\include "lilypond-book-preamble.ly"
-%(preamble_string)s
-
-
-
-
 
 
 %% ****************************************************************
 %% Start cut-&-pastable-section 
 %% ****************************************************************
 
+%(preamble_string)s
+
 \paper {
   #(define dump-extents #t)
   %(font_dump_setting)s
@@ -1109,8 +1092,7 @@ class Lilypond_snippet (Snippet):
             and (self.relevant_contents (self.full_ly ())
                  == self.relevant_contents (open (ly_file).read ()))):
             return None
-        if global_options.verbose:
-            print 'OUT OF DATE: ', ly_file
+
         return self
 
     def png_is_outdated (self):
@@ -1565,6 +1547,7 @@ def write_file_map (lys, name):
     snippet_map = open ('snippet-map.ly', 'w')
     snippet_map.write ("""
 #(define version-seen #t)
+#(define output-empty-score-list #f)
 #(ly:add-file-name-alist '(
 """)
     for ly in lys:
@@ -1577,7 +1560,7 @@ def write_file_map (lys, name):
 def do_process_cmd (chunks, input_name):
     all_lys = filter (lambda x: is_derived_class (x.__class__,
                            Lilypond_snippet),
-             chunks)
+                      chunks)
 
     write_file_map (all_lys, input_name)
     ly_outdated = filter (lambda x: is_derived_class (x.__class__,