From f6e5359110f4bd5facc04a98f94acbc41b6e5228 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 3 Oct 2014 21:20:20 +0200 Subject: Update pyload to the new plugins structure --- pyload/manager/AccountManager.py | 2 +- pyload/manager/AddonManager.py | 306 ++++++++++++++++++++++++++++++++++ pyload/manager/CaptchaManager.py | 4 +- pyload/manager/HookManager.py | 305 --------------------------------- pyload/manager/PluginManager.py | 27 +-- pyload/manager/ThreadManager.py | 8 +- pyload/manager/thread/PluginThread.py | 16 +- 7 files changed, 336 insertions(+), 332 deletions(-) create mode 100644 pyload/manager/AddonManager.py delete mode 100644 pyload/manager/HookManager.py (limited to 'pyload/manager') diff --git a/pyload/manager/AccountManager.py b/pyload/manager/AccountManager.py index d1958f4b6..ec092d740 100644 --- a/pyload/manager/AccountManager.py +++ b/pyload/manager/AccountManager.py @@ -36,7 +36,7 @@ class AccountManager: if plugin in self.accounts: if plugin not in self.plugins: try: - self.plugins[plugin] = self.core.pluginManager.loadClass("accounts", plugin)(self, self.accounts[plugin]) + self.plugins[plugin] = self.core.pluginManager.loadClass("account", plugin)(self, self.accounts[plugin]) except TypeError: # The account class no longer exists (blacklisted plugin). Skipping the account to avoid crash return None diff --git a/pyload/manager/AddonManager.py b/pyload/manager/AddonManager.py new file mode 100644 index 000000000..a81e0a74f --- /dev/null +++ b/pyload/manager/AddonManager.py @@ -0,0 +1,306 @@ +# -*- coding: utf-8 -*- + +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see . + + @author: RaNaN, mkaay + @interface-version: 0.1 +""" +import __builtin__ + +import traceback +from thread import start_new_thread +from threading import RLock + +from types import MethodType + +from pyload.manager.thread.PluginThread import AddonThread +from pyload.manager.PluginManager import literal_eval +from utils import lock + +class AddonManager: + """Manages addons, delegates and handles Events. + + Every plugin can define events, \ + but some very usefull events are called by the Core. + Contrary to overwriting addon methods you can use event listener, + which provides additional entry point in the control flow. + Only do very short tasks or use threads. + + **Known Events:** + Most addon methods exists as events. These are the additional known events. + + ===================== ============== ================================== + Name Arguments Description + ===================== ============== ================================== + downloadPreparing fid A download was just queued and will be prepared now. + downloadStarts fid A plugin will immediately starts the download afterwards. + linksAdded links, pid Someone just added links, you are able to modify the links. + allDownloadsProcessed Every link was handled, pyload would idle afterwards. + allDownloadsFinished Every download in queue is finished. + unrarFinished folder, fname An Unrar job finished + configChanged The config was changed via the api. + pluginConfigChanged The plugin config changed, due to api or internal process. + ===================== ============== ================================== + + | Notes: + | allDownloadsProcessed is *always* called before allDownloadsFinished. + | configChanged is *always* called before pluginConfigChanged. + + + """ + + def __init__(self, core): + self.core = core + self.config = self.core.config + + __builtin__.addonManager = self #needed to let addons register themself + + self.log = self.core.log + self.plugins = [] + self.pluginMap = {} + self.methods = {} #dict of names and list of methods usable by rpc + + self.events = {} # contains events + + #registering callback for config event + self.config.pluginCB = MethodType(self.dispatchEvent, "pluginConfigChanged", basestring) + + self.addEvent("pluginConfigChanged", self.manageAddon) + + self.lock = RLock() + self.createIndex() + + def try_catch(func): + def new(*args): + try: + return func(*args) + except Exception, e: + args[0].log.error(_("Error executing addon: %s") % e) + if args[0].core.debug: + traceback.print_exc() + + return new + + + def addRPC(self, plugin, func, doc): + plugin = plugin.rpartition(".")[2] + doc = doc.strip() if doc else "" + + if plugin in self.methods: + self.methods[plugin][func] = doc + else: + self.methods[plugin] = {func: doc} + + def callRPC(self, plugin, func, args, parse): + if not args: args = tuple() + if parse: + args = tuple([literal_eval(x) for x in args]) + + plugin = self.pluginMap[plugin] + f = getattr(plugin, func) + return f(*args) + + + def createIndex(self): + plugins = [] + + active = [] + deactive = [] + + for pluginname in self.core.pluginManager.addonPlugins: + try: + # hookClass = getattr(plugin, plugin.__name__) + + if self.config.getPlugin(pluginname, "activated"): + pluginClass = self.core.pluginManager.loadClass("addon", pluginname) + if not pluginClass: continue + + plugin = pluginClass(self.core, self) + plugins.append(plugin) + self.pluginMap[pluginClass.__name__] = plugin + if plugin.isActivated(): + active.append(pluginClass.__name__) + else: + deactive.append(pluginname) + + + except: + self.log.warning(_("Failed activating %(name)s") % {"name": pluginname}) + if self.core.debug: + traceback.print_exc() + + self.log.info(_("Activated plugins: %s") % ", ".join(sorted(active))) + self.log.info(_("Deactivate plugins: %s") % ", ".join(sorted(deactive))) + + self.plugins = plugins + + def manageAddon(self, plugin, name, value): + if name == "activated" and value: + self.activateAddon(plugin) + elif name == "activated" and not value: + self.deactivateAddon(plugin) + + def activateAddon(self, plugin): + + #check if already loaded + for inst in self.plugins: + if inst.__name__ == plugin: + return + + pluginClass = self.core.pluginManager.loadClass("addon", plugin) + + if not pluginClass: return + + self.log.debug("Plugin loaded: %s" % plugin) + + plugin = pluginClass(self.core, self) + self.plugins.append(plugin) + self.pluginMap[pluginClass.__name__] = plugin + + # call core Ready + start_new_thread(plugin.coreReady, tuple()) + + def deactivateAddon(self, plugin): + + addon = None + for inst in self.plugins: + if inst.__name__ == plugin: + addon = inst + + if not addon: + return + + self.log.debug("Plugin unloaded: %s" % plugin) + + addon.unload() + + #remove periodic call + self.log.debug("Removed callback %s" % self.core.scheduler.removeJob(addon.cb)) + self.plugins.remove(addon) + del self.pluginMap[addon.__name__] + + + @try_catch + def coreReady(self): + for plugin in self.plugins: + if plugin.isActivated(): + plugin.coreReady() + + self.dispatchEvent("coreReady") + + @try_catch + def coreExiting(self): + for plugin in self.plugins: + if plugin.isActivated(): + plugin.coreExiting() + + self.dispatchEvent("coreExiting") + + @lock + def downloadPreparing(self, pyfile): + for plugin in self.plugins: + if plugin.isActivated(): + plugin.downloadPreparing(pyfile) + + self.dispatchEvent("downloadPreparing", pyfile) + + @lock + def downloadFinished(self, pyfile): + for plugin in self.plugins: + if plugin.isActivated(): + plugin.downloadFinished(pyfile) + + self.dispatchEvent("downloadFinished", pyfile) + + @lock + @try_catch + def downloadFailed(self, pyfile): + for plugin in self.plugins: + if plugin.isActivated(): + plugin.downloadFailed(pyfile) + + self.dispatchEvent("downloadFailed", pyfile) + + @lock + def packageFinished(self, package): + for plugin in self.plugins: + if plugin.isActivated(): + plugin.packageFinished(package) + + self.dispatchEvent("packageFinished", package) + + @lock + def beforeReconnecting(self, ip): + for plugin in self.plugins: + plugin.beforeReconnecting(ip) + + self.dispatchEvent("beforeReconnecting", ip) + + @lock + def afterReconnecting(self, ip): + for plugin in self.plugins: + if plugin.isActivated(): + plugin.afterReconnecting(ip) + + self.dispatchEvent("afterReconnecting", ip) + + def startThread(self, function, *args, **kwargs): + t = AddonThread(self.core.threadManager, function, args, kwargs) + + def activePlugins(self): + """ returns all active plugins """ + return [x for x in self.plugins if x.isActivated()] + + def getAllInfo(self): + """returns info stored by hook plugins""" + info = {} + for name, plugin in self.pluginMap.iteritems(): + if plugin.info: + #copy and convert so str + info[name] = dict([(x, str(y) if not isinstance(y, basestring) else y) for x, y in plugin.info.iteritems()]) + return info + + + def getInfo(self, plugin): + info = {} + if plugin in self.pluginMap and self.pluginMap[plugin].info: + info = dict([(x, str(y) if not isinstance(y, basestring) else y) + for x, y in self.pluginMap[plugin].info.iteritems()]) + + return info + + def addEvent(self, event, func): + """Adds an event listener for event name""" + if event in self.events: + self.events[event].append(func) + else: + self.events[event] = [func] + + def removeEvent(self, event, func): + """removes previously added event listener""" + if event in self.events: + self.events[event].remove(func) + + def dispatchEvent(self, event, *args): + """dispatches event with args""" + if event in self.events: + for f in self.events[event]: + try: + f(*args) + except Exception, e: + self.log.warning("Error calling event handler %s: %s, %s, %s" + % (event, f, args, str(e))) + if self.core.debug: + traceback.print_exc() diff --git a/pyload/manager/CaptchaManager.py b/pyload/manager/CaptchaManager.py index 0ba876ae8..06f1347fc 100644 --- a/pyload/manager/CaptchaManager.py +++ b/pyload/manager/CaptchaManager.py @@ -64,7 +64,7 @@ class CaptchaManager: if cli: #client connected -> should solve the captcha task.setWaiting(50) #wait 50 sec for response - for plugin in self.core.hookManager.activePlugins(): + for plugin in self.core.addonManager.activePlugins(): try: plugin.newCaptchaTask(task) except: @@ -87,7 +87,7 @@ class CaptchaTask: self.captchaFormat = format self.captchaFile = file self.captchaResultType = result_type - self.handler = [] #the hook plugins that will take care of the solution + self.handler = [] #: the hook plugins that will take care of the solution self.result = None self.waitUntil = None self.error = None #error message diff --git a/pyload/manager/HookManager.py b/pyload/manager/HookManager.py deleted file mode 100644 index 6f5477aeb..000000000 --- a/pyload/manager/HookManager.py +++ /dev/null @@ -1,305 +0,0 @@ -# -*- coding: utf-8 -*- - -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . - - @author: RaNaN, mkaay - @interface-version: 0.1 -""" -import __builtin__ - -import traceback -from thread import start_new_thread -from threading import RLock - -from types import MethodType - -from pyload.manager.thread.PluginThread import HookThread -from pyload.manager.PluginManager import literal_eval -from utils import lock - -class HookManager: - """Manages hooks, delegates and handles Events. - - Every plugin can define events, \ - but some very usefull events are called by the Core. - Contrary to overwriting hook methods you can use event listener, - which provides additional entry point in the control flow. - Only do very short tasks or use threads. - - **Known Events:** - Most hook methods exists as events. These are the additional known events. - - ===================== ============== ================================== - Name Arguments Description - ===================== ============== ================================== - downloadPreparing fid A download was just queued and will be prepared now. - downloadStarts fid A plugin will immediately starts the download afterwards. - linksAdded links, pid Someone just added links, you are able to modify the links. - allDownloadsProcessed Every link was handled, pyload would idle afterwards. - allDownloadsFinished Every download in queue is finished. - unrarFinished folder, fname An Unrar job finished - configChanged The config was changed via the api. - pluginConfigChanged The plugin config changed, due to api or internal process. - ===================== ============== ================================== - - | Notes: - | allDownloadsProcessed is *always* called before allDownloadsFinished. - | configChanged is *always* called before pluginConfigChanged. - - - """ - - def __init__(self, core): - self.core = core - self.config = self.core.config - - __builtin__.hookManager = self #needed to let hooks register themself - - self.log = self.core.log - self.plugins = [] - self.pluginMap = {} - self.methods = {} #dict of names and list of methods usable by rpc - - self.events = {} # contains events - - #registering callback for config event - self.config.pluginCB = MethodType(self.dispatchEvent, "pluginConfigChanged", basestring) - - self.addEvent("pluginConfigChanged", self.manageHooks) - - self.lock = RLock() - self.createIndex() - - def try_catch(func): - def new(*args): - try: - return func(*args) - except Exception, e: - args[0].log.error(_("Error executing hooks: %s") % str(e)) - if args[0].core.debug: - traceback.print_exc() - - return new - - - def addRPC(self, plugin, func, doc): - plugin = plugin.rpartition(".")[2] - doc = doc.strip() if doc else "" - - if plugin in self.methods: - self.methods[plugin][func] = doc - else: - self.methods[plugin] = {func: doc} - - def callRPC(self, plugin, func, args, parse): - if not args: args = tuple() - if parse: - args = tuple([literal_eval(x) for x in args]) - - plugin = self.pluginMap[plugin] - f = getattr(plugin, func) - return f(*args) - - - def createIndex(self): - plugins = [] - - active = [] - deactive = [] - - for pluginname in self.core.pluginManager.hookPlugins: - try: - #hookClass = getattr(plugin, plugin.__name__) - - if self.config.getPlugin(pluginname, "activated"): - pluginClass = self.core.pluginManager.loadClass("hooks", pluginname) - if not pluginClass: continue - - plugin = pluginClass(self.core, self) - plugins.append(plugin) - self.pluginMap[pluginClass.__name__] = plugin - if plugin.isActivated(): - active.append(pluginClass.__name__) - else: - deactive.append(pluginname) - - - except: - self.log.warning(_("Failed activating %(name)s") % {"name": pluginname}) - if self.core.debug: - traceback.print_exc() - - self.log.info(_("Activated plugins: %s") % ", ".join(sorted(active))) - self.log.info(_("Deactivate plugins: %s") % ", ".join(sorted(deactive))) - - self.plugins = plugins - - def manageHooks(self, plugin, name, value): - if name == "activated" and value: - self.activateHook(plugin) - elif name == "activated" and not value: - self.deactivateHook(plugin) - - def activateHook(self, plugin): - - #check if already loaded - for inst in self.plugins: - if inst.__name__ == plugin: - return - - pluginClass = self.core.pluginManager.loadClass("hooks", plugin) - - if not pluginClass: return - - self.log.debug("Plugin loaded: %s" % plugin) - - plugin = pluginClass(self.core, self) - self.plugins.append(plugin) - self.pluginMap[pluginClass.__name__] = plugin - - # call core Ready - start_new_thread(plugin.coreReady, tuple()) - - def deactivateHook(self, plugin): - - hook = None - for inst in self.plugins: - if inst.__name__ == plugin: - hook = inst - - if not hook: return - - self.log.debug("Plugin unloaded: %s" % plugin) - - hook.unload() - - #remove periodic call - self.log.debug("Removed callback %s" % self.core.scheduler.removeJob(hook.cb)) - self.plugins.remove(hook) - del self.pluginMap[hook.__name__] - - - @try_catch - def coreReady(self): - for plugin in self.plugins: - if plugin.isActivated(): - plugin.coreReady() - - self.dispatchEvent("coreReady") - - @try_catch - def coreExiting(self): - for plugin in self.plugins: - if plugin.isActivated(): - plugin.coreExiting() - - self.dispatchEvent("coreExiting") - - @lock - def downloadPreparing(self, pyfile): - for plugin in self.plugins: - if plugin.isActivated(): - plugin.downloadPreparing(pyfile) - - self.dispatchEvent("downloadPreparing", pyfile) - - @lock - def downloadFinished(self, pyfile): - for plugin in self.plugins: - if plugin.isActivated(): - plugin.downloadFinished(pyfile) - - self.dispatchEvent("downloadFinished", pyfile) - - @lock - @try_catch - def downloadFailed(self, pyfile): - for plugin in self.plugins: - if plugin.isActivated(): - plugin.downloadFailed(pyfile) - - self.dispatchEvent("downloadFailed", pyfile) - - @lock - def packageFinished(self, package): - for plugin in self.plugins: - if plugin.isActivated(): - plugin.packageFinished(package) - - self.dispatchEvent("packageFinished", package) - - @lock - def beforeReconnecting(self, ip): - for plugin in self.plugins: - plugin.beforeReconnecting(ip) - - self.dispatchEvent("beforeReconnecting", ip) - - @lock - def afterReconnecting(self, ip): - for plugin in self.plugins: - if plugin.isActivated(): - plugin.afterReconnecting(ip) - - self.dispatchEvent("afterReconnecting", ip) - - def startThread(self, function, *args, **kwargs): - t = HookThread(self.core.threadManager, function, args, kwargs) - - def activePlugins(self): - """ returns all active plugins """ - return [x for x in self.plugins if x.isActivated()] - - def getAllInfo(self): - """returns info stored by hook plugins""" - info = {} - for name, plugin in self.pluginMap.iteritems(): - if plugin.info: - #copy and convert so str - info[name] = dict([(x, str(y) if not isinstance(y, basestring) else y) for x, y in plugin.info.iteritems()]) - return info - - - def getInfo(self, plugin): - info = {} - if plugin in self.pluginMap and self.pluginMap[plugin].info: - info = dict([(x, str(y) if not isinstance(y, basestring) else y) - for x, y in self.pluginMap[plugin].info.iteritems()]) - - return info - - def addEvent(self, event, func): - """Adds an event listener for event name""" - if event in self.events: - self.events[event].append(func) - else: - self.events[event] = [func] - - def removeEvent(self, event, func): - """removes previously added event listener""" - if event in self.events: - self.events[event].remove(func) - - def dispatchEvent(self, event, *args): - """dispatches event with args""" - if event in self.events: - for f in self.events[event]: - try: - f(*args) - except Exception, e: - self.log.warning("Error calling event handler %s: %s, %s, %s" - % (event, f, args, str(e))) - if self.core.debug: - traceback.print_exc() diff --git a/pyload/manager/PluginManager.py b/pyload/manager/PluginManager.py index 56e59237c..939b17347 100644 --- a/pyload/manager/PluginManager.py +++ b/pyload/manager/PluginManager.py @@ -17,7 +17,7 @@ from pyload.config.Parser import IGNORE class PluginManager: ROOT = "pyload.plugins." USERROOT = "userplugins." - TYPES = ("accounts", "container", "crypter", "hooks", "hoster", "internal", "ocr") + TYPES = ("account", "addon", "base", "container", "crypter", "hook", "hoster", "internal", "ocr") PATTERN = re.compile(r'__pattern__.*=.*r("|\')([^"\']+)') VERSION = re.compile(r'__version__.*=.*("|\')([0-9.]+)') @@ -49,14 +49,15 @@ class PluginManager: f = open(join("userplugins", "__init__.py"), "wb") f.close() - self.plugins['crypter'] = self.crypterPlugins = self.parse("crypter", pattern=True) + self.plugins['account'] = self.accountPlugins = self.parse("account") + self.plugins['addon'] = self.addonPlugins = self.parse("addon") + self.plugins['base'] = self.basePlugins = self.parse("base") self.plugins['container'] = self.containerPlugins = self.parse("container", pattern=True) + self.plugins['crypter'] = self.crypterPlugins = self.parse("crypter", pattern=True) + # self.plugins['hook'] = self.hookPlugins = self.parse("hook") self.plugins['hoster'] = self.hosterPlugins = self.parse("hoster", pattern=True) - - self.plugins['ocr'] = self.captchaPlugins = self.parse("ocr") - self.plugins['accounts'] = self.accountPlugins = self.parse("accounts") - self.plugins['hooks'] = self.hookPlugins = self.parse("hooks") self.plugins['internal'] = self.internalPlugins = self.parse("internal") + self.plugins['ocr'] = self.ocrPlugins = self.parse("ocr") self.log.debug("created index of plugins") @@ -154,7 +155,7 @@ class PluginManager: else: config = [list(config)] - if folder == "hooks": + if folder == "addon": append = True for item in config: if item[0] == "activated": append = False @@ -167,7 +168,7 @@ class PluginManager: except: self.log.error("Invalid config in %s: %s" % (name, config)) - elif folder == "hooks": #force config creation + elif folder == "addon": #force config creation desc = self.DESC.findall(content) desc = desc[0][1] if desc else "" config = (["activated", "bool", "Activated", False],) @@ -318,7 +319,7 @@ class PluginManager: as_dict = {} for t,n in type_plugins: - if t in ("hooks", "internal"): #: do not reload hooks or internals, because would cause to much side effects + if t in ("base", "addon", "internal"): #: do not reload them because would cause to much side effects continue elif t in as_dict: as_dict[t].append(n) @@ -339,11 +340,13 @@ class PluginManager: reloaded.append(id) #index creation - self.plugins['crypter'] = self.crypterPlugins = self.parse("crypter", pattern=True) + self.plugins['account'] = self.accountPlugins = self.parse("account") self.plugins['container'] = self.containerPlugins = self.parse("container", pattern=True) + self.plugins['crypter'] = self.crypterPlugins = self.parse("crypter", pattern=True) + # self.plugins['hook'] = self.hookPlugins = self.parse("hook") self.plugins['hoster'] = self.hosterPlugins = self.parse("hoster", pattern=True) - self.plugins['ocr'] = self.captchaPlugins = self.parse("ocr") - self.plugins['accounts'] = self.accountPlugins = self.parse("accounts") + self.plugins['ocr'] = self.ocrPlugins = self.parse("ocr") + if "accounts" in as_dict: #: accounts needs to be reloaded self.core.accountManager.initPlugins() diff --git a/pyload/manager/ThreadManager.py b/pyload/manager/ThreadManager.py index 1073f8040..50af4a93a 100644 --- a/pyload/manager/ThreadManager.py +++ b/pyload/manager/ThreadManager.py @@ -42,8 +42,8 @@ class ThreadManager: self.core = core self.log = core.log - self.threads = [] # thread list - self.localThreads = [] #hook+decrypter threads + self.threads = [] #: thread list + self.localThreads = [] #: addon+decrypter threads self.pause = True @@ -185,7 +185,7 @@ class ThreadManager: ip = self.getIP() - self.core.hookManager.beforeReconnecting(ip) + self.core.addonManager.beforeReconnecting(ip) self.log.debug("Old IP: %s" % ip) @@ -202,7 +202,7 @@ class ThreadManager: reconn.wait() sleep(1) ip = self.getIP() - self.core.hookManager.afterReconnecting(ip) + self.core.addonManager.afterReconnecting(ip) self.log.info(_("Reconnected, new IP: %s") % ip) diff --git a/pyload/manager/thread/PluginThread.py b/pyload/manager/thread/PluginThread.py index 5c274fa46..c5092a207 100644 --- a/pyload/manager/thread/PluginThread.py +++ b/pyload/manager/thread/PluginThread.py @@ -182,11 +182,11 @@ class DownloadThread(PluginThread): self.m.log.info(_("Download starts: %s" % pyfile.name)) # start download - self.m.core.hookManager.downloadPreparing(pyfile) + self.m.core.addonManager.downloadPreparing(pyfile) pyfile.plugin.preprocessing(self) self.m.log.info(_("Download finished: %s") % pyfile.name) - self.m.core.hookManager.downloadFinished(pyfile) + self.m.core.addonManager.downloadFinished(pyfile) self.m.core.files.checkPackageFinished(pyfile) except NotImplementedError: @@ -236,7 +236,7 @@ class DownloadThread(PluginThread): self.m.log.warning(_("Download failed: %(name)s | %(msg)s") % {"name": pyfile.name, "msg": msg}) pyfile.error = msg - self.m.core.hookManager.downloadFailed(pyfile) + self.m.core.addonManager.downloadFailed(pyfile) self.clean(pyfile) continue @@ -277,7 +277,7 @@ class DownloadThread(PluginThread): print_exc() self.writeDebugReport(pyfile) - self.m.core.hookManager.downloadFailed(pyfile) + self.m.core.addonManager.downloadFailed(pyfile) self.clean(pyfile) continue @@ -307,7 +307,7 @@ class DownloadThread(PluginThread): print_exc() self.writeDebugReport(pyfile) - self.m.core.hookManager.downloadFailed(pyfile) + self.m.core.addonManager.downloadFailed(pyfile) self.clean(pyfile) continue @@ -409,7 +409,7 @@ class DecrypterThread(PluginThread): exc_clear() - #self.m.core.hookManager.downloadFinished(pyfile) + #self.m.core.addonManager.downloadFinished(pyfile) #self.m.localThreads.remove(self) @@ -418,8 +418,8 @@ class DecrypterThread(PluginThread): pyfile.delete() -class HookThread(PluginThread): - """thread for hooks""" +class AddonThread(PluginThread): + """thread for addons""" #-------------------------------------------------------------------------- def __init__(self, m, function, args, kwargs): -- cgit v1.2.3