Modified Generator Base Class in order to pass custom Jinja filters in

settings.py
This commit is contained in:
Alessandro Martin 2011-04-12 02:17:42 +08:00 committed by Alexis Metaireau
commit c421956cd9

View file

@ -36,6 +36,10 @@ class Generator(object):
extensions=self.settings.get('JINJA_EXTENSIONS', []), extensions=self.settings.get('JINJA_EXTENSIONS', []),
) )
# get custom Jinja filters from user settings
custom_filters = self.settings.get('JINJA_FILTERS', {})
self._env.filters.update(custom_filters)
def get_template(self, name): def get_template(self, name):
"""Return the template by name. """Return the template by name.
Use self.theme to get the templates to use, and return a list of Use self.theme to get the templates to use, and return a list of