]> git.donarmstrong.com Git - lilypond.git/blobdiff - python/musicxml.py
Merge branch 'master' of ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / python / musicxml.py
index a08afb081435c6146cff3cd1b173cc98ae4d6ee8..9d6fa054dbddd136b8184021dc0fbfe97ccdb46a 100644 (file)
@@ -5,6 +5,13 @@ from rational import *
 import re
 import sys
 import copy
+import lilylib
+
+_ = lilylib._
+
+def error (str):
+    ly.stderr_write ((_ ("error: %s") % str) + "\n")
+
 
 def escape_ly_output_string (input_string):
     return_string = input_string
@@ -44,7 +51,7 @@ class Xml_node:
        return ''.join ([c.get_text () for c in self._children])
 
     def message (self, msg):
-        sys.stderr.write (msg+'\n')
+        lilylib.stderr_write (msg+'\n')
 
         p = self
         while p:
@@ -262,7 +269,7 @@ class Attributes (Measure_element):
             else:
                 return (4, 4)
         except KeyError:
-            sys.stderr.write (_ ("error: requested time signature, but time sig is unknown\n"))
+            error (_ ("requested time signature, but time sig is unknown"))
             return (4, 4)
 
     # returns clef information in the form ("cleftype", position, octave-shift)
@@ -362,7 +369,7 @@ class Part_list (Music_xml_node):
         if instrument_name:
             return instrument_name
         else:
-            sys.stderr.write (_ ("Unable to find find instrument for ID=%s\n") % id)
+            lilylib.stderr_write (_ ("Unable to find find instrument for ID=%s\n") % id)
             return "Grand Piano"
 
 class Part_group (Music_xml_node):
@@ -776,6 +783,9 @@ class Pedal (Music_xml_spanner):
 class Glissando (Music_xml_spanner):
     pass
 
+class Slide (Music_xml_spanner):
+    pass
+
 class Octave_shift (Music_xml_spanner):
     # default is 8 for the octave-shift!
     def get_size (self):
@@ -898,6 +908,7 @@ class_dict = {
        'pitch': Pitch,
        'rest': Rest,
     'score-part': Score_part,
+        'slide': Slide,
        'slur': Slur,
        'staff': Staff,
         'syllabic': Syllabic,