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/HookManager.py | |
parent | account plugins: first draft (diff) | |
download | pyload-f67363da314acbbe44282ddb3526fea3b0160b8b.tar.xz |
modified hookmanager
Diffstat (limited to 'module/HookManager.py')
-rw-r--r-- | module/HookManager.py | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/module/HookManager.py b/module/HookManager.py index d37c904a9..e4cea0757 100644 --- a/module/HookManager.py +++ b/module/HookManager.py @@ -38,27 +38,13 @@ class HookManager(): self.lock.acquire() plugins = [] - pluginStr = self.core.config["plugins"]["load_hook_plugins"] - for pluginModule in pluginStr.split(","): - pluginModule = pluginModule.strip() - if not pluginModule: - continue - pluginName = pluginModule.split(".")[-1] - if pluginName in self.config.keys(): - if not self.config[pluginName]["activated"]: - self.logger.info("Deactivated %s" % pluginName) - continue - else: - self.configParser.set(pluginName, {"option": "activated", "type": "bool", "name": "Activated"}, True) - module = __import__(pluginModule, globals(), locals(), [pluginName], -1) - pluginClass = getattr(module, pluginName) + for pluginClass in self.core.pluginManager.getHookPlugins(): try: plugin = pluginClass(self.core) plugin.readConfig() plugins.append(plugin) - self.logger.info("Activated %s" % pluginName) except: - self.logger.warning("Failed activating %s" % pluginName) + self.logger.warning(_("Failed activating %(name)s") % {"name":plugin.__name__}) self.plugins = plugins self.lock.release() |