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

Side by Side Diff: utils/apidoc/mdn/postProcess.dart

Issue 11358145: Update utils to new library syntax. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « utils/apidoc/mdn/extract.dart ('k') | utils/apidoc/mdn/prettyPrint.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * Read database.json, 2 * Read database.json,
3 * write database.filtered.json (with "best" entries) 3 * write database.filtered.json (with "best" entries)
4 * and obsolete.json (with entries marked obsolete). 4 * and obsolete.json (with entries marked obsolete).
5 */ 5 */
6 6
7 #library("postProcess"); 7 library postProcess;
8 8
9 #import("dart:io"); 9 import 'dart:io';
10 #import("dart:json"); 10 import 'dart:json';
11 #import("util.dart"); 11 import 'util.dart';
12 12
13 void main() { 13 void main() {
14 // Database of code documentation. 14 // Database of code documentation.
15 Map<String, List> database = JSON.parse( 15 Map<String, List> database = JSON.parse(
16 new File('output/database.json').readAsTextSync()); 16 new File('output/database.json').readAsTextSync());
17 final filteredDb = {}; 17 final filteredDb = {};
18 final obsolete = []; 18 final obsolete = [];
19 for (String type in database.keys) { 19 for (String type in database.keys) {
20 final entry = pickBestEntry(database[type], type); 20 final entry = pickBestEntry(database[type], type);
21 if (entry == null) { 21 if (entry == null) {
22 print("Can't find ${type} in database. Skipping."); 22 print("Can't find ${type} in database. Skipping.");
23 continue; 23 continue;
24 } 24 }
25 filteredDb[type] = entry; 25 filteredDb[type] = entry;
26 if (entry.containsKey("members")) { 26 if (entry.containsKey("members")) {
27 Map members = getMembersMap(entry); 27 Map members = getMembersMap(entry);
28 for (String name in members.keys) { 28 for (String name in members.keys) {
29 Map memberData = members[name]; 29 Map memberData = members[name];
30 if (memberData['obsolete'] == true) { 30 if (memberData['obsolete'] == true) {
31 obsolete.add({'type': type, 'member' : name}); 31 obsolete.add({'type': type, 'member' : name});
32 } 32 }
33 } 33 }
34 } 34 }
35 } 35 }
36 writeFileSync("output/database.filtered.json", JSON.stringify(filteredDb)); 36 writeFileSync("output/database.filtered.json", JSON.stringify(filteredDb));
37 writeFileSync("output/obsolete.json", JSON.stringify(obsolete)); 37 writeFileSync("output/obsolete.json", JSON.stringify(obsolete));
38 } 38 }
OLDNEW
« no previous file with comments | « utils/apidoc/mdn/extract.dart ('k') | utils/apidoc/mdn/prettyPrint.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698