diff options
author | Ian Bicking <ian@ianbicking.org> | 2005-08-22 18:22:27 +0000 |
---|---|---|
committer | Ian Bicking <ian@ianbicking.org> | 2005-08-22 18:22:27 +0000 |
commit | 286a5da8ee0572f486ff95a43e59d45e2c928f9a (patch) | |
tree | 1ed476b090fdda9834d088b38c54c27687e8e23b /examples/helloworld/index.py | |
parent | 70ecfc62397f9ac76932ecf49b7fd9975ad7932c (diff) | |
download | paste-git-286a5da8ee0572f486ff95a43e59d45e2c928f9a.tar.gz |
Examples will be kept in a separate location in the repository in the future; build-pkg is deprecated also
Diffstat (limited to 'examples/helloworld/index.py')
-rw-r--r-- | examples/helloworld/index.py | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/examples/helloworld/index.py b/examples/helloworld/index.py deleted file mode 100644 index 4fe0742..0000000 --- a/examples/helloworld/index.py +++ /dev/null @@ -1,31 +0,0 @@ -""" -WSGI application - -Automated greeting application. -""" - -import cgi - -def application(environ, start_response): - def body(): - form = cgi.FieldStorage(fp=environ['wsgi.input'], - environ=environ, - keep_blank_values=1) - - if form.getvalue('name'): - yield ('<html><head><title>Hello!</title></head>\n') - yield ('<body>\n') - yield ('<h1>Hello %s!</h1>\n' % form['name'].value) - else: - yield ('<html><head><title>Who is there?</title></head>\n') - yield ('<body>\n') - yield ('<h1>Who is there?</h1>\n') - yield ('<form action="%s" method="POST">\n' % environ['SCRIPT_NAME']) - yield ('What is your name?<br>\n') - yield ('<input type="text" name="name" value="%s"><br>\n' - % cgi.escape(form.getvalue('name', ''), 1)) - yield ('<input type="submit" value="That is my name"></form>\n') - yield ('</body></html>\n') - - start_response('200 OK', [('Content-type', 'text/html')]) - return body() |