PageRenderTime 82ms CodeModel.GetById 40ms app.highlight 3ms RepoModel.GetById 37ms app.codeStats 0ms

/docs/examples/simple-python/main.py

https://bitbucket.org/ianb/silverlining/
Python | 17 lines | 16 code | 1 blank | 0 comment | 5 complexity | c089c4f1c9a05f4015c4efcaea87891d MD5 | raw file
 1import os
 2
 3def application(environ, start_response):
 4    start_response('200 OK', [('Content-type', 'text/html')])
 5    parts = []
 6    parts.append('<html><body><pre>')
 7    parts.append('<h1>os.environ:</h1>\n')
 8    for name, value in sorted(os.environ.items()):
 9        parts.append('%s=%s\n' % (name, value))
10    parts.append('\n\n')
11    parts.append('<h1>wsgi environ:</h1>\n')
12    for name, value in sorted(os.environ.items()):
13        if name.upper() != name:
14            value = repr(value)
15        parts.append('%s=%s\n' % (name, value))
16    parts.append('</pre></body></html>')
17    return parts