Mercurial > piecrust2
diff piecrust/processing/sass.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 | 81d9c3a3a0b5 |
children | e00ff3dcb5ec |
line wrap: on
line diff
--- a/piecrust/processing/sass.py Sat Apr 29 21:42:22 2017 -0700 +++ b/piecrust/processing/sass.py Wed May 17 00:11:48 2017 -0700 @@ -5,8 +5,7 @@ import logging import platform import subprocess -from piecrust.processing.base import SimpleFileProcessor -from piecrust.processing.tree import FORCE_BUILD +from piecrust.processing.base import SimpleFileProcessor, FORCE_BUILD logger = logging.getLogger(__name__) @@ -17,23 +16,23 @@ def __init__(self): super(SassProcessor, self).__init__( - extensions={'scss': 'css', 'sass': 'css'}) + extensions={'scss': 'css', 'sass': 'css'}) self._conf = None self._map_dir = None def initialize(self, app): super(SassProcessor, self).initialize(app) - def onPipelineStart(self, pipeline): - super(SassProcessor, self).onPipelineStart(pipeline) + def onPipelineStart(self, ctx): + super(SassProcessor, self).onPipelineStart(ctx) - self._map_dir = os.path.join(pipeline.tmp_dir, 'sass') - if pipeline.is_first_worker: + self._map_dir = os.path.join(ctx.tmp_dir, 'sass') + if ctx.is_main_process: if not os.path.isdir(self._map_dir): os.makedirs(self._map_dir) # Ignore include-only Sass files. - pipeline.addIgnorePatterns(['_*.scss', '_*.sass']) + ctx.ignore_patterns += ['_*.scss', '_*.sass'] def getDependencies(self, path): if _is_include_only(path):