summaryrefslogtreecommitdiffstats
path: root/pyload/plugin/Plugin.py
diff options
context:
space:
mode:
authorGravatar Armin <Armin@Armin-PC.diedering.lan> 2015-04-10 01:07:51 +0200
committerGravatar Armin <Armin@Armin-PC.diedering.lan> 2015-04-10 01:07:51 +0200
commit48a492bcffbf795577fed9f9b03b1e304c91409e (patch)
tree32f7bd233afb48596d9e9a7a138be56d173d7c38 /pyload/plugin/Plugin.py
parentfix: OboomCom and SmoozedCom with beaker >= v1.7.x (diff)
downloadpyload-48a492bcffbf795577fed9f9b03b1e304c91409e.tar.xz
more fixes. now running all plugins
Diffstat (limited to 'pyload/plugin/Plugin.py')
-rw-r--r--pyload/plugin/Plugin.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/pyload/plugin/Plugin.py b/pyload/plugin/Plugin.py
index 1c2091d66..486dbeb0f 100644
--- a/pyload/plugin/Plugin.py
+++ b/pyload/plugin/Plugin.py
@@ -87,6 +87,10 @@ class Base(object):
return self._log("critical", args)
+ def getPluginConfSection(self):
+ return "%s_%s" % (self.__class__.__name__, getattr(self, "_%s__type" % self.__class__.__name__))
+
+
#: Deprecated method
def setConf(self, option, value):
""" see `setConfig` """
@@ -100,7 +104,7 @@ class Base(object):
:param value:
:return:
"""
- self.core.config.setPlugin(self.__class__.__name__, option, value)
+ self.core.config.setPlugin(self.getPluginConfSection(), option, value)
#: Deprecated method
@@ -115,24 +119,24 @@ class Base(object):
:param option:
:return:
"""
- return self.core.config.getPlugin(self.__class__.__name__, option)
+ return self.core.config.getPlugin(self.getPluginConfSection(), option)
def setStorage(self, key, value):
""" Saves a value persistently to the database """
- self.core.db.setStorage(self.__class__.__name__, key, value)
+ self.core.db.setStorage(self.getPluginConfSection(), key, value)
def store(self, key, value):
""" same as `setStorage` """
- self.core.db.setStorage(self.__class__.__name__, key, value)
+ self.core.db.setStorage(self.getPluginConfSection(), key, value)
def getStorage(self, key=None, default=None):
""" Retrieves saved value or dict of all saved entries if key is None """
if key:
- return self.core.db.getStorage(self.__class__.__name__, key) or default
- return self.core.db.getStorage(self.__class__.__name__, key)
+ return self.core.db.getStorage(self.getPluginConfSection(), key) or default
+ return self.core.db.getStorage(self.getPluginConfSection(), key)
def retrieve(self, *args, **kwargs):