Mercurial > piecrust2
diff piecrust/pipelines/asset.py @ 979:45ad976712ec
tests: Big push to get the tests to pass again.
- Lots of fixes everywhere in the code.
- Try to handle debug logging in the multiprocessing worker pool when running in pytest. Not perfect, but usable for now.
- Replace all `.md` test files with `.html` since now a auto-format extension always sets the format.
- Replace `out` with `outfiles` in most places since now blog archives are added to the bake output and I don't want to add expected outputs for blog archives everywhere.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 29 Oct 2017 22:51:57 -0700 |
parents | 08e02c2a2a1a |
children | 8adc27285d93 |
line wrap: on
line diff
--- a/piecrust/pipelines/asset.py Sun Oct 29 22:46:41 2017 -0700 +++ b/piecrust/pipelines/asset.py Sun Oct 29 22:51:57 2017 -0700 @@ -25,19 +25,18 @@ "The asset pipeline only support file-system sources.") super().__init__(source, ppctx) - self.enabled_processors = None - self.ignore_patterns = [] + self._ignore_patterns = [] self._processors = None self._base_dir = source.fs_endpoint_path def initialize(self): # Get the list of processors for this run. processors = self.app.plugin_loader.getProcessors() - if self.enabled_processors is not None: - logger.debug("Filtering processors to: %s" % - self.enabled_processors) + 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, - self.enabled_processors) + enabled_processors) # Invoke pre-processors. proc_ctx = ProcessorContext(self) @@ -55,7 +54,9 @@ # Pre-processors can define additional ignore patterns so let's # add them to what we had already. - self.ignore_patterns += make_re(proc_ctx.ignore_patterns) + ignores = self.app.config.get('pipelines/asset/ignore', []) + ignores += proc_ctx.ignore_patterns + self._ignore_patterns += make_re(ignores) # Register timers. stats = self.app.env.stats @@ -65,7 +66,7 @@ def run(self, job, ctx, result): # See if we need to ignore this item. rel_path = os.path.relpath(job.content_item.spec, self._base_dir) - if re_matchany(rel_path, self.ignore_patterns): + if re_matchany(rel_path, self._ignore_patterns): return record_entry = result.record_entry