From 303036bce2a68569d721ae88d29b7b46a70d8f36 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 16 Dec 2015 12:37:44 +0100 Subject: New plugin: EventMapper --- module/plugins/hooks/EventMapper.py | 80 +++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 module/plugins/hooks/EventMapper.py diff --git a/module/plugins/hooks/EventMapper.py b/module/plugins/hooks/EventMapper.py new file mode 100644 index 000000000..ca1be2bdd --- /dev/null +++ b/module/plugins/hooks/EventMapper.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.Addon import Addon + + +class EventMapper(Addon): + __name__ = "EventMapper" + __type__ = "hook" + __version__ = "0.01" + __status__ = "testing" + + __config__ = [("activated", "bool", "Activated", True)] + + __description__ = """Map old events to new events""" + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + def activate(self, *args): + self.manager.dispatchEvent("activate", *args) + + + def exit(self, *args): + self.manager.dispatchEvent("exit", *args) + + + def config_changed(self, *args): + self.manager.dispatchEvent("config_changed", *args) + + + def all_downloads_finished(self, *args): + self.manager.dispatchEvent("all_downloads_finished", *args) + + + def all_downloads_processed(self, *args): + self.manager.dispatchEvent("all_downloads_processed", *args) + + + def links_added(self, *args): + self.manager.dispatchEvent("links_added", *args) + + + def download_preparing(self, *args): + self.manager.dispatchEvent("download_preparing", *args) + + + def download_finished(self, *args): + self.manager.dispatchEvent("download_finished", *args) + + + def download_failed(self, *args): + self.manager.dispatchEvent("download_failed", *args) + + + def package_deleted(self, *args): + self.manager.dispatchEvent("package_deleted", *args) + + + def package_finished(self, *args): + self.manager.dispatchEvent("package_finished", *args) + + + def before_reconnect(self, *args): + self.manager.dispatchEvent("before_reconnect", *args) + + + def after_reconnect(self, *args): + self.manager.dispatchEvent("after_reconnect", *args) + + + def captcha_task(self, *args): + self.manager.dispatchEvent("captcha_task", *args) + + + def captcha_correct(self, *args): + self.manager.dispatchEvent("captcha_correct", *args) + + + def captcha_invalid(self, *args): + self.manager.dispatchEvent("captcha_invalid", *args) -- cgit v1.2.3