comparison piecrust/data/base.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 1d5f02778723
children 501bd4ab7e06
comparison
equal deleted inserted replaced
988:f83ae0a5d793 989:8adc27285d93
3 3
4 class MergedMapping(collections.abc.Mapping): 4 class MergedMapping(collections.abc.Mapping):
5 """ Provides a dictionary-like object that's really the aggregation of 5 """ Provides a dictionary-like object that's really the aggregation of
6 multiple dictionary-like objects. 6 multiple dictionary-like objects.
7 """ 7 """
8 def __init__(self, dicts, path=''): 8 def __init__(self, dicts, path='', *, stats=None):
9 self._dicts = dicts 9 self._dicts = dicts
10 self._path = path 10 self._path = path
11 self._stats = stats
11 12
12 def __getattr__(self, name): 13 def __getattr__(self, name):
13 try: 14 try:
14 return self[name] 15 return self[name]
15 except KeyError: 16 except KeyError: