aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Plugins/Extensions/WebInterface/plugin.py
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2006-09-22 03:04:35 +0000
committerFelix Domke <tmbinc@elitedvb.net>2006-09-22 03:04:35 +0000
commit3a0c7bdb992181e4cbdbf09d9f7d14c13c911659 (patch)
tree3e49012e883b743a663e79da35e8a29e87b812a9 /lib/python/Plugins/Extensions/WebInterface/plugin.py
parent655aa56e49589f1764e948b8328e61889c485747 (diff)
downloadenigma2-3a0c7bdb992181e4cbdbf09d9f7d14c13c911659.tar.gz
enigma2-3a0c7bdb992181e4cbdbf09d9f7d14c13c911659.zip
work on web interface
Diffstat (limited to 'lib/python/Plugins/Extensions/WebInterface/plugin.py')
-rw-r--r--lib/python/Plugins/Extensions/WebInterface/plugin.py60
1 files changed, 0 insertions, 60 deletions
diff --git a/lib/python/Plugins/Extensions/WebInterface/plugin.py b/lib/python/Plugins/Extensions/WebInterface/plugin.py
index 71c4afcc..e69de29b 100644
--- a/lib/python/Plugins/Extensions/WebInterface/plugin.py
+++ b/lib/python/Plugins/Extensions/WebInterface/plugin.py
@@ -1,60 +0,0 @@
-from Plugins.Plugin import PluginDescriptor
-
-sessions = [ ]
-
-def startWebserver():
- from twisted.internet import reactor
- from twisted.web2 import server, http, static, resource, stream, http_headers, responsecode
- from twisted.python import util
- import webif
-
- class ScreenPage(resource.Resource):
- def __init__(self, path):
- self.path = path
-
- def render(self, req):
- global sessions
- if sessions == [ ]:
- return http.Response(200, stream="please wait until enigma has booted")
-
- s = stream.ProducerStream()
- webif.renderPage(s, self.path, sessions[0]) # login?
- return http.Response(stream=s)
-
- def locateChild(self, request, segments):
- path = '/'.join(["web"] + segments)
- if path[-1:] == "/":
- path += "index"
-
- path += ".xml"
- return ScreenPage(path), ()
-
- class Toplevel(resource.Resource):
- addSlash = True
-
- def render(self, req):
- return http.Response(responsecode.OK, {'Content-type': http_headers.MimeType('text', 'html')},
- stream='Hello! you want probably go to <a href="/web">the test</a> instead.')
-
- child_web = ScreenPage("/") # "/web"
- child_hdd = static.File("/hdd")
- child_webdata = static.File(util.sibpath(__file__, "web-data"))
-
- site = server.Site(Toplevel())
-
- reactor.listenTCP(80, http.HTTPFactory(site))
-
-def autostart(reason, **kwargs):
- if "session" in kwargs:
- global sessions
- sessions.append(kwargs["session"])
- return
-
- if reason == 0:
- #try:
- startWebserver()
- #except ImportError:
- # print "twisted not available, not starting web services"
-
-def Plugins(**kwargs):
- return PluginDescriptor(where = [PluginDescriptor.WHERE_SESSIONSTART, PluginDescriptor.WHERE_AUTOSTART], fnc = autostart)