From: Reinhold Kainhofer Date: Wed, 19 Sep 2007 01:29:56 +0000 (+0200) Subject: MusicXML: Fixes of my previous commit X-Git-Tag: release/2.11.35-1~105 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5b4bdcf4e6c7c823eeda0432e37d76277768b588;p=lilypond.git MusicXML: Fixes of my previous commit If a score does not use any elements, fool musicxml2ly with a dummy value of "None". Similarly, don't use dict[staff], but dict.get to avoid crashes in that case. Signed-off-by: Reinhold Kainhofer --- diff --git a/python/musicxml.py b/python/musicxml.py index 7281a129f3..e9660eb571 100644 --- a/python/musicxml.py +++ b/python/musicxml.py @@ -549,6 +549,8 @@ class Part (Music_xml_node): sid = None if staff_id: sid = staff_id.get_text () + else: + sid = "None" if vid and not voices.has_key (vid): voices[vid] = Musicxml_voice() if vid and sid and not n.get_maybe_exist_typed_child (Grace): @@ -592,7 +594,7 @@ class Part (Music_xml_node): if staff_id: staff_id = staff_id.get_text () if staff_id: - dir_voices = staff_to_voice_dict[staff_id] + dir_voices = staff_to_voice_dict.get (staff_id, voices.keys ()) else: dir_voices = voices.keys () for v in dir_voices: