diff options
Diffstat (limited to 'pyload/plugins')
-rw-r--r-- | pyload/plugins/Addon.py | 2 | ||||
-rw-r--r-- | pyload/plugins/Plugin.py | 2 | ||||
-rw-r--r-- | pyload/plugins/addon/ExternalScripts.py | 14 | ||||
-rw-r--r-- | pyload/plugins/addon/ExtractArchive.py | 18 | ||||
-rw-r--r-- | pyload/plugins/addon/RestartSlow.py | 2 |
5 files changed, 21 insertions, 17 deletions
diff --git a/pyload/plugins/Addon.py b/pyload/plugins/Addon.py index 43743848a..1c3049c10 100644 --- a/pyload/plugins/Addon.py +++ b/pyload/plugins/Addon.py @@ -41,7 +41,7 @@ class Addon(Base): #: automatically register event listeners for functions, attribute will be deleted dont use it yourself event_map = {} - # Alternative to event_map + # Deprecated alternative to event_map #: List of events the plugin can handle, name the functions exactly like eventname. event_list = [] #@NOTE: dont make duplicate entries in event_map diff --git a/pyload/plugins/Plugin.py b/pyload/plugins/Plugin.py index 77ae50123..07797e8c6 100644 --- a/pyload/plugins/Plugin.py +++ b/pyload/plugins/Plugin.py @@ -618,7 +618,7 @@ class Plugin(Base): filename = join(location, name) - self.core.addonManager.dispatchEvent("downloadStarts", self.pyfile, url, filename) + self.core.addonManager.dispatchEvent("download-start", self.pyfile, url, filename) try: newname = self.req.httpDownload(url, filename, get=get, post=post, ref=ref, cookies=cookies, diff --git a/pyload/plugins/addon/ExternalScripts.py b/pyload/plugins/addon/ExternalScripts.py index e6ee6a765..a2d7b8d86 100644 --- a/pyload/plugins/addon/ExternalScripts.py +++ b/pyload/plugins/addon/ExternalScripts.py @@ -20,13 +20,17 @@ class ExternalScripts(Addon): __description = """Run external scripts""" __license = "GPLv3" __authors = [("mkaay", "mkaay@mkaay.de"), - ("RaNaN", "ranan@pyload.org"), - ("spoob", "spoob@pyload.org"), - ("Walter Purcaro", "vuolter@gmail.com")] + ("RaNaN", "ranan@pyload.org"), + ("spoob", "spoob@pyload.org"), + ("Walter Purcaro", "vuolter@gmail.com")] - event_list = ["archive_extracted", "package_extracted", "all_archives_extracted", "all_archives_processed", - "allDownloadsFinished", "allDownloadsProcessed"] + event_map = {'archive-extracted' : "archive_extracted", + 'package-extracted' : "package_extracted", + 'all_archives-extracted' : "all_archives_extracted", + 'all_archives-processed' : "all_archives_processed", + 'all_downloads-finished' : "allDownloadsFinished", + 'all_downloads-processed': "allDownloadsProcessed"} def setup(self): diff --git a/pyload/plugins/addon/ExtractArchive.py b/pyload/plugins/addon/ExtractArchive.py index 135e460c3..15224eba5 100644 --- a/pyload/plugins/addon/ExtractArchive.py +++ b/pyload/plugins/addon/ExtractArchive.py @@ -76,11 +76,11 @@ class ExtractArchive(Addon): __description = """Extract different kind of archives""" __license = "GPLv3" __authors = [("RaNaN", "ranan@pyload.org"), - ("AndroKev", None), - ("Walter Purcaro", "vuolter@gmail.com")] + ("AndroKev", None), + ("Walter Purcaro", "vuolter@gmail.com")] - event_list = ["allDownloadsProcessed"] + event_map = {'all_downloads-processed': "allDownloadsProcessed"} def setup(self): @@ -138,8 +138,8 @@ class ExtractArchive(Addon): local = copy(self.queue) del self.queue[:] if self.extract(local, thread): #: check only if all gone fine, no failed reporting for now - self.manager.dispatchEvent("all_archives_extracted") - self.manager.dispatchEvent("all_archives_processed") + self.manager.dispatchEvent("all_archives-extracted") + self.manager.dispatchEvent("all_archives-processed") def extract(self, ids, thread=None): @@ -224,10 +224,10 @@ class ExtractArchive(Addon): if matched: if success: extracted.append(pid) - self.manager.dispatchEvent("package_extracted", p) + self.manager.dispatchEvent("package-extracted", p) else: failed.append(pid) - self.manager.dispatchEvent("package_extract_failed", p) + self.manager.dispatchEvent("package-extract_failed", p) else: self.logInfo(_("No files found to extract")) @@ -287,7 +287,7 @@ class ExtractArchive(Addon): self.logInfo(basename(plugin.file), _("Extracting finished")) extracted_files = plugin.getExtractedFiles() - self.manager.dispatchEvent("archive_extracted", pyfile, plugin.out, plugin.file, extracted_files) + self.manager.dispatchEvent("archive-extracted", pyfile, plugin.out, plugin.file, extracted_files) return extracted_files @@ -300,7 +300,7 @@ class ExtractArchive(Addon): print_exc() self.logError(basename(plugin.file), _("Unknown Error"), e) - self.manager.dispatchEvent("archive_extract_failed", pyfile) + self.manager.dispatchEvent("archive-extract_failed", pyfile) raise Exception(_("Extract failed")) diff --git a/pyload/plugins/addon/RestartSlow.py b/pyload/plugins/addon/RestartSlow.py index 2f1657154..61d842b7d 100644 --- a/pyload/plugins/addon/RestartSlow.py +++ b/pyload/plugins/addon/RestartSlow.py @@ -21,7 +21,7 @@ class RestartSlow(Addon): __authors = [("Walter Purcaro", "vuolter@gmail.com")] - event_list = ["downloadStarts"] + event_map = {'download-start': "downloadStarts"} def setup(self): |