Chromium Code Reviews| Index: gm/gm_json.py |
| =================================================================== |
| --- gm/gm_json.py (revision 9897) |
| +++ gm/gm_json.py (working copy) |
| @@ -45,3 +45,8 @@ |
| above.""" |
| file_contents = open(file_path, 'r').read() |
| return LoadFromString(file_contents) |
| + |
| +def WriteToFile(json_dict, file_path): |
| + """Writes the JSON summary in json_dict out to file_path.""" |
| + with open(file_path, 'w') as outfile: |
| + json.dump(json_dict, outfile, sort_keys=True, indent=2) |