comparison piecrust/data/base.py @ 242:f130365568ff

internal: Code reorganization to put less stuff in `sources.base`. Interfaces that sources can implement are in `sources.interfaces`. The default page source is in `sources.default`. The `SimplePageSource` is gone since most subclasses only wanted to do *some* stuff the same, but *lots* of stuff slightly different. I may have to revisit the code to extract exactly the code that's in common.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 18 Feb 2015 18:35:03 -0800
parents eaf18442bff8
children da5e6e00fb41
comparison
equal deleted inserted replaced
241:85a6c7ba5e3b 242:f130365568ff
3 from piecrust.data.assetor import Assetor 3 from piecrust.data.assetor import Assetor
4 from piecrust.uriutil import get_slug 4 from piecrust.uriutil import get_slug
5 5
6 6
7 logger = logging.getLogger(__name__) 7 logger = logging.getLogger(__name__)
8
9
10 class IPaginationSource(object):
11 """ Defines the interface for a source that can be used as the data
12 for an iterator or a pagination.
13 """
14 def getItemsPerPage(self):
15 raise NotImplementedError()
16
17 def getSourceIterator(self):
18 raise NotImplementedError()
19
20 def getSorterIterator(self, it):
21 raise NotImplementedError()
22
23 def getTailIterator(self, it):
24 raise NotImplementedError()
25
26 def getPaginationFilter(self, page):
27 raise NotImplementedError()
28
29 def getSettingAccessor(self):
30 raise NotImplementedError()
31 8
32 9
33 class LazyPageConfigData(object): 10 class LazyPageConfigData(object):
34 """ An object that represents the configuration header of a page, 11 """ An object that represents the configuration header of a page,
35 but also allows for additional data. It's meant to be exposed 12 but also allows for additional data. It's meant to be exposed