| 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 import database | 6 import database |
| 7 import databasebuilder | 7 import databasebuilder |
| 8 import idlparser | 8 import idlparser |
| 9 import logging.config | 9 import logging.config |
| 10 import os.path | 10 import os.path |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 'DOMApplicationCache': 'ApplicationCache', | 124 'DOMApplicationCache': 'ApplicationCache', |
| 125 'DOMCoreException': 'DOMException', | 125 'DOMCoreException': 'DOMException', |
| 126 'DOMFormData': 'FormData', | 126 'DOMFormData': 'FormData', |
| 127 'DOMSelection': 'Selection', | 127 'DOMSelection': 'Selection', |
| 128 'DOMWindow': 'Window', | 128 'DOMWindow': 'Window', |
| 129 'SharedWorkerContext': 'SharedWorkerGlobalScope', | 129 'SharedWorkerContext': 'SharedWorkerGlobalScope', |
| 130 'WorkerContext': 'WorkerGlobalScope', | 130 'WorkerContext': 'WorkerGlobalScope', |
| 131 }) | 131 }) |
| 132 | 132 |
| 133 # Import WebKit IDLs. | 133 # Import WebKit IDLs. |
| 134 for file_name in idl_files: | 134 builder.import_idl_files(idl_files, webkit_options) |
| 135 builder.import_idl_file(file_name, webkit_options) | |
| 136 | 135 |
| 137 # Import Dart idl: | 136 # Import Dart idl: |
| 138 dart_options = databasebuilder.DatabaseBuilderOptions( | 137 dart_options = databasebuilder.DatabaseBuilderOptions( |
| 139 idl_syntax=idlparser.FREMONTCUT_SYNTAX, | 138 idl_syntax=idlparser.FREMONTCUT_SYNTAX, |
| 140 source='Dart', | 139 source='Dart', |
| 141 rename_operation_arguments_on_merge=True) | 140 rename_operation_arguments_on_merge=True) |
| 142 | 141 |
| 143 builder.import_idl_file( | 142 builder.import_idl_files( |
| 144 os.path.join(current_dir, '..', 'idl', 'dart', 'dart.idl'), | 143 [ os.path.join(current_dir, '..', 'idl', 'dart', 'dart.idl') ], |
| 145 dart_options) | 144 dart_options) |
| 146 | 145 |
| 147 # Merging: | 146 # Merging: |
| 148 builder.merge_imported_interfaces() | 147 builder.merge_imported_interfaces() |
| 149 | 148 |
| 150 builder.fetch_constructor_data(webkit_options) | 149 builder.fetch_constructor_data(webkit_options) |
| 151 builder.fix_displacements('WebKit') | 150 builder.fix_displacements('WebKit') |
| 152 | 151 |
| 153 # Cleanup: | 152 # Cleanup: |
| 154 builder.normalize_annotations(['WebKit', 'Dart']) | 153 builder.normalize_annotations(['WebKit', 'Dart']) |
| 155 | 154 |
| 156 db.Save() | 155 db.Save() |
| 156 return db |
| 157 | 157 |
| 158 def main(): | 158 def main(): |
| 159 current_dir = os.path.dirname(__file__) | 159 current_dir = os.path.dirname(__file__) |
| 160 | 160 |
| 161 webkit_dirs = [ | 161 webkit_dirs = [ |
| 162 'css', | 162 'css', |
| 163 'dom', | 163 'dom', |
| 164 'fileapi', | 164 'fileapi', |
| 165 'html', | 165 'html', |
| 166 'html/canvas', | 166 'html/canvas', |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 | 208 |
| 209 for dir_name in webkit_dirs: | 209 for dir_name in webkit_dirs: |
| 210 dir_path = os.path.join(webcore_dir, dir_name) | 210 dir_path = os.path.join(webcore_dir, dir_name) |
| 211 os.path.walk(dir_path, visitor, None) | 211 os.path.walk(dir_path, visitor, None) |
| 212 | 212 |
| 213 database_dir = os.path.join(current_dir, '..', 'database') | 213 database_dir = os.path.join(current_dir, '..', 'database') |
| 214 return build_database(idl_files, database_dir) | 214 return build_database(idl_files, database_dir) |
| 215 | 215 |
| 216 if __name__ == '__main__': | 216 if __name__ == '__main__': |
| 217 sys.exit(main()) | 217 sys.exit(main()) |
| OLD | NEW |