Author: ianb
Date: 2005-03-26 13:02:41 -0700 (Sat, 26 Mar 2005)
New Revision: 2236
Added:
WSGIKit/trunk/examples/hello.py
WSGIKit/trunk/examples/helloworld.cgi
WSGIKit/trunk/examples/helloworld_wrap.cgi
Removed:
WSGIKit/trunk/wsgikit/hello.py
WSGIKit/trunk/wsgikit/helloworld.cgi
WSGIKit/trunk/wsgikit/helloworld_wrap.cgi
Log:
Moved CGI examples into examples/
Copied: WSGIKit/trunk/examples/hello.py (from rev 2233, WSGIKit/trunk/wsgikit/hello.py)
Copied: WSGIKit/trunk/examples/helloworld.cgi (from rev 2233, WSGIKit/trunk/wsgikit/helloworld.cgi)
Copied: WSGIKit/trunk/examples/helloworld_wrap.cgi (from rev 2233, WSGIKit/trunk/wsgikit/helloworld_wrap.cgi)
Deleted: WSGIKit/trunk/wsgikit/hello.py
===================================================================
--- WSGIKit/trunk/wsgikit/hello.py 2005-03-26 20:02:29 UTC (rev 2235)
+++ WSGIKit/trunk/wsgikit/hello.py 2005-03-26 20:02:41 UTC (rev 2236)
@@ -1,28 +0,0 @@
-"""
-WSGI application
-
-Automated greeting application.
-"""
-
-import cgi
-
-def application(environ, start_response):
- form = cgi.FieldStorage(fp=environ['wsgi.input'],
- environ=environ,
- keep_blank_values=1)
- write = start_response('200 OK', [('Content-type', 'text/html')])
- if form.getvalue('name'):
- write('<html><head><title>Hello!</title></head>\n')
- write('<body>\n')
- write('<h1>Hello %s!</h1>\n' % form['name'].value)
- else:
- write('<html><head><title>Who is there?</title></head>\n')
- write('<body>\n')
- write('<h1>Who is there?</h1>\n')
- write('<form action="%s" method="POST">\n' % environ['SCRIPT_NAME'])
- write('What is your name?<br>\n')
- write('<input type="text" name="name" value="%s"><br>\n'
- % cgi.escape(form.getvalue('name', ''), 1))
- write('<input type="submit" value="That is my name"></form>\n')
- write('</body></html>\n')
- return None
Deleted: WSGIKit/trunk/wsgikit/helloworld.cgi
===================================================================
--- WSGIKit/trunk/wsgikit/helloworld.cgi 2005-03-26 20:02:29 UTC (rev 2235)
+++ WSGIKit/trunk/wsgikit/helloworld.cgi 2005-03-26 20:02:41 UTC (rev 2236)
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-
-import cgi
-
-form = cgi.FieldStorage()
-import os
-
-print 'Content-type: text/html\n'
-
-if form.getvalue('name'):
- print '<html><head><title>Hello!</title></head>'
- print '<body>'
- print '<h1>Hello %s!</h1>' % form['name'].value
-else:
- print '<html><head><title>Who is there?</title></head>'
- print '<body>'
- print '<h1>Who is there?</h1>'
-
-print '<form action="%s" method="POST">' % os.environ['SCRIPT_NAME']
-print 'What is your name?<br>'
-print '<input type="text" name="name" value="%s"><br>' \
- % cgi.escape(form.getvalue('name', ''), 1)
-print '<input type="submit" value="That is my name"></form>'
-print '</body></html>'
Deleted: WSGIKit/trunk/wsgikit/helloworld_wrap.cgi
===================================================================
--- WSGIKit/trunk/wsgikit/helloworld_wrap.cgi 2005-03-26 20:02:29 UTC (rev 2235)
+++ WSGIKit/trunk/wsgikit/helloworld_wrap.cgi 2005-03-26 20:02:41 UTC (rev 2236)
@@ -1,6 +0,0 @@
-#!/usr/bin/env python
-
-import cgiserver
-import pycgiwrapper
-cgiserver.run_with_cgi(
- pycgiwrapper.CGIWrapper('helloworld.cgi'))
|