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 copy | 6 import copy |
7 import database | 7 import database |
8 import idlparser | 8 import idlparser |
9 import logging | 9 import logging |
10 import os | 10 import os |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 if not attribute.is_read_only: | 118 if not attribute.is_read_only: |
119 setter_attr = copy.deepcopy(attribute) | 119 setter_attr = copy.deepcopy(attribute) |
120 setter_attr.is_fc_setter = True | 120 setter_attr.is_fc_setter = True |
121 new_attributes.append(setter_attr) | 121 new_attributes.append(setter_attr) |
122 interface.attributes = new_attributes | 122 interface.attributes = new_attributes |
123 | 123 |
124 # Add 'Optional' attribute to whitelisted arguments. | 124 # Add 'Optional' attribute to whitelisted arguments. |
125 for op in interface.operations: | 125 for op in interface.operations: |
126 for argument in op.arguments: | 126 for argument in op.arguments: |
127 in_optional_whitelist = (interface.id, op.id, argument.id) in optional_a
rgument_whitelist | 127 in_optional_whitelist = (interface.id, op.id, argument.id) in optional_a
rgument_whitelist |
128 if in_optional_whitelist or set(['Optional', 'Callback']).issubset(argum
ent.ext_attrs.keys()): | 128 if in_optional_whitelist: |
129 argument.ext_attrs['Optional'] = None | 129 argument.ext_attrs['Optional'] = None |
130 argument.ext_attrs['RequiredCppParameter'] = None | |
131 | 130 |
132 def _rename_types(self, idl_file, import_options): | 131 def _rename_types(self, idl_file, import_options): |
133 """Rename interface and type names with names provided in the | 132 """Rename interface and type names with names provided in the |
134 options. Also clears scopes from scoped names""" | 133 options. Also clears scopes from scoped names""" |
135 | 134 |
136 def rename(name): | 135 def rename(name): |
137 name_parts = name.split('::') | 136 name_parts = name.split('::') |
138 name = name_parts[-1] | 137 name = name_parts[-1] |
139 if name in import_options.type_rename_map: | 138 if name in import_options.type_rename_map: |
140 name = import_options.type_rename_map[name] | 139 name = import_options.type_rename_map[name] |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 annotation = idl_node.annotations[source] | 554 annotation = idl_node.annotations[source] |
556 for name, value in annotation.items(): | 555 for name, value in annotation.items(): |
557 if (name in top_level_annotation | 556 if (name in top_level_annotation |
558 and value == top_level_annotation[name]): | 557 and value == top_level_annotation[name]): |
559 del annotation[name] | 558 del annotation[name] |
560 | 559 |
561 map(normalize, interface.parents) | 560 map(normalize, interface.parents) |
562 map(normalize, interface.constants) | 561 map(normalize, interface.constants) |
563 map(normalize, interface.attributes) | 562 map(normalize, interface.attributes) |
564 map(normalize, interface.operations) | 563 map(normalize, interface.operations) |
OLD | NEW |