diff options
Diffstat (limited to 'pyload/PluginManager.py')
-rw-r--r-- | pyload/PluginManager.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/pyload/PluginManager.py b/pyload/PluginManager.py index ea0515999..f3d2b999d 100644 --- a/pyload/PluginManager.py +++ b/pyload/PluginManager.py @@ -132,6 +132,10 @@ class PluginManager: return res["hoster"], res["crypter"] + def getPlugin(self, plugin, name): + """ Retrieves the plugin tuple for a single plugin or none """ + return self.loader.getPlugin(plugin, name) + def getPlugins(self, plugin): """ Get all plugins of a certain type in a dict """ plugins = {} @@ -179,7 +183,10 @@ class PluginManager: def loadClass(self, plugin, name): """Returns the class of a plugin with the same name""" module = self.loadModule(plugin, name) - if module: return getattr(module, name) + try: + if module: return getattr(module, name) + except AttributeError: + self.log.error(_("Plugin does not define class '%s'") % name) def find_module(self, fullname, path=None): #redirecting imports if necessary |