comparison piecrust/sources/base.py @ 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 58ebf50235a5
children a12ad254176e
comparison
equal deleted inserted replaced
812:82509bce94ca 826:7f235e65ef5d
1 import copy 1 import copy
2 import logging 2 import logging
3 from werkzeug.utils import cached_property 3 from werkzeug.utils import cached_property
4 from piecrust.configuration import ConfigurationError 4 from piecrust.configuration import ConfigurationError
5 from piecrust.page import Page 5 from piecrust.page import Page
6 from piecrust.data.assetor import Assetor
6 7
7 8
8 REALM_USER = 0 9 REALM_USER = 0
9 REALM_THEME = 1 10 REALM_THEME = 1
10 REALM_NAMES = { 11 REALM_NAMES = {
134 "Unknown data provider type: %s" % self.data_type) 135 "Unknown data provider type: %s" % self.data_type)
135 self._provider_type = cls 136 self._provider_type = cls
136 137
137 return self._provider_type(self, page, override) 138 return self._provider_type(self, page, override)
138 139
140 def buildPageAssetor(self, page, uri):
141 return Assetor(page, uri)
142