X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/11ea75ea8a760d6043e4472b28372741faea6197..a572ebf53a8b090484e5976c533b0333c8dde022:/lib/python/Plugins/web/plugin.py diff --git a/lib/python/Plugins/web/plugin.py b/lib/python/Plugins/web/plugin.py index bdcbd058..7fce3789 100644 --- a/lib/python/Plugins/web/plugin.py +++ b/lib/python/Plugins/web/plugin.py @@ -1,24 +1,19 @@ -from enigma import * -from twisted.internet import reactor -from twisted.web2 import server, http, static - -def autostart(): - print "Web startup" - # For example, serve the /tmp directory - toplevel = static.File("/tmp") +def startWebserver(): + from twisted.internet import reactor + from twisted.web2 import server, http, static + from Plugins.Plugin import PluginDescriptor + toplevel = static.File("/hdd") site = server.Site(toplevel) - reactor.listenTCP(8080, http.HTTPFactory(site)) - -def autoend(): - pass + reactor.listenTCP(80, http.HTTPFactory(site)) -def getPicturePaths(): - return [] +def autostart(reason): + if reason == 0: + try: + startWebserver() + except ImportError: + print "twisted not available, not starting web services" -def getPlugins(): - return [] - -def getMenuRegistrationList(): - return [] +def Plugins(): + return PluginDescriptor(where = PluginDescriptor.WHERE_AUTOSTART, fnc = autostart)