Merge branch 'master' of git://schwerkraft.elitedvb.net/enigma2-plugins/enigma2-plugins
[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 def autostart(reason, **kwargs):
15         if "session" in kwargs:
16                 session = kwargs["session"]
17                 root = static.File(eEnv.resolve("${libdir}/enigma2/python/Plugins/Extensions/WebBouquetEditor/web-data"))
18                 root.putChild("web", ScreenPage(session, util.sibpath(__file__, "web"), True) )
19                 root.putChild('tmp', static.File('/tmp'))
20                 root.putChild("uploadfile",WebUploadResource(session))
21                 addExternalChild( ("bouqueteditor", root) )
22
23 def Plugins(**kwargs):
24         list = [PluginDescriptor(name="WebBouquetEditor", description=_("WebBouquetEditor"), where = PluginDescriptor.WHERE_SESSIONSTART, fnc = autostart)]  
25         return list