diff options
Diffstat (limited to 'module/PluginManager.py')
-rw-r--r-- | module/PluginManager.py | 14 |
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. |