comparison piecrust/pipelines/records.py @ 989:8adc27285d93

bake: Big pass on bake performance. - Reduce the amount of data passed between processes. - Make inter-process data simple objects to make it easier to test with alternatives to pickle. - Make sources have the basic requirement to be able to find a content item from an item spec (path). - Make Hoedown the default Markdown formatter.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 19 Nov 2017 14:29:17 -0800
parents 45ad976712ec
children
comparison
equal deleted inserted replaced
988:f83ae0a5d793 989:8adc27285d93
35 content source. 35 content source.
36 """ 36 """
37 def __init__(self, name): 37 def __init__(self, name):
38 self.name = name 38 self.name = name
39 self.deleted_out_paths = [] 39 self.deleted_out_paths = []
40 self.user_data = {}
40 self.success = True 41 self.success = True
41 self._entries = {} 42 self._entries = {}
42 43
43 @property 44 @property
44 def entry_count(self): 45 def entry_count(self):
59 60
60 class MultiRecord: 61 class MultiRecord:
61 """ A container that includes multiple `Record` instances -- one for 62 """ A container that includes multiple `Record` instances -- one for
62 each content source that was baked. 63 each content source that was baked.
63 """ 64 """
64 RECORD_VERSION = 12 65 RECORD_VERSION = 13
65 66
66 def __init__(self): 67 def __init__(self):
67 self.records = [] 68 self.records = []
68 self.success = True 69 self.success = True
69 self.bake_time = 0 70 self.bake_time = 0
206 else: 207 else:
207 raise Exception( 208 raise Exception(
208 "A current record entry already exists for '%s' " 209 "A current record entry already exists for '%s' "
209 "(%s)" % (key, diff[1].item_spec)) 210 "(%s)" % (key, diff[1].item_spec))
210 211
212 def copy(self):
213 return RecordHistory(self._previous, self._current)
214
211 215
212 class MultiRecordHistory: 216 class MultiRecordHistory:
213 """ Tracks the differences between an 'old' and a 'new' record 217 """ Tracks the differences between an 'old' and a 'new' record
214 container. 218 container.
215 """ 219 """