changeset 1035:1a7f3ae09c53

bake: Allow specifying which asset processors to use on a per-source basis.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 16 Jan 2018 08:40:34 -0800
parents 96f1e5e377ef
children 12a1bd7af52e
files piecrust/pipelines/asset.py
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/piecrust/pipelines/asset.py	Tue Jan 16 08:39:08 2018 -0800
+++ b/piecrust/pipelines/asset.py	Tue Jan 16 08:40:34 2018 -0800
@@ -34,11 +34,12 @@
     def initialize(self):
         # Get the list of processors for this run.
         processors = self.app.plugin_loader.getProcessors()
-        enabled_processors = self.app.config.get('pipelines/asset/processors')
-        if enabled_processors is not None:
-            logger.debug("Filtering processors to: %s" % enabled_processors)
-            processors = get_filtered_processors(processors,
-                                                 enabled_processors)
+        for flt in [
+                self.app.config.get('pipelines/asset/processors'),
+                self.source.config.get('processors')]:
+            if flt is not None:
+                logger.debug("Filtering processors to: %s" % flt)
+                processors = get_filtered_processors(processors, flt)
 
         # Invoke pre-processors.
         proc_ctx = ProcessorContext(self)