From cd8fe0001039f02f8d34038e3e5f42eeef408ebf Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Mon, 8 Dec 2008 22:52:53 +0100 Subject: [PATCH] MusicXML: Print out a warning for invalid octave shift sizes --- python/musicexp.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 2.39.5