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

Side by Side Diff: lib/dom/scripts/dartdomgenerator.py

Issue 10068019: Fix ApiDoc to work with new dart:html code. Tweak dart:html generator to generate clearer @domName … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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
OLDNEW
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 """This is the entry point to create Dart APIs from the IDL database.""" 6 """This is the entry point to create Dart APIs from the IDL database."""
7 7
8 import dartgenerator 8 import dartgenerator
9 import database 9 import database
10 import logging.config 10 import logging.config
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 # Remove these types since they are mapped directly to dart. 88 # Remove these types since they are mapped directly to dart.
89 common_database.DeleteInterface('DOMStringMap') 89 common_database.DeleteInterface('DOMStringMap')
90 common_database.DeleteInterface('DOMStringList') 90 common_database.DeleteInterface('DOMStringList')
91 91
92 generator.RenameTypes(common_database, { 92 generator.RenameTypes(common_database, {
93 # W3C -> Dart renames 93 # W3C -> Dart renames
94 'AbstractView': 'Window', 94 'AbstractView': 'Window',
95 'Function': 'EventListener', 95 'Function': 'EventListener',
96 'DOMStringMap': 'Map<String, String>', 96 'DOMStringMap': 'Map<String, String>',
97 'DOMStringList': 'List<String>', 97 'DOMStringList': 'List<String>',
98 }, False) 98 }, True)
99 generator.FilterMembersWithUnidentifiedTypes(common_database) 99 generator.FilterMembersWithUnidentifiedTypes(common_database)
100 webkit_database = common_database.Clone() 100 webkit_database = common_database.Clone()
101 101
102 # Generate Dart interfaces for the WebKit DOM. 102 # Generate Dart interfaces for the WebKit DOM.
103 generator.FilterInterfaces(database = webkit_database, 103 generator.FilterInterfaces(database = webkit_database,
104 or_annotations = ['WebKit', 'Dart'], 104 or_annotations = ['WebKit', 'Dart'],
105 exclude_displaced = ['WebKit'], 105 exclude_displaced = ['WebKit'],
106 exclude_suppressed = ['WebKit', 'Dart']) 106 exclude_suppressed = ['WebKit', 'Dart'])
107 generator.RenameTypes(webkit_database, _webkit_renames, False) 107 generator.RenameTypes(webkit_database, _webkit_renames, True)
Jacob 2012/04/12 17:38:03 This parameter was inverted previously. Cleaning u
108 108
109 if generate_html_systems: 109 if generate_html_systems:
110 html_renames = _MakeHtmlRenames(common_database) 110 html_renames = _MakeHtmlRenames(common_database)
111 generator.RenameTypes(webkit_database, html_renames, True) 111 generator.RenameTypes(webkit_database, html_renames, False)
112 html_renames_inverse = dict((v,k) for k, v in html_renames.iteritems()) 112 html_renames_inverse = dict((v,k) for k, v in html_renames.iteritems())
113 else: 113 else:
114 html_renames_inverse = {} 114 html_renames_inverse = {}
115 115
116 webkit_renames_inverse = dict((v,k) for k, v in _webkit_renames.iteritems()) 116 webkit_renames_inverse = dict((v,k) for k, v in _webkit_renames.iteritems())
117 117
118 generator.Generate(database = webkit_database, 118 generator.Generate(database = webkit_database,
119 output_dir = output_dir, 119 output_dir = output_dir,
120 lib_dir = output_dir, 120 lib_dir = output_dir,
121 module_source_preference = ['WebKit', 'Dart'], 121 module_source_preference = ['WebKit', 'Dart'],
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 database_dir, use_database_cache) 189 database_dir, use_database_cache)
190 190
191 if html_systems: 191 if html_systems:
192 output_dir = options.output_dir or os.path.join(current_dir, 192 output_dir = options.output_dir or os.path.join(current_dir,
193 '../../html/generated') 193 '../../html/generated')
194 GenerateDOM(html_systems, True, output_dir, 194 GenerateDOM(html_systems, True, output_dir,
195 database_dir, use_database_cache or dom_systems) 195 database_dir, use_database_cache or dom_systems)
196 196
197 if __name__ == '__main__': 197 if __name__ == '__main__':
198 sys.exit(main()) 198 sys.exit(main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698