changeset 8560:646ba821f63e

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.
author John Rouillard <rouilj@ieee.org>
date Wed, 08 Apr 2026 21:00:34 -0400
parents 19670ecbad82
children 395c258636ad
files frontends/roundup.cgi
diffstat 1 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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]

Roundup Issue Tracker: http://roundup-tracker.org/