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 provides shared functionality for systems to generate | 6 """This module provides shared functionality for systems to generate |
| 7 Dart APIs from the IDL database.""" | 7 Dart APIs from the IDL database.""" |
| 8 | 8 |
| 9 import copy | 9 import copy |
| 10 import re | 10 import re |
| (...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 789 } | 789 } |
| 790 | 790 |
| 791 def FindCommonAnnotations(interface_name, member_name=None): | 791 def FindCommonAnnotations(interface_name, member_name=None): |
| 792 """ Finds annotations common between dart2js and dartium. | 792 """ Finds annotations common between dart2js and dartium. |
| 793 """ | 793 """ |
| 794 if member_name: | 794 if member_name: |
| 795 key = '%s.%s' % (interface_name, member_name) | 795 key = '%s.%s' % (interface_name, member_name) |
| 796 else: | 796 else: |
| 797 key = interface_name | 797 key = interface_name |
| 798 | 798 |
| 799 annotations = ["@DocsEditable", | 799 annotations = ["@DomName('" + key + "')",] |
| 800 "@DomName('" + key + "')",] | 800 # Only add this for members, so we don't add DocsEditable to templated classes |
| 801 # (they get it from the default class template) | |
| 802 if member_name: | |
| 803 annotations.append('@DocsEditable'); | |
|
Andrei Mouravski
2013/01/22 22:49:10
Can you make this prepend so that the diff is near
blois
2013/01/22 22:58:50
If the order of attributes is not necessary, then
| |
| 804 | |
| 801 if (dart_annotations.get(key) != None): | 805 if (dart_annotations.get(key) != None): |
| 802 annotations.extend(dart_annotations.get(key)) | 806 annotations.extend(dart_annotations.get(key)) |
| 803 | 807 |
| 804 return annotations | 808 return annotations |
| 805 | 809 |
| 806 def FindDart2JSAnnotations(idl_type, interface_name, member_name): | 810 def FindDart2JSAnnotations(idl_type, interface_name, member_name): |
| 807 """ Finds all annotations for Dart2JS members- including annotations for | 811 """ Finds all annotations for Dart2JS members- including annotations for |
| 808 both dart2js and dartium. | 812 both dart2js and dartium. |
| 809 """ | 813 """ |
| 810 annotations = FindCommonAnnotations(interface_name, member_name) | 814 annotations = FindCommonAnnotations(interface_name, member_name) |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1378 self) | 1382 self) |
| 1379 | 1383 |
| 1380 if type_data.clazz == 'SVGTearOff': | 1384 if type_data.clazz == 'SVGTearOff': |
| 1381 dart_interface_name = self._renamer.RenameInterface( | 1385 dart_interface_name = self._renamer.RenameInterface( |
| 1382 self._database.GetInterface(type_name)) | 1386 self._database.GetInterface(type_name)) |
| 1383 return SVGTearOffIDLTypeInfo( | 1387 return SVGTearOffIDLTypeInfo( |
| 1384 type_name, type_data, dart_interface_name, self) | 1388 type_name, type_data, dart_interface_name, self) |
| 1385 | 1389 |
| 1386 class_name = '%sIDLTypeInfo' % type_data.clazz | 1390 class_name = '%sIDLTypeInfo' % type_data.clazz |
| 1387 return globals()[class_name](type_name, type_data) | 1391 return globals()[class_name](type_name, type_data) |
| OLD | NEW |