3d-interface/prototype/index.py

34 lines
882 B
Python
Raw Normal View History

2015-04-12 21:13:41 +02:00
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from webtools import Web
def main():
print('Content-type: text/html')
print()
page = Web.Element(Web.ROOT_DIR + 'templates/page.html')
head = Web.Element(Web.ROOT_DIR + 'templates/head.html')
body = Web.Element(Web.ROOT_DIR + 'templates/body.html')
jsIncludes = Web.Element(Web.ROOT_DIR + 'templates/jsIncludes.html')
2015-04-20 10:13:49 +02:00
2015-04-12 21:13:41 +02:00
mainJs = Web.Element()
mainJs.open_string = ' <script src="js/main.js"></script>'
content = Web.Element('index.html')
2015-04-20 10:13:49 +02:00
staticPath = Web.Element()
staticPath.open_string = ' <script>static_path = \'/\';</script>'
2015-04-12 21:13:41 +02:00
page.add_child(head)
page.add_child(body)
body.add_child(content)
body.add_child(jsIncludes)
2015-04-20 10:13:49 +02:00
jsIncludes.add_child(staticPath)
2015-04-12 21:13:41 +02:00
jsIncludes.add_child(mainJs)
page.print()
if __name__ == '__main__':
main()