Show
Ignore:
Timestamp:
02/15/08 17:08:59 (2 years ago)
Author:
JensDiemer
Message:

FastCGI: besser debugging

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pylucid/tests/server_tests/fastCGI_test.fcgi

    r1413 r1415  
    1919""" 
    2020 
    21 import sys, os 
     21import sys, os, time 
    2222 
    2323# Logging 
    2424#LOGFILE = None # No logging! 
    25 LOGFILE = "PyLucid_fcgi.log" # Log into this file 
     25LOGFILE = "PyLucid_fcgi_test.log" # Log into this file 
    2626 
    2727 
     
    5151 
    5252 
     53start_overall = time.time() 
     54 
    5355try: 
    5456    def app(environ, start_response): 
    5557        start_response('200 OK', [('Content-Type', 'text/html')]) 
     58        yield '<h1>FastCGI test app</h1>' 
     59 
     60        # Display the overall running time 
     61        yield 'overall time: %.2fsec' % (time.time() - start_overall) 
    5662 
    5763        from cgi import escape 
    58         yield '<h1>FastCGI Environment</h1><table>' 
    59         yield '<tr><th>%s</th><td>%s</td></tr>' % ( 
    60             escape(repr(k)), escape(repr(v)) 
    61         ) 
     64        yield '<h2>FastCGI Environment:</h2><table>' 
     65        for k, v in sorted(environ.items()): 
     66            yield '<tr><th>%s</th><td>%s</td></tr>' % ( 
     67                escape(repr(k)), escape(repr(v)) 
     68            ) 
     69        yield '</table>' 
     70 
    6271 
    6372    WSGIServer(app).run()