comparison piecrust/sources/posts.py @ 6:f5ca5c5bed85

More Python 3 fixes, modularization, and new unit tests.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 16 Aug 2014 08:15:30 -0700
parents 474c9882decf
children 617191dec18e
comparison
equal deleted inserted replaced
5:474c9882decf 6:f5ca5c5bed85
4 import glob 4 import glob
5 import logging 5 import logging
6 import datetime 6 import datetime
7 from piecrust import CONTENT_DIR 7 from piecrust import CONTENT_DIR
8 from piecrust.sources.base import (PageSource, IPreparingSource, 8 from piecrust.sources.base import (PageSource, IPreparingSource,
9 SimplePaginationSourceMixin,
9 PageNotFoundError, InvalidFileSystemEndpointError, 10 PageNotFoundError, InvalidFileSystemEndpointError,
10 PageFactory, MODE_CREATING) 11 PageFactory, MODE_CREATING)
11 12
12 13
13 logger = logging.getLogger(__name__) 14 logger = logging.getLogger(__name__)
14 15
15 16
16 class PostsSource(PageSource, IPreparingSource): 17 class PostsSource(PageSource, IPreparingSource, SimplePaginationSourceMixin):
17 PATH_FORMAT = None 18 PATH_FORMAT = None
18 19
19 def __init__(self, app, name, config): 20 def __init__(self, app, name, config):
20 super(PostsSource, self).__init__(app, name, config) 21 super(PostsSource, self).__init__(app, name, config)
21 self.fs_endpoint = config.get('fs_endpoint', name) 22 self.fs_endpoint = config.get('fs_endpoint', name)