Index: trunk/src/mojo/public/tools/bindings/pylib/mojom/generate/template_expander.py |
=================================================================== |
--- trunk/src/mojo/public/tools/bindings/pylib/mojom/generate/template_expander.py (revision 279687) |
+++ trunk/src/mojo/public/tools/bindings/pylib/mojom/generate/template_expander.py (working copy) |
@@ -30,16 +30,12 @@ |
import jinja2 |
-def ApplyTemplate(mojo_generator, base_dir, path_to_template, params, |
- filters=None, **kwargs): |
+def ApplyTemplate(base_dir, path_to_template, params, filters=None, **kwargs): |
template_directory, template_name = os.path.split(path_to_template) |
path_to_templates = os.path.join(base_dir, template_directory) |
loader = jinja2.FileSystemLoader([path_to_templates]) |
- final_kwargs = dict(mojo_generator.GetJinjaParameters()) |
- final_kwargs.update(kwargs) |
jinja_env = jinja2.Environment(loader=loader, keep_trailing_newline=True, |
- **final_kwargs) |
- jinja_env.globals.update(mojo_generator.GetGlobals()); |
+ **kwargs) |
if filters: |
jinja_env.filters.update(filters) |
template = jinja_env.get_template(template_name) |
@@ -52,8 +48,7 @@ |
def RealDecorator(generator): |
def GeneratorInternal(*args, **kwargs2): |
parameters = generator(*args, **kwargs2) |
- return ApplyTemplate(args[0], base_dir, path_to_template, parameters, |
- **kwargs) |
+ return ApplyTemplate(base_dir, path_to_template, parameters, **kwargs) |
GeneratorInternal.func_name = generator.func_name |
return GeneratorInternal |
return RealDecorator |