added safeName for windows directory

This commit is contained in:
Clinton Hall 2013-03-04 16:21:18 -08:00
commit 7accf74fb9

View file

@ -32,7 +32,7 @@ def main(inputDirectory, inputName, inputCategory, inputHash):
for category in categories: for category in categories:
if category == inputCategory: if category == inputCategory:
outputDestination = os.path.normpath(os.path.join(outputDirectory, category, inputName)) outputDestination = os.path.normpath(os.path.join(outputDirectory, category, safeName(inputName)))
Logger.info("MAIN: Output directory set to: %s", outputDestination) Logger.info("MAIN: Output directory set to: %s", outputDestination)
break break
else: else:
@ -50,7 +50,7 @@ def main(inputDirectory, inputName, inputCategory, inputHash):
if root == 1: if root == 1:
Logger.debug("MAIN: Looking for %s in filename", inputName) Logger.debug("MAIN: Looking for %s in filename", inputName)
if (inputName in file) or (os.path.splitext(file)[0] in inputName): if (safeName(inputName) in safeName(file)) or (safeName(os.path.splitext(file)[0]) in safeName(inputName)):
pass # This file does match the Torrent name pass # This file does match the Torrent name
Logger.debug("Found file %s that matches Torrent Name %s", file, inputName) Logger.debug("Found file %s that matches Torrent Name %s", file, inputName)
else: else: