Stop renamer if folders don't exist

This commit is contained in:
Ruud
2012-01-08 23:35:22 +01:00
parent 04c4d69661
commit 10b7baf291
+4 -1
View File
@@ -46,7 +46,10 @@ class Renamer(Plugin):
return
# Check to see if the "to" folder is inside the "from" folder.
if self.conf('from') in self.conf('to'):
if not os.path.isdir(self.conf('from')) or not os.path.isdir(self.conf('to')):
log.debug('"To" and "From" have to exist.')
return
elif self.conf('from') in self.conf('to'):
log.error('The "to" can\'t be inside of the "from" folder. You\'ll get an infinite loop.')
return