X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/e7a4be1d20a33dbd97acfa021db2f8b82bf7a844..b9d9e49b2d990fbd32f647c20ad3f7ddcaf17d02:/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) ]