]> git.donarmstrong.com Git - lilypond.git/blobdiff - python/convertrules.py
Merge branch 'master' into lilypond/translation
[lilypond.git] / python / convertrules.py
index 3571d1a9b2115e4179b271c0544b412cb99ff4fb..be132ac5e3db3c7b269b330634317b93fa81a97f 100644 (file)
@@ -2950,8 +2950,8 @@ you must now specify the distances between staves rather than the offset of stav
     str = re.sub ('ly:(system-start-text::print|note-head::brew-ez-stencil|ambitus::print)',
                   '\\1', str)
     str = re.sub ('(\\bBeam\\s+#\')(?=thickness\\b)', '\\1beam-', str)
-    str = re.sub (r'(\\context\s*\{{1}[^\}]+\\name\s+"*Dynamics"*[^\}]*\}{1})',
-                  '', str)
+    str = re.sub (r'(\\context\s*\{{1}[^\}]+\\type\s+\"?Engraver_group\"?\s+\\name\s+"*Dynamics"*[^\}]*\}{1})',
+                  '% [Convert-ly] The Dynamics context is now included by default.', str)
     return str
 
 @rule ((2, 13, 10),
@@ -3065,10 +3065,8 @@ def conv(str):
     str = re.sub ('after-title-spacing',           'markup-system-spacing', str)
     str = re.sub ('before-title-spacing',          'score-markup-spacing',  str)
     str = re.sub ('between-scores-system-spacing', 'score-system-spacing',  str)
-
-    # also converts page-breaking-between-system-spacing:
+    # this rule also converts page-breaking-between-system-spacing:
     str = re.sub ('between-system-spacing',        'system-system-spacing', str)
-
     str = re.sub ('between-title-spacing',         'markup-markup-spacing', str)
     str = re.sub ('bottom-system-spacing',         'last-bottom-spacing',   str)
     str = re.sub ('top-title-spacing',             'top-markup-spacing',    str)
@@ -3078,6 +3076,53 @@ def conv(str):
                   str);
     return str
 
+@rule ((2, 13, 39),
+    _ ("Rename vertical spacing grob properties."))
+def conv(str):
+    # this rule also converts default-next-staff-spacing:
+    str = re.sub ('next-staff-spacing',       'staff-staff-spacing',             str)
+    # this is not a mistake:
+    #   Both 'next- and 'between- become 'staff-staff-spacing.
+    #   There is no conflict since they are in different grobs.
+    str = re.sub ('between-staff-spacing',    'staff-staff-spacing',             str)
+    str = re.sub ('after-last-staff-spacing', 'staffgroup-staff-spacing',        str)
+    str = re.sub ('inter-staff-spacing',      'nonstaff-relatedstaff-spacing',   str)
+    str = re.sub ('non-affinity-spacing',     'nonstaff-unrelatedstaff-spacing', str)
+    str = re.sub ('inter-loose-line-spacing', 'nonstaff-nonstaff-spacing',       str);
+
+    return str
+
+@rule ((2, 13, 40),
+    _ ("Remove \\paper variables head-separation and foot-separation."))
+def conv(str):
+    if re.search (r'head-separation', str):
+        stderr_write("\n")
+        stderr_write(NOT_SMART % ("head-separation.\n"))
+        stderr_write(_ ("Adjust settings for top-system-spacing instead.\n"))
+        stderr_write (UPDATE_MANUALLY)
+    if re.search (r'foot-separation', str):
+        stderr_write("\n")
+        stderr_write(NOT_SMART % ("foot-separation.\n"))
+        stderr_write(_ ("Adjust settings for last-bottom-spacing instead.\n"))
+        stderr_write(UPDATE_MANUALLY);
+
+    return str
+
+@rule ((2, 13, 42),
+    _ ("Rename space to basic-distance in various spacing alists.\n\
+Remove HarmonicParenthesesItem grob."))
+def conv(str):
+    str = re.sub (r'\(space\s+\.\s+([0-9]*\.?[0-9]*)\)', r'(basic-distance . \1)', str)
+    str = re.sub (r"#'space\s+=\s+#?([0-9]*\.?[0-9]*)", r"#'basic-distance = #\1", str)
+    if re.search (r'HarmonicParenthesesItem', str):
+       stderr_write ("\n")
+       stderr_write (NOT_SMART % ("HarmonicParenthesesItem.\n"))
+       stderr_write (_ ("HarmonicParenthesesItem has been eliminated.\n"))
+       stderr_write (_ ("Harmonic parentheses are part of the TabNoteHead grob.\n"))
+       stderr_write (UPDATE_MANUALLY);
+    return str
+
+
 # Guidelines to write rules (please keep this at the end of this file)
 #
 # - keep at most one rule per version; if several conversions should be done,