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 json | 10 import json |
| (...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 825 # Add documentation from JSON. | 825 # Add documentation from JSON. |
| 826 comments = [] | 826 comments = [] |
| 827 | 827 |
| 828 if library_name in _dom_json and interface_name in _dom_json[library_name]: | 828 if library_name in _dom_json and interface_name in _dom_json[library_name]: |
| 829 if member_name and (member_name in | 829 if member_name and (member_name in |
| 830 _dom_json[library_name][interface_name]['members']): | 830 _dom_json[library_name][interface_name]['members']): |
| 831 comments = _dom_json[library_name][interface_name]['members'][member_name] | 831 comments = _dom_json[library_name][interface_name]['members'][member_name] |
| 832 elif 'comment' in _dom_json[library_name][interface_name]: | 832 elif 'comment' in _dom_json[library_name][interface_name]: |
| 833 comments = _dom_json[library_name][interface_name]['comment'] | 833 comments = _dom_json[library_name][interface_name]['comment'] |
| 834 | 834 |
| 835 if (len(comments)): | |
|
blois
2013/01/29 16:53:31
unnecessary parens, and I believe you can just do:
| |
| 836 comments = ['\n'.join(comments)] | |
| 837 | |
| 835 return comments | 838 return comments |
| 836 | 839 |
| 837 def GetAnnotationsAndComments(interface_name, member_name=None, | 840 def GetAnnotationsAndComments(interface_name, member_name=None, |
| 838 library_name=None): | 841 library_name=None): |
| 839 annotations = GetComments(interface_name, member_name, library_name) | 842 annotations = GetComments(interface_name, member_name, library_name) |
| 840 annotations = annotations + (FindCommonAnnotations(interface_name, | 843 annotations = annotations + (FindCommonAnnotations(interface_name, |
| 841 member_name, | 844 member_name, |
| 842 library_name)) | 845 library_name)) |
| 843 | 846 |
| 844 return annotations | 847 return annotations |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1441 self) | 1444 self) |
| 1442 | 1445 |
| 1443 if type_data.clazz == 'SVGTearOff': | 1446 if type_data.clazz == 'SVGTearOff': |
| 1444 dart_interface_name = self._renamer.RenameInterface( | 1447 dart_interface_name = self._renamer.RenameInterface( |
| 1445 self._database.GetInterface(type_name)) | 1448 self._database.GetInterface(type_name)) |
| 1446 return SVGTearOffIDLTypeInfo( | 1449 return SVGTearOffIDLTypeInfo( |
| 1447 type_name, type_data, dart_interface_name, self) | 1450 type_name, type_data, dart_interface_name, self) |
| 1448 | 1451 |
| 1449 class_name = '%sIDLTypeInfo' % type_data.clazz | 1452 class_name = '%sIDLTypeInfo' % type_data.clazz |
| 1450 return globals()[class_name](type_name, type_data) | 1453 return globals()[class_name](type_name, type_data) |
| OLD | NEW |