#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
    a low level fastCGI test
    ~~~~~~~~~~~~~~~~~~~~~~~~

    The fastCGI test application.

    Last commit info:
    ~~~~~~~~~~~~~~~~~
    $LastChangedDate: 2007-09-20 13:51:27 +0200 (Do, 20 Sep 2007) $
    $Rev: 1235 $
    $Author: JensDiemer $

    :copyright: 2007 by Jens Diemer
    :license: GNU GPL v3, see LICENSE.txt for more details.
"""

from cgi import escape
import sys, os

def app(environ, start_response):
    start_response('200 OK', [('Content-Type', 'text/html')])

    yield '<h1>FastCGI Environment</h1><table>'
    for k, v in sorted(environ.items()):
        yield '<tr><th>%s</th><td>%s</td></tr>' % (escape(k), escape(v))
