summaryrefslogtreecommitdiffstats
path: root/module/PluginManager.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-01-06 15:54:52 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-01-06 15:54:52 +0100
commit6f8b5347dfa119a3df21f4ca8ba8c2b1537a726a (patch)
tree627c4d99f0aaa4c8022b70b3ebe72f201d924dd6 /module/PluginManager.py
parentremoved unneeded stuff (diff)
downloadpyload-6f8b5347dfa119a3df21f4ca8ba8c2b1537a726a.tar.xz
first working parts of config api
Diffstat (limited to 'module/PluginManager.py')
-rw-r--r--module/PluginManager.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/module/PluginManager.py b/module/PluginManager.py
index 6f2268388..d74123040 100644
--- a/module/PluginManager.py
+++ b/module/PluginManager.py
@@ -60,10 +60,9 @@ class PluginManager:
self.plugins = {}
self.modules = {} # cached modules
self.history = [] # match history to speedup parsing (type, name)
+ self.user_context = {} # plugins working with user context
self.createIndex()
- # TODO, replacement for this?
- #self.core.config.parseValues(self.core.config.PLUGIN)
#register for import addon
sys.meta_path.append(self)
@@ -213,6 +212,10 @@ class PluginManager:
else: # activated flag missing
config.insert(0, ("activated", "bool", "Activated", False))
+ # Everything that is no addon and user_context=True, is added to dict
+ if folder != "addons" or attrs.get("user_context", False):
+ self.user_context[name] = True
+
try:
self.core.config.addConfigSection(name, name, desc, long_desc, config)
except:
@@ -386,6 +389,13 @@ class PluginManager:
return True
+ def isUserPlugin(self, plugin):
+ """ A plugin suitable for multiple user """
+ return plugin in self.user_context
+
+ def isPluginType(self, plugin, type):
+ return plugin in self.plugins[type]
+
def loadIcons(self):
"""Loads all icons from plugins, plugin type is not in result, because its not important here.