diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-07-07 11:16:06 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-07-07 11:16:06 +0200 |
commit | 4344fb664864b157ac397ea210a7b34eaf3b275f (patch) | |
tree | e86a558f7cc6a15273b3aa3a0f5d474968316f28 /module/plugins/hooks | |
parent | additional log message (diff) | |
download | pyload-4344fb664864b157ac397ea210a7b34eaf3b275f.tar.xz |
basic event manager
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r-- | module/plugins/hooks/CaptchaTrader.py | 3 | ||||
-rw-r--r-- | module/plugins/hooks/ExternalScripts.py | 5 | ||||
-rw-r--r-- | module/plugins/hooks/IRCInterface.py | 4 | ||||
-rw-r--r-- | module/plugins/hooks/XMPPInterface.py | 4 |
4 files changed, 9 insertions, 7 deletions
diff --git a/module/plugins/hooks/CaptchaTrader.py b/module/plugins/hooks/CaptchaTrader.py index 2bae9401a..62ac2c8cc 100644 --- a/module/plugins/hooks/CaptchaTrader.py +++ b/module/plugins/hooks/CaptchaTrader.py @@ -58,6 +58,8 @@ class CaptchaTrader(Hook): RESPOND_URL = "http://captchatrader.com/api/respond" GETCREDITS_URL = "http://captchatrader.com/api/get_credits/username:%(user)s/password:%(password)s/" + def setup(self): + self.info = {} def getCredits(self): json = getURL(CaptchaTrader.GETCREDITS_URL % {"user": self.getConfig("username"), @@ -67,6 +69,7 @@ class CaptchaTrader(Hook): raise CaptchaTraderException(response[1]) else: self.logInfo(_("%s credits left") % response[1]) + self.info["credits"] = response[1] return response[1] def submit(self, captcha, captchaType="file", match=None): diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index bbf5acde3..daffc1827 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -40,7 +40,6 @@ class ExternalScripts(Hook): folders = ['download_preparing', 'download_finished', 'package_finished', 'before_reconnect', 'after_reconnect', 'unrar_finished'] - for folder in folders: self.scripts[folder] = [] @@ -52,6 +51,7 @@ class ExternalScripts(Hook): if names: self.logInfo(_("Installed scripts for %s : %s") % (script_type, ", ".join([basename(x) for x in names]))) + def initPluginType(self, folder, path): if not exists(path): try: @@ -91,8 +91,7 @@ class ExternalScripts(Hook): def packageFinished(self, pypack): for script in self.scripts['package_finished']: folder = self.core.config['general']['download_folder'] - if self.core.config.get("general", "folder_per_package"): - folder = save_join(folder. pypack.folder) + folder = save_join(folder. pypack.folder) self.callScript(script, pypack.name, folder, pypack.id) diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 6fdb7622f..8be84f863 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -49,9 +49,9 @@ class IRCInterface(Thread, Hook): __author_name__ = ("Jeix") __author_mail__ = ("Jeix@hasnomail.com") - def __init__(self, core): + def __init__(self, core, manager): Thread.__init__(self) - Hook.__init__(self, core) + Hook.__init__(self, core, manager) self.setDaemon(True) self.sm = core.server_methods diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index ce937c5d6..a96adf524 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -43,8 +43,8 @@ class XMPPInterface(IRCInterface, JabberClient): implements(IMessageHandlersProvider) - def __init__(self, core): - IRCInterface.__init__(self, core) + def __init__(self, core, manager): + IRCInterface.__init__(self, core, manager) self.jid = JID(self.getConfig("jid")) password = self.getConfig("pw") |