Template loading for GUI

parent 6af34a25
...@@ -47,7 +47,7 @@ log = logging.getLogger( 'Webgui' ) ...@@ -47,7 +47,7 @@ log = logging.getLogger( 'Webgui' )
curdir=os.path.abspath(os.path.dirname(sys.argv[0])) curdir=os.path.abspath(os.path.dirname(sys.argv[0]))
LOGINFILE=os.path.normpath("/".join([curdir, 'Web/resources/login.html'])) LOGINFILE=os.path.normpath("/".join([curdir, 'Web/resources/login.html']))
GUIFILE=os.path.normpath("/".join([curdir, 'Web/resources/page.html']))
from common import uni, GzipRequest, StaticFile, codeOk, permissionDenied, RedirectToHome, neededPermission from common import uni, GzipRequest, StaticFile, codeOk, permissionDenied, RedirectToHome, neededPermission
import ajax import ajax
...@@ -101,11 +101,25 @@ class BasePage(rend.Page): ...@@ -101,11 +101,25 @@ class BasePage(rend.Page):
return permissionDenied() return permissionDenied()
class GuiPage(BasePage): class GuiPage(BasePage):
addSlash = True addSlash = True
html="""<html><head></head><body><div>Cannot find GuiPage template files</div></body></html>""" html="""<html><head></head><body><div>Cannot find GuiPage template files</div></body></html>"""
def __init__(self, avatarid):
self.avatarId = avatarid
super(GuiPage, self).__init__(self)
if os.path.isfile(GUIFILE):
try:
lf = open(GUIFILE, "r")
self.html = lf.read()
lf.close()
except:
pass
def renderHTTP( self, ctx): def renderHTTP( self, ctx):
request = inevow.IRequest(ctx) request = inevow.IRequest(ctx)
return self.getStandardHTML(request.uri) return self.getStandardHTML(request.uri)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment