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

Unified Diff: tools/jsondiff.py

Issue 19112002: svndiff.py: add ability to compare before-and-after JSON files, not just raw images (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/svndiff.py » ('j') | tools/svndiff.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/jsondiff.py
===================================================================
--- tools/jsondiff.py (revision 10016)
+++ tools/jsondiff.py (working copy)
@@ -159,17 +159,20 @@
# main...
-parser = argparse.ArgumentParser()
-parser.add_argument('old',
- help='Path to JSON file whose expectations to display on ' +
- 'the "old" side of the diff. This can be a filepath on ' +
- 'local storage, or a URL.')
-parser.add_argument('new', nargs='?',
- help='Path to JSON file whose expectations to display on ' +
- 'the "new" side of the diff; if not specified, uses the ' +
- 'ACTUAL results from the "old" JSON file. This can be a ' +
- 'filepath on local storage, or a URL.')
-args = parser.parse_args()
-differ = GMDiffer()
-diffs = differ.GenerateDiffDict(oldfile=args.old, newfile=args.new)
-json.dump(diffs, sys.stdout, sort_keys=True, indent=2)
+if __name__ == '__main__':
borenet 2013/07/12 19:48:04 I'd prefer having most of this stuff inside of a M
epoger 2013/07/16 17:29:55 Done.
+ parser = argparse.ArgumentParser()
+ parser.add_argument(
+ 'old',
+ help='Path to JSON file whose expectations to display on ' +
+ 'the "old" side of the diff. This can be a filepath on ' +
+ 'local storage, or a URL.')
+ parser.add_argument(
+ 'new', nargs='?',
+ help='Path to JSON file whose expectations to display on ' +
+ 'the "new" side of the diff; if not specified, uses the ' +
+ 'ACTUAL results from the "old" JSON file. This can be a ' +
+ 'filepath on local storage, or a URL.')
+ args = parser.parse_args()
+ differ = GMDiffer()
+ diffs = differ.GenerateDiffDict(oldfile=args.old, newfile=args.new)
+ json.dump(diffs, sys.stdout, sort_keys=True, indent=2)
« no previous file with comments | « no previous file | tools/svndiff.py » ('j') | tools/svndiff.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698