2020# instead of mod_python FieldStorage
2121# 29-apr-2004 [als] created
2222
23- __version__ = "$Revision: 1.3 $" [11 :- 2 ]
24- __date__ = "$Date: 2004-10-23 14:13:24 $" [7 :- 2 ]
23+ __version__ = "$Revision: 1.4 $" [11 :- 2 ]
24+ __date__ = "$Date: 2004-11-22 07:33:34 $" [7 :- 2 ]
2525
2626import cgi
2727import os
@@ -76,12 +76,17 @@ def handler(req):
7676 _options = req .get_options ()
7777 _home = _options .get ("TrackerHome" )
7878 _lang = _options .get ("TrackerLanguage" )
79+ _timing = _options .get ("TrackerTiming" , "no" )
80+ if _timing .lower () in ("no" , "false" ):
81+ _timing = ""
82+ _debug = _options .get ("TrackerDebug" , "no" )
83+ _debug = _debug .lower not in ("no" , "false" )
7984 if not (_home and os .path .isdir (_home )):
8085 apache .log_error (
8186 "PythonOption TrackerHome missing or invalid for %(uri)s"
8287 % {'uri' : req .uri })
8388 return apache .HTTP_INTERNAL_SERVER_ERROR
84- _tracker = roundup .instance .open (_home )
89+ _tracker = roundup .instance .open (_home , not _debug )
8590 # create environment
8691 # Note: cookies are read from HTTP variables, so we need all HTTP vars
8792 req .add_common_vars ()
@@ -91,6 +96,8 @@ def handler(req):
9196 # os.environ['PATH_INFO'] = string.join(path[2:], '/')
9297 # we just remove the first character ('/')
9398 _env ["PATH_INFO" ] = req .path_info [1 :]
99+ if _timing :
100+ _env ["CGI_SHOW_TIMING" ] = _timing
94101 _form = cgi .FieldStorage (req , environ = _env )
95102 _client = _tracker .Client (_tracker , Request (req ), _env , _form ,
96103 translator = TranslationService .get_translation (_lang ,
0 commit comments