]> git.donarmstrong.com Git - lilypond.git/blobdiff - python/convertrules.py
Fix 2241: Proper copyright/header/tagline handling with multiple bookparts
[lilypond.git] / python / convertrules.py
index acabe0237e452869b4648caf98180af7c8ace815..b3aa1676c0dae090fc2434b0cc2b3e2c941ef95c 100644 (file)
@@ -3346,7 +3346,7 @@ def conv (str):
                   sub_tempo, str)
     return str
 
-@rule((2, 15, 39), r"\footnote -> <>\footnote, -\footnote -> \footnote")
+@rule((2, 15, 39), r"\footnote ... -> \footnote ... \default")
 def conv (str):
     def not_first (s):
         def match_fun (m):
@@ -3355,15 +3355,36 @@ def conv (str):
             return m.expand (s)
         return match_fun
     str = re.sub ("(" + matchmarkup + ")|"
-                  + r"(?<![-_^])((?:[-_^][-_^])*)(\\footnote(?:\s*"
+                  + r"(\\footnote(?:\s*"
                   + matchmarkup + ")?" + matcharg + "(?:" + matcharg
                   + ")?\s+" + matchmarkup + ")",
-                  not_first (r"\2<>\3"), str)
-    str = re.sub ("(" + matchmarkup + ")|"
-                  + r"(?<![-_^])((?:[-_^][-_^])*)-(\\footnote(?:\s*"
-                  + matchmarkup + ")?" + matcharg + "(?:" + matcharg
-                  + ")?\s+" + matchmarkup + ")",
-                  not_first (r"\2\3"), str)
+                  not_first (r"\2 \\default"), str)
+    return str
+
+@rule ((2, 15, 40), r"Remove beamWholeMeasure")
+def conv (str):
+    if re.search (r"\bbeamWholeMeasure\b", str):
+        stderr_write (NOT_SMART % "beamWholeMeasure")
+        stderr_write (_ ("beamExceptions controls whole-measure beaming.") + "\n")
+    return str
+
+@rule ((2, 15, 42), r"\set stringTuning -> \set Staff.stringTuning")
+def conv (str):
+    str = re.sub (r"(\\set\s+)stringTuning", r"\1Staff.stringTuning", str)
+    return str
+
+wordsyntax = r"[a-zA-Z\200-\377](?:[-_]?[a-zA-Z\200-\377])*"
+
+@rule ((2, 15, 43), r'"custom-tuning" = -> custom-tuning =')
+def conv (str):
+    str = re.sub ('\n"(' + wordsyntax + r')"(\s*=\s*\\stringTuning)', "\n\\1\\2", str)
+    return str
+
+@rule ((2, 17, 0), r"blank-*-force -> blank-*-penalty")
+def conv (str):
+    str = re.sub ('blank-page-force', 'blank-page-penalty', str)
+    str = re.sub ('blank-last-page-force', 'blank-last-page-penalty', str)
+    str = re.sub ('blank-after-score-page-force', 'blank-after-score-page-penalty', str)
     return str
 
 # Guidelines to write rules (please keep this at the end of this file)