Mercurial > piecrust2
comparison piecrust/dataproviders/pageiterator.py @ 905:1d0364614665
internal: Sources can cache their pages in addition to their items.
Added `getAllPages` to content sources to prevent having to look up cached
page objects in the page repository all the time.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 23 Jul 2017 08:26:57 -0700 |
parents | d6d35b2efd04 |
children | abc52a6262a1 |
comparison
equal
deleted
inserted
replaced
904:cc2647360036 | 905:1d0364614665 |
---|---|
360 # iterator chain. It acts as the end. | 360 # iterator chain. It acts as the end. |
361 self.it = None | 361 self.it = None |
362 | 362 |
363 def __iter__(self): | 363 def __iter__(self): |
364 source = self.source | 364 source = self.source |
365 app = source.app | 365 yield from source.getAllPages() |
366 for item in source.getAllContents(): | |
367 yield app.getPage(source, item) | |
368 | 366 |
369 | 367 |
370 class PaginationDataBuilderIterator: | 368 class PaginationDataBuilderIterator: |
371 def __init__(self, it): | 369 def __init__(self, it): |
372 self.it = it | 370 self.it = it |