Back to index

moin  1.9.0~rc2
Classes | Functions | Variables
MoinMoin.support.flup.server.fcgi Namespace Reference

Classes

class  WSGIServer

Functions

def test_app

Variables

string __author__ = 'Allan Saddi <allan@saddi.com>'
string __version__ = '$Revision$'
list __all__ = ['WSGIServer']
tuple test_app = validate.validator(test_app)

Function Documentation

def MoinMoin.support.flup.server.fcgi.test_app (   environ,
  start_response 
)
Probably not the most efficient example.

Definition at line 122 of file fcgi.py.

00122 
00123     def test_app(environ, start_response):
00124         """Probably not the most efficient example."""
00125         import cgi
00126         start_response('200 OK', [('Content-Type', 'text/html')])
00127         yield '<html><head><title>Hello World!</title></head>\n' \
00128               '<body>\n' \
00129               '<p>Hello World!</p>\n' \
00130               '<table border="1">'
00131         names = environ.keys()
00132         names.sort()
00133         for name in names:
00134             yield '<tr><td>%s</td><td>%s</td></tr>\n' % (
00135                 name, cgi.escape(`environ[name]`))
00136 
00137         form = cgi.FieldStorage(fp=environ['wsgi.input'], environ=environ,
00138                                 keep_blank_values=1)
00139         if form.list:
00140             yield '<tr><th colspan="2">Form data</th></tr>'
00141 
00142         for field in form.list:
00143             yield '<tr><td>%s</td><td>%s</td></tr>\n' % (
00144                 field.name, field.value)
00145 
00146         yield '</table>\n' \
00147               '</body></html>\n'


Variable Documentation

Definition at line 57 of file fcgi.py.

string MoinMoin.support.flup.server.fcgi.__author__ = 'Allan Saddi <allan@saddi.com>'

Definition at line 49 of file fcgi.py.

Definition at line 50 of file fcgi.py.

Definition at line 149 of file fcgi.py.