Back to index

moin  1.9.0~rc2
Classes | Functions | Variables
MoinMoin.support.flup.server.fcgi_single 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_single.test_app (   environ,
  start_response 
)
Probably not the most efficient example.

Definition at line 126 of file fcgi_single.py.

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


Variable Documentation

Definition at line 58 of file fcgi_single.py.

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

Definition at line 49 of file fcgi_single.py.

Definition at line 50 of file fcgi_single.py.

Definition at line 153 of file fcgi_single.py.