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

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

Issue 683583002: Update mojo sdk to rev e083961bf11fd0c94d40be8853761da529b6d444 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: geolocation Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 {%- macro enum_values(enum) -%} 5 {%- macro enum_values(enum) -%}
6 [ 6 [
7 {% for field in enum.fields %} 7 {% for field in enum.fields %}
8 ('{{field.name}}', {{field.computed_value}}), 8 ('{{field.name}}', {{field.computed_value}}),
9 {% endfor %} 9 {% endfor %}
10 ] 10 ]
11 {%- endmacro -%} 11 {%- endmacro -%}
12
13 {%- macro struct_descriptor(struct) -%}
14 {
15 {% if struct.constants %}
16 'constants': {
17 {% for constant in struct.constants %}
18 '{{constant|name}}': {{constant.value|expression_to_text}},
19 {% endfor %}
20 },
21 {% endif %}
22 {% if struct.enums %}
23 'enums': {
24 {% for enum in struct.enums %}
25 '{{enum|name}}': {{enum_values(enum)|indent(6)}},
26 {% endfor %}
27 },
28 {% endif %}
29 {% if struct.fields %}
30 'fields': [
31 {% for byte in struct.bytes %}
32 {% if byte.packed_fields %}
33 {{byte|field_group}},
34 {% endif %}
35 {% endfor %}
36 ],
37 {% endif %}
38 }
39 {%- endmacro -%}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698