comparison roundup/cgi/client.py @ 8556:dd0445649244

bug(perf): put legacy '_file' last in tuple to speed up match
author John Rouillard <rouilj@ieee.org>
date Mon, 06 Apr 2026 01:30:55 -0400
parents 98fb176224fc
children f80c566f5726
comparison
equal deleted inserted replaced
8555:98fb176224fc 8556:dd0445649244
1824 1824
1825 The URL path after the instance identifier is examined. The path 1825 The URL path after the instance identifier is examined. The path
1826 is generally only one entry long. 1826 is generally only one entry long.
1827 1827
1828 - if there is no path, then we are in the "home" context. 1828 - if there is no path, then we are in the "home" context.
1829 - if the path is "_file", then the additional path entry 1829 - if the path is "@@file" (or "_file", then the additional
1830 specifies the filename of a static file we're to serve up 1830 path entry specifies the filename of a static file we're to
1831 from the instance "html" directory. Raises a SendStaticFile 1831 serve up from the instance "html" directory. Raises a
1832 exception.(*) 1832 SendStaticFile exception.(*)
1833 - if there is something in the path (eg "issue"), it identifies 1833 - if there is something in the path (eg "issue"), it identifies
1834 the tracker class we're to display. 1834 the tracker class we're to display.
1835 - if the path is an item designator (eg "issue123"), then we're 1835 - if the path is an item designator (eg "issue123"), then we're
1836 to display a specific item. 1836 to display a specific item.
1837 - if the path starts with an item designator and is longer than 1837 - if the path starts with an item designator and is longer than
1889 if template_override is not None: 1889 if template_override is not None:
1890 self.template = template_override 1890 self.template = template_override
1891 else: 1891 else:
1892 self.template = '' 1892 self.template = ''
1893 return 1893 return
1894 if path[0] in ('_file', '@@file'): 1894 if path[0] in ('@@file', '_file'):
1895 raise SendStaticFile(os.path.join(*path[1:])) 1895 raise SendStaticFile(os.path.join(*path[1:]))
1896 1896
1897 self.classname = path[0] 1897 self.classname = path[0]
1898 if len(path) > 1: 1898 if len(path) > 1:
1899 # send the file identified by the designator in path[0] 1899 # send the file identified by the designator in path[0]

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