aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Plugins/Extensions/SocketMMI/plugin.py
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2007-11-23 18:03:59 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2007-11-23 18:03:59 +0000
commitb9d9e49b2d990fbd32f647c20ad3f7ddcaf17d02 (patch)
treeea7bcb5ecc694254e952a64f00818fef5a18dd00 /lib/python/Plugins/Extensions/SocketMMI/plugin.py
parente7a4be1d20a33dbd97acfa021db2f8b82bf7a844 (diff)
downloadenigma2-b9d9e49b2d990fbd32f647c20ad3f7ddcaf17d02.tar.gz
enigma2-b9d9e49b2d990fbd32f647c20ad3f7ddcaf17d02.zip
add python files for socket mmi plugin
Diffstat (limited to 'lib/python/Plugins/Extensions/SocketMMI/plugin.py')
-rw-r--r--lib/python/Plugins/Extensions/SocketMMI/plugin.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/python/Plugins/Extensions/SocketMMI/plugin.py b/lib/python/Plugins/Extensions/SocketMMI/plugin.py
new file mode 100644
index 00000000..4eadf2ea
--- /dev/null
+++ b/lib/python/Plugins/Extensions/SocketMMI/plugin.py
@@ -0,0 +1,27 @@
+from Plugins.Plugin import PluginDescriptor
+from SocketMMI import SocketMMIMessageHandler
+
+socketHandler = None
+
+def main(session, **kwargs):
+ socketHandler.startMMI()
+
+def menu(menuid, **kwargs):
+ if menuid == "setup" and socketHandler and socketHandler.connected():
+ return [(socketHandler.getName(), main, "socket_mmi", 0)]
+ return [ ]
+
+def sessionstart(reason, session):
+ socketHandler.setSession(session)
+
+def autostart(reason, **kwargs):
+ global socketHandler
+ if reason == 1:
+ socketHandler = None
+ else:
+ socketHandler = SocketMMIMessageHandler()
+
+def Plugins(**kwargs):
+ return [ PluginDescriptor(name = "SocketMMI", description = "Python frontend for /tmp/mmi.socket", where = PluginDescriptor.WHERE_MENU, fnc = menu),
+ PluginDescriptor(where = PluginDescriptor.WHERE_SESSIONSTART, fnc = sessionstart),
+ PluginDescriptor(where = PluginDescriptor.WHERE_AUTOSTART, fnc = autostart) ]