Mercurial > piecrust2
changeset 112:d31cbbdb4ecc
Use cache paths that are easier to debug than hashes.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 19 Oct 2014 00:25:02 -0700 |
parents | 208c652551a3 |
children | de257cc40ce1 |
files | piecrust/page.py |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/piecrust/page.py Thu Oct 16 17:03:42 2014 -0700 +++ b/piecrust/page.py Sun Oct 19 00:25:02 2014 -0700 @@ -209,7 +209,8 @@ def _do_load_page(app, path, path_mtime): # Check the cache first. cache = app.cache.getCache('pages') - cache_path = "%s.json" % hashlib.md5(path.encode('utf8')).hexdigest() + rel_path = os.path.relpath(path, app.root_dir) + cache_path = "%s.json" % rel_path.replace('/', '_').strip('_') page_time = path_mtime or os.path.getmtime(path) if cache.isValid(cache_path, page_time): cache_data = json.loads(cache.read(cache_path),