summaryrefslogtreecommitdiff
path: root/examples/helloworld
diff options
context:
space:
mode:
authorianb <devnull@localhost>2005-08-22 18:22:27 +0000
committerianb <devnull@localhost>2005-08-22 18:22:27 +0000
commit27f2c911e823216a8db5873a53b1da10c0a4c4d1 (patch)
tree1ed476b090fdda9834d088b38c54c27687e8e23b /examples/helloworld
parente17ed7b172e6b8e914c28cd3dfec53fa7b452eb7 (diff)
downloadpaste-27f2c911e823216a8db5873a53b1da10c0a4c4d1.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')
-rw-r--r--examples/helloworld/__init__.py2
-rw-r--r--examples/helloworld/index.py31
2 files changed, 0 insertions, 33 deletions
diff --git a/examples/helloworld/__init__.py b/examples/helloworld/__init__.py
deleted file mode 100644
index ef59661..0000000
--- a/examples/helloworld/__init__.py
+++ /dev/null
@@ -1,2 +0,0 @@
-# No overrides.
-
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()