Moved from php to python

This commit is contained in:
Thomas FORGIONE
2015-04-12 21:13:41 +02:00
parent 35a8522088
commit 925f6bab74
30 changed files with 4886 additions and 124 deletions

8
bouncing/index.html Normal file
View File

@@ -0,0 +1,8 @@
<section>
<h2>Bouncing cube</h2>
<p>
Click on the cube to make it jump !
</p>
<div id="container"></div>
#
</section>

View File

@@ -1,18 +0,0 @@
<?php include_once("header_functions.php"); ?>
<!doctype html>
<html>
<?php head("Bouncing cube"); ?>
<body>
<?php include("header.php"); ?>
<?php include("nav.php"); ?>
<section>
<h2>Bouncing cube</h2>
<p>
Click on the cube to make it jump !
</p>
<div id="container"></div>
</section>
<?php include("jsIncludes.php"); ?>
<script src="js/BouncingMain.js"></script>
</body>
</html>

28
bouncing/index.py Executable file
View File

@@ -0,0 +1,28 @@
#!/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')
mainJs = Web.Element()
mainJs.open_string = ' <script src="js/BouncingMain.js"></script>'
content = Web.Element('index.html')
page.add_child(head)
page.add_child(body)
body.add_child(content)
body.add_child(jsIncludes)
jsIncludes.add_child(mainJs)
page.print()
if __name__ == '__main__':
main()