summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar GamaC0de <nitzo2001@yahoo.com> 2016-04-26 01:12:39 +0200
committerGravatar GamaC0de <nitzo2001@yahoo.com> 2016-04-26 01:12:39 +0200
commit285d132130cab2ce90729fa2815082a91ec0e540 (patch)
tree47c36fe15f9f5c565e644df5e90cc2be8f79e6c3
parentMerge pull request #2435 from OndrejIT/stable (diff)
downloadpyload-285d132130cab2ce90729fa2815082a91ec0e540.tar.xz
[misc] add 'plugin=' parameter to 'config' class to allow getting other plugins settings
-rw-r--r--module/plugins/internal/misc.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/module/plugins/internal/misc.py b/module/plugins/internal/misc.py
index 606c0c528..fb8071b49 100644
--- a/module/plugins/internal/misc.py
+++ b/module/plugins/internal/misc.py
@@ -38,7 +38,7 @@ except ImportError:
class misc(object):
__name__ = "misc"
__type__ = "plugin"
- __version__ = "0.34"
+ __version__ = "0.35"
__status__ = "stable"
__pattern__ = r'^unmatchable$'
@@ -55,7 +55,7 @@ class Config(object):
self.plugin = plugin
- def set(self, option, value):
+ def set(self, option, value, plugin=None):
"""
Set config value for current plugin
@@ -63,10 +63,10 @@ class Config(object):
:param value:
:return:
"""
- self.plugin.pyload.api.setConfigValue(self.plugin.classname, option, value, section="plugin")
+ self.plugin.pyload.api.setConfigValue(plugin or self.plugin.classname, option, value, section="plugin")
- def get(self, option, default=None):
+ def get(self, option, default=None, plugin=None):
"""
Returns config value for current plugin
@@ -74,7 +74,7 @@ class Config(object):
:return:
"""
try:
- return self.plugin.pyload.config.getPlugin(self.plugin.classname, option)
+ return self.plugin.pyload.config.getPlugin(plugin or self.plugin.classname, option)
except KeyError:
self.plugin.log_debug("Config option `%s` not found, use default `%s`" % (option, default)) #@TODO: Restore to `log_warning` in 0.4.10