summaryrefslogtreecommitdiffstats
path: root/pyload/plugin/addon/HotFolder.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugin/addon/HotFolder.py')
-rw-r--r--pyload/plugin/addon/HotFolder.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/pyload/plugin/addon/HotFolder.py b/pyload/plugin/addon/HotFolder.py
index 1b1235f09..0137514a8 100644
--- a/pyload/plugin/addon/HotFolder.py
+++ b/pyload/plugin/addon/HotFolder.py
@@ -14,7 +14,7 @@ from pyload.utils import fs_encode, fs_join
class HotFolder(Addon):
__name__ = "HotFolder"
__type__ = "addon"
- __version__ = "0.13"
+ __version__ = "0.14"
__config__ = [("folder" , "str" , "Folder to observe" , "container"),
("watch_file", "bool", "Observe link file" , False ),
@@ -35,14 +35,14 @@ class HotFolder(Addon):
def periodical(self):
- folder = fs_encode(self.getConfig("folder"))
- file = fs_encode(self.getConfig("file"))
+ folder = fs_encode(self.getConfig('folder'))
+ file = fs_encode(self.getConfig('file'))
try:
if not os.path.isdir(os.path.join(folder, "finished")):
os.makedirs(os.path.join(folder, "finished"))
- if self.getConfig("watch_file"):
+ if self.getConfig('watch_file'):
with open(file, "a+") as f:
f.seek(0)
content = f.read().strip()
@@ -64,11 +64,11 @@ class HotFolder(Addon):
if not os.path.isfile(path) or f.endswith("~") or f.startswith("#") or f.startswith("."):
continue
- newpath = os.path.join(folder, "finished", f if self.getConfig("keep") else "tmp_" + f)
+ newpath = os.path.join(folder, "finished", f if self.getConfig('keep') else "tmp_" + f)
move(path, newpath)
self.logInfo(_("Added %s from HotFolder") % f)
self.core.api.addPackage(f, [newpath], 1)
- except IOError, e:
+ except (IOError, OSError), e:
self.logError(e)