Index: mojo/public/tools/bindings/generators/python_templates/module.py.tmpl |
diff --git a/mojo/public/tools/bindings/generators/python_templates/module.py.tmpl b/mojo/public/tools/bindings/generators/python_templates/module.py.tmpl |
index aa631d92fe6016ef5b2961f4efc27b6c929041d2..86ecf93104185592f4344ab9c2a5666db886ce74 100644 |
--- a/mojo/public/tools/bindings/generators/python_templates/module.py.tmpl |
+++ b/mojo/public/tools/bindings/generators/python_templates/module.py.tmpl |
@@ -3,6 +3,7 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
+import mojo.bindings.descriptor as _descriptor |
import mojo.bindings.reflection as _reflection |
{% if imports %} |
@@ -42,5 +43,14 @@ class {{struct|name}}(object): |
{% endfor %} |
}, |
{% endif %} |
+{% if struct.fields %} |
+ 'fields': [ |
+{% for byte in struct.bytes %} |
+{% for packed_field in byte.packed_fields %} |
+ {{packed_field|field_descriptor}}, |
+{% endfor %} |
+{% endfor %} |
+ ], |
+{% endif %} |
} |
{% endfor %} |