Mercurial > piecrust2
diff piecrust/data/linker.py @ 440:32c7c2d219d2
performance: Refactor how data is managed to reduce copying.
* Make use of `collections.abc.Mapping` to better identify things that are
supposed to look like dictionaries.
* Instead of handling "overlay" of data in a dict tree in each different data
object, make all objects `Mapping`s and handle merging at a higher level
with the new `MergedMapping` object.
* Since this new object is read-only, remove the need for deep-copying of
app and page configurations.
* Split data classes into separate modules.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 28 Jun 2015 08:22:39 -0700 |
parents | e7b865f8f335 |
children | 48fcdd967212 |
line wrap: on
line diff
--- a/piecrust/data/linker.py Sat Jun 27 22:28:32 2015 -0700 +++ b/piecrust/data/linker.py Sun Jun 28 08:22:39 2015 -0700 @@ -1,7 +1,8 @@ import logging import collections -from piecrust.data.base import PaginationData, LazyPageConfigLoaderHasNoValue from piecrust.data.iterators import PageIterator +from piecrust.data.pagedata import LazyPageConfigLoaderHasNoValue +from piecrust.data.paginationdata import PaginationData from piecrust.sources.interfaces import IPaginationSource, IListableSource @@ -103,7 +104,7 @@ self.is_page = True self._child_linker = page._linker_info.child_linker - self.mapLoader('*', self._linkerChildLoader) + self._mapLoader('*', self._linkerChildLoader) @property def parent(self):