Chromium Code Reviews| 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 generates Dart APIs from the IDL database.""" | 6 """This module generates Dart APIs from the IDL database.""" |
| 7 | 7 |
| 8 import emitter | 8 import emitter |
| 9 import idlnode | 9 import idlnode |
| 10 import logging | 10 import logging |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 101 _logger.info('renaming interface %s to %s' % (old_name, new_name)) | 101 _logger.info('renaming interface %s to %s' % (old_name, new_name)) |
| 102 interface = database.GetInterface(old_name) | 102 interface = database.GetInterface(old_name) |
| 103 database.DeleteInterface(old_name) | 103 database.DeleteInterface(old_name) |
| 104 if not database.HasInterface(new_name): | 104 if not database.HasInterface(new_name): |
| 105 interface.id = new_name | 105 interface.id = new_name |
| 106 database.AddInterface(interface) | 106 database.AddInterface(interface) |
| 107 else: | 107 else: |
| 108 new_interface = database.GetInterface(new_name) | 108 new_interface = database.GetInterface(new_name) |
| 109 MergeNodes(new_interface, interface) | 109 MergeNodes(new_interface, interface) |
| 110 | 110 |
| 111 interface.javascript_binding_name = (old_name if rename_javascript_bindi ng_names | 111 if rename_javascript_binding_names: |
| 112 else new_name) | 112 interface.javascript_binding_name = new_name |
| 113 for member in interface.operations + interface.constants + interface.a ttributes: | |
|
Bob Nystrom
2012/04/12 17:54:06
long line
sra1
2012/04/12 17:58:21
line length.
for member in (....
...):
should
Jacob
2012/04/13 08:56:01
Done.
Jacob
2012/04/13 08:56:01
Done.
| |
| 114 member.interface_javascript_binding_name = new_name | |
| 113 | 115 |
| 114 # Fix references: | 116 # Fix references: |
| 115 for interface in database.GetInterfaces(): | 117 for interface in database.GetInterfaces(): |
| 116 for idl_type in interface.all(idlnode.IDLType): | 118 for idl_type in interface.all(idlnode.IDLType): |
| 117 type_name = self._StripModules(idl_type.id) | 119 type_name = self._StripModules(idl_type.id) |
| 118 if type_name in conversion_table: | 120 if type_name in conversion_table: |
| 119 idl_type.id = conversion_table[type_name] | 121 idl_type.id = conversion_table[type_name] |
| 120 | 122 |
| 121 def FilterMembersWithUnidentifiedTypes(self, database): | 123 def FilterMembersWithUnidentifiedTypes(self, database): |
| 122 """Removes unidentified types. | 124 """Removes unidentified types. |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 625 pass | 627 pass |
| 626 | 628 |
| 627 def AddTypedArrayConstructors(self, element_type): | 629 def AddTypedArrayConstructors(self, element_type): |
| 628 pass | 630 pass |
| 629 | 631 |
| 630 def AddOperation(self, info): | 632 def AddOperation(self, info): |
| 631 pass | 633 pass |
| 632 | 634 |
| 633 def AddEventAttributes(self, event_attrs): | 635 def AddEventAttributes(self, event_attrs): |
| 634 pass | 636 pass |
| OLD | NEW |