Mercurial > piecrust2
diff piecrust/sources/base.py @ 854:08e02c2a2a1a
core: Keep refactoring, this time to prepare for generator sources.
- Make a few APIs simpler.
- Content pipelines create their own jobs, so that generator sources can
keep aborting in `getContents`, but rely on their pipeline to generate
pages for baking.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 04 Jun 2017 23:34:28 -0700 |
parents | f070a4fc033c |
children | 448710d84121 |
line wrap: on
line diff
--- a/piecrust/sources/base.py Sun May 21 00:06:59 2017 -0700 +++ b/piecrust/sources/base.py Sun Jun 04 23:34:28 2017 -0700 @@ -13,7 +13,10 @@ # Types of relationships a content source can be asked for. -REL_ASSETS = 1 +REL_PARENT_GROUP = 1 +REL_LOGICAL_PARENT_ITEM = 2 +REL_LOGICAl_CHILD_GROUP = 3 +REL_ASSETS = 10 logger = logging.getLogger(__name__) @@ -43,10 +46,13 @@ """ Describes a piece of content. Some known metadata that PieCrust will use include: - - `route_params`: A dictionary of route parameters to generate - the URL to the content. - - `config`: A dictionary of configuration settings to merge - into the settings found in the content itself. + - `date`: A `datetime.date` object that will set the date of the page. + - `datetime`: A `datetime.datetime` object that will set the date and + time of the page. + - `route_params`: A dictionary of route parameters to generate the + URL to the content. + - `config`: A dictionary of configuration settings to merge into the + settings found in the content itself. """ def __init__(self, spec, metadata): self.spec = spec @@ -72,6 +78,8 @@ class ContentSource: """ A source for content. """ + DEFAULT_PIPELINE_NAME = None + def __init__(self, app, name, config): self.app = app self.name = name