OLD | NEW |
1 #!/usr/bin/python2.7 | 1 #!/usr/bin/python2.7 |
2 # | 2 # |
3 # Copyright 2013 Google Inc. All Rights Reserved. | 3 # Copyright 2013 Google Inc. All Rights Reserved. |
4 # | 4 # |
5 # Licensed under the Apache License, Version 2.0 (the "License"); | 5 # Licensed under the Apache License, Version 2.0 (the "License"); |
6 # you may not use this file except in compliance with the License. | 6 # you may not use this file except in compliance with the License. |
7 # You may obtain a copy of the License at | 7 # You may obtain a copy of the License at |
8 # | 8 # |
9 # http://www.apache.org/licenses/LICENSE-2.0 | 9 # http://www.apache.org/licenses/LICENSE-2.0 |
10 # | 10 # |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 195 |
196 input_file = args[0] | 196 input_file = args[0] |
197 output_file = args[1] | 197 output_file = args[1] |
198 | 198 |
199 if not os.path.exists(input_file): | 199 if not os.path.exists(input_file): |
200 parser.error('The given input file, \'%s\', doesn\'t exist' % input_file) | 200 parser.error('The given input file, \'%s\', doesn\'t exist' % input_file) |
201 | 201 |
202 with open(input_file, 'r') as f: | 202 with open(input_file, 'r') as f: |
203 input_data = json.load(f) | 203 input_data = json.load(f) |
204 | 204 |
205 entities = _generate_entities(input_json) | 205 entities = _generate_entities(input_data) |
206 | 206 |
207 with open(output_file, 'w') as f: | 207 with open(output_file, 'w') as f: |
208 _output_converted_json(f, | 208 _output_converted_json(f, |
209 options, | 209 options, |
210 input_json['executable']['name'], | 210 input_data['executable']['name'], |
211 entities) | 211 entities) |
212 | 212 |
213 | 213 |
214 if __name__ == '__main__': | 214 if __name__ == '__main__': |
215 sys.exit(main()) | 215 sys.exit(main()) |
OLD | NEW |