1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/examples/Common/Simple/__init__.py Sat Feb 07 23:49:18 2004 +0000
1.3 @@ -0,0 +1,38 @@
1.4 +#!/usr/bin/env python
1.5 +
1.6 +"A simple application for test purposes."
1.7 +
1.8 +import WebStack.Generic
1.9 +
1.10 +class SimpleResource:
1.11 +
1.12 + "A simple resource."
1.13 +
1.14 + def respond(self, trans):
1.15 + trans.set_content_type(WebStack.Generic.ContentType("text/html"))
1.16 +
1.17 + # Get some information.
1.18 +
1.19 + out = trans.get_response_stream()
1.20 + out.write("""
1.21 +<html>
1.22 + <body>
1.23 + <h1>Test</h1>
1.24 + <ul>
1.25 + <li>Path: %s</li>
1.26 + <li>Path info: %s</li>
1.27 + <li>Request method: %s</li>
1.28 + <li>Content type: %s</li>
1.29 + <li>Charset: %s</li>
1.30 + </ul>
1.31 + </body>
1.32 +</html>
1.33 +""" % (
1.34 + trans.get_path(),
1.35 + trans.get_path_info(),
1.36 + trans.get_request_method(),
1.37 + trans.get_content_type().content_type,
1.38 + trans.get_content_type().charset,
1.39 +))
1.40 +
1.41 +# vim: tabstop=4 expandtab shiftwidth=4
2.1 --- a/examples/Common/SimpleApplication/__init__.py Sat Feb 07 23:49:03 2004 +0000
2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2.3 @@ -1,38 +0,0 @@
2.4 -#!/usr/bin/env python
2.5 -
2.6 -"A simple application for test purposes."
2.7 -
2.8 -import WebStack.Generic
2.9 -
2.10 -class SimpleResource:
2.11 -
2.12 - "A simple resource."
2.13 -
2.14 - def respond(self, trans):
2.15 - trans.set_content_type(WebStack.Generic.ContentType("text/html"))
2.16 -
2.17 - # Get some information.
2.18 -
2.19 - out = trans.get_response_stream()
2.20 - out.write("""
2.21 -<html>
2.22 - <body>
2.23 - <h1>Test</h1>
2.24 - <ul>
2.25 - <li>Path: %s</li>
2.26 - <li>Path info: %s</li>
2.27 - <li>Request method: %s</li>
2.28 - <li>Content type: %s</li>
2.29 - <li>Charset: %s</li>
2.30 - </ul>
2.31 - </body>
2.32 -</html>
2.33 -""" % (
2.34 - trans.get_path(),
2.35 - trans.get_path_info(),
2.36 - trans.get_request_method(),
2.37 - trans.get_content_type().content_type,
2.38 - trans.get_content_type().charset,
2.39 -))
2.40 -
2.41 -# vim: tabstop=4 expandtab shiftwidth=4