comparison piecrust/sources/blogarchives.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 8adc27285d93
comparison
equal deleted inserted replaced
904:cc2647360036 905:1d0364614665
106 def _load(self): 106 def _load(self):
107 if self._months is not None: 107 if self._months is not None:
108 return 108 return
109 109
110 month_index = {} 110 month_index = {}
111 src = self._inner_source 111 for page in self._inner_source.getAllPages():
112 app = src.app
113 for item in self._inner_source.getAllContents():
114 page = app.getPage(src, item)
115
116 if page.datetime.year != self._year: 112 if page.datetime.year != self._year:
117 continue 113 continue
118 114
119 month = page.datetime.month 115 month = page.datetime.month
120 116