| OLD | NEW |
| 1 {% from "module_macros.tmpl" import enum_values %} | 1 {% from "module_macros.tmpl" import enum_values %} |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import mojo.bindings.descriptor as _descriptor |
| 6 import mojo.bindings.reflection as _reflection | 7 import mojo.bindings.reflection as _reflection |
| 7 {% if imports %} | 8 {% if imports %} |
| 8 | 9 |
| 9 {% for import in imports %} | 10 {% for import in imports %} |
| 10 import {{import.python_module}} | 11 import {{import.python_module}} |
| 11 {% endfor %} | 12 {% endfor %} |
| 12 {% endif %} | 13 {% endif %} |
| 13 {#--- Constants #} | 14 {#--- Constants #} |
| 14 {% if module.constants %} | 15 {% if module.constants %} |
| 15 | 16 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 35 {% endfor %} | 36 {% endfor %} |
| 36 }, | 37 }, |
| 37 {% endif %} | 38 {% endif %} |
| 38 {% if struct.enums %} | 39 {% if struct.enums %} |
| 39 'enums': { | 40 'enums': { |
| 40 {% for enum in struct.enums %} | 41 {% for enum in struct.enums %} |
| 41 '{{enum|name}}': {{enum_values(enum)|indent(6)}}, | 42 '{{enum|name}}': {{enum_values(enum)|indent(6)}}, |
| 42 {% endfor %} | 43 {% endfor %} |
| 43 }, | 44 }, |
| 44 {% endif %} | 45 {% endif %} |
| 46 {% if struct.fields %} |
| 47 'fields': [ |
| 48 {% for byte in struct.bytes %} |
| 49 {% for packed_field in byte.packed_fields %} |
| 50 {{packed_field|field_descriptor}}, |
| 51 {% endfor %} |
| 52 {% endfor %} |
| 53 ], |
| 54 {% endif %} |
| 45 } | 55 } |
| 46 {% endfor %} | 56 {% endfor %} |
| OLD | NEW |