Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: tools/dom/scripts/generator.py

Issue 12090035: Split the comment strings in docs extraction on newlines. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merged master. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« tools/dom/docs/lib/docs.dart ('K') | « tools/dom/docs/lib/docs.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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)
OLDNEW
« tools/dom/docs/lib/docs.dart ('K') | « tools/dom/docs/lib/docs.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698