From 285d132130cab2ce90729fa2815082a91ec0e540 Mon Sep 17 00:00:00 2001 From: GamaC0de Date: Tue, 26 Apr 2016 02:12:39 +0300 Subject: [misc] add 'plugin=' parameter to 'config' class to allow getting other plugins settings --- module/plugins/internal/misc.py | 10 +++++----- 1 file 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 -- cgit v1.2.3