re-add web plugin
[openblackhole/openblackhole-enigma2.git] / lib / python / Plugins / web / plugin.py
index e4c099b..1c40293 100644 (file)
@@ -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)