Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Penguidom
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
domotika
Penguidom
Commits
2308deed
Commit
2308deed
authored
Jan 12, 2018
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Template loading for GUI
parent
6af34a25
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
web.py
penguidom/web/web.py
+15
-1
No files found.
penguidom/web/web.py
View file @
2308deed
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment