aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2006-01-11 14:23:48 +0000
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2006-01-11 14:23:48 +0000
commit061f02110eeeb6f8b44b2d3229a098c3c270f10c (patch)
tree26709862f037f16eae3a4593b48322be9c83bd8c /lib/python
parentcf47b44f867cafaba6fe0e7a1539bd3c11e9c7e9 (diff)
downloadenigma2-061f02110eeeb6f8b44b2d3229a098c3c270f10c.tar.gz
enigma2-061f02110eeeb6f8b44b2d3229a098c3c270f10c.zip
add arabic to the language list
change plugin interface: plugins can now have screens or functions as objects to call when plugin is selected plugins can have multiple plugin menu entries
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Components/Language.py1
-rw-r--r--lib/python/Components/PluginComponent.py63
-rw-r--r--lib/python/Plugins/update/plugin.py11
3 files changed, 39 insertions, 36 deletions
diff --git a/lib/python/Components/Language.py b/lib/python/Components/Language.py
index d6e43a5d..456fe026 100644
--- a/lib/python/Components/Language.py
+++ b/lib/python/Components/Language.py
@@ -11,6 +11,7 @@ class Language:
# FIXME make list dynamically
self.addLanguage(_("English"), "en")
self.addLanguage(_("German"), "de")
+ self.addLanguage(_("Arabic"), "ar")
def addLanguage(self, name, lang):
try:
diff --git a/lib/python/Components/PluginComponent.py b/lib/python/Components/PluginComponent.py
index 10e1b59d..172e33e3 100644
--- a/lib/python/Components/PluginComponent.py
+++ b/lib/python/Components/PluginComponent.py
@@ -20,31 +20,32 @@ class PluginComponent:
for x in dir:
path = resolveFilename(SCOPE_PLUGINS, x) + "/"
- try:
- if os.path.exists(path):
- if fileExists(path + "plugin.py"):
- pluginmodule = self.prefix + x + ".plugin"
- print "trying to import " + pluginmodule
- exec "import " + pluginmodule
- plugin = eval(pluginmodule)
- picturepath = plugin.getPicturePath()
- pluginname = plugin.getPluginName()
- try:
- for menuEntry in plugin.getMenuRegistrationList():
- self.menuEntries.append([menuEntry, pluginmodule])
- except:
- pass
-
- list.append((picturepath, pluginname , x))
- if runAutostartPlugins:
- try: plugin.autostart()
- except: pass
- if runAutoendPlugins:
- try: plugin.autoend()
- except: pass
+ #try:
+ if os.path.exists(path):
+ if fileExists(path + "plugin.py"):
+ pluginmodule = self.prefix + x + ".plugin"
+ print "trying to import " + pluginmodule
+ exec "import " + pluginmodule
+ plugin = eval(pluginmodule)
+ picturepaths = plugin.getPicturePaths()
+ plugins = plugin.getPlugins()
+ try:
+ for menuEntry in plugin.getMenuRegistrationList():
+ self.menuEntries.append([menuEntry, pluginmodule])
+ except:
+ pass
+
+ for y in range(len(plugins)):
+ list.append((path + picturepaths[y], plugins[y][0] , x, plugins[y][1], plugins[y][2]))
+ if runAutostartPlugins:
+ try: plugin.autostart()
+ except: pass
+ if runAutoendPlugins:
+ try: plugin.autoend()
+ except: pass
- except:
- print "Directory", path, "contains a faulty plugin"
+ #except:
+ # print "Directory", path, "contains a faulty plugin"
self.menuUpdate()
return list
@@ -57,10 +58,14 @@ class PluginComponent:
menuupdater.addMenuItem(menuEntry[0][0], menuEntry[0][2], menuEntry[1], menuEntry[0][3])
def runPlugin(self, plugin, session):
- try:
- exec "import " + self.prefix + plugin[2] + ".plugin"
- eval(self.prefix + plugin[2] + ".plugin").main(session)
- except:
- print "exec of plugin failed!"
+ #try:
+ exec("import " + self.prefix + plugin[2] + ".plugin")
+ print self.prefix + plugin[2] + ".plugin." + plugin[4]
+ if plugin[3] == "screen":
+ session.open(eval(self.prefix + plugin[2] + ".plugin." + plugin[4]))
+ elif plugin[3] == "function":
+ eval(self.prefix + plugin[2] + ".plugin." + plugin[4])(session)
+ #except:
+ #print "exec of plugin failed!"
plugins = PluginComponent()
diff --git a/lib/python/Plugins/update/plugin.py b/lib/python/Plugins/update/plugin.py
index 500b6825..79f67490 100644
--- a/lib/python/Plugins/update/plugin.py
+++ b/lib/python/Plugins/update/plugin.py
@@ -56,14 +56,11 @@ class Example(Screen):
#def autoend():
#print "**************************** AUTOEND"
-def main(session):
- session.open(Example)
-
-def getPicturePath():
- return "update.png"
+def getPicturePaths():
+ return ["update.png"]
-def getPluginName():
- return "Softwareupdate"
+def getPlugins():
+ return [("Softwareupdate", "screen", "Example")]
def getMenuRegistrationList():
list = []