comparison piecrust/sources/prose.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 65db6df28120
children f070a4fc033c
comparison
equal deleted inserted replaced
851:2c7e57d80bba 852:4850f8c21b6e
1 import os 1 import os
2 import os.path 2 import os.path
3 import copy 3 import copy
4 import logging 4 import logging
5 from piecrust.sources.base import MODE_CREATING, MODE_PARSING 5 from piecrust.sources.default import DefaultContentSource
6 from piecrust.sources.default import DefaultPageSource
7 6
8 7
9 logger = logging.getLogger(__name__) 8 logger = logging.getLogger(__name__)
10 9
11 10
12 class ProseSource(DefaultPageSource): 11 class ProseSource(DefaultContentSource):
13 SOURCE_NAME = 'prose' 12 SOURCE_NAME = 'prose'
14 13
15 def __init__(self, app, name, config): 14 def __init__(self, app, name, config):
16 super(ProseSource, self).__init__(app, name, config) 15 super(ProseSource, self).__init__(app, name, config)
17 self.config_recipe = config.get('config', {}) 16 self.config_recipe = config.get('config', {})