Mercurial > piecrust2
comparison piecrust/page.py @ 7:343d08ef5668
More PieCrust 3 fixes, and a couple of miscellaneous bug fixes.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sat, 16 Aug 2014 15:07:22 -0700 |
parents | f5ca5c5bed85 |
children | fce061f8c2ed |
comparison
equal
deleted
inserted
replaced
6:f5ca5c5bed85 | 7:343d08ef5668 |
---|---|
170 raise Exception("Loading page '%s' but not execution context has " | 170 raise Exception("Loading page '%s' but not execution context has " |
171 "been created for it." % path) | 171 "been created for it." % path) |
172 | 172 |
173 # Check the cache first. | 173 # Check the cache first. |
174 cache = app.cache.getCache('pages') | 174 cache = app.cache.getCache('pages') |
175 cache_path = "%s.json" % hashlib.md5(path).hexdigest() | 175 cache_path = "%s.json" % hashlib.md5(path.encode('utf8')).hexdigest() |
176 page_time = os.path.getmtime(path) | 176 page_time = os.path.getmtime(path) |
177 if cache.isValid(cache_path, page_time): | 177 if cache.isValid(cache_path, page_time): |
178 exec_info.was_cache_valid = True | 178 exec_info.was_cache_valid = True |
179 cache_data = json.loads(cache.read(cache_path)) | 179 cache_data = json.loads(cache.read(cache_path)) |
180 config = PageConfiguration(values=cache_data['config'], | 180 config = PageConfiguration(values=cache_data['config'], |