From: Reinhold Kainhofer <reinhold@kainhofer.com>
Date: Mon, 8 Dec 2008 21:52:53 +0000 (+0100)
Subject: MusicXML: Print out a warning for invalid octave shift sizes
X-Git-Tag: release/2.12.0-1~13^2~27^2
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=cd8fe0001039f02f8d34038e3e5f42eeef408ebf;p=lilypond.git

MusicXML: Print out a warning for invalid octave shift sizes
---

diff --git a/python/musicexp.py b/python/musicexp.py
index c8898bcc54..b1df9417f7 100644
--- a/python/musicexp.py
+++ b/python/musicexp.py
@@ -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