From 62b91ae48f0a181506dc03d09ac3f2f9cc71c33c Mon Sep 17 00:00:00 2001 From: Colin P. McCabe Date: Sat, 16 Mar 2024 21:03:09 -0700 Subject: [PATCH] tagger.py: fix for latest python Fix for latest python (that apparently requires escaping backslash when in a double-quoted string, to get a literal backslash) --- tagger.py | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tagger.py b/tagger.py index e67f275..c82d7d3 100755 --- a/tagger.py +++ b/tagger.py @@ -78,23 +78,23 @@ def verify_program_installed(prog): # Regular expressions for parsing file names-- # which is, after all, what this program is all about -music_file_re = re.compile(".*\.mp3$") +music_file_re = re.compile(".*\\.mp3$") music_file_name_re = re.compile(".*/" + "(?P[^/]*)/" + "(?P[0123456789][0123456789]*) - " + "(?P[^/]*)" + - "\.[a-zA-Z0123456789]*$") + "\\.[a-zA-Z0123456789]*$") audiobook_file_name_re = re.compile(".*/" + "(?P[^/]*)/" + "(?P[0123456789][0123456789]*)"); dir_name_re = re.compile("(.*/)?" + - "(?P[0-9A-Za-z _.\-]*?) - " + - "(?P[0-9A-Za-z _(),'.\-\+]*)" + - "(?P = [0-9A-Za-z _'.\-]*)?" - "(?P\[LL\])?$") + "(?P[0-9A-Za-z _.\\-]*?) - " + + "(?P[0-9A-Za-z _(),'.\\-\\+]*)" + + "(?P = [0-9A-Za-z _'.\\-]*)?" + "(?P\\[LL\\])?$") def self_test_music_file(m, artist, album_name, \ conductor, track_number, title): @@ -307,7 +307,7 @@ if (self_test): sys.exit(0) for dir in dirs: - if (re.search("\[LL\]", dir)): + if (re.search("\\[LL\\]", dir)): print("skipping \"" + dir + "\"...") continue # Assume that paths without a directory prefix are local -- 1.6.6.rc1.39.g9a42