fix imports
[enigma2.git] / lib / python / Plugins / web / plugin.py
index b450b8cda656bcd900f5d51619451c71150a7474..7fce37897a5e0c488001750a5e14c7a102690545 100644 (file)
@@ -1,23 +1,19 @@
-from enigma import *
 
-from twisted.internet import reactor
-from twisted.web2 import server, http, static
-
-def autostart():
-       print "Web startup"
+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(80, http.HTTPFactory(site))
 
-def autoend():
-       pass
-
-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)