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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/bindings/generate_idl_diff.py

Issue 2169673003: Move bindings tooling scripts to Tools/Scripts/webkitpy/bindings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@change-test
Patch Set: Move test Created 4 years, 5 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
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """generate_idl_diff.py is a script that generates a diff of two given IDL files . 6 """generate_idl_diff.py is a script that generates a diff of two given IDL files .
7 Usage: generate_idl_diff.py old_file.json new_file.json diff_file.json 7 Usage: generate_idl_diff.py old_file.json new_file.json diff_file.json
8 old_file.json: An input json file including idl data of old Chrome version 8 old_file.json: An input json file including idl data of old Chrome version
9 new_file.json: An input json file including idl data of new Chrome version 9 new_file.json: An input json file including idl data of new Chrome version
10 diff_file.json: An output json file expressing a diff between old_file.json 10 diff_file.json: An output json file expressing a diff between old_file.json
11 and new_file.json 11 and new_file.json
12 """ 12 """
13 13
14 import json 14 import json
15 import os
16 import sys 15 import sys
17 16
18 17 # pylint: disable=W0105
19 """Data structure of input files of this script. 18 """Data structure of input files of this script.
20 The format of the json files is as follows. Each json file contains multiple 19 The format of the json files is as follows. Each json file contains multiple
21 "interface"s. Each "interface" contains 'ExtAttributes', 'Consts', 'Attributes' 20 "interface"s. Each "interface" contains 'ExtAttributes', 'Consts', 'Attributes'
22 and 'Operations'. Each item in them are called a "member". 21 and 'Operations'. Each item in them are called a "member".
23 {'InterfaceName': { 22 {'InterfaceName': {
24 'ExtAttributes': [{'Name': '...'}, 23 'ExtAttributes': [{'Name': '...'},
25 ..., 24 ...,
26 ], 25 ],
27 'Consts': [{'Type': '...', 26 'Consts': [{'Type': '...',
28 'Name': '...', 27 'Name': '...',
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 new_json_file = argv[1] 174 new_json_file = argv[1]
176 output_file = argv[2] 175 output_file = argv[2]
177 old_interfaces = load_json_file(old_json_file) 176 old_interfaces = load_json_file(old_json_file)
178 new_interfaces = load_json_file(new_json_file) 177 new_interfaces = load_json_file(new_json_file)
179 diff = interfaces_diff(old_interfaces, new_interfaces) 178 diff = interfaces_diff(old_interfaces, new_interfaces)
180 write_diff(diff, output_file) 179 write_diff(diff, output_file)
181 180
182 181
183 if __name__ == '__main__': 182 if __name__ == '__main__':
184 main(sys.argv[1:]) 183 main(sys.argv[1:])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698