How about this?
diff --git a/web/contrib/template.py b/web/contrib/template.py
index 2642d65..7495d39 100644
--- a/web/contrib/template.py
+++ b/web/contrib/template.py
@@ -82,8 +82,12 @@ class render_jinja:
render.hello(name='jinja2')
"""
def __init__(self, *a, **kwargs):
+ extensions = kwargs.pop('extensions', [])
+ globals = kwargs.pop('globals', {})
+
from jinja2 import Environment,FileSystemLoader
- self._lookup = Environment(loader=FileSystemLoader(*a, **kwargs))
+ self._lookup = Environment(loader=FileSystemLoader(*a,
**kwargs), extensions=extensions)
+ self._lookup.globals.update(globals)
def __getattr__(self, name):
# Assuming all templates end with .html
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---