dayssince/handler/env.py

24 lines
369 B
Python

import cgi
def env(data):
out = '''<!DOCTYPE HTML>
<html>
<head>
<title>Environment!</title>
</head>
<body>
<table>'''
for key, value in data.items():
try:
out += '''\n <tr><th>%s</th><td>%s</td></tr>''' % (cgi.escape(key), cgi.escape(repr(value)))
except Exception:
pass
out += '''
</table>
</body>
</html>'''
return iter([out.encode()])