]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/convert-ly.py
release commit
[lilypond.git] / scripts / convert-ly.py
index c4e0619901c52c2c3cc22ce0d4e8c797940189da..ceef2f27e1a63d72ca433d98997d1c7e3b502fc6 100644 (file)
@@ -777,7 +777,7 @@ if 1:
 
 if 1:
        def conv (str):
-               str = re.sub ('([Cc])horda', '\\1orda', str)
+               str = re.sub ('([Cc])hord([ea])', '\\1ord\\2', str)
                return str
        
        conversions.append (((1,3,144), conv, 'Chorda -> Corda'))
@@ -826,6 +826,131 @@ if 1:
        conversions.append (((1,3,148), conv, '"(align" -> "(axis", "(rows" -> "(columns"'))
 
 
+if 1:
+       def conv (str):
+               str = re.sub ('SystemStartDelimiter', 'systemStartDelimiter', str)
+               return str
+       conversions.append (((1,5,33), conv, 'SystemStartDelimiter -> systemStartDelimiter'))
+
+if 1:
+       def conv (str):
+               str = re.sub ('arithmetic-multiplier', 'spacing-increment', str)
+               str = re.sub ('arithmetic-basicspace', 'shortest-duration-space', str)          
+               return str
+       
+       conversions.append (((1,5,38), conv, 'SystemStartDelimiter -> systemStartDelimiter'))
+
+
+if 1:
+       def conv (str):
+       
+               def func(match):
+                       break_dict = {
+                       "Instrument_name": "instrument-name",
+                       "Left_edge_item": "left-edge",
+                       "Span_bar": "span-bar",
+                       "Breathing_sign": "breathing-sign",
+                       "Staff_bar": "staff-bar",
+                       "Clef_item": "clef",
+                       "Key_item": "key-signature",
+                       "Time_signature": "time-signature",
+                       "Custos": "custos"
+                       }
+                       props =  match.group (1)
+                       for (k,v) in break_dict.items():
+                               props = re.sub (k, v, props)
+                       return  "breakAlignOrder = #'(%s)" % props
+
+               str = re.sub ("breakAlignOrder *= *#'\\(([a-z_\n\tA-Z ]+)\\)",
+                             func, str)
+               return str
+
+       # 40 ? 
+       conversions.append (((1,5,40), conv, 'breakAlignOrder property names'))
+       
+
+if 1:
+       def conv (str):
+               str = re.sub ('noAutoBeaming *= *##f', 'autoBeaming = ##t', str)
+               str = re.sub ('noAutoBeaming *= *##t', 'autoBeaming = ##f', str)
+               return str
+       
+       conversions.append (((1,5,49), conv, 'noAutoBeaming -> autoBeaming'))
+
+if 1:
+       def conv (str):
+               str = re.sub ('tuplet-bracket-visibility', 'bracket-visibility', str)
+               str = re.sub ('tuplet-number-visibility', 'number-visibility', str)             
+               return str
+       
+       conversions.append (((1,5,52), conv, 'tuplet-X-visibility -> X-visibility'))
+
+if 1:
+       def conv (str):
+               str = re.sub ('Pitch::transpose', 'ly-transpose-pitch', str)
+
+               return str
+       
+       conversions.append (((1,5,56), conv, 'Pitch::transpose -> ly-transpose-pitch'))
+
+if 1:
+       def conv (str):
+               str = re.sub ('textNonEmpty *= *##t', "TextScript \\set #'no-spacing-rods = ##f", str)
+               str = re.sub ('textNonEmpty *= *##f', "TextScript \\set #'no-spacing-rods = ##t", str)
+               return str
+       
+       conversions.append (((1,5,58), conv, 'deprecate textNonEmpty'))
+
+
+if 1:
+       def conv (str):
+               str = re.sub ('MinimumVerticalExtent', 'MinimumV@rticalExtent', str)
+               str = re.sub ('ExtraVerticalExtent', 'ExtraV@rticalExtent', str)
+               str = re.sub ('VerticalExtent', 'verticalExtent', str)
+               str = re.sub ('ExtraV@rticalExtent', 'extraVerticalExtent', str)
+               str = re.sub ('MinimumV@rticalExtent', 'minimumVerticalExtent', str)            
+               return str
+
+       conversions.append (((1,5,59), conv,
+       'XxxxVerticalExtent -> xxxVerticalExtent'))
+
+if 1:
+       def conv (str):
+               str = re.sub ('visibility-lambda', 'break-visibility', str)
+               return str
+
+       conversions.append (((1,5,62), conv,
+       'visibility-lambda -> break-visibility'))
+       
+
+if 1:
+       def conv (str):
+               if re.search (r'\addlyrics',str) \
+                      and re.search ('automaticMelismata', str)  == None:
+                       sys.stderr.write  ('automaticMelismata is turned on by default since 1.5.67. Please fix this by hand.')
+                       raise FatalConversionError()
+               return str
+
+       conversions.append (((1,5,67), conv,
+                            'automaticMelismata turned on by default'))
+
+if 1:
+       def conv (str):
+               str = re.sub ('ly-set-grob-property([^!])', 'ly-set-grob-property!\1', str)
+               str = re.sub ('ly-set-mus-property([^!])', 'ly-set-mus-property!\1', str)               
+               return str
+       
+       conversions.append (((1,5,68), conv, 'ly-set-X-property -> ly-set-X-property!'))
+
+if 1:
+       def conv (str):
+               str = re.sub ('extent-X', 'X-extent', str)
+               str = re.sub ('extent-Y', 'Y-extent', str)              
+               return str
+       
+       conversions.append (((1,5,71), conv, 'extent-[XY] -> [XY]-extent'))
+
+
 ################################
 #      END OF CONVERSIONS      
 ################################