# 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<dir_name>[^/]*)/" +
"(?P<track_number>[0123456789][0123456789]*) - " +
"(?P<track_name>[^/]*)" +
- "\.[a-zA-Z0123456789]*$")
+ "\\.[a-zA-Z0123456789]*$")
audiobook_file_name_re = re.compile(".*/" +
"(?P<dir_name>[^/]*)/" +
"(?P<track_number>[0123456789][0123456789]*)");
dir_name_re = re.compile("(.*/)?" +
- "(?P<artist>[0-9A-Za-z _.\-]*?) - " +
- "(?P<album>[0-9A-Za-z _(),'.\-\+]*)" +
- "(?P<conductor> = [0-9A-Za-z _'.\-]*)?"
- "(?P<encoding>\[LL\])?$")
+ "(?P<artist>[0-9A-Za-z _.\\-]*?) - " +
+ "(?P<album>[0-9A-Za-z _(),'.\\-\\+]*)" +
+ "(?P<conductor> = [0-9A-Za-z _'.\\-]*)?"
+ "(?P<encoding>\\[LL\\])?$")
def self_test_music_file(m, artist, album_name, \
conductor, track_number, title):
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