Mercurial > piecrust2
comparison piecrust/sources/base.py @ 986:ef224cce343c
sources: Respect the "abort source use" setting when iterating on a source.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 31 Oct 2017 09:29:14 -0700 |
parents | 45ad976712ec |
children | 8adc27285d93 |
comparison
equal
deleted
inserted
replaced
985:74f4bde40fd0 | 986:ef224cce343c |
---|---|
104 | 104 |
105 def getAllPages(self): | 105 def getAllPages(self): |
106 if self._page_cache is not None: | 106 if self._page_cache is not None: |
107 return self._page_cache | 107 return self._page_cache |
108 | 108 |
109 if self.app.env.abort_source_use: | |
110 raise AbortedSourceUseError() | |
111 | |
109 getter = self.app.getPage | 112 getter = self.app.getPage |
110 self._page_cache = [getter(self, i) for i in self.getAllContents()] | 113 self._page_cache = [getter(self, i) for i in self.getAllContents()] |
111 return self._page_cache | 114 return self._page_cache |
112 | 115 |
113 def getAllContents(self): | 116 def getAllContents(self): |