diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-06-15 06:54:39 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-06-15 06:54:39 +0200 |
commit | 2b1399197d6090e8672edabbbfaa59d0ecb4ce8d (patch) | |
tree | c787c4a1ddcea82068a10c088ea5e158c7cc2ed0 /module | |
parent | [Plugin] Typo (diff) | |
download | pyload-2b1399197d6090e8672edabbbfaa59d0ecb4ce8d.tar.xz |
Fix https://github.com/pyload/pyload/issues/1498
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/internal/MultiHook.py | 11 | ||||
-rw-r--r-- | module/plugins/internal/Plugin.py | 10 | ||||
-rw-r--r-- | module/plugins/internal/SimpleHoster.py | 10 |
3 files changed, 8 insertions, 23 deletions
diff --git a/module/plugins/internal/MultiHook.py b/module/plugins/internal/MultiHook.py index 4a2c6654b..0a85ba277 100644 --- a/module/plugins/internal/MultiHook.py +++ b/module/plugins/internal/MultiHook.py @@ -11,7 +11,7 @@ from module.utils import decode, remove_chars class MultiHook(Hook): __name__ = "MultiHook" __type__ = "hook" - __version__ = "0.46" + __version__ = "0.47" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -106,15 +106,6 @@ class MultiHook(Hook): return rep - def getConfig(self, option, default=''): #@TODO: Remove in 0.4.10 - """getConfig with default value - sublass may not implements all config options""" - try: - return self.getConf(option) - - except KeyError: - return default - - def pluginsCached(self): if self.plugins: return self.plugins diff --git a/module/plugins/internal/Plugin.py b/module/plugins/internal/Plugin.py index b89772052..16aa9cc45 100644 --- a/module/plugins/internal/Plugin.py +++ b/module/plugins/internal/Plugin.py @@ -104,14 +104,18 @@ class Base(object): return self.setConfig(*args, **kwargs) - def getConfig(self, option): + def getConfig(self, option, default=""): """ Returns config value for current plugin :param option: :return: """ - return self.core.config.getPlugin(self.__name__, option) + try: + return self.core.config.getPlugin(self.__name__, option) + + except KeyError: + return default #: Deprecated method @@ -166,7 +170,7 @@ class Base(object): class Plugin(Base): __name__ = "Plugin" __type__ = "hoster" - __version__ = "0.09" + __version__ = "0.10" __pattern__ = r'^unmatchable$' __config__ = [] #: [("name", "type", "desc", "default")] diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index ad76e27a6..a00676aa1 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -817,16 +817,6 @@ class SimpleHoster(Hoster): return size <= traffic - #@TODO: Remove in 0.4.10 - def getConfig(self, option, default=''): - """getConfig with default value - sublass may not implements all config options""" - try: - return self.getConf(option) - - except KeyError: - return default - - def retryFree(self): if not self.premium: return |