comparison piecrust/data/assetor.py @ 96:0445a2232de7

Improvements and fixes to incremental baking. * Better handling of the render pass during page rendering. * Used sources are paired with the pass they were used in. * Proper use and invalidation of the rendered segments cache based on render passes. * The `Assetor` is also better tracking what was used in a page. * Add flags on a page to get better caching information for the debug window. * Property invalidation of the previous bake record when needed. * Better information about why pages are delayed.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 07 Sep 2014 23:48:57 -0700
parents 62c7a97c8340
children 9f3fc17e71e1
comparison
equal deleted inserted replaced
95:cb6eadea0845 96:0445a2232de7
55 55
56 def __iter__(self): 56 def __iter__(self):
57 self._cacheAssets() 57 self._cacheAssets()
58 return map(lambda i: i[0], self._cache.values()) 58 return map(lambda i: i[0], self._cache.values())
59 59
60 def _getAssetPaths(self):
61 self._cacheAssets()
62 return map(lambda i: i[1], self._cache.values())
63
64 def _debugRenderAssetNames(self): 60 def _debugRenderAssetNames(self):
65 self._cacheAssets() 61 self._cacheAssets()
66 return list(self._cache.keys()) 62 return list(self._cache.keys())
67 63
68 def _cacheAssets(self): 64 def _cacheAssets(self):
89 "Multiple asset files are named '%s'." % name) 85 "Multiple asset files are named '%s'." % name)
90 self._cache[name] = (base_url + fn, full_fn) 86 self._cache[name] = (base_url + fn, full_fn)
91 87
92 cpi = self._page.app.env.exec_info_stack.current_page_info 88 cpi = self._page.app.env.exec_info_stack.current_page_info
93 if cpi is not None: 89 if cpi is not None:
94 cpi.render_ctx.used_assets = self 90 used_assets = list(map(lambda i: i[1], self._cache.values()))
91 cpi.render_ctx.used_assets = used_assets
95 92