From: Felix Domke Date: Sun, 19 Feb 2006 22:36:17 +0000 (+0000) Subject: re-add web plugin X-Git-Tag: 2.6.0~4133 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/2164297221bc9611a0f5a039b34c6850137773a6?ds=sidebyside re-add web plugin --- diff --git a/lib/python/Plugins/web/plugin.py b/lib/python/Plugins/web/plugin.py index e4c099bb..1c40293a 100644 --- a/lib/python/Plugins/web/plugin.py +++ b/lib/python/Plugins/web/plugin.py @@ -1,13 +1,19 @@ from twisted.internet import reactor from twisted.web2 import server, http, static +from Plugins.Plugin import PluginDescriptor -# this is currently not working def startWebserver(): - print "Web startup" toplevel = static.File("/hdd") site = server.Site(toplevel) reactor.listenTCP(80, http.HTTPFactory(site)) +def autostart(reason): + if reason == 0: + try: + startWebserver() + except ImportError: + print "twisted not available, not starting web services" + def Plugins(): - return [ ] + return PluginDescriptor(where = PluginDescriptor.WHERE_AUTOSTART, fnc = autostart)