diff options
| author | ghost <andreas.monzner@multimedia-labs.de> | 2011-03-03 18:43:41 +0100 |
|---|---|---|
| committer | ghost <andreas.monzner@multimedia-labs.de> | 2011-03-09 14:38:28 +0100 |
| commit | db34d7e342d82f9767045de76b791fee2357bbc4 (patch) | |
| tree | c9baa7de0e95c710072654dcf07b3f4da48904b2 /lib | |
| parent | d0380b44396cbcd497f42eb0047b58b309596007 (diff) | |
| download | enigma2-db34d7e342d82f9767045de76b791fee2357bbc4.tar.gz enigma2-db34d7e342d82f9767045de76b791fee2357bbc4.zip | |
add plugin weight to PluginDescriptor... so the plugin start order can be changed now
Diffstat (limited to 'lib')
| -rwxr-xr-x | lib/python/Components/PluginComponent.py | 5 | ||||
| -rwxr-xr-x | lib/python/Plugins/Plugin.py | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/python/Components/PluginComponent.py b/lib/python/Components/PluginComponent.py index 93b08900..a713c3b4 100755 --- a/lib/python/Components/PluginComponent.py +++ b/lib/python/Components/PluginComponent.py @@ -122,13 +122,14 @@ class PluginComponent: for x in where: res.extend(self.plugins.get(x, [ ])) - - return res + res.sort(key=lambda x:x.weight) + return res def getPluginsForMenu(self, menuid): res = [ ] for p in self.getPlugins(PluginDescriptor.WHERE_MENU): res += p(menuid) + res.sort(key=lambda x:x.weight) return res def clearPluginList(self): diff --git a/lib/python/Plugins/Plugin.py b/lib/python/Plugins/Plugin.py index e26174a1..d87e6e96 100755 --- a/lib/python/Plugins/Plugin.py +++ b/lib/python/Plugins/Plugin.py @@ -61,7 +61,7 @@ class PluginDescriptor: WHERE_SOFTWAREMANAGER = 14 - def __init__(self, name = "Plugin", where = [ ], description = "", icon = None, fnc = None, wakeupfnc = None, needsRestart = None, internal = False): + def __init__(self, name = "Plugin", where = [ ], description = "", icon = None, fnc = None, wakeupfnc = None, needsRestart = None, internal = False, weight = 0): self.name = name self.internal = internal self.needsRestart = needsRestart @@ -78,6 +78,8 @@ class PluginDescriptor: else: self.icon = icon + self.weight = weight + self.wakeupfnc = wakeupfnc self.__call__ = fnc |
