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

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

Issue 1423213002: Fix the path for modules before passing them to the generator. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « mojo/public/tools/bindings/invoke_code_generators.py ('k') | no next file » | 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 325246d59a1660156d4164d490402d0880bf874a..69a364d734fe8539921b21a4b226cd49474665e2 100755
--- a/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py
+++ b/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py
@@ -61,8 +61,9 @@ class FileTranslator(object):
mod.imports = []
if mojom_file.imports:
mod.imports = [self.ImportFromMojom(imp) for imp in mojom_file.imports]
- # TODO(azani): The key should be equal to SourceFileInfo.file_name of
- # imported types.
+ # When translating an imported type, its SourceFileInfo.file_name is a key
+ # into self._imports. The value is the module from which the type was
+ # imported.
self._imports = {imp['module'].path: imp for imp in mod.imports}
if mojom_file.declared_mojom_objects:
@@ -94,7 +95,6 @@ class FileTranslator(object):
mojom_file: {MojomFile} the file to be translated.
"""
mod.name = os.path.basename(mojom_file.file_name)
- # TODO(azani): Fix the path here!
mod.path = mojom_file.file_name
mod.namespace = mojom_file.module_namespace
if mojom_file.attributes:
« no previous file with comments | « mojo/public/tools/bindings/invoke_code_generators.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698