X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=python%2Fmusicxml.py;h=9d6fa054dbddd136b8184021dc0fbfe97ccdb46a;hb=2f996385b21b9d5006c7369c2c496ccbee001e97;hp=a08afb081435c6146cff3cd1b173cc98ae4d6ee8;hpb=3dd560c0c440c9e97730ca13f6d5abbb020bb02e;p=lilypond.git diff --git a/python/musicxml.py b/python/musicxml.py index a08afb0814..9d6fa054db 100644 --- a/python/musicxml.py +++ b/python/musicxml.py @@ -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,