Template loading for GUI

parent 6af34a25
......@@ -47,7 +47,7 @@ log = logging.getLogger( 'Webgui' )
curdir=os.path.abspath(os.path.dirname(sys.argv[0]))
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
import ajax
......@@ -101,10 +101,24 @@ class BasePage(rend.Page):
return permissionDenied()
class GuiPage(BasePage):
addSlash = True
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):
request = inevow.IRequest(ctx)
......
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