Mercurial > piecrust2
diff piecrust/routing.py @ 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 | d47d9493bb0a |
children | 55087da9a72e |
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) + '$'