OLD | NEW |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 # (setq py-indent-offset 4) | 2 # (setq py-indent-offset 4) |
3 | 3 |
4 | 4 |
5 import string | 5 import string |
6 import re | 6 import re |
7 import sys | 7 import sys |
8 import lilylib | 8 import lilylib |
9 | 9 |
10 _ = lilylib._ | 10 _ = lilylib._ |
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 "Left_edge_item": "left-edge", | 640 "Left_edge_item": "left-edge", |
641 "Span_bar": "span-bar", | 641 "Span_bar": "span-bar", |
642 "Breathing_sign": "breathing-sign", | 642 "Breathing_sign": "breathing-sign", |
643 "Staff_bar": "staff-bar", | 643 "Staff_bar": "staff-bar", |
644 "Clef_item": "clef", | 644 "Clef_item": "clef", |
645 "Key_item": "key-signature", | 645 "Key_item": "key-signature", |
646 "Time_signature": "time-signature", | 646 "Time_signature": "time-signature", |
647 "Custos": "custos" | 647 "Custos": "custos" |
648 } | 648 } |
649 props = match.group (1) | 649 props = match.group (1) |
650 for (k,v) in break_dict.items(): | 650 for (k,v) in list(break_dict.items()): |
651 props = re.sub (k, v, props) | 651 props = re.sub (k, v, props) |
652 return "breakAlignOrder = #'(%s)" % props | 652 return "breakAlignOrder = #'(%s)" % props |
653 | 653 |
654 str = re.sub ("breakAlignOrder *= *#'\\(([a-z_\n\tA-Z ]+)\\)", | 654 str = re.sub ("breakAlignOrder *= *#'\\(([a-z_\n\tA-Z ]+)\\)", |
655 func, str) | 655 func, str) |
656 return str | 656 return str |
657 | 657 |
658 | 658 |
659 @rule ((1, 5, 49), 'noAutoBeaming -> autoBeaming') | 659 @rule ((1, 5, 49), 'noAutoBeaming -> autoBeaming') |
660 def conv (str): | 660 def conv (str): |
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1754 str = re.sub ('ly:get-mus-property', 'ly:music-property',str) | 1754 str = re.sub ('ly:get-mus-property', 'ly:music-property',str) |
1755 str = re.sub ('ly:get-context-property', 'ly:context-property',str) | 1755 str = re.sub ('ly:get-context-property', 'ly:context-property',str) |
1756 return str | 1756 return str |
1757 | 1757 |
1758 | 1758 |
1759 @rule ((2, 1, 27), "property transposing -> tuning") | 1759 @rule ((2, 1, 27), "property transposing -> tuning") |
1760 def conv (str): | 1760 def conv (str): |
1761 def subst (m): | 1761 def subst (m): |
1762 (o, g) = divmod (int (m.group (2)), 12) | 1762 (o, g) = divmod (int (m.group (2)), 12) |
1763 | 1763 |
1764 lower_pitches = filter (lambda x : x <= g, [0, 2, 4, 5, 7, 9, 11, 12]) | 1764 lower_pitches = [x for x in [0, 2, 4, 5, 7, 9, 11, 12] if x <= g] |
1765 s = len (lower_pitches) -1 | 1765 s = len (lower_pitches) -1 |
1766 a = g - lower_pitches [-1] | 1766 a = g - lower_pitches [-1] |
1767 | 1767 |
1768 | 1768 |
1769 str = 'cdefgab' [s] | 1769 str = 'cdefgab' [s] |
1770 str += ['eses', 'es', '', 'is', 'isis'][a + 2] | 1770 str += ['eses', 'es', '', 'is', 'isis'][a + 2] |
1771 o += 1 # c' is octave 0 | 1771 o += 1 # c' is octave 0 |
1772 if o < 0: | 1772 if o < 0: |
1773 str += (-o) * "," | 1773 str += (-o) * "," |
1774 elif o > 0: | 1774 elif o > 0: |
(...skipping 2207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3982 # - keep at most one rule per version; if several conversions should be done, | 3982 # - keep at most one rule per version; if several conversions should be done, |
3983 # concatenate them into a single "conv" function; | 3983 # concatenate them into a single "conv" function; |
3984 # | 3984 # |
3985 # - enclose strings to be localized with `_(' and `)'; | 3985 # - enclose strings to be localized with `_(' and `)'; |
3986 # | 3986 # |
3987 # - write rule for bumping major stable version with | 3987 # - write rule for bumping major stable version with |
3988 # | 3988 # |
3989 # _ ("bump version for release") | 3989 # _ ("bump version for release") |
3990 # | 3990 # |
3991 # as exact description. | 3991 # as exact description. |
OLD | NEW |