| 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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 or not html_setter_name) | 451 or not html_setter_name) |
| 452 | 452 |
| 453 # We don't yet handle inconsistent renames of the getter and setter yet. | 453 # We don't yet handle inconsistent renames of the getter and setter yet. |
| 454 assert(not html_setter_name or html_name == html_setter_name) | 454 assert(not html_setter_name or html_name == html_setter_name) |
| 455 | 455 |
| 456 if not is_secondary: | 456 if not is_secondary: |
| 457 self._members_emitter.Emit('\n /** @domName $DOMINTERFACE.$DOMNAME */', | 457 self._members_emitter.Emit('\n /** @domName $DOMINTERFACE.$DOMNAME */', |
| 458 DOMINTERFACE=attribute.doc_js_interface_name, | 458 DOMINTERFACE=attribute.doc_js_interface_name, |
| 459 DOMNAME=dom_name) | 459 DOMNAME=dom_name) |
| 460 if read_only: | 460 if read_only: |
| 461 template = '\n abstract $TYPE get $NAME;\n' | 461 template = '\n $TYPE get $NAME;\n' |
| 462 else: | 462 else: |
| 463 template = '\n $TYPE $NAME;\n' | 463 template = '\n $TYPE $NAME;\n' |
| 464 | 464 |
| 465 self._members_emitter.Emit(template, | 465 self._members_emitter.Emit(template, |
| 466 NAME=html_name, | 466 NAME=html_name, |
| 467 TYPE=SecureOutputType(self, attribute.type.id)) | 467 TYPE=SecureOutputType(self, attribute.type.id)) |
| 468 | 468 |
| 469 self._backend.AddAttribute(attribute, html_name, read_only) | 469 self._backend.AddAttribute(attribute, html_name, read_only) |
| 470 | 470 |
| 471 def AddSecondaryAttribute(self, interface, attribute): | 471 def AddSecondaryAttribute(self, interface, attribute): |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1116 | 1116 |
| 1117 library_emitter = self._multiemitter.FileEmitter(library_file_path) | 1117 library_emitter = self._multiemitter.FileEmitter(library_file_path) |
| 1118 library_file_dir = os.path.dirname(library_file_path) | 1118 library_file_dir = os.path.dirname(library_file_path) |
| 1119 auxiliary_dir = os.path.relpath(auxiliary_dir, library_file_dir) | 1119 auxiliary_dir = os.path.relpath(auxiliary_dir, library_file_dir) |
| 1120 imports_emitter = library_emitter.Emit( | 1120 imports_emitter = library_emitter.Emit( |
| 1121 self._template, AUXILIARY_DIR=massage_path(auxiliary_dir)) | 1121 self._template, AUXILIARY_DIR=massage_path(auxiliary_dir)) |
| 1122 for path in sorted(self._path_to_emitter.keys()): | 1122 for path in sorted(self._path_to_emitter.keys()): |
| 1123 relpath = os.path.relpath(path, library_file_dir) | 1123 relpath = os.path.relpath(path, library_file_dir) |
| 1124 imports_emitter.Emit( | 1124 imports_emitter.Emit( |
| 1125 "#source('$PATH');\n", PATH=massage_path(relpath)) | 1125 "#source('$PATH');\n", PATH=massage_path(relpath)) |
| OLD | NEW |