~graphite-dev/whisper/trunk

« back to all changes in this revision

Viewing changes to bin/whisper-diff.py

  • Committer: GitHub
  • Author(s): Denis Zhdanov
  • Date: 2017-05-08 19:07:44 UTC
  • mfrom: (168.4.2)
  • Revision ID: git-v1:699f48c38a40e58638d4bca0dc56bea2f9153472
Merge pull request #208 from piotr1212/diff_py3

py3 compatible print

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
 
72
72
 
73
73
def print_summary_json(diffs, path_a, path_b):
74
 
  print json.dumps({'path_a': path_a,
 
74
  print(json.dumps({'path_a': path_a,
75
75
                    'path_b': path_b,
76
76
                    'archives': [{'archive': archive,
77
77
                                  'total': total,
78
78
                                  'points': points.__len__()}
79
79
                                 for archive, points, total in diffs]},
80
 
                   sort_keys=True, indent=2, separators=(',', ' : '))
 
80
                   sort_keys=True, indent=2, separators=(',', ' : ')))
81
81
 
82
82
 
83
83
def print_diffs_json(diffs, path_a, path_b):
84
 
  print json.dumps({'path_a': path_a,
 
84
  print(json.dumps({'path_a': path_a,
85
85
                    'path_b': path_b,
86
86
                    'archives': [{'archive': archive,
87
87
                                  'total': total,
92
92
                                      'value_b': p[2]
93
93
                                    } for p in points]}
94
94
                                 for archive, points, total in diffs]},
95
 
                   sort_keys=True, indent=2, separators=(',', ' : '))
 
95
                   sort_keys=True, indent=2, separators=(',', ' : ')))
96
96
 
97
97
 
98
98
def main():