diff options
author | mkaay <mkaay@mkaay.de> | 2010-05-06 21:28:24 +0200 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2010-05-06 21:28:24 +0200 |
commit | f67363da314acbbe44282ddb3526fea3b0160b8b (patch) | |
tree | b93f1947cdc6d8c675b83b8771eab6f71afb377b /module/PluginManager.py | |
parent | account plugins: first draft (diff) | |
download | pyload-f67363da314acbbe44282ddb3526fea3b0160b8b.tar.xz |
modified hookmanager
Diffstat (limited to 'module/PluginManager.py')
-rw-r--r-- | module/PluginManager.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/module/PluginManager.py b/module/PluginManager.py index f4ecb8f88..fb3948639 100644 --- a/module/PluginManager.py +++ b/module/PluginManager.py @@ -40,6 +40,7 @@ class PluginManager(): self.hosterPlugins = [] self.captchaPlugins = [] self.accountPlugins = [] + self.hookPlugins = [] self.lock = Lock() self.createIndex() @@ -51,6 +52,7 @@ class PluginManager(): self.hosterPlugins = self.parse(self.core.config["plugins"]["load_hoster_plugins"], _("Hoster")) self.captchaPlugins = self.parse(self.core.config["plugins"]["load_captcha_plugins"], _("Captcha")) self.accountPlugins = self.parse(self.core.config["plugins"]["load_account_plugins"], _("Account"), create=True) + self.hookPlugins = self.parse(self.core.config["plugins"]["load_hook_plugins"], _("Hook")) self.lock.release() self.logger.info(_("created index of plugins")) @@ -69,11 +71,12 @@ class PluginManager(): module = __import__(pluginModule, globals(), locals(), [pluginName], -1) pluginClass = getattr(module, pluginName) try: + self.logger.debug(_("%(type)s: %(name)s added") % {"name":pluginName, "type":ptype}) if create: pluginClass = pluginClass(self) plugins.append(pluginClass) - self.logger.debug(_("%(type)s: %(name)s added") % {"name":pluginName, "type":ptype}) except: + self.logger.warning(_("Failed activating %(name)s") % {"name":pluginName}) if self.core.config['general']['debug_mode']: traceback.print_exc() return plugins @@ -101,3 +104,6 @@ class PluginManager(): if plugin.__name__ == name: return plugin return None + + def getHookPlugins(self): + return self.hookPlugins |