Mercurial > piecrust2
comparison piecrust/baking/scheduler.py @ 338:938be93215cb
bake: Improve render context and bake record, fix incremental bake bugs.
* Used sources and taxonomies are now stored on a per-render-pass basis.
This fixes bugs where sources/taxonomies were used for one pass, but that
pass is skipped on a later bake because its result is cached.
* Bake records are now created for all pages even when they're not baked.
Record collapsing is gone except for taxonomy index pages.
* Bake records now also have sub-entries in order to store information about
each sub-page, since some sub-pages could use sources/taxonomies differently
than others, or be missing from the output. This lets PieCrust handle
clean/dirty states on a sub-page level.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Mon, 06 Apr 2015 19:59:54 -0700 |
parents | 1187739e5a19 |
children |
comparison
equal
deleted
inserted
replaced
337:49408002798e | 338:938be93215cb |
---|---|
82 return job | 82 return job |
83 | 83 |
84 def _isJobReady(self, job): | 84 def _isJobReady(self, job): |
85 e = self.record.getPreviousEntry( | 85 e = self.record.getPreviousEntry( |
86 job.factory.source.name, | 86 job.factory.source.name, |
87 job.factory.rel_path) | 87 job.factory.rel_path, |
88 taxonomy_info=job.record_entry.taxonomy_info) | |
88 if not e: | 89 if not e: |
89 return (True, None) | 90 return (True, None) |
90 for sn, rp in e.used_source_names: | 91 used_source_names = e.getAllUsedSourceNames() |
92 for sn in used_source_names: | |
91 if sn == job.factory.source.name: | 93 if sn == job.factory.source.name: |
92 continue | 94 continue |
93 if any(filter(lambda j: j.factory.source.name == sn, self.jobs)): | 95 if any(filter(lambda j: j.factory.source.name == sn, |
96 self.jobs)): | |
94 return (False, sn) | 97 return (False, sn) |
95 if any(filter(lambda j: j.factory.source.name == sn, | 98 if any(filter(lambda j: j.factory.source.name == sn, |
96 self._active_jobs)): | 99 self._active_jobs)): |
97 return (False, sn) | 100 return (False, sn) |
98 return (True, None) | 101 return (True, None) |