aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Plugins/Extensions/WebInterface/plugin.py
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2006-07-17 13:56:37 +0000
committerFelix Domke <tmbinc@elitedvb.net>2006-07-17 13:56:37 +0000
commit954106887a9b77a26753c5613ff368ce4c997044 (patch)
treed1a1a1967d7a77a2e3d6cf871dc74911b180dd69 /lib/python/Plugins/Extensions/WebInterface/plugin.py
parent982001658e3e55d320d747717fcf8e56c2cec1b6 (diff)
downloadenigma2-954106887a9b77a26753c5613ff368ce4c997044.tar.gz
enigma2-954106887a9b77a26753c5613ff368ce4c997044.zip
move xml files into web/, support hierarchy
Diffstat (limited to 'lib/python/Plugins/Extensions/WebInterface/plugin.py')
-rw-r--r--lib/python/Plugins/Extensions/WebInterface/plugin.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/python/Plugins/Extensions/WebInterface/plugin.py b/lib/python/Plugins/Extensions/WebInterface/plugin.py
index 84a82331..cc9a546b 100644
--- a/lib/python/Plugins/Extensions/WebInterface/plugin.py
+++ b/lib/python/Plugins/Extensions/WebInterface/plugin.py
@@ -5,18 +5,30 @@ 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, req, sessions[0]) # login?
+ 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
@@ -24,8 +36,9 @@ def startWebserver():
return http.Response(responsecode.OK, {'Content-type': http_headers.MimeType('text', 'html')},
stream='Hello! you want probably go to <a href="/test">the test</a> instead.')
- child_test = ScreenPage() # "/test"
+ child_web = ScreenPage("/") # "/web"
child_hdd = static.File("/hdd")
+ child_webdata = static.File(util.sibpath(__file__, "web-data"))
site = server.Site(Toplevel())