Mercurial > piecrust2
changeset 225:a75d024ee839
serve: Keep the `?!debug` when generating URLs if it is enabled.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 03 Feb 2015 21:04:55 -0800 |
parents | 4f00bb99400e |
children | e9dc18a275ff |
files | piecrust/routing.py |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/piecrust/routing.py Tue Feb 03 18:51:30 2015 -0800 +++ b/piecrust/routing.py Tue Feb 03 21:04:55 2015 -0800 @@ -26,6 +26,8 @@ self.uri_root = app.config.get('site/root').rstrip('/') + '/' self.uri_pattern = uri.lstrip('/') self.uri_format = route_re.sub(self._uriFormatRepl, self.uri_pattern) + if app.config.get('site/show_debug_info'): + self.uri_format += '?!debug' # Get the straight-forward regex for matching this URI pattern. p = route_re.sub(self._uriPatternRepl, self.uri_pattern) + '$'