| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Schema of the JSON summary file written out by the GM tool. | 6 """Schema of the JSON summary file written out by the GM tool. |
| 7 | 7 |
| 8 This must be kept in sync with the kJsonKey_ constants in gm_expectations.cpp ! | 8 This must be kept in sync with the kJsonKey_ constants in gm_expectations.cpp ! |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 JSONKEY_HEADER = 'header' | 88 JSONKEY_HEADER = 'header' |
| 89 JSONKEY_HEADER_TYPE = 'type' | 89 JSONKEY_HEADER_TYPE = 'type' |
| 90 JSONKEY_HEADER_REVISION = 'revision' | 90 JSONKEY_HEADER_REVISION = 'revision' |
| 91 JSONKEY_IMAGE_CHECKSUMALGORITHM = 'checksumAlgorithm' | 91 JSONKEY_IMAGE_CHECKSUMALGORITHM = 'checksumAlgorithm' |
| 92 JSONKEY_IMAGE_CHECKSUMVALUE = 'checksumValue' | 92 JSONKEY_IMAGE_CHECKSUMVALUE = 'checksumValue' |
| 93 JSONKEY_IMAGE_COMPARISONRESULT = 'comparisonResult' | 93 JSONKEY_IMAGE_COMPARISONRESULT = 'comparisonResult' |
| 94 JSONKEY_IMAGE_FILEPATH = 'filepath' | 94 JSONKEY_IMAGE_FILEPATH = 'filepath' |
| 95 JSONKEY_SOURCE_TILEDIMAGES = 'tiled-images' | 95 JSONKEY_SOURCE_TILEDIMAGES = 'tiled-images' |
| 96 JSONKEY_SOURCE_WHOLEIMAGE = 'whole-image' | 96 JSONKEY_SOURCE_WHOLEIMAGE = 'whole-image' |
| 97 JSONKEY_IMAGE_BASE_GS_URL = 'image-base-gs-url' |
| 97 | 98 |
| 98 | 99 |
| 99 # Root directory where the buildbots store their actually-generated images... | 100 # Root directory where the buildbots store their actually-generated images... |
| 100 # as a publicly readable HTTP URL: | 101 # as a publicly readable HTTP URL: |
| 101 GM_ACTUALS_ROOT_HTTP_URL = ( | 102 GM_ACTUALS_ROOT_HTTP_URL = ( |
| 102 'http://chromium-skia-gm.commondatastorage.googleapis.com/gm') | 103 'http://chromium-skia-gm.commondatastorage.googleapis.com/gm') |
| 103 # as a GS URL that allows credential-protected write access: | 104 # as a GS URL that allows credential-protected write access: |
| 104 GM_ACTUALS_ROOT_GS_URL = 'gs://chromium-skia-gm/gm' | 105 GM_ACTUALS_ROOT_GS_URL = 'gs://chromium-skia-gm/gm' |
| 105 | 106 |
| 106 # Root directory where buildbots store skimage actual results json files. | 107 # Root directory where buildbots store skimage actual results json files. |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 190 |
| 190 | 191 |
| 191 def WriteToFile(json_dict, file_path): | 192 def WriteToFile(json_dict, file_path): |
| 192 """Writes the JSON summary in json_dict out to file_path. | 193 """Writes the JSON summary in json_dict out to file_path. |
| 193 | 194 |
| 194 The file is written Unix-style (each line ends with just LF, not CRLF); | 195 The file is written Unix-style (each line ends with just LF, not CRLF); |
| 195 see https://code.google.com/p/skia/issues/detail?id=1815 for reasons.""" | 196 see https://code.google.com/p/skia/issues/detail?id=1815 for reasons.""" |
| 196 with io.open(file_path, mode='w', newline='', encoding='utf-8') as outfile: | 197 with io.open(file_path, mode='w', newline='', encoding='utf-8') as outfile: |
| 197 outfile.write(unicode(json.dumps(json_dict, outfile, sort_keys=True, | 198 outfile.write(unicode(json.dumps(json_dict, outfile, sort_keys=True, |
| 198 indent=2))) | 199 indent=2))) |
| OLD | NEW |