add webbouqueteditor (dmm plugin contest winner plugin)
[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
13 def autostart(reason, **kwargs):
14         if "session" in kwargs:
15                 session = kwargs["session"]
16                 root = static.File("/usr/lib/enigma2/python/Plugins/Extensions/WebBouquetEditor/web-data")
17                 root.putChild("web", ScreenPage(session, util.sibpath(__file__, "web"), True) )
18                 root.putChild('tmp', static.File('/tmp'))
19                 root.putChild("uploadfile",WebUploadResource(session))
20                 addExternalChild( ("bouqueteditor", root) )
21
22 def Plugins(**kwargs):
23         list = [PluginDescriptor(name="WebBouquetEditor", description=_("WebBouquetEditor"), where = PluginDescriptor.WHERE_SESSIONSTART, fnc = autostart)]  
24         return list