]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/convert-ly.py
*** empty log message ***
[lilypond.git] / scripts / convert-ly.py
index 880fd23415d7969bdd455c82961813951e1ab5f1..1f0cea3ad7eeabf70f58de646e6248c766b537ad 100644 (file)
@@ -4,7 +4,7 @@
 #
 # source file of the GNU LilyPond music typesetter
 #
-# (c) 1998--2004  Han-Wen Nienhuys <hanwen@cs.uu.nl>
+# (c) 1998--2005  Han-Wen Nienhuys <hanwen@cs.uu.nl>
 #                 Jan Nieuwenhuizen <janneke@gnu.org>
 
 import os
@@ -1840,6 +1840,8 @@ Grob::preset_extent removed.
 
 
 def conv (str):
+       str = re.sub (r'(\\property[^=]+)=\s*([-0-9]+)',
+                     r'\1= #\2', str) 
        str = re.sub (r'\\property\s+([^. ]+)\s*\.\s*([^\\=]+)\s*\\(set|override)',
                      r"\\overrid@ \1.\2 ", str)
        str = re.sub (r'\\property\s+([^. ]+)\s*\.\s*([^\\= ]+)\s*=\s*',
@@ -2242,6 +2244,17 @@ conversions.append (((2, 3, 23),
                     conv,
                     '''\context Foo = NOTENAME -> \context Foo = "NOTENAME"'''))
 
+def conv (str):
+       def sub(m):
+               return regularize_id (m.group (1))
+       str = re.sub (r'(maintainer_email|maintainer_web|midi_stuff|gourlay_maxmeasures)',
+                     sub, str)
+       return str
+
+conversions.append (((2, 3, 24),
+                    conv,
+                    '''regularize other identifiers.'''))
+
 
 def conv (str):
        return str
@@ -2287,8 +2300,23 @@ conversions.append (((2, 5, 2),
 
 def conv (str):
        str = re.sub ('ly:find-glyph-by-name', 'ly:font-get-glyph', str)
-       str = re.sub ('"accidentals-', '"accidentals.', str)
-       str = re.sub ('"scripts-', '"scripts.', str)
+       str = re.sub ('"(scripts|clefs|accidentals)-', r'"\1.', str)
+       str = re.sub ("'hufnagel-do-fa", "'hufnagel.do.fa", str) 
+       str = re.sub ("'(vaticana|hufnagel|medicaea|petrucci|neomensural|mensural)-", r"'\1.", str) 
+       return str
+
+conversions.append (((2, 5, 3),
+                    conv,
+                    'ly:find-glyph-by-name -> ly:font-get-glyph, remove - from glyphnames.'))
+
+
+
+def conv (str):
+       if re.search (r"\\encoding", str):
+               sys.stderr.write ("Sorry, input files should be UTF8.\n"
+                                 + "Please convert by hand.")
+               raise FatalConversionError()
+
        return str
 
 conversions.append (((2, 5, 2),