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

Side by Side Diff: mojo/public/tools/bindings/generators/mojom_dart_generator.py

Issue 878883002: Dart: Adjusts class Application for removal of Application/Shell Client= (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « mojo/public/dart/src/application.dart ('k') | services/dart/test/echo.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Generates dart source files from a mojom.Module.""" 5 """Generates dart source files from a mojom.Module."""
6 6
7 import re 7 import re
8 8
9 import mojom.generate.generator as generator 9 import mojom.generate.generator as generator
10 import mojom.generate.module as mojom 10 import mojom.generate.module as mojom
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 413
414 # Since each import is assigned a library in Dart, they need to have 414 # Since each import is assigned a library in Dart, they need to have
415 # unique names. 415 # unique names.
416 unique_name = simple_name 416 unique_name = simple_name
417 counter = 0 417 counter = 0
418 while unique_name in used_names: 418 while unique_name in used_names:
419 counter += 1 419 counter += 1
420 unique_name = simple_name + str(counter) 420 unique_name = simple_name + str(counter)
421 421
422 used_names.add(unique_name) 422 used_names.add(unique_name)
423 each_import["unique_name"] = unique_name 423 each_import["unique_name"] = unique_name + '_mojom'
424 counter += 1 424 counter += 1
425 return self.module.imports 425 return self.module.imports
426 426
427 def GetImportedInterfaces(self): 427 def GetImportedInterfaces(self):
428 interface_to_import = {} 428 interface_to_import = {}
429 for each_import in self.module.imports: 429 for each_import in self.module.imports:
430 for each_interface in each_import["module"].interfaces: 430 for each_interface in each_import["module"].interfaces:
431 name = each_interface.name 431 name = each_interface.name
432 interface_to_import[name] = each_import["unique_name"] + "." + name 432 interface_to_import[name] = each_import["unique_name"] + "." + name
433 return interface_to_import 433 return interface_to_import
434 434
435 def ImportedFrom(self): 435 def ImportedFrom(self):
436 interface_to_import = {} 436 interface_to_import = {}
437 for each_import in self.module.imports: 437 for each_import in self.module.imports:
438 for each_interface in each_import["module"].interfaces: 438 for each_interface in each_import["module"].interfaces:
439 name = each_interface.name 439 name = each_interface.name
440 interface_to_import[name] = each_import["unique_name"] + "." 440 interface_to_import[name] = each_import["unique_name"] + "."
441 return interface_to_import 441 return interface_to_import
OLDNEW
« no previous file with comments | « mojo/public/dart/src/application.dart ('k') | services/dart/test/echo.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698