diff piecrust/processing/requirejs.py @ 852:4850f8c21b6e

core: Start of the big refactor for PieCrust 3.0. * Everything is a `ContentSource`, including assets directories. * Most content sources are subclasses of the base file-system source. * A source is processed by a "pipeline", and there are 2 built-in pipelines, one for assets and one for pages. The asset pipeline is vaguely functional, but the page pipeline is completely broken right now. * Rewrite the baking process as just running appropriate pipelines on each content item. This should allow for better parallelization.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 17 May 2017 00:11:48 -0700
parents e5f048799d61
children
line wrap: on
line diff
--- a/piecrust/processing/requirejs.py	Sat Apr 29 21:42:22 2017 -0700
+++ b/piecrust/processing/requirejs.py	Wed May 17 00:11:48 2017 -0700
@@ -1,12 +1,9 @@
 import os
 import os.path
-import json
-import hashlib
 import logging
 import platform
 import subprocess
-from piecrust.processing.base import Processor, PRIORITY_FIRST
-from piecrust.processing.tree import FORCE_BUILD
+from piecrust.processing.base import Processor, PRIORITY_FIRST, FORCE_BUILD
 
 
 logger = logging.getLogger(__name__)
@@ -33,15 +30,15 @@
         self._conf.setdefault('bin', 'r.js')
         self._conf.setdefault('out_path', self._conf['build_path'])
 
-    def onPipelineStart(self, pipeline):
-        super(RequireJSProcessor, self).onPipelineStart(pipeline)
+    def onPipelineStart(self, ctx):
+        super(RequireJSProcessor, self).onPipelineStart(ctx)
 
         if self._conf is None:
             return
 
         logger.debug("Adding Javascript suppressor to build pipeline.")
         skip = _JavascriptSkipProcessor(self._conf['build_path'])
-        pipeline.processors.append(skip)
+        ctx.extra_processors.append(skip)
 
     def matches(self, path):
         if self._conf is None: