Mercurial > piecrust2
changeset 826:7f235e65ef5d
Allow PageSource to provide a custom assetor
author | Ben Artin <ben@artins.org> |
---|---|
date | Sun, 01 Jan 2017 18:02:13 -0500 |
parents | 82509bce94ca |
children | 570f89414b2c |
files | piecrust/data/builder.py piecrust/sources/base.py |
diffstat | 2 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/piecrust/data/builder.py Tue Dec 20 22:20:18 2016 -0800 +++ b/piecrust/data/builder.py Sun Jan 01 18:02:13 2017 -0500 @@ -1,6 +1,5 @@ import logging from werkzeug.utils import cached_property -from piecrust.data.assetor import Assetor from piecrust.data.base import MergedMapping from piecrust.data.linker import PageLinkerData from piecrust.data.pagedata import PageData @@ -40,7 +39,7 @@ paginator = Paginator(page, pgn_source, page_num=ctx.page_num, pgn_filter=ctx.pagination_filter) - assetor = Assetor(page, first_uri) + assetor = page.source.buildPageAssetor(page, first_uri) linker = PageLinkerData(page.source, page.rel_path) data = { 'piecrust': pc_data,
--- a/piecrust/sources/base.py Tue Dec 20 22:20:18 2016 -0800 +++ b/piecrust/sources/base.py Sun Jan 01 18:02:13 2017 -0500 @@ -3,6 +3,7 @@ from werkzeug.utils import cached_property from piecrust.configuration import ConfigurationError from piecrust.page import Page +from piecrust.data.assetor import Assetor REALM_USER = 0 @@ -136,3 +137,6 @@ return self._provider_type(self, page, override) + def buildPageAssetor(self, page, uri): + return Assetor(page, uri) +