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

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

Issue 159983003: Fix a bug with mojom imports where 2 imports with the same namespace would (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 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
« no previous file with comments | « mojo/public/bindings/mojom_bindings_generator.py ('k') | mojo/public/bindings/pylib/generate/mojom_data.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/bindings/pylib/generate/mojom.py
diff --git a/mojo/public/bindings/pylib/generate/mojom.py b/mojo/public/bindings/pylib/generate/mojom.py
index 98f7224d8838af45ed1afa48f257da15617a4387..4e8ef13f1767b0ab2a4fba77d074c432b2c07c4d 100644
--- a/mojo/public/bindings/pylib/generate/mojom.py
+++ b/mojo/public/bindings/pylib/generate/mojom.py
@@ -69,7 +69,7 @@ class Field(object):
class Struct(Kind):
def __init__(self, name = None):
self.name = name
- self.imported_from_namespace = None
+ self.imported_from = None
if name != None:
spec = 'x:' + name
else:
@@ -78,11 +78,11 @@ class Struct(Kind):
self.fields = []
@classmethod
- def CreateFromImport(cls, kind, import_namespace):
+ def CreateFromImport(cls, kind, imported_from):
"""Used with 'import module' - clones the kind imported from the
given module's namespace."""
kind = copy.deepcopy(kind)
- kind.imported_from_namespace = import_namespace
+ kind.imported_from = imported_from
return kind
def AddField(self, name, kind, ordinal = None, default = None):
@@ -92,16 +92,16 @@ class Struct(Kind):
def GetFullName(self, separator):
"""Returns the fully qualified type name, including namespace prefix."""
- if self.imported_from_namespace:
- return separator.join([self.imported_from_namespace, self.name])
+ if self.imported_from:
+ return separator.join([self.imported_from["namespace"], self.name])
return self.name
def GetFullNameInternal(self, separator):
"""Returns the fully qualified type name for an internal data structure,
including namespace prefix."""
- if self.imported_from_namespace:
+ if self.imported_from:
return separator.join(
- [self.imported_from_namespace, "internal", self.name])
+ [self.imported_from["namespace"], "internal", self.name])
return self.name
« no previous file with comments | « mojo/public/bindings/mojom_bindings_generator.py ('k') | mojo/public/bindings/pylib/generate/mojom_data.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698