Skip to content
Browse files

Fixed typo in the formatter engine and engine options are now passed …

…to the template loader for mako templates.
  • Loading branch information...
1 parent 9e654bc commit f2ffefccc43eba0934eaa2add5e56ac5a10c206a @amcgregor amcgregor committed
4 marrow/templating/template/
@@ -42,8 +42,8 @@ class FormatterEngine(Engine):
def render(self, template, data, **options):
"""Implemented by a sub-class, this returns the 2-tuple of mimetype and unicode content."""
- return options.get('content_type', b'text/plain', renderer.vformat(
+ return options.get('content_type', b'text/plain'), renderer.vformat(
data if not isinstance(data, dict) else tuple(),
data if isinstance(data, dict) else dict()
- ))
+ )
7 marrow/templating/template/
@@ -20,14 +20,15 @@
class Mako(Engine):
def prepare(self, filename, **options):
- return self.get_template(filename)
+ return self.get_template(filename, dict(options))
def render(self, template, data, **options):
return options.get('content_type', b'text/html'), template.render_unicode(**data)
- def get_template(self, uri):
+ def get_template(self, uri, options):
filename = resolve(uri)[1]
- return Template(filename=filename, lookup=self)
+ options.pop('content_type', None)
+ return Template(filename=filename, lookup=self, **options)
def adjust_uri(self, uri, relativeto):
return uri

0 comments on commit f2ffefc

Please sign in to comment.
Something went wrong with that request. Please try again.