diff piecrust/pipelines/base.py @ 1136:5f97b5b59dfe

bake: Optimize cache handling for the baking process. - Get rid of the 2-level pipeline runs... handle a single set of passes. - Go back to load/render segments/layout passes for pages. - Add descriptions of what each job batch does. - Improve the taxonomy pipeline so it doesn't re-bake terms that don't need to be re-baked. - Simplify some of the code.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 23 Apr 2018 21:47:49 -0700
parents 971b4d67e82a
children
line wrap: on
line diff
--- a/piecrust/pipelines/base.py	Mon Apr 23 21:37:43 2018 -0700
+++ b/piecrust/pipelines/base.py	Mon Apr 23 21:47:49 2018 -0700
@@ -2,7 +2,6 @@
 import logging
 from werkzeug.utils import cached_property
 from piecrust.configuration import ConfigurationError
-from piecrust.sources.base import ContentItem
 
 
 logger = logging.getLogger(__name__)
@@ -58,19 +57,6 @@
         self.pass_num = pass_num
 
 
-class PipelineJobValidateContext(_PipelineMasterProcessJobContextBase):
-    """ Context for validating jobs on subsequent step runs (i.e. validating
-        the list of jobs to run starting with the second step).
-
-        This is run on the master process, so it can access both the
-        previous and current records.
-    """
-    def __init__(self, pass_num, step_num, record_name, record_histories):
-        super().__init__(record_name, record_histories)
-        self.pass_num = pass_num
-        self.step_num = step_num
-
-
 class PipelineJobRunContext:
     """ Context for running pipeline baking jobs.
 
@@ -103,11 +89,10 @@
         This is run on the master process, so it can access the current
         record.
     """
-    def __init__(self, record, job, pass_num, step_num):
+    def __init__(self, record, job, pass_num):
         self.record = record
         self.job = job
         self.pass_num = pass_num
-        self.step_num = step_num
 
     @cached_property
     def record_entry(self):
@@ -160,7 +145,7 @@
     def createJobs(self, ctx):
         return [
             create_job(self, item.spec)
-            for item in self.source.getAllContents()]
+            for item in self.source.getAllContents()], None
 
     def createRecordEntry(self, item_spec):
         entry_class = self.RECORD_ENTRY_CLASS
@@ -171,9 +156,6 @@
     def handleJobResult(self, result, ctx):
         raise NotImplementedError()
 
-    def validateNextStepJobs(self, jobs, ctx):
-        pass
-
     def run(self, job, ctx, result):
         raise NotImplementedError()