diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-08-05 20:13:16 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-08-05 20:13:16 +0200 |
commit | 2dcf398b41b198823f058182b4460f83ca217aee (patch) | |
tree | cf3cd416f612757bc7b953e77999423b37744f86 /module/plugins/hooks | |
parent | api account fix (diff) | |
download | pyload-2dcf398b41b198823f058182b4460f83ca217aee.tar.xz |
fixes, closed #361
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r-- | module/plugins/hooks/ExternalScripts.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 540b60477..36e026721 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -27,18 +27,20 @@ from module.utils import save_join class ExternalScripts(Hook): __name__ = "ExternalScripts" - __version__ = "0.2" - __description__ = """run external scripts""" + __version__ = "0.21" + __description__ = """Run external scripts""" __config__ = [("activated", "bool", "Activated", "True")] __author_name__ = ("mkaay", "RaNaN", "spoob") __author_mail__ = ("mkaay@mkaay.de", "ranan@pyload.org", "spoob@pyload.org") + event_list = ["unrarFinished", "allDownloadsFinished", "allDownloadsProcessed"] def setup(self): self.scripts = {} folders = ['download_preparing', 'download_finished', 'package_finished', - 'before_reconnect', 'after_reconnect', 'unrar_finished'] + 'before_reconnect', 'after_reconnect', 'unrar_finished', + 'all_dls_finished', 'all_dls_processed'] for folder in folders: @@ -58,6 +60,7 @@ class ExternalScripts(Hook): makedirs(path) except : self.logDebug("Script folder %s not created" % folder) + return for f in listdir(path): if f.startswith("#") or f.startswith(".") or f.startswith("_") or f.endswith("~") or f.endswith(".swp"): @@ -105,3 +108,12 @@ class ExternalScripts(Hook): def unrarFinished(self, folder, fname): for script in self.scripts["unrar_finished"]: self.callScript(script, folder, fname) + + def allDownloadsFinished(self): + for script in self.scripts["all_dls_finished"]: + self.callScript(script) + + def allDownloadsProcessed(self): + for script in self.scripts["all_dls_processed"]: + self.callScript(script) + |