| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2012, 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 module provides shared functionality for the system to generate | 6 """This module provides shared functionality for the system to generate |
| 7 Dart:html APIs from the IDL database.""" | 7 Dart:html APIs from the IDL database.""" |
| 8 | 8 |
| 9 import emitter | 9 import emitter |
| 10 import os | 10 import os |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 self.factory_provider_name = factory_provider_name | 75 self.factory_provider_name = factory_provider_name |
| 76 | 76 |
| 77 def ConstructorInfo(self, interface_name): | 77 def ConstructorInfo(self, interface_name): |
| 78 info = OperationInfo() | 78 info = OperationInfo() |
| 79 info.overloads = None | 79 info.overloads = None |
| 80 info.declared_name = interface_name | 80 info.declared_name = interface_name |
| 81 info.name = interface_name | 81 info.name = interface_name |
| 82 info.constructor_name = self.name | 82 info.constructor_name = self.name |
| 83 info.js_name = None | 83 info.js_name = None |
| 84 info.type_name = interface_name | 84 info.type_name = interface_name |
| 85 info.param_infos = map(lambda tXn: ParamInfo(tXn[1], None, tXn[0], 'null'), | 85 info.param_infos = map(lambda tXn: ParamInfo(tXn[1], None, tXn[0], True), |
| 86 self.opt_params) | 86 self.opt_params) |
| 87 return info | 87 return info |
| 88 | 88 |
| 89 _html_element_constructors = { | 89 _html_element_constructors = { |
| 90 'AnchorElement' : | 90 'AnchorElement' : |
| 91 ElementConstructorInfo(tag='a', opt_params=[('DOMString', 'href')]), | 91 ElementConstructorInfo(tag='a', opt_params=[('DOMString', 'href')]), |
| 92 'AreaElement': 'area', | 92 'AreaElement': 'area', |
| 93 'ButtonElement': 'button', | 93 'ButtonElement': 'button', |
| 94 'BRElement': 'br', | 94 'BRElement': 'br', |
| 95 'BaseElement': 'base', | 95 'BaseElement': 'base', |
| (...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1124 | 1124 |
| 1125 library_emitter = self._multiemitter.FileEmitter(library_file_path) | 1125 library_emitter = self._multiemitter.FileEmitter(library_file_path) |
| 1126 library_file_dir = os.path.dirname(library_file_path) | 1126 library_file_dir = os.path.dirname(library_file_path) |
| 1127 auxiliary_dir = os.path.relpath(auxiliary_dir, library_file_dir) | 1127 auxiliary_dir = os.path.relpath(auxiliary_dir, library_file_dir) |
| 1128 imports_emitter = library_emitter.Emit( | 1128 imports_emitter = library_emitter.Emit( |
| 1129 self._template, AUXILIARY_DIR=massage_path(auxiliary_dir)) | 1129 self._template, AUXILIARY_DIR=massage_path(auxiliary_dir)) |
| 1130 for path in sorted(self._path_to_emitter.keys()): | 1130 for path in sorted(self._path_to_emitter.keys()): |
| 1131 relpath = os.path.relpath(path, library_file_dir) | 1131 relpath = os.path.relpath(path, library_file_dir) |
| 1132 imports_emitter.Emit( | 1132 imports_emitter.Emit( |
| 1133 "#source('$PATH');\n", PATH=massage_path(relpath)) | 1133 "#source('$PATH');\n", PATH=massage_path(relpath)) |
| OLD | NEW |