Chromium Code Reviews| Index: mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py |
| diff --git a/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py b/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py |
| index 3bf13715bbce637de57c6b7297c3ed55905af747..75de1163f962cbf61ede4a7bd30342d9a8ae0012 100755 |
| --- a/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py |
| +++ b/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py |
| @@ -393,12 +393,16 @@ class FileTranslator(object): |
| == mojom_types_mojom.UserDefinedType.Tags.interface_type) |
| mojom_interface = mojom_type.interface_type |
| interface.attributes = self.AttributesFromMojom(mojom_interface) |
| - interface.service_name = None |
| - if interface.attributes: |
| - interface.service_name = interface.attributes.get('ServiceName') |
| self.PopulateModuleOrImportedFrom(interface, mojom_interface) |
| - interface.name = mojom_interface.interface_name |
| + interface.name = mojom_interface.decl_data.short_name |
| interface.spec = interface.name |
| + interface.service_name = mojom_interface.service_name |
| + if interface.attributes: |
| + assert interface.service_name == interface.attributes.get( |
| + 'ServiceName', None), interface.service_name |
| + else: |
| + assert interface.service_name == None, interface.service_name |
|
azani
2016/02/10 00:06:39
standard python practice is to use: is None instea
rudominer
2016/02/10 00:43:49
Done.
|
| + |
| # Translate the dictionary of methods into a list of module.Methods. |
| # In order to have a deterministic ordering we sort by method ordinal. |