From: Colin P. McCabe Date: Sun, 17 Mar 2024 04:03:09 +0000 (-0700) Subject: tagger.py: fix for latest python X-Git-Url: http://club.cc.cmu.edu/~cmccabe/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62b91ae48f0a181506dc03d09ac3f2f9cc71c33c;p=cmccabe-bin 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) --- 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