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

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

Issue 1508613003: Require an explicit ServiceName annotation for interfaces in Python. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « mojo/public/python/mojo_bindings/interface_reflection.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 {% from "module_macros.tmpl" import enum_values %} 1 {% from "module_macros.tmpl" import enum_values %}
2 {% from "module_macros.tmpl" import struct_descriptor %} 2 {% from "module_macros.tmpl" import struct_descriptor %}
3 {% from "module_macros.tmpl" import union_descriptor %} 3 {% from "module_macros.tmpl" import union_descriptor %}
4 # Copyright 2014 The Chromium Authors. All rights reserved. 4 # Copyright 2014 The Chromium Authors. All rights reserved.
5 # Use of this source code is governed by a BSD-style license that can be 5 # Use of this source code is governed by a BSD-style license that can be
6 # found in the LICENSE file. 6 # found in the LICENSE file.
7 7
8 import mojo_bindings.descriptor as _descriptor 8 import mojo_bindings.descriptor as _descriptor
9 import mojo_bindings.reflection as _reflection 9 import mojo_bindings.reflection as _reflection
10 {% if interfaces %} 10 {% if interfaces %}
(...skipping 29 matching lines...) Expand all
40 class {{union|name}}(object): 40 class {{union|name}}(object):
41 __metaclass__ = _reflection.MojoUnionType 41 __metaclass__ = _reflection.MojoUnionType
42 DESCRIPTOR = {{union_descriptor(union)|indent(2)}} 42 DESCRIPTOR = {{union_descriptor(union)|indent(2)}}
43 {% endfor %} 43 {% endfor %}
44 44
45 {% for interface in interfaces %} 45 {% for interface in interfaces %}
46 46
47 class {{interface|name}}(object): 47 class {{interface|name}}(object):
48 __metaclass__ = _interface_reflection.MojoInterfaceType 48 __metaclass__ = _interface_reflection.MojoInterfaceType
49 DESCRIPTOR = { 49 DESCRIPTOR = {
50 'fully_qualified_name': '{% if namespace %}{{namespace|replace(".","::")}}:: {% endif %}{{interface|fully_qualified_name|replace(".","::")}}', 50 'fully_qualified_name': {% if interface.service_name %}'{{interface.service_ name}}'{% else %}None{% endif %},
51 'version': {{interface.version}}, 51 'version': {{interface.version}},
52 'methods': [ 52 'methods': [
53 {% for method in interface.methods %} 53 {% for method in interface.methods %}
54 { 54 {
55 'name': '{{method|name}}', 55 'name': '{{method|name}}',
56 'ordinal': {{method.ordinal}}, 56 'ordinal': {{method.ordinal}},
57 'parameters': {{struct_descriptor(method.param_struct)|indent(8)}}, 57 'parameters': {{struct_descriptor(method.param_struct)|indent(8)}},
58 {% if method.response_parameters != None %} 58 {% if method.response_parameters != None %}
59 'responses': {{struct_descriptor(method.response_param_struct)|indent(8) }}, 59 'responses': {{struct_descriptor(method.response_param_struct)|indent(8) }},
60 {% endif %} 60 {% endif %}
61 }, 61 },
62 {% endfor %} 62 {% endfor %}
63 ], 63 ],
64 } 64 }
65 {% endfor %} 65 {% endfor %}
OLDNEW
« no previous file with comments | « mojo/public/python/mojo_bindings/interface_reflection.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698