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

Unified Diff: mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py

Issue 1418453017: Fix some minor bugs related to imports in the new mojom bindings generator. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix tests. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9323f8a2d43bf80abad382a13b2c4e022dee8c2f..816f42ce82925c94eb2c8423d1df497a5bb24c45 100755
--- a/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py
+++ b/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py
@@ -318,8 +318,11 @@ class FileTranslator(object):
if mojom.decl_data.source_file_info.file_name == self._file_name:
module_type.module = self._module
else:
- module_type.imported_from = self._imports[
+ imported_from = self._imports[
mojom.decl_data.source_file_info.file_name]
+ module_type.imported_from = imported_from
+ module_type.module = imported_from['module']
+
def OrdinalFromMojom(self, mojom):
"""Extracts the declared ordinal from a mojom StructField or UnionField.
@@ -621,6 +624,10 @@ class FileTranslator(object):
self._type_cache[type_key] = module_type
from_mojom(module_type, mojom_type)
+ # module.py expects the spec of user defined types to be set when
+ # constructing map and array types, but the value appears unimportant.
+ module_type.spec = 'dummyspec'
+
return module_type
« no previous file with comments | « no previous file | mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698