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

Unified Diff: mojo/public/tools/bindings/generators/python_templates/module_macros.tmpl

Issue 1218023006: Implement python mojo bindings unions. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 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
Index: mojo/public/tools/bindings/generators/python_templates/module_macros.tmpl
diff --git a/mojo/public/tools/bindings/generators/python_templates/module_macros.tmpl b/mojo/public/tools/bindings/generators/python_templates/module_macros.tmpl
index 21c70db3038ed615f53482f0dd94e90ae99b628a..c979f59434ba74a58c054c44f5dc602af0e6ddca 100644
--- a/mojo/public/tools/bindings/generators/python_templates/module_macros.tmpl
+++ b/mojo/public/tools/bindings/generators/python_templates/module_macros.tmpl
@@ -37,3 +37,13 @@
{% endif %}
}
{%- endmacro -%}
+
+{%- macro union_descriptor(union) -%}
+{
+ 'fields': [
+{% for field in union.fields %}
+ {{field|union_field_descriptor}},
+{% endfor %}
+ ],
+ }
+{%- endmacro -%}
« no previous file with comments | « mojo/public/tools/bindings/generators/python_templates/module.py.tmpl ('k') | mojo/python/tests/bindings_unions_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698