Mercurial > piecrust2
diff piecrust/data/provider.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 | 474c9882decf |
children | 923699e816d0 |
line wrap: on
line diff
--- a/piecrust/data/provider.py Sat Aug 16 08:15:30 2014 -0700 +++ b/piecrust/data/provider.py Sat Aug 16 15:07:22 2014 -0700 @@ -1,5 +1,4 @@ import time -import itertools from piecrust.data.iterators import PageIterator from piecrust.sources.base import ArraySource @@ -18,7 +17,10 @@ def __getattr__(self, name): if self._user_data is not None: - return self._user_data[name] + try: + return self._user_data[name] + except KeyError: + pass raise AttributeError() def __getitem__(self, name): @@ -170,6 +172,8 @@ for fac in self._source.getPageFactories(): post = fac.buildPage() tax_values = post.config.get(tax_name) + if tax_values is None: + continue if not isinstance(tax_values, list): tax_values = [tax_values] for val in tax_values: