]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/etf2ly.py
release: 1.3.91
[lilypond.git] / scripts / etf2ly.py
index 83b85773831dc5c4668257c81c246f4ff3ffea1b..4d142ff7e557ce7d7aaa6d690a875c9fa442d538 100644 (file)
@@ -353,19 +353,22 @@ class Measure:
        def valid (self):
                return self.valid
        def calculate (self):
+               fs = []
+
+               
                if len (self.finale) < 2:
-                       sys.stderr.write ("Measure %d in staff %d  has incomplete information.\n" % (self.number, self.staff.number))
-                       self.valid = 0
-                       return 
+                       fs = self.finale[0]
+                       fs = map (string.atoi, list (fs))
+                       self.clef = fs[1]
+                       self.frames = [fs[0]]
+               else:
+                       fs = self.finale[0:2]
                        
-               f0 = self.finale[0]
-               f1 = self.finale[1]
-               
-               self.clef = string.atoi (f0[0])
-               self.flags = string.atoi (f0[1])
-               fs = map (string.atoi, list (f0[2:]) + [f1[0]])
+                       fs = map (string.atoi, list (fs))
+                       self.clef = fs[0]
+                       self.flags = fs[1]
+                       self.frames = fs[2:]
 
-               self.frames = fs
 
 class Frame:
        def __init__ (self, finale):
@@ -489,9 +492,13 @@ class Staff:
                        for m in self.measures[1:]:
                                if not m or not m.valid:
                                        continue
+
+                               fr = None
+                               try:
+                                       fr = m.frames[x]
+                               except IndexError:
+                                       pass
                                
-                               
-                               fr = m.frames[x]
                                if fr:
                                        first_frame = fr
                                        if gap <> (0,1):