Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: trunk/src/mojo/public/tools/bindings/pylib/mojom/generate/template_expander.py

Issue 354833003: Revert 279677 "Generate java bindings for structs." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/src/mojo/public/tools/bindings/pylib/mojom/generate/generator.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « trunk/src/mojo/public/tools/bindings/pylib/mojom/generate/generator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698