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

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: now_works 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
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)

Powered by Google App Engine
This is Rietveld 408576698