Skip to content

Commit

Permalink
change to run on python 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
aupfred committed Jan 2, 2025
1 parent 0a3cf2c commit 1a57669
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions abc_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
r'\%\%beginps(.|\s)+?\%\%endps', # remove embedded postscript
r'\%\%begintext(.|\s)+?\%\%endtext', # remove text
r'\[\w:.*?\]', # remove embedded fields
r'(?m)^\w:.*?$', # remove normal fields
r'(?m)%.*$', # remove comments
#r'(?m)^\w:.*?$', # remove normal fields
r'^\w:.*?$', # remove normal fields
#r'(?m)%.*$', # remove comments
r'%.*$', # remove comments
r'\[\w:.*?\]', # remove embedded fields
r'\\"', # remove escaped " characters
r'".*?"', # remove strings
Expand All @@ -19,7 +21,7 @@
r'!.+?!', # remove ornaments like eg. !pralltriller!
r'\+.+?\+', # remove ornaments like eg. +pralltriller+
r'\{.*?\}', # remove grace notes
]))
]), flags=re.M)

def remove_non_note_fragments(abc):
# replace non-note fragments of the text by replacing them by spaces (thereby preserving offsets), but keep also bar and repeat symbols
Expand Down
2 changes: 1 addition & 1 deletion tune_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ class AbcStructure(object):
@staticmethod
def get_sections(cwd):
# [1.3.6.2 [JWDJ] bugfix This fixes 'str>ng' in Fields and Command Reference
reference_content = io.open(os.path.join(cwd, 'reference.txt'), 'rU', encoding='latin-1').read()
reference_content = io.open(os.path.join(cwd, 'reference.txt'), 'r', encoding='latin-1').read()
if AbcStructure.replace_regexes is None:
AbcStructure.replace_regexes = [
(re.compile(r'\bh((?:bass/chord|length|logical|string|int|fl-?\n?oat\s?|command|str|text|vol|h|n|char|clef|bass|chord)\d*\s?(?: (?:string|int|float)\d*?)*)i\b'), r'<\1>'), # enclose types with < and >
Expand Down

0 comments on commit 1a57669

Please sign in to comment.