]> git.donarmstrong.com Git - lilypond.git/blobdiff - python/book_snippets.py
Lilypond-book: Remove unused options/paper variables
[lilypond.git] / python / book_snippets.py
index b4849a0dbba79c2953c543a5dbe66138677ad824..a7f99f875f873ed349f300bde6d17bb724b1cc7a 100644 (file)
@@ -38,7 +38,6 @@ EXAMPLEINDENT = 'exampleindent'
 FILENAME = 'filename'
 FILTER = 'filter'
 FRAGMENT = 'fragment'
-LANG = 'lang'    ## TODO: This is handled nowhere!
 LAYOUT = 'layout'
 LILYQUOTE = 'lilyquote'
 LINE_WIDTH = 'line-width'
@@ -92,7 +91,6 @@ simple_options = [
     PRINTFILENAME,
     DOCTITLE,
     TEXIDOC,
-    LANG,
     VERBATIM,
     FILENAME,
     ALT,
@@ -196,7 +194,6 @@ PREAMBLE_LY = '''%%%% Generated by %(program_name)s
 
 \paper {
   %(paper_string)s
-  force-assignment = #""
   line-width = #(- line-width (* mm  %(padding_mm)f))
 }
 
@@ -686,7 +683,8 @@ printing diff against existing file." % filename)
 
         # UGH - junk self.global_options
         skip_lily = self.global_options.skip_lilypond_run
-        for required in [base + '.ly']:
+        for required in [base + '.ly',
+                         base + '.txt']:
             require_file (required)
         if not skip_lily:
             require_file (base + '-systems.count')
@@ -739,7 +737,7 @@ printing diff against existing file." % filename)
         """Pass input through cmd, and return the result."""
 
         if self.global_options.verbose:
-            progress (_ ("Opening filter `%s'\n") % cmd)
+            progress (_ ("Running through filter `%s'\n") % cmd)
 
         # TODO: Use Popen once we resolve the problem with msvcrt in Windows:
         (stdin, stdout, stderr) = os.popen3 (cmd)
@@ -880,6 +878,7 @@ class MusicXMLFileSnippet (LilypondFileSnippet):
             option_list.append ('--compressed')
             self.compressed = True
         opts = " ".join (option_list)
+        progress (_ ("Converting MusicXML file `%s'...\n") % self.filename)
 
         ly_code = self.filter_pipe (self.contents, 'musicxml2ly %s --out=- - ' % opts)
         return ly_code
@@ -914,8 +913,8 @@ class MusicXMLFileSnippet (LilypondFileSnippet):
         if os.path.exists (xmlfilename):
             diff_against_existing = self.filter_pipe (self.contents, 'diff -u %s - ' % xmlfilename)
             if diff_against_existing:
-                warning ("%s: duplicate filename but different contents of orginal file,\n\
-printing diff against existing file." % xmlfilename)
+                warning (_ ("%s: duplicate filename but different contents of orginal file,\n\
+printing diff against existing file.") % xmlfilename)
                 ly.stderr_write (diff_against_existing)
         else:
             out = file (xmlfilename, 'w')
@@ -927,13 +926,15 @@ printing diff against existing file." % xmlfilename)
         if os.path.exists (filename):
             diff_against_existing = self.filter_pipe (self.full_ly (), 'diff -u %s -' % filename)
             if diff_against_existing:
-                warning ("%s: duplicate filename but different contents of converted lilypond file,\n\
-printing diff against existing file." % filename)
+                warning (_ ("%s: duplicate filename but different contents of converted lilypond file,\n\
+printing diff against existing file.") % filename)
                 ly.stderr_write (diff_against_existing)
         else:
             out = file (filename, 'w')
             out.write (self.full_ly ())
             out.close ()
+            file (path + '.txt', 'w').write ('image of music')
+
 
 
 class LilyPondVersionString (Snippet):