comparison 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
comparison
equal deleted inserted replaced
224:4f00bb99400e 225:a75d024ee839
24 self.app = app 24 self.app = app
25 uri = cfg['url'] 25 uri = cfg['url']
26 self.uri_root = app.config.get('site/root').rstrip('/') + '/' 26 self.uri_root = app.config.get('site/root').rstrip('/') + '/'
27 self.uri_pattern = uri.lstrip('/') 27 self.uri_pattern = uri.lstrip('/')
28 self.uri_format = route_re.sub(self._uriFormatRepl, self.uri_pattern) 28 self.uri_format = route_re.sub(self._uriFormatRepl, self.uri_pattern)
29 if app.config.get('site/show_debug_info'):
30 self.uri_format += '?!debug'
29 31
30 # Get the straight-forward regex for matching this URI pattern. 32 # Get the straight-forward regex for matching this URI pattern.
31 p = route_re.sub(self._uriPatternRepl, self.uri_pattern) + '$' 33 p = route_re.sub(self._uriPatternRepl, self.uri_pattern) + '$'
32 self.uri_re = re.compile(p) 34 self.uri_re = re.compile(p)
33 35