[MerlinEPGCenter] - implement workaround to fix zapping to channel when alternatives...
[enigma2-plugins.git] / webbouqueteditor / src / plugin.py
1 # Plugin
2 from Components.PluginComponent import plugins
3 from Plugins.Plugin import PluginDescriptor
4 # Webinterface
5 from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
6 from Plugins.Extensions.WebInterface.WebChilds.Screenpage import ScreenPage
7 # Twisted
8 from twisted.web import static
9 from twisted.python import util
10 #
11 from WebChilds.WebUploadResource import WebUploadResource
12 from enigma import eEnv
13
14 if hasattr(static.File, 'render_GET'):
15         class File(static.File):
16                 def render_POST(self, request):
17                         return self.render_GET(request)
18 else:
19         File = static.File
20
21 def autostart(reason, **kwargs):
22         if "session" in kwargs:
23                 session = kwargs["session"]
24                 root = File(eEnv.resolve("${libdir}/enigma2/python/Plugins/Extensions/WebBouquetEditor/web-data"))
25                 root.putChild("web", ScreenPage(session, util.sibpath(__file__, "web"), True) )
26                 root.putChild('tmp', File('/tmp'))
27                 root.putChild("uploadfile",WebUploadResource(session))
28                 addExternalChild( ("bouqueteditor", root, "BouquetEditor", 1, True) )
29
30 def Plugins(**kwargs):
31         list = [PluginDescriptor(name="WebBouquetEditor", description=_("WebBouquetEditor"), where = PluginDescriptor.WHERE_SESSIONSTART, fnc = autostart)]
32         return list