LEFT | RIGHT |
1 # (setq py-indent-offset 4) | 1 # (setq py-indent-offset 4) |
2 | 2 |
3 | 3 |
4 import string | 4 import string |
5 import re | 5 import re |
6 import sys | 6 import sys |
7 import lilylib | 7 import lilylib |
8 | 8 |
9 _ = lilylib._ | 9 _ = lilylib._ |
10 | 10 |
(...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1180 leftpar = re.compile(r"\(") | 1180 leftpar = re.compile(r"\(") |
1181 rightpar = re.compile(r"\)") | 1181 rightpar = re.compile(r"\)") |
1182 | 1182 |
1183 def text_markup (str): | 1183 def text_markup (str): |
1184 result = '' | 1184 result = '' |
1185 # Find the beginning of each markup: | 1185 # Find the beginning of each markup: |
1186 match = markup_start.search (str) | 1186 match = markup_start.search (str) |
1187 while match: | 1187 while match: |
1188 result = result + str[:match.end (1)] + " \markup" | 1188 result = result + str[:match.end (1)] + " \markup" |
1189 str = str[match.end( 2):] | 1189 str = str[match.end( 2):] |
1190 » # Count matching parentheses to find the end of the | 1190 » # Count matching parentheses to find the end of the |
1191 # current markup: | 1191 # current markup: |
1192 nesting_level = 0 | 1192 nesting_level = 0 |
1193 pars = re.finditer(r"[()]",str) | 1193 pars = re.finditer(r"[()]",str) |
1194 for par in pars: | 1194 for par in pars: |
1195 if par.group () == '(': | 1195 if par.group () == '(': |
1196 nesting_level = nesting_level + 1 | 1196 nesting_level = nesting_level + 1 |
1197 else: | 1197 else: |
1198 nesting_level = nesting_level - 1 | 1198 nesting_level = nesting_level - 1 |
1199 if nesting_level == 0: | 1199 if nesting_level == 0: |
1200 markup_end = par.end () | 1200 markup_end = par.end () |
(...skipping 20 matching lines...) Expand all Loading... |
1221 str = re.sub (r"""([^-])\\\) *([a-z]+[,']*[!?]?[0-9:]*\.*)""", | 1221 str = re.sub (r"""([^-])\\\) *([a-z]+[,']*[!?]?[0-9:]*\.*)""", |
1222 r"\1 \2\\)", str) | 1222 r"\1 \2\\)", str) |
1223 str = re.sub (r"""([^-\\])\) *([a-z]+[,']*[!?]?[0-9:]*\.*)""", | 1223 str = re.sub (r"""([^-\\])\) *([a-z]+[,']*[!?]?[0-9:]*\.*)""", |
1224 r"\1 \2)", str) | 1224 r"\1 \2)", str) |
1225 str = re.sub (r"""([^-])\\! *([a-z]+[,']*[!?]?[0-9:]*\.*)""", | 1225 str = re.sub (r"""([^-])\\! *([a-z]+[,']*[!?]?[0-9:]*\.*)""", |
1226 r"\1 \2\\!", str) | 1226 r"\1 \2\\!", str) |
1227 return str | 1227 return str |
1228 | 1228 |
1229 string_or_scheme = re.compile ('("(?:[^"\\\\]|\\\\.)*")|(#\\s*\'?\\s*\\()') | 1229 string_or_scheme = re.compile ('("(?:[^"\\\\]|\\\\.)*")|(#\\s*\'?\\s*\\()') |
1230 | 1230 |
1231 # Only apply articulation_substitute () outside strings and | 1231 # Only apply articulation_substitute () outside strings and |
1232 # Scheme expressions: | 1232 # Scheme expressions: |
1233 def smarter_articulation_subst (str): | 1233 def smarter_articulation_subst (str): |
1234 result = '' | 1234 result = '' |
1235 # Find the beginning of next string or Scheme expr.: | 1235 # Find the beginning of next string or Scheme expr.: |
1236 match = string_or_scheme.search (str) | 1236 match = string_or_scheme.search (str) |
1237 while match: | 1237 while match: |
1238 # Convert the preceding LilyPond code: | 1238 # Convert the preceding LilyPond code: |
1239 previous_chunk = str[:match.start()] | 1239 previous_chunk = str[:match.start()] |
1240 result = result + articulation_substitute (previous_chunk) | 1240 result = result + articulation_substitute (previous_chunk) |
1241 if match.group (1): # Found a string | 1241 if match.group (1): # Found a string |
1242 # Copy the string to output: | 1242 # Copy the string to output: |
1243 result = result + match.group (1) | 1243 result = result + match.group (1) |
1244 str = str[match.end(1):] | 1244 str = str[match.end(1):] |
1245 » else: # Found a Scheme expression. Count | 1245 » else: # Found a Scheme expression. Count |
1246 # matching parentheses to find its end | 1246 # matching parentheses to find its end |
1247 str = str[match.start ():] | 1247 str = str[match.start ():] |
1248 nesting_level = 0 | 1248 nesting_level = 0 |
1249 pars = re.finditer(r"[()]",str) | 1249 pars = re.finditer(r"[()]",str) |
1250 for par in pars: | 1250 for par in pars: |
1251 if par.group () == '(': | 1251 if par.group () == '(': |
1252 nesting_level = nesting_level + 1 | 1252 nesting_level = nesting_level + 1 |
1253 else: | 1253 else: |
1254 nesting_level = nesting_level - 1 | 1254 nesting_level = nesting_level - 1 |
1255 if nesting_level == 0: | 1255 if nesting_level == 0: |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1314 r'\\grace { \1 }', str) | 1314 r'\\grace { \1 }', str) |
1315 str = re.sub ("\\\\grace[\t\n ]*{([^}]+)}", | 1315 str = re.sub ("\\\\grace[\t\n ]*{([^}]+)}", |
1316 r"""\\grace { | 1316 r"""\\grace { |
1317 \\property Voice.Stem \\override #'stroke-style = #"grace" | 1317 \\property Voice.Stem \\override #'stroke-style = #"grace" |
1318 \1 | 1318 \1 |
1319 \\property Voice.Stem \\revert #'stroke-style } | 1319 \\property Voice.Stem \\revert #'stroke-style } |
1320 """, str) | 1320 """, str) |
1321 return str | 1321 return str |
1322 | 1322 |
1323 | 1323 |
1324 @rule ((1, 9, 3), (_ ("%s misspelling") % "\\acciaccatura") + | 1324 @rule ((1, 9, 3), (_ ("%s misspelling") % "\\acciaccatura") + |
1325 ", fingerHorizontalDirection -> fingeringOrientations") | 1325 ", fingerHorizontalDirection -> fingeringOrientations") |
1326 def conv (str): | 1326 def conv (str): |
1327 str = re.sub ('accacciatura', | 1327 str = re.sub ('accacciatura', |
1328 'acciaccatura', str) | 1328 'acciaccatura', str) |
1329 | 1329 |
1330 if re.search ("context-spec-music", str): | 1330 if re.search ("context-spec-music", str): |
1331 stderr_write ('\n') | 1331 stderr_write ('\n') |
1332 stderr_write (NOT_SMART % "context-spec-music") | 1332 stderr_write (NOT_SMART % "context-spec-music") |
1333 stderr_write ('\n') | 1333 stderr_write ('\n') |
1334 stderr_write (UPDATE_MANUALLY) | 1334 stderr_write (UPDATE_MANUALLY) |
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1995 \\override TextScript #'direction = #-1 | 1995 \\override TextScript #'direction = #-1 |
1996 \\override Script #'direction = #-1 | 1996 \\override Script #'direction = #-1 |
1997 }""", str) | 1997 }""", str) |
1998 str = re.sub (r'\\scriptBoth', r"""{ | 1998 str = re.sub (r'\\scriptBoth', r"""{ |
1999 \\revert TextScript #'direction | 1999 \\revert TextScript #'direction |
2000 \\revert Script #'direction | 2000 \\revert Script #'direction |
2001 }""", str) | 2001 }""", str) |
2002 str = re.sub ('soloADue', 'printPartCombineTexts', str) | 2002 str = re.sub ('soloADue', 'printPartCombineTexts', str) |
2003 str = re.sub (r'\\applymusic\s*#notes-to-clusters', | 2003 str = re.sub (r'\\applymusic\s*#notes-to-clusters', |
2004 '\\makeClusters', str) | 2004 '\\makeClusters', str) |
2005 | 2005 |
2006 str = re.sub (r'pagenumber\s*=', 'firstpagenumber = ', str) | 2006 str = re.sub (r'pagenumber\s*=', 'firstpagenumber = ', str) |
2007 return str | 2007 return str |
2008 | 2008 |
2009 | 2009 |
2010 @rule ((2, 3, 16), _ ('''\\foo -> \\foomode (for chords, notes, etc.) | 2010 @rule ((2, 3, 16), _ ('''\\foo -> \\foomode (for chords, notes, etc.) |
2011 fold \\new FooContext \\foomode into \\foo.''')) | 2011 fold \\new FooContext \\foomode into \\foo.''')) |
2012 def conv (str): | 2012 def conv (str): |
2013 str = re.sub (r'\\chords\b', r'\\chordmode', str) | 2013 str = re.sub (r'\\chords\b', r'\\chordmode', str) |
2014 str = re.sub (r'\\lyrics\b', r'\\lyricmode', str) | 2014 str = re.sub (r'\\lyrics\b', r'\\lyricmode', str) |
2015 str = re.sub (r'\\figures\b', r'\\figuremode', str) | 2015 str = re.sub (r'\\figures\b', r'\\figuremode', str) |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2048 warning (_ ('''staff size should be changed at top-level | 2048 warning (_ ('''staff size should be changed at top-level |
2049 with | 2049 with |
2050 | 2050 |
2051 #(set-global-staff-size <STAFF-HEIGHT-IN-POINT>) | 2051 #(set-global-staff-size <STAFF-HEIGHT-IN-POINT>) |
2052 | 2052 |
2053 ''')) | 2053 ''')) |
2054 | 2054 |
2055 | 2055 |
2056 str = re.sub (r'#\(paper-set-staff-size', '%Use set-global-staff-size at top
level\n% #(layout-set-staff-size', str) | 2056 str = re.sub (r'#\(paper-set-staff-size', '%Use set-global-staff-size at top
level\n% #(layout-set-staff-size', str) |
2057 return str | 2057 return str |
2058 | 2058 |
2059 | 2059 |
2060 @rule ((2, 3, 23), r'\context Foo = NOTENAME -> \context Foo = "NOTENAME"') | 2060 @rule ((2, 3, 23), r'\context Foo = NOTENAME -> \context Foo = "NOTENAME"') |
2061 def conv (str): | 2061 def conv (str): |
2062 str = re.sub (r'\\context\s+([a-zA-Z]+)\s*=\s*([a-z]+)\s', | 2062 str = re.sub (r'\\context\s+([a-zA-Z]+)\s*=\s*([a-z]+)\s', |
2063 r'\\context \1 = "\2" ', | 2063 r'\\context \1 = "\2" ', |
2064 str ) | 2064 str ) |
2065 return str | 2065 return str |
2066 | 2066 |
2067 | 2067 |
2068 @rule ((2, 3, 24), _ ('''regularize other identifiers''')) | 2068 @rule ((2, 3, 24), _ ('''regularize other identifiers''')) |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2233 return str | 2233 return str |
2234 | 2234 |
2235 | 2235 |
2236 @rule ((2, 6, 0), _ ("bump version for release")) | 2236 @rule ((2, 6, 0), _ ("bump version for release")) |
2237 def conv (str): | 2237 def conv (str): |
2238 return str | 2238 return str |
2239 | 2239 |
2240 | 2240 |
2241 @rule ((2, 7, 0), 'ly:get-default-font -> ly:grob-default-font') | 2241 @rule ((2, 7, 0), 'ly:get-default-font -> ly:grob-default-font') |
2242 def conv (str): | 2242 def conv (str): |
2243 return re.sub('ly:get-default-font', 'ly:grob-default-font', str) | 2243 return re.sub('ly:get-default-font', 'ly:grob-default-font', str) |
2244 | 2244 |
2245 | 2245 |
2246 @rule ((2, 7, 1), '''ly:parser-define -> ly:parser-define! | 2246 @rule ((2, 7, 1), '''ly:parser-define -> ly:parser-define! |
2247 excentricity -> eccentricity | 2247 excentricity -> eccentricity |
2248 Timing_engraver -> Timing_translator + Default_bar_line_engraver | 2248 Timing_engraver -> Timing_translator + Default_bar_line_engraver |
2249 ''') | 2249 ''') |
2250 def conv (str): | 2250 def conv (str): |
2251 str = re.sub('ly:parser-define', 'ly:parser-define!', str) | 2251 str = re.sub('ly:parser-define', 'ly:parser-define!', str) |
2252 str = re.sub('excentricity', 'eccentricity', str) | 2252 str = re.sub('excentricity', 'eccentricity', str) |
2253 str = re.sub(r'\\(consists|remove) *"?Timing_engraver"?', | 2253 str = re.sub(r'\\(consists|remove) *"?Timing_engraver"?', |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2532 | 2532 |
2533 def sub_tempo (m): | 2533 def sub_tempo (m): |
2534 dur = int (m.group (1)) | 2534 dur = int (m.group (1)) |
2535 dots = len (m.group (2)) | 2535 dots = len (m.group (2)) |
2536 count = int (m.group (3)) | 2536 count = int (m.group (3)) |
2537 | 2537 |
2538 log2 = 0 | 2538 log2 = 0 |
2539 while dur > 1 : | 2539 while dur > 1 : |
2540 dur /= 2 | 2540 dur /= 2 |
2541 log2 += 1 | 2541 log2 += 1 |
2542 | 2542 |
2543 den = (1 << dots) * (1 << log2) | 2543 den = (1 << dots) * (1 << log2) |
2544 num = ((1 << (dots+1)) - 1) | 2544 num = ((1 << (dots+1)) - 1) |
2545 | 2545 |
2546 return """ | 2546 return """ |
2547 \midi { | 2547 \midi { |
2548 \context { | 2548 \context { |
2549 \Score | 2549 \Score |
2550 tempoWholesPerMinute = #(ly:make-moment %d %d) | 2550 tempoWholesPerMinute = #(ly:make-moment %d %d) |
2551 } | 2551 } |
2552 } | 2552 } |
2553 | 2553 |
2554 """ % (num*count, den) | 2554 """ % (num*count, den) |
2555 | 2555 |
2556 str = re.sub (r'\\midi\s*{\s*\\tempo ([0-9]+)\s*([.]*)\s*=\s*([0-9]+)\s*}',
sub_tempo, str) | 2556 str = re.sub (r'\\midi\s*{\s*\\tempo ([0-9]+)\s*([.]*)\s*=\s*([0-9]+)\s*}',
sub_tempo, str) |
2557 return str | 2557 return str |
2558 | 2558 |
2559 | 2559 |
2560 @rule ((2, 9, 19), "printfirst-page-number -> print-first-page-number") | 2560 @rule ((2, 9, 19), "printfirst-page-number -> print-first-page-number") |
2561 def conv (str): | 2561 def conv (str): |
2562 str = re.sub ('printfirst-page-number', 'print-first-page-number', str) | 2562 str = re.sub ('printfirst-page-number', 'print-first-page-number', str) |
2563 return str | 2563 return str |
2564 | 2564 |
2565 | 2565 |
(...skipping 22 matching lines...) Expand all Loading... |
2588 "AccidentalCautionary #'parenthesized = ##t", str) | 2588 "AccidentalCautionary #'parenthesized = ##t", str) |
2589 str = re.sub ("([A-Za-z]+)\s*#'cautionary-style\s*=\s*#'parentheses", | 2589 str = re.sub ("([A-Za-z]+)\s*#'cautionary-style\s*=\s*#'parentheses", |
2590 r"\1 #'parenthesized = ##t", str) | 2590 r"\1 #'parenthesized = ##t", str) |
2591 str = re.sub ("([A-Za-z]+)\s*#'cautionary-style\s*=\s*#'smaller", | 2591 str = re.sub ("([A-Za-z]+)\s*#'cautionary-style\s*=\s*#'smaller", |
2592 r"\1 #'font-size = #-2", str) | 2592 r"\1 #'font-size = #-2", str) |
2593 return str | 2593 return str |
2594 | 2594 |
2595 | 2595 |
2596 @rule ((2, 11, 6), _ ("Rename accidental glyphs, use glyph-name-alist.")) | 2596 @rule ((2, 11, 6), _ ("Rename accidental glyphs, use glyph-name-alist.")) |
2597 def conv (str): | 2597 def conv (str): |
2598 | 2598 |
2599 def sub_acc_name (m): | 2599 def sub_acc_name (m): |
2600 idx = int (m.group (1).replace ('M','-')) | 2600 idx = int (m.group (1).replace ('M','-')) |
2601 | 2601 |
2602 return ["accidentals.doublesharp", | 2602 return ["accidentals.doublesharp", |
2603 "accidentals.sharp.slashslash.stemstemstem", | 2603 "accidentals.sharp.slashslash.stemstemstem", |
2604 "accidentals.sharp", | 2604 "accidentals.sharp", |
2605 "accidentals.sharp.slashslash.stem", | 2605 "accidentals.sharp.slashslash.stem", |
2606 "accidentals.natural", | 2606 "accidentals.natural", |
2607 "accidentals.mirroredflat", | 2607 "accidentals.mirroredflat", |
2608 "accidentals.flat", | 2608 "accidentals.flat", |
2609 "accidentals.mirroredflat.flat", | 2609 "accidentals.mirroredflat.flat", |
2610 "accidentals.flatflat"][4-idx] | 2610 "accidentals.flatflat"][4-idx] |
2611 | 2611 |
2612 str = re.sub (r"accidentals[.](M?[-0-9]+)", | 2612 str = re.sub (r"accidentals[.](M?[-0-9]+)", |
2613 sub_acc_name, str) | 2613 sub_acc_name, str) |
2614 str = re.sub (r"(KeySignature|Accidental[A-Za-z]*)\s*#'style\s*=\s*#'([a-z]+
)", | 2614 str = re.sub (r"(KeySignature|Accidental[A-Za-z]*)\s*#'style\s*=\s*#'([a-z]+
)", |
2615 r"\1 #'glyph-name-alist = #alteration-\2-glyph-name-alist", st
r) | 2615 r"\1 #'glyph-name-alist = #alteration-\2-glyph-name-alist", st
r) |
2616 ## FIXME: standard vs default, alteration-FOO vs FOO-alteration | 2616 ## FIXME: standard vs default, alteration-FOO vs FOO-alteration |
2617 str = str.replace ('alteration-default-glyph-name-alist', | 2617 str = str.replace ('alteration-default-glyph-name-alist', |
2618 'standard-alteration-glyph-name-alist') | 2618 'standard-alteration-glyph-name-alist') |
2619 return str | 2619 return str |
2620 | 2620 |
2621 | 2621 |
2622 @rule ((2, 11, 10), """allowBeamBreak -> Beam #'breakable = ##t | 2622 @rule ((2, 11, 10), """allowBeamBreak -> Beam #'breakable = ##t |
2623 addquote -> addQuote | 2623 addquote -> addQuote |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2662 for (var, h) in [('left', m.group (3)), | 2662 for (var, h) in [('left', m.group (3)), |
2663 ('right', m.group (4))]: | 2663 ('right', m.group (4))]: |
2664 | 2664 |
2665 if h and float (h): | 2665 if h and float (h): |
2666 once = m.group (1) | 2666 once = m.group (1) |
2667 if not once: | 2667 if not once: |
2668 once = '' | 2668 once = '' |
2669 context = m.group (2) | 2669 context = m.group (2) |
2670 if not context: | 2670 if not context: |
2671 context = '' | 2671 context = '' |
2672 | 2672 |
2673 s += (r"%s \override %sTextSpanner #'bound-details #'%s #'text =
\markup { \draw-line #'(0 . %s) }" | 2673 s += (r"%s \override %sTextSpanner #'bound-details #'%s #'text =
\markup { \draw-line #'(0 . %s) }" |
2674 % (once, context, var, h)) | 2674 % (once, context, var, h)) |
2675 | 2675 |
2676 s += '\n' | 2676 s += '\n' |
2677 | 2677 |
2678 return s | 2678 return s |
2679 | 2679 |
2680 | 2680 |
2681 str = re.sub (r"(\\once)?\s*\\override\s*([a-zA-Z]+\s*[.]\s*)?TextSpanner\s*
#'edge-height\s*=\s*#'\(\s*([0-9.-]+)\s+[.]\s+([0-9.-]+)\s*\)", sub_edge_height,
str) | 2681 str = re.sub (r"(\\once)?\s*\\override\s*([a-zA-Z]+\s*[.]\s*)?TextSpanner\s*
#'edge-height\s*=\s*#'\(\s*([0-9.-]+)\s+[.]\s+([0-9.-]+)\s*\)", sub_edge_height,
str) |
2682 return str | 2682 return str |
2683 | 2683 |
2684 | 2684 |
2685 @rule ((2, 11, 23), "#'break-align-symbol -> #'break-align-symbols") | 2685 @rule ((2, 11, 23), "#'break-align-symbol -> #'break-align-symbols") |
2686 def conv (str): | 2686 def conv (str): |
2687 str = re.sub (r"\\override\s*([a-zA-Z.]+)\s*#'break-align-symbol\s*=\s*#'([a
-z-]+)", | 2687 str = re.sub (r"\\override\s*([a-zA-Z.]+)\s*#'break-align-symbol\s*=\s*#'([a
-z-]+)", |
2688 r"\\override \1 #'break-align-symbols = #'(\2)", str) | 2688 r"\\override \1 #'break-align-symbols = #'(\2)", str) |
2689 return str | 2689 return str |
2690 | 2690 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2737 @rule ((2, 11, 50), _ ("metronomeMarkFormatter uses text markup as second argume
nt,\n\ | 2737 @rule ((2, 11, 50), _ ("metronomeMarkFormatter uses text markup as second argume
nt,\n\ |
2738 fret diagram properties moved to fret-diagram-details.")) | 2738 fret diagram properties moved to fret-diagram-details.")) |
2739 def conv (str): | 2739 def conv (str): |
2740 ## warning 1/2: metronomeMarkFormatter uses text markup as second argument | 2740 ## warning 1/2: metronomeMarkFormatter uses text markup as second argument |
2741 if re.search ('metronomeMarkFormatter', str): | 2741 if re.search ('metronomeMarkFormatter', str): |
2742 stderr_write (NOT_SMART % _ ("metronomeMarkFormatter got an additional t
ext argument.\n")) | 2742 stderr_write (NOT_SMART % _ ("metronomeMarkFormatter got an additional t
ext argument.\n")) |
2743 stderr_write (_ ("The function assigned to Score.metronomeMarkFunction n
ow uses the signature\n%s") % | 2743 stderr_write (_ ("The function assigned to Score.metronomeMarkFunction n
ow uses the signature\n%s") % |
2744 "\t(format-metronome-markup text dur count context)\n"
) | 2744 "\t(format-metronome-markup text dur count context)\n"
) |
2745 | 2745 |
2746 ## warning 2/2: fret diagram properties moved to fret-diagram-details | 2746 ## warning 2/2: fret diagram properties moved to fret-diagram-details |
2747 fret_props = ['barre-type', | 2747 fret_props = ['barre-type', |
2748 'dot-color', | 2748 'dot-color', |
2749 'dot-radius', | 2749 'dot-radius', |
2750 'finger-code', | 2750 'finger-code', |
2751 'fret-count', | 2751 'fret-count', |
2752 'label-dir', | 2752 'label-dir', |
2753 'number-type', | 2753 'number-type', |
2754 'string-count', | 2754 'string-count', |
2755 'xo-font-magnification', | 2755 'xo-font-magnification', |
2756 'mute-string', | 2756 'mute-string', |
2757 'open-string', | 2757 'open-string', |
2758 'orientation'] | 2758 'orientation'] |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2793 return str | 2793 return str |
2794 | 2794 |
2795 @rule ((2, 11, 53), "infinite-spacing-height -> extra-spacing-height") | 2795 @rule ((2, 11, 53), "infinite-spacing-height -> extra-spacing-height") |
2796 def conv (str): | 2796 def conv (str): |
2797 str = re.sub (r"infinite-spacing-height\s+=\s+##t", r"extra-spacing-height =
#'(-inf.0 . +inf.0)", str) | 2797 str = re.sub (r"infinite-spacing-height\s+=\s+##t", r"extra-spacing-height =
#'(-inf.0 . +inf.0)", str) |
2798 str = re.sub (r"infinite-spacing-height\s+=\s+##f", r"extra-spacing-height =
#'(0 . 0)", str) | 2798 str = re.sub (r"infinite-spacing-height\s+=\s+##f", r"extra-spacing-height =
#'(0 . 0)", str) |
2799 return str | 2799 return str |
2800 | 2800 |
2801 @rule ((2, 11, 55), "#(set-octavation oct) -> \\ottava #oct,\n\ | 2801 @rule ((2, 11, 55), "#(set-octavation oct) -> \\ottava #oct,\n\ |
2802 \\put-adjacent markup axis dir markup -> \\put-adjacent axis dir markup markup") | 2802 \\put-adjacent markup axis dir markup -> \\put-adjacent axis dir markup markup") |
2803 def conv (str): | 2803 def conv (str): |
2804 str = re.sub (r"#\(set-octavation (-*[0-9]+)\)", r"\\ottava #\1", str) | 2804 str = re.sub (r"#\(set-octavation (-*[0-9]+)\)", r"\\ottava #\1", str) |
2805 if re.search ('put-adjacent', str): | 2805 if re.search ('put-adjacent', str): |
2806 stderr_write (NOT_SMART % _ ("\\put-adjacent argument order.\n")) | 2806 stderr_write (NOT_SMART % _ ("\\put-adjacent argument order.\n")) |
2807 stderr_write (_ ("Axis and direction now come before markups:\n")) | 2807 stderr_write (_ ("Axis and direction now come before markups:\n")) |
2808 stderr_write (_ ("\\put-adjacent axis dir markup markup.")) | 2808 stderr_write (_ ("\\put-adjacent axis dir markup markup.")) |
2809 return str | 2809 return str |
2810 | 2810 |
2811 @rule ((2, 11, 57), "\\center-align -> \\center-column, \\hcenter -> \\center-al
ign") | 2811 @rule ((2, 11, 57), "\\center-align -> \\center-column, \\hcenter -> \\center-al
ign") |
2812 def conv (str): | 2812 def conv (str): |
2813 str = re.sub (r"([\\:]+)center-align", r"\1center-column", str) | 2813 str = re.sub (r"([\\:]+)center-align", r"\1center-column", str) |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2915 if re.search("override-auto-beam-setting", str): | 2915 if re.search("override-auto-beam-setting", str): |
2916 stderr_write ("\n") | 2916 stderr_write ("\n") |
2917 stderr_write (NOT_SMART % _("override-auto-beam-setting.\n\ | 2917 stderr_write (NOT_SMART % _("override-auto-beam-setting.\n\ |
2918 Autobeam settings are now overriden with \\overrideBeamSettings.\n")) | 2918 Autobeam settings are now overriden with \\overrideBeamSettings.\n")) |
2919 stderr_write (UPDATE_MANUALLY) | 2919 stderr_write (UPDATE_MANUALLY) |
2920 if re.search("revert-auto-beam-setting", str): | 2920 if re.search("revert-auto-beam-setting", str): |
2921 stderr_write ("\n") | 2921 stderr_write ("\n") |
2922 stderr_write (NOT_SMART % _("override-auto-beam-setting.\n\ | 2922 stderr_write (NOT_SMART % _("override-auto-beam-setting.\n\ |
2923 Autobeam settings are now reverted with \\revertBeamSettings.\n")) | 2923 Autobeam settings are now reverted with \\revertBeamSettings.\n")) |
2924 stderr_write (UPDATE_MANUALLY) | 2924 stderr_write (UPDATE_MANUALLY) |
2925 if re.search("beatGrouping", str): | 2925 str = re.sub(r"\\set\s+#\'beatGrouping", r"\\setBeatGrouping", str) |
2926 stderr_write ("\n") | 2926 if re.search(r"(\w+\.beatGrouping)", str): |
2927 stderr_write (NOT_SMART % _("beatGrouping.\n\ | 2927 stderr_write (NOT_SMART % _(".beatGrouping. \n\ |
2928 Beat grouping is now adjusted with \\overrideBeamSettings.\n")) | 2928 beatGrouping with a specified context must now be accomplished with\n\ |
| 2929 \\overrideBeamSettings.\n")) |
2929 stderr_write (UPDATE_MANUALLY) | 2930 stderr_write (UPDATE_MANUALLY) |
2930 return str | 2931 return str |
2931 | 2932 |
2932 # Guidelines to write rules (please keep this at the end of this file) | 2933 # Guidelines to write rules (please keep this at the end of this file) |
2933 # | 2934 # |
2934 # - keep at most one rule per version; if several conversions should be done, | 2935 # - keep at most one rule per version; if several conversions should be done, |
2935 # concatenate them into a single "conv" function; | 2936 # concatenate them into a single "conv" function; |
2936 # | 2937 # |
2937 # - enclose strings to be localized with `_(' and `)'; | 2938 # - enclose strings to be localized with `_(' and `)'; |
2938 # | 2939 # |
2939 # - write rule for bumping major stable version with | 2940 # - write rule for bumping major stable version with |
2940 # | 2941 # |
2941 # _ ("bump version for release") | 2942 # _ ("bump version for release") |
2942 # | 2943 # |
2943 # as exact description. | 2944 # as exact description. |
LEFT | RIGHT |