diff 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
line wrap: on
line diff
--- a/piecrust/baking/scheduler.py	Sat Apr 04 07:55:49 2015 -0700
+++ b/piecrust/baking/scheduler.py	Mon Apr 06 19:59:54 2015 -0700
@@ -84,13 +84,16 @@
     def _isJobReady(self, job):
         e = self.record.getPreviousEntry(
                 job.factory.source.name,
-                job.factory.rel_path)
+                job.factory.rel_path,
+                taxonomy_info=job.record_entry.taxonomy_info)
         if not e:
             return (True, None)
-        for sn, rp in e.used_source_names:
+        used_source_names = e.getAllUsedSourceNames()
+        for sn in used_source_names:
             if sn == job.factory.source.name:
                 continue
-            if any(filter(lambda j: j.factory.source.name == sn, self.jobs)):
+            if any(filter(lambda j: j.factory.source.name == sn,
+                          self.jobs)):
                 return (False, sn)
             if any(filter(lambda j: j.factory.source.name == sn,
                           self._active_jobs)):