Mercurial > piecrust2
comparison piecrust/dataproviders/pageiterator.py @ 877:d6d35b2efd04
bake: Rename "pass" to "step" and make the page pipeline use different steps.
That pipeline is now first loading all pages, and then rendering full pages
unless they trigger a sub-render.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 15 Jun 2017 22:16:23 -0700 |
parents | 757fba54bfd3 |
children | 1d0364614665 |
comparison
equal
deleted
inserted
replaced
876:d1095774bfcf | 877:d6d35b2efd04 |
---|---|
1 import logging | 1 import logging |
2 from piecrust.data.filters import PaginationFilter | 2 from piecrust.data.filters import PaginationFilter |
3 from piecrust.data.paginationdata import PaginationData | 3 from piecrust.data.paginationdata import PaginationData |
4 from piecrust.events import Event | 4 from piecrust.events import Event |
5 from piecrust.dataproviders.base import DataProvider | 5 from piecrust.dataproviders.base import DataProvider |
6 from piecrust.sources.base import ContentSource, AbortedSourceUseError | 6 from piecrust.sources.base import ContentSource |
7 | 7 |
8 | 8 |
9 logger = logging.getLogger(__name__) | 9 logger = logging.getLogger(__name__) |
10 | 10 |
11 | 11 |
238 | 238 |
239 def _load(self): | 239 def _load(self): |
240 if self._cache is not None: | 240 if self._cache is not None: |
241 return | 241 return |
242 | 242 |
243 if self._is_content_source: | |
244 if self._source.app.env.abort_source_use: | |
245 if self._current_page is not None: | |
246 logger.debug("Aborting iteration of '%s' from: %s." % | |
247 (self._source.name, | |
248 self._current_page.content_spec)) | |
249 else: | |
250 logger.debug("Aborting iteration of '%s'." % | |
251 self._source.name) | |
252 raise AbortedSourceUseError() | |
253 | |
254 self._ensureSorter() | 243 self._ensureSorter() |
255 | 244 |
256 if self._is_content_source: | 245 if self._is_content_source: |
257 self._it = PaginationDataBuilderIterator(self._it) | 246 self._it = PaginationDataBuilderIterator(self._it) |
258 | 247 |