From b9d9e49b2d990fbd32f647c20ad3f7ddcaf17d02 Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Fri, 23 Nov 2007 18:03:59 +0000 Subject: add python files for socket mmi plugin --- lib/python/Plugins/Extensions/SocketMMI/plugin.py | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 lib/python/Plugins/Extensions/SocketMMI/plugin.py (limited to 'lib/python/Plugins/Extensions/SocketMMI/plugin.py') 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) ] -- cgit v1.2.3