Mercurial > piecrust2
view piecrust/templating/base.py @ 877:d6d35b2efd04
bake: Rename "pass" to "step" and make the page pipeline use different steps.
That pipeline is now first loading all pages, and then rendering full pages
unless they trigger a sub-render.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 15 Jun 2017 22:16:23 -0700 |
parents | 96d363e2da4b |
children | 1bb704434ee2 |
line wrap: on
line source
class TemplateNotFoundError(Exception): pass class TemplatingError(Exception): def __init__(self, message, filename=None, lineno=-1): super(TemplatingError, self).__init__() self.message = message self.filename = filename self.lineno = lineno def __str__(self): msg = '' if self.filename: msg += self.filename if self.lineno >= 0: msg += ', line %d' % self.lineno msg += ': ' + self.message return msg class TemplateEngine(object): EXTENSIONS = [] def initialize(self, app): self.app = app def renderSegmentPart(self, path, seg_part, data): raise NotImplementedError() def renderFile(self, paths, data): raise NotImplementedError()