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

Unified Diff: gm/gm_json.py

Issue 18348018: rebaseline.py: if expectations dir contains JSON format results, update those instead of image files (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: ready_for_review Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/rebaseline.py » ('j') | tools/rebaseline.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | tools/rebaseline.py » ('j') | tools/rebaseline.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698