Mercurial > piecrust2
comparison piecrust/cache.py @ 105:7d2fdf43d7ca
Property clean all caches when force baking, except the `app` cache.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 17 Sep 2014 21:49:25 -0700 |
parents | efd0d3bacc9e |
children | c2ca72fb7f0b |
comparison
equal
deleted
inserted
replaced
104:28518b515513 | 105:7d2fdf43d7ca |
---|---|
32 self.caches[name] = c | 32 self.caches[name] = c |
33 return c | 33 return c |
34 | 34 |
35 def getCacheDir(self, name): | 35 def getCacheDir(self, name): |
36 return os.path.join(self.base_dir, name) | 36 return os.path.join(self.base_dir, name) |
37 | |
38 def getCacheNames(self, except_names=None): | |
39 _, dirnames, __ = next(os.walk(self.base_dir)) | |
40 if except_names is None: | |
41 return dirnames | |
42 return [dn for dn in dirnames if dn not in except_names] | |
37 | 43 |
38 | 44 |
39 class SimpleCache(object): | 45 class SimpleCache(object): |
40 def __init__(self, base_dir): | 46 def __init__(self, base_dir): |
41 self.base_dir = base_dir | 47 self.base_dir = base_dir |