]> git.donarmstrong.com Git - lilypond.git/commitdiff
MusicXML: Print out a warning for invalid octave shift sizes
authorReinhold Kainhofer <reinhold@kainhofer.com>
Mon, 8 Dec 2008 21:52:53 +0000 (22:52 +0100)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Mon, 8 Dec 2008 22:22:46 +0000 (23:22 +0100)
python/musicexp.py

index c8898bcc547be6f9f9131839f24ce2697f7863bc..b1df9417f7531cfadcddf8bd72f9cd87d6852ccd 100644 (file)
@@ -991,7 +991,11 @@ class OctaveShiftEvent (SpanEvent):
         self.span_type = {'up': 1, 'down': -1}.get (type, 0)
     def ly_octave_shift_indicator (self):
         # convert 8/15 to lilypond indicators (+-1/+-2)
-        value = {8: 1, 15: 2}.get (self.size, 0)
+        try:
+            value = {8: 1, 15: 2}[self.size]
+        except KeyError:
+            warning (_ ("Invalid octave shift size found: %s. Using no shift.") % self.size)
+            value = 0
         # negative values go up!
         value *= -1*self.span_type
         return value