summaryrefslogtreecommitdiffstats
path: root/module/PluginManager.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-02-20 23:11:33 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-02-20 23:11:33 +0100
commit14ecf91716fd403922b44567d75d4cbe3abea617 (patch)
tree9f101dbedd74b9f19c7c187114ffd6fcab7e19fa /module/PluginManager.py
parentfixed showing files after deletion of package (diff)
downloadpyload-14ecf91716fd403922b44567d75d4cbe3abea617.tar.xz
parse category from addons
Diffstat (limited to 'module/PluginManager.py')
-rw-r--r--module/PluginManager.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/module/PluginManager.py b/module/PluginManager.py
index f5a3fe31d..c20481e33 100644
--- a/module/PluginManager.py
+++ b/module/PluginManager.py
@@ -36,7 +36,7 @@ IGNORE = (
'EasyShareCom', 'FlyshareCz'
)
-PluginTuple = namedtuple("PluginTuple", "version re deps user path")
+PluginTuple = namedtuple("PluginTuple", "version re deps category user path")
class PluginManager:
ROOT = "module.plugins."
@@ -184,10 +184,10 @@ class PluginManager:
else: plugin_re = self.NO_MATCH
deps = attrs.get("dependencies", None)
+ category = attrs.get("category", None) if folder == "addons" else None
# create plugin tuple
- plugin = PluginTuple(version, plugin_re, deps, bool(home), filename)
-
+ plugin = PluginTuple(version, plugin_re, deps, category, bool(home), filename)
# internals have no config
if folder == "internal":
@@ -285,12 +285,10 @@ class PluginManager:
# MultiHoster will overwrite this
getPlugin = getPluginClass
-
def loadAttributes(self, type, name):
plugin = self.plugins[type][name]
return self.parseAttributes(plugin.path, name, type)
-
def loadModule(self, type, name):
""" Returns loaded module for plugin
@@ -396,6 +394,11 @@ class PluginManager:
def isPluginType(self, plugin, type):
return plugin in self.plugins[type]
+ def getCategory(self, plugin):
+ if plugin in self.plugins["addons"]:
+ return self.plugins["addons"][plugin] or "addon"
+
+
def loadIcons(self):
"""Loads all icons from plugins, plugin type is not in result, because its not important here.