| 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 to provide Dart metadata for | 6 """This module provides shared functionality to provide Dart metadata for |
| 7 DOM APIs. | 7 DOM APIs. |
| 8 """ | 8 """ |
| 9 | 9 |
| 10 import copy | 10 import copy |
| 11 import json | 11 import json |
| 12 import logging | 12 import logging |
| 13 import monitored | 13 import monitored |
| 14 import os | 14 import os |
| 15 import re | 15 import re |
| 16 from generator import ConstantOutputOrder | 16 from generator import ConstantOutputOrder |
| 17 from htmlrenamer import renamed_html_members, html_interface_renames | 17 from htmlrenamer import renamed_html_members, html_interface_renames |
| 18 | 18 |
| 19 _logger = logging.getLogger('DartMetadata') | 19 _logger = logging.getLogger('dartmetadata') |
| 20 | 20 |
| 21 # Annotations to be placed on native members. The table is indexed by the IDL | 21 # Annotations to be placed on native members. The table is indexed by the IDL |
| 22 # interface and member name, and by IDL return or field type name. Both are | 22 # interface and member name, and by IDL return or field type name. Both are |
| 23 # used to assemble the annotations: | 23 # used to assemble the annotations: |
| 24 # | 24 # |
| 25 # INTERFACE.MEMBER: annotations for member. | 25 # INTERFACE.MEMBER: annotations for member. |
| 26 # +TYPE: add annotations only if there are member annotations. | 26 # +TYPE: add annotations only if there are member annotations. |
| 27 # -TYPE: add annotations only if there are no member annotations. | 27 # -TYPE: add annotations only if there are no member annotations. |
| 28 # TYPE: add regardless of member annotations. | 28 # TYPE: add regardless of member annotations. |
| 29 | 29 |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 return '@Experimental' | 574 return '@Experimental' |
| 575 elif support_level == 'experimental': | 575 elif support_level == 'experimental': |
| 576 return '@Experimental' | 576 return '@Experimental' |
| 577 elif support_level == 'nonstandard': | 577 elif support_level == 'nonstandard': |
| 578 return '@Experimental' | 578 return '@Experimental' |
| 579 elif support_level == 'stable': | 579 elif support_level == 'stable': |
| 580 return | 580 return |
| 581 elif support_level == 'deprecated': | 581 elif support_level == 'deprecated': |
| 582 return '@Deprecated' | 582 return '@Deprecated' |
| 583 else: | 583 else: |
| 584 _logger.warn('Unknown support_level - %s:%s' % (interface.id, member_id)) | 584 _logger.warn('Unknown support_level - %s:%s' % (interface_id, member_id)) |
| 585 | 585 |
| 586 def Flush(self): | 586 def Flush(self): |
| 587 json_file = open(self._api_status_path, 'w+') | 587 json_file = open(self._api_status_path, 'w+') |
| 588 json.dump(self._types, json_file, indent=2, separators=(',', ': '), sort_key
s=True) | 588 json.dump(self._types, json_file, indent=2, separators=(',', ': '), sort_key
s=True) |
| 589 json_file.close() | 589 json_file.close() |
| OLD | NEW |