Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(109)

Delta Between Two Patch Sets: python/convertrules.py

Issue 2401042: convert: properly escape some single-backslashes. (Closed)
Left Patch Set: Created 14 years, 5 months ago
Right Patch Set: oops, forgot to deal with \* Created 14 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 2897 matching lines...) Expand 10 before | Expand all | Expand 10 after
2908 str = re.sub (r'ly:hairpin::after-line-breaking', r'ly:spanner::kill-zero-sp anned-time', str) 2908 str = re.sub (r'ly:hairpin::after-line-breaking', r'ly:spanner::kill-zero-sp anned-time', str)
2909 if re.search("(Slur|Tie)\w+#\'dash-fraction", str) \ 2909 if re.search("(Slur|Tie)\w+#\'dash-fraction", str) \
2910 or re.search("(Slur|Tie)\w+#\'dash-period", str): 2910 or re.search("(Slur|Tie)\w+#\'dash-period", str):
2911 stderr_write ("\n") 2911 stderr_write ("\n")
2912 stderr_write (NOT_SMART % _("Dash parameters for slurs and ties are now in \'dash-details.\n")) 2912 stderr_write (NOT_SMART % _("Dash parameters for slurs and ties are now in \'dash-details.\n"))
2913 stderr_write (UPDATE_MANUALLY) 2913 stderr_write (UPDATE_MANUALLY)
2914 return str 2914 return str
2915 2915
2916 @rule ((2, 13, 4), 2916 @rule ((2, 13, 4),
2917 _ ("Autobeaming rules have changed. override-auto-beam-setting and\n\ 2917 _ ("Autobeaming rules have changed. override-auto-beam-setting and\n\
2918 revert-auto-beam-setting have been eliminated. \\overrideBeamSettings has been\ n\ 2918 revert-auto-beam-setting have been eliminated.\n\
2919 added. beatGrouping has been eliminated.\n\ 2919 \\overrideBeamSettings has been added.\n\
2920 beatGrouping has been eliminated.\n\
2920 Different settings for vertical layout.\n\ 2921 Different settings for vertical layout.\n\
2921 ly:system-start-text::print -> system-start-text::print\n\ 2922 ly:system-start-text::print -> system-start-text::print\n\
2922 Beam #'thickness -> Beam #'beam-thickness\n\ 2923 Beam #'thickness -> Beam #'beam-thickness\n\
2923 ly:note-head::brew-ez-stencil -> note-head::brew-ez-stencil\n\ 2924 ly:note-head::brew-ez-stencil -> note-head::brew-ez-stencil\n\
2924 ly:ambitus::print -> ambitus::print\n\ 2925 ly:ambitus::print -> ambitus::print\n\
2925 Explicit dynamics context definition from `Piano centered dynamics'\n\ 2926 Explicit dynamics context definition from `Piano centered dynamics'\n\
2926 template replaced by new `Dynamics' context.")) 2927 template replaced by new `Dynamics' context."))
2927 def conv(str): 2928 def conv(str):
2928 if re.search("override-auto-beam-setting", str): 2929 if re.search("override-auto-beam-setting", str):
2929 stderr_write ("\n") 2930 stderr_write ("\n")
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
2982 stderr_write(UPDATE_MANUALLY) 2983 stderr_write(UPDATE_MANUALLY)
2983 2984
2984 return str 2985 return str
2985 2986
2986 @rule ((2, 13, 16), 2987 @rule ((2, 13, 16),
2987 _ ("Unify fetaNumber and fetaDynamic encodings")) 2988 _ ("Unify fetaNumber and fetaDynamic encodings"))
2988 def conv(str): 2989 def conv(str):
2989 return re.sub(r'\bfeta(Number|Dynamic)', 'fetaText', str) 2990 return re.sub(r'\bfeta(Number|Dynamic)', 'fetaText', str)
2990 2991
2991 @rule ((2, 13, 18), 2992 @rule ((2, 13, 18),
2992 _ ("\\RemoveEmpty*StaffContext -> \*Staff \\RemoveEmptyStaves")) 2993 _ ("\\RemoveEmpty*StaffContext -> \\*Staff \\RemoveEmptyStaves"))
dak 2010/10/11 18:18:48 Any particular reason that \*Staff does not get th
2993 def conv(str): 2994 def conv(str):
2994 str = re.sub (r"\\RemoveEmpty(|Drum|Rhythmic|Tab)StaffContext", 2995 str = re.sub (r"\\RemoveEmpty(|Drum|Rhythmic|Tab)StaffContext",
2995 r"\\\1Staff \\RemoveEmptyStaves", 2996 r"\\\1Staff \\RemoveEmptyStaves",
2996 str); 2997 str);
2997 str = re.sub (r"\\AncientRemoveEmptyStaffContext", 2998 str = re.sub (r"\\AncientRemoveEmptyStaffContext",
2998 r"\\VaticanaStaff \\RemoveEmptyStaves", 2999 r"\\VaticanaStaff \\RemoveEmptyStaves",
2999 str); 3000 str);
3000 return str 3001 return str
3001 3002
3002 @rule ((2, 13, 20), 3003 @rule ((2, 13, 20),
3003 _ ("\\cresc etc. are now postfix operators")) 3004 _ ("\\cresc etc. are now postfix operators"))
3004 def conv (str): 3005 def conv (str):
3005 str = re.sub (r'\\(cresc|dim|endcresc|enddim)\b', r'\\deprecated\1', str) 3006 str = re.sub (r'\\(cresc|dim|endcresc|enddim)\b', r'\\deprecated\1', str)
3006 return str 3007 return str
3007 3008
3008 @rule ((2, 13, 29), 3009 @rule ((2, 13, 29),
3009 _ ("Eliminate beamSettings, beatLength, \\setBeatGrouping, \\overrideBeam Settings and \\revertBeamSettings\n\ 3010 _ ("Eliminate beamSettings, beatLength, \\setBeatGrouping, \\overrideBeam Settings and \\revertBeamSettings.\n\
3010 \"accordion.accEtcbase\" -> \"accordion.etcbass\"")) 3011 \"accordion.accEtcbase\" -> \"accordion.etcbass\""))
3011 def conv(str): 3012 def conv(str):
3012 def sub_acc (m): 3013 def sub_acc (m):
3013 d = { 3014 d = {
3014 'Dot': 'dot', 3015 'Dot': 'dot',
3015 'Discant': 'discant', 3016 'Discant': 'discant',
3016 'Bayanbase': 'bayanbass', 3017 'Bayanbase': 'bayanbass',
3017 'Stdbase': 'stdbass', 3018 'Stdbase': 'stdbass',
3018 'Freebase': 'freebass', 3019 'Freebase': 'freebass',
3019 'OldEE': 'oldEE' 3020 'OldEE': 'oldEE'
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
3070 # - keep at most one rule per version; if several conversions should be done, 3071 # - keep at most one rule per version; if several conversions should be done,
3071 # concatenate them into a single "conv" function; 3072 # concatenate them into a single "conv" function;
3072 # 3073 #
3073 # - enclose strings to be localized with `_(' and `)'; 3074 # - enclose strings to be localized with `_(' and `)';
3074 # 3075 #
3075 # - write rule for bumping major stable version with 3076 # - write rule for bumping major stable version with
3076 # 3077 #
3077 # _ ("bump version for release") 3078 # _ ("bump version for release")
3078 # 3079 #
3079 # as exact description. 3080 # as exact description.
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b