# HG changeset patch # User John Rouillard # Date 1775696434 14400 # Node ID 646ba821f63e74267b437119e3de2b0697c714d2 # Parent 19670ecbad82a0638d48e8833074906f8ed8945c feat: add TIMING option, python install dir setting, more cleanups Add commented out sys.path.append(...) for user to change location of roundup libraries. Add TIMING global to control output of timing information. Some more ruff cleanups and remove from __future__ import print_function. This is Python 3 for pete's sake. diff -r 19670ecbad82 -r 646ba821f63e frontends/roundup.cgi --- a/frontends/roundup.cgi Wed Apr 08 19:27:34 2026 -0400 +++ b/frontends/roundup.cgi Wed Apr 08 21:00:34 2026 -0400 @@ -16,13 +16,12 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -# python version check -from __future__ import print_function - import sys import time -from roundup import version_check +# If roundup is not on your normal path, add it here. +# sys.path.append('/home/username/develop/roundup_dev') +from roundup import version_check # noqa: F401 from roundup.anypy.html import html_escape from roundup.anypy.strings import StringIO, s2b from roundup.i18n import _ @@ -50,6 +49,13 @@ # stderr) or to the web client (via cgitb). DEBUG_TO_CLIENT = False +# Return timing information to the client. +# Set TIMING to: +# "" - Do not sent timing info to client. (Default) +# "COMMENT" - Hide timing in html comment, view source to see it. +# "INLINE" - Display timing at bottom of web page +TIMING = "" + # This indicates where the Roundup tracker lives TRACKER_HOMES = { # 'example': '/path/to/example', @@ -161,6 +167,9 @@ import roundup.cgi.client import roundup.instance + if TIMING: + os.environ["CGI_SHOW_TIMING"] = TIMING + request = RequestWrapper(out) problem_header = roundup.cgi.client.are_header_values_safe(os.environ) if problem_header: @@ -186,7 +195,6 @@ out.write(s2b(error_body)) return - path = os.environ.get('PATH_INFO', '/').split('/') request.path = os.environ.get('PATH_INFO', '/') tracker = path[1]