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

Unified Diff: third_party/mojo/src/mojo/public/tools/bindings/generators/mojom_python_generator.py

Issue 910883002: Update mojo sdk to rev 8af2ccff2eee4bfca1043015abee30482a030b30 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Apply 9f87aeadbda22441b7d469e596f7bd7d0d73e2a8 (https://codereview.chromium.org/908973002/) Created 5 years, 10 months 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 side-by-side diff with in-line comments
Download patch
Index: third_party/mojo/src/mojo/public/tools/bindings/generators/mojom_python_generator.py
diff --git a/third_party/mojo/src/mojo/public/tools/bindings/generators/mojom_python_generator.py b/third_party/mojo/src/mojo/public/tools/bindings/generators/mojom_python_generator.py
index f8a70579ad0054948246ef51e07283ecc4014cf9..d4d4ed7e5d723eabd5f6528d9f714d43b6033dcb 100644
--- a/third_party/mojo/src/mojo/public/tools/bindings/generators/mojom_python_generator.py
+++ b/third_party/mojo/src/mojo/public/tools/bindings/generators/mojom_python_generator.py
@@ -191,14 +191,6 @@ def GetFieldGroup(byte):
assert len(byte.packed_fields) == 1
return GetFieldDescriptor(byte.packed_fields[0])
-def GetResponseStructFromMethod(method):
- return generator.GetDataHeader(
- False, generator.GetResponseStructFromMethod(method))
-
-def GetStructFromMethod(method):
- return generator.GetDataHeader(
- False, generator.GetStructFromMethod(method))
-
def ComputeStaticValues(module):
in_progress = set()
computed = set()
@@ -287,8 +279,8 @@ class Generator(generator.Generator):
'field_group': GetFieldGroup,
'fully_qualified_name': GetFullyQualifiedName,
'name': GetNameForElement,
- 'response_struct_from_method': GetResponseStructFromMethod,
- 'struct_from_method': GetStructFromMethod,
+ 'response_struct_from_method': generator.GetResponseStructFromMethod,
+ 'struct_from_method': generator.GetStructFromMethod,
}
@UseJinja('python_templates/module.py.tmpl', filters=python_filters)
@@ -296,7 +288,7 @@ class Generator(generator.Generator):
return {
'enums': self.module.enums,
'imports': self.GetImports(),
- 'interfaces': self.GetQualifiedInterfaces(),
+ 'interfaces': self.module.interfaces,
'module': ComputeStaticValues(self.module),
'namespace': self.module.namespace,
'structs': self.GetStructs(),
@@ -312,26 +304,6 @@ class Generator(generator.Generator):
each['python_module'] = MojomToPythonImport(each['module_name'])
return self.module.imports
- def GetQualifiedInterfaces(self):
- """
- Returns the list of interfaces of the module. Each interface that has a
- client will have a reference to the representation of the client interface
- in the 'qualified_client' field.
- """
- interfaces = self.module.interfaces
- all_interfaces = [] + interfaces
- for each in self.GetImports():
- all_interfaces += [data.KindFromImport(x, each) for x in
- each['module'].interfaces];
- interfaces_by_name = dict((x.name, x) for x in all_interfaces)
- for interface in interfaces:
- if interface.client:
- assert interface.client in interfaces_by_name, (
- 'Unable to find interface %s declared as client of %s.' %
- (interface.client, interface.name))
- interface.qualified_client = interfaces_by_name[interface.client]
- return sorted(interfaces, key=lambda i: (bool(i.client), i.name))
-
def GetJinjaParameters(self):
return {
'lstrip_blocks': True,

Powered by Google App Engine
This is Rietveld 408576698