#
# 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>
-
-# TODO
-# use -f and -t for -s output
-
-# NEWS
-# 0.2
-# - rewrite in python
-
import os
import sys
import __main__
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*',
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
conv,
'ly:import-module -> ly:module-copy'))
+def conv (str):
+ str = re.sub (r'\\(column|fill-line|dir-column|center-align|right-align|left-align|bracketed-y-column)\s*<([^<]*)>',
+ r'\\\1 {\2}', str)
+ str = re.sub (r'\\(column|fill-line|dir-column|center-align|right-align|left-align|bracketed-y-column)\s*<([^<]*)>',
+ r'\\\1 {\2}', str)
+ str = re.sub (r'\\(column|fill-line|dir-column|center-align|right-align|left-align|bracketed-y-column)\s*<([^<]*)>',
+ r'\\\1 {\2}', str)
+ return str
+
+conversions.append (((2, 5, 2),
+ conv,
+ '\markup .. < .. > .. -> \markup .. { .. } ..'))
+
+def conv (str):
+ str = re.sub ('ly:find-glyph-by-name', 'ly:font-get-glyph', 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),
+ conv,
+ 'ly:find-glyph-by-name -> ly:font-get-glyph, remove - from glyphnames.'))
################################