Mercurial > piecrust2
comparison piecrust/uriutil.py @ 495:4284c673bb91
internal: Fix some edge-cases for splitting sub-URIs.
A given URI may or may not have a trailing slash, regardless of the
`trailing_slash` configuration setting. Add unit tests to check those cases.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 23 Jul 2015 22:11:59 -0700 |
parents | d4321317beae |
children | e85f29b28b84 |
comparison
equal
deleted
inserted
replaced
494:2537fe95d771 | 495:4284c673bb91 |
---|---|
90 | 90 |
91 pretty_urls = app.config.get('site/pretty_urls') | 91 pretty_urls = app.config.get('site/pretty_urls') |
92 trailing_slash = app.config.get('site/trailing_slash') | 92 trailing_slash = app.config.get('site/trailing_slash') |
93 if not pretty_urls: | 93 if not pretty_urls: |
94 uri, ext = os.path.splitext(uri) | 94 uri, ext = os.path.splitext(uri) |
95 elif trailing_slash: | 95 else: |
96 uri = uri.rstrip('/') | 96 uri = uri.rstrip('/') |
97 | 97 |
98 page_num = 1 | 98 page_num = 1 |
99 pgn_suffix_re = app.config.get('__cache/pagination_suffix_re') | 99 pgn_suffix_re = app.config.get('__cache/pagination_suffix_re') |
100 m = re.search(pgn_suffix_re, uri) | 100 m = re.search(pgn_suffix_re, uri) |