Mercurial > piecrust2
comparison piecrust/processing/sass.py @ 666:81d9c3a3a0b5
internal: Get rid of the whole "sub cache" business.
* Compute cache keys up front, so the cache directory is only chosen once.
* Buffer up config variants to apply before loading the config. Makes it
possible to cache variant-resulting configs, too.
* Make a factory class to reuse the logic that creates the `PieCrust` object
correctly for multi-process workers and such.
* Add a test.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 03 Mar 2016 08:22:41 -0800 |
parents | a406b75c4bea |
children | 4850f8c21b6e |
comparison
equal
deleted
inserted
replaced
665:5dc13c816045 | 666:81d9c3a3a0b5 |
---|---|
127 raise Exception("The `sass/options` configuration setting " | 127 raise Exception("The `sass/options` configuration setting " |
128 "must be an array of arguments.") | 128 "must be an array of arguments.") |
129 | 129 |
130 cache_dir = None | 130 cache_dir = None |
131 if self.app.cache.enabled: | 131 if self.app.cache.enabled: |
132 cache_dir = os.path.join(self.app.sub_cache_dir, 'sass') | 132 cache_dir = os.path.join(self.app.cache_dir, 'sass') |
133 self._conf.setdefault('cache_dir', cache_dir) | 133 self._conf.setdefault('cache_dir', cache_dir) |
134 | 134 |
135 def _getMapPath(self, path): | 135 def _getMapPath(self, path): |
136 map_name = "%s_%s.map" % ( | 136 map_name = "%s_%s.map" % ( |
137 os.path.basename(path), | 137 os.path.basename(path), |