comparison piecrust/environment.py @ 991:1857dbd4580f

bake: Fix bugs introduced by bake optimizations, of course. - Make the execution stats JSON-serializable. - Re-add ability to differentiate between sources used during segment rendering and during layout rendering. Fixes problems with cache invalidation of pages that use other sources. - Make taxonomy-related stuff JSON-serializable.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 20 Nov 2017 23:06:47 -0800
parents 08e02c2a2a1a
children a9a592f655e3
comparison
equal deleted inserted replaced
990:22cf13b86cc3 991:1857dbd4580f
58 self.counters[oc] = v + ov 58 self.counters[oc] = v + ov
59 for oc, ov in other.manifests.items(): 59 for oc, ov in other.manifests.items():
60 v = self.manifests.setdefault(oc, []) 60 v = self.manifests.setdefault(oc, [])
61 self.manifests[oc] = v + ov 61 self.manifests[oc] = v + ov
62 62
63 def toData(self):
64 return {
65 'timers': self.timers.copy(),
66 'counters': self.counters.copy(),
67 'manifests': self.manifests.copy()}
68
69 def fromData(self, data):
70 self.timers = data['timers']
71 self.counters = data['counters']
72 self.manifests = data['manifests']
73
63 74
64 class Environment: 75 class Environment:
65 def __init__(self): 76 def __init__(self):
66 from piecrust.cache import MemCache 77 from piecrust.cache import MemCache
67 from piecrust.rendering import RenderingContextStack 78 from piecrust.rendering import RenderingContextStack