Mercurial > piecrust2
comparison piecrust/templating/jinjaengine.py @ 722:f0a3af3fbea2
internal: Remove unused code.
| author | Ludovic Chabant <ludovic@chabant.com> |
|---|---|
| date | Sun, 29 May 2016 20:15:56 -0700 |
| parents | a14371c5cda7 |
| children | b91fe30ae7aa |
comparison
equal
deleted
inserted
replaced
| 721:234d0c7c02cf | 722:f0a3af3fbea2 |
|---|---|
| 19 from piecrust.environment import AbortedSourceUseError | 19 from piecrust.environment import AbortedSourceUseError |
| 20 from piecrust.rendering import format_text | 20 from piecrust.rendering import format_text |
| 21 from piecrust.routing import CompositeRouteFunction | 21 from piecrust.routing import CompositeRouteFunction |
| 22 from piecrust.templating.base import (TemplateEngine, TemplateNotFoundError, | 22 from piecrust.templating.base import (TemplateEngine, TemplateNotFoundError, |
| 23 TemplatingError) | 23 TemplatingError) |
| 24 from piecrust.uriutil import multi_replace, split_sub_uri | 24 from piecrust.uriutil import multi_replace |
| 25 | 25 |
| 26 | 26 |
| 27 logger = logging.getLogger(__name__) | 27 logger = logging.getLogger(__name__) |
| 28 | 28 |
| 29 | 29 |
| 253 def _paginate(self, value, items_per_page=5): | 253 def _paginate(self, value, items_per_page=5): |
| 254 cpi = self.app.env.exec_info_stack.current_page_info | 254 cpi = self.app.env.exec_info_stack.current_page_info |
| 255 if cpi is None or cpi.page is None or cpi.render_ctx is None: | 255 if cpi is None or cpi.page is None or cpi.render_ctx is None: |
| 256 raise Exception("Can't paginate when no page has been pushed " | 256 raise Exception("Can't paginate when no page has been pushed " |
| 257 "on the execution stack.") | 257 "on the execution stack.") |
| 258 first_uri, _ = split_sub_uri(self.app, cpi.render_ctx.uri) | |
| 259 return Paginator(cpi.page, value, | 258 return Paginator(cpi.page, value, |
| 260 page_num=cpi.render_ctx.page_num, | 259 page_num=cpi.render_ctx.page_num, |
| 261 items_per_page=items_per_page) | 260 items_per_page=items_per_page) |
| 262 | 261 |
| 263 def _formatWith(self, value, format_name): | 262 def _formatWith(self, value, format_name): |
