Mercurial > piecrust2
comparison piecrust/pipelines/asset.py @ 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 | 8adc27285d93 |
children | c8fb7b024faa |
comparison
equal
deleted
inserted
replaced
1034:96f1e5e377ef | 1035:1a7f3ae09c53 |
---|---|
32 self._base_dir = source.fs_endpoint_path | 32 self._base_dir = source.fs_endpoint_path |
33 | 33 |
34 def initialize(self): | 34 def initialize(self): |
35 # Get the list of processors for this run. | 35 # Get the list of processors for this run. |
36 processors = self.app.plugin_loader.getProcessors() | 36 processors = self.app.plugin_loader.getProcessors() |
37 enabled_processors = self.app.config.get('pipelines/asset/processors') | 37 for flt in [ |
38 if enabled_processors is not None: | 38 self.app.config.get('pipelines/asset/processors'), |
39 logger.debug("Filtering processors to: %s" % enabled_processors) | 39 self.source.config.get('processors')]: |
40 processors = get_filtered_processors(processors, | 40 if flt is not None: |
41 enabled_processors) | 41 logger.debug("Filtering processors to: %s" % flt) |
42 processors = get_filtered_processors(processors, flt) | |
42 | 43 |
43 # Invoke pre-processors. | 44 # Invoke pre-processors. |
44 proc_ctx = ProcessorContext(self) | 45 proc_ctx = ProcessorContext(self) |
45 for proc in processors: | 46 for proc in processors: |
46 proc.onPipelineStart(proc_ctx) | 47 proc.onPipelineStart(proc_ctx) |