From d8a27f5d7621fa452f83d6aa091edae5d7a58556 Mon Sep 17 00:00:00 2001 From: Mike Bayer <mike_mp@zzzcomputing.com> Date: Mon, 9 Apr 2007 15:49:30 +0000 Subject: [PATCH] - TGPlugin passes options to string-based templates [ticket:35] --- CHANGES | 1 + lib/mako/ext/turbogears.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index ef8c322..3d22ea3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,7 @@ 0.1.6 - fix to module_directory path generation when the path is "./" [ticket:34] +- TGPlugin passes options to string-based templates [ticket:35] 0.1.5 - AST expression generation - added in just about everything diff --git a/lib/mako/ext/turbogears.py b/lib/mako/ext/turbogears.py index e550332..c98893e 100644 --- a/lib/mako/ext/turbogears.py +++ b/lib/mako/ext/turbogears.py @@ -18,12 +18,13 @@ class TGPlugin(object): tmpl_options[k[5:]] = v elif k in ['directories', 'filesystem_checks', 'module_directory']: tmpl_options[k] = v + self.tmpl_options = tmpl_options self.lookup = TemplateLookup(**tmpl_options) def load_template(self, templatename, template_string=None): """Loads a template from a file or a string""" if template_string is not None: - return Template(template_string) + return Template(template_string, **self.tmpl_options) # Translate TG dot notation to normal / template path if '/' not in templatename and '.' not in templatename: templatename = '/' + templatename.replace('.', '/') + '.' + self.extension -- GitLab