Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 """This is the entry point to create Dart APIs from the IDL database.""" | 6 """This is the entry point to create Dart APIs from the IDL database.""" |
| 7 | 7 |
| 8 import dartgenerator | 8 import dartgenerator |
| 9 import database | 9 import database |
| 10 import logging.config | 10 import logging.config |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 template_dir=os.path.join(current_dir, '..', 'templates'), | 79 template_dir=os.path.join(current_dir, '..', 'templates'), |
| 80 base_package='') | 80 base_package='') |
| 81 generator.LoadAuxiliary() | 81 generator.LoadAuxiliary() |
| 82 | 82 |
| 83 common_database = database.Database(database_dir) | 83 common_database = database.Database(database_dir) |
| 84 if use_database_cache: | 84 if use_database_cache: |
| 85 common_database.LoadFromCache() | 85 common_database.LoadFromCache() |
| 86 else: | 86 else: |
| 87 common_database.Load() | 87 common_database.Load() |
| 88 | 88 |
| 89 generator.RenameTypes(common_database, { | |
|
Anton Muhin
2012/04/17 10:57:59
nice!
| |
| 90 # W3C -> Dart renames | |
| 91 'AbstractView': 'Window', | |
| 92 'Function': 'EventListener', | |
| 93 }, True) | |
| 94 | |
| 95 generator.FilterMembersWithUnidentifiedTypes(common_database) | 89 generator.FilterMembersWithUnidentifiedTypes(common_database) |
| 96 webkit_database = common_database.Clone() | 90 webkit_database = common_database.Clone() |
| 97 | 91 |
| 98 # Generate Dart interfaces for the WebKit DOM. | 92 # Generate Dart interfaces for the WebKit DOM. |
| 99 generator.FilterInterfaces(database = webkit_database, | 93 generator.FilterInterfaces(database = webkit_database, |
| 100 or_annotations = ['WebKit', 'Dart'], | 94 or_annotations = ['WebKit', 'Dart'], |
| 101 exclude_displaced = ['WebKit'], | 95 exclude_displaced = ['WebKit'], |
| 102 exclude_suppressed = ['WebKit', 'Dart']) | 96 exclude_suppressed = ['WebKit', 'Dart']) |
| 103 generator.RenameTypes(webkit_database, _webkit_renames, True) | 97 generator.RenameTypes(webkit_database, _webkit_renames, True) |
| 104 | 98 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 185 database_dir, use_database_cache) | 179 database_dir, use_database_cache) |
| 186 | 180 |
| 187 if html_systems: | 181 if html_systems: |
| 188 output_dir = options.output_dir or os.path.join(current_dir, | 182 output_dir = options.output_dir or os.path.join(current_dir, |
| 189 '../../html/generated') | 183 '../../html/generated') |
| 190 GenerateDOM(html_systems, True, output_dir, | 184 GenerateDOM(html_systems, True, output_dir, |
| 191 database_dir, use_database_cache or dom_systems) | 185 database_dir, use_database_cache or dom_systems) |
| 192 | 186 |
| 193 if __name__ == '__main__': | 187 if __name__ == '__main__': |
| 194 sys.exit(main()) | 188 sys.exit(main()) |
| OLD | NEW |