comparison piecrust/environment.py @ 371:c2ca72fb7f0b 2.0.0a8

caching: Use separate caches for config variants and other contexts. * The `_cache` directory is now organized in multiple "sub-caches" for different contexts. * A new context is created when config variants or overrides are applied. * `serve` context uses a different context that the other commends, to prevent the `bake` command's output from messing up the preview server (e.g. with how asset URLs are generated differently between the two). * Fix a few places where the cache directory was referenced directly.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 03 May 2015 23:59:46 -0700
parents aa6b7ff6a193
children e7b865f8f335
comparison
equal deleted inserted replaced
370:a1bbe66cba03 371:c2ca72fb7f0b
135 def initialize(self, app): 135 def initialize(self, app):
136 self.start_time = time.clock() 136 self.start_time = time.clock()
137 self.exec_info_stack.clear() 137 self.exec_info_stack.clear()
138 self.was_cache_cleaned = False 138 self.was_cache_cleaned = False
139 self.base_asset_url_format = '%uri%' 139 self.base_asset_url_format = '%uri%'
140 self._onSubCacheDirChanged(app)
140 141
142 def _onSubCacheDirChanged(self, app):
141 for name, repo in self.fs_caches.items(): 143 for name, repo in self.fs_caches.items():
142 cache = app.cache.getCache(name) 144 cache = app.cache.getCache(name)
143 repo.fs_cache = cache 145 repo.fs_cache = cache
144 146
145 147