Mercurial > piecrust2
comparison piecrust/baking/single.py @ 264:74bea91c9630
bake: Don't store internal config values in the bake record.
We sometimes store actual objects in the page config (like for instance page
linkers) and we don't want that to be pickled.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 24 Feb 2015 23:18:23 -0800 |
parents | 61145dcd56e0 |
children | 8c0c53a315ae |
comparison
equal
deleted
inserted
replaced
263:a68e207ca406 | 264:74bea91c9630 |
---|---|
13 from piecrust.sources.base import (PageFactory, | 13 from piecrust.sources.base import (PageFactory, |
14 REALM_NAMES, REALM_USER, REALM_THEME) | 14 REALM_NAMES, REALM_USER, REALM_THEME) |
15 | 15 |
16 | 16 |
17 logger = logging.getLogger(__name__) | 17 logger = logging.getLogger(__name__) |
18 | |
19 | |
20 def copy_public_page_config(config): | |
21 res = config.get().copy() | |
22 for k in list(res.keys()): | |
23 if k.startswith('__'): | |
24 del res[k] | |
25 return res | |
18 | 26 |
19 | 27 |
20 class BakingError(Exception): | 28 class BakingError(Exception): |
21 pass | 29 pass |
22 | 30 |
96 | 104 |
97 cur_sub = 1 | 105 cur_sub = 1 |
98 has_more_subs = True | 106 has_more_subs = True |
99 force_this = self.force | 107 force_this = self.force |
100 invalidate_formatting = False | 108 invalidate_formatting = False |
101 record_entry.config = page.config.get().copy() | 109 record_entry.config = copy_public_page_config(page.config) |
102 prev_record_entry = self.record.getPreviousEntry( | 110 prev_record_entry = self.record.getPreviousEntry( |
103 factory.source.name, factory.rel_path, | 111 factory.source.name, factory.rel_path, |
104 taxonomy_name, taxonomy_term) | 112 taxonomy_name, taxonomy_term) |
105 | 113 |
106 logger.debug("Baking '%s'..." % uri) | 114 logger.debug("Baking '%s'..." % uri) |