Improved form in stream and corrected a bug in web.py

This commit is contained in:
Thomas FORGIONE 2015-04-12 21:46:02 +02:00
parent 7b98fe724b
commit 8f923cb757
3 changed files with 4 additions and 4 deletions

View File

@ -8,7 +8,7 @@
<p> <p>
You can try with a different resolution (between 1 and 25) You can try with a different resolution (between 1 and 25)
<form action="" method="GET"> <form action="" method="GET">
Resolution : <input id="res" name="res" type="number" min="1" max="25" value="5" length=10/> Resolution : <input id="res" name="res" type="number" min="1" max="25" value="%(res)s" length=10/>
<input type="submit" value="Go !" /> <input type="submit" value="Go !" />
</form> </form>
</p> </p>

View File

@ -42,7 +42,7 @@ def main():
body.add_child(jsIncludes) body.add_child(jsIncludes)
jsIncludes.add_child(mainJs) jsIncludes.add_child(mainJs)
page.print() page.print({'res' : res})
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View File

@ -40,7 +40,7 @@ class Element:
self.children.append(child) self.children.append(child)
def print(self, format = {}): def print(self, format = {}):
self.open() self.open(format)
for i in self.children: for i in self.children:
i.print(format) i.print(format)
self.close() self.close(format)