Chromium Code Reviews| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 86 | 86 |
| 87 JSONKEY_HEADER = 'header' | 87 JSONKEY_HEADER = 'header' |
| 88 JSONKEY_HEADER_TYPE = 'type' | 88 JSONKEY_HEADER_TYPE = 'type' |
| 89 JSONKEY_HEADER_REVISION = 'revision' | 89 JSONKEY_HEADER_REVISION = 'revision' |
| 90 JSONKEY_IMAGE_CHECKSUMALGORITHM = 'checksumAlgorithm' | 90 JSONKEY_IMAGE_CHECKSUMALGORITHM = 'checksumAlgorithm' |
| 91 JSONKEY_IMAGE_CHECKSUMVALUE = 'checksumValue' | 91 JSONKEY_IMAGE_CHECKSUMVALUE = 'checksumValue' |
| 92 JSONKEY_IMAGE_COMPARISONRESULT = 'comparisonResult' | 92 JSONKEY_IMAGE_COMPARISONRESULT = 'comparisonResult' |
| 93 JSONKEY_IMAGE_FILEPATH = 'filepath' | 93 JSONKEY_IMAGE_FILEPATH = 'filepath' |
| 94 JSONKEY_SOURCE_TILEDIMAGES = 'tiled-images' | 94 JSONKEY_SOURCE_TILEDIMAGES = 'tiled-images' |
| 95 JSONKEY_SOURCE_WHOLEIMAGE = 'whole-image' | 95 JSONKEY_SOURCE_WHOLEIMAGE = 'whole-image' |
| 96 JSONKEY_GOOGLE_STORAGE_BUCKET = 'gs-bucket' | |
|
epoger
2014/08/15 17:52:50
I think this CL is fine *except* that I think it w
rmistry
2014/08/21 13:08:29
Done.
| |
| 96 | 97 |
| 97 | 98 |
| 98 # Root directory where the buildbots store their actually-generated images... | 99 # Root directory where the buildbots store their actually-generated images... |
| 99 # as a publicly readable HTTP URL: | 100 # as a publicly readable HTTP URL: |
| 100 GM_ACTUALS_ROOT_HTTP_URL = ( | 101 GM_ACTUALS_ROOT_HTTP_URL = ( |
| 101 'http://chromium-skia-gm.commondatastorage.googleapis.com/gm') | 102 'http://chromium-skia-gm.commondatastorage.googleapis.com/gm') |
| 102 # as a GS URL that allows credential-protected write access: | 103 # as a GS URL that allows credential-protected write access: |
| 103 GM_ACTUALS_ROOT_GS_URL = 'gs://chromium-skia-gm/gm' | 104 GM_ACTUALS_ROOT_GS_URL = 'gs://chromium-skia-gm/gm' |
| 104 | 105 |
| 105 # Root directory where buildbots store skimage actual results json files. | 106 # Root directory where buildbots store skimage actual results json files. |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 188 | 189 |
| 189 | 190 |
| 190 def WriteToFile(json_dict, file_path): | 191 def WriteToFile(json_dict, file_path): |
| 191 """Writes the JSON summary in json_dict out to file_path. | 192 """Writes the JSON summary in json_dict out to file_path. |
| 192 | 193 |
| 193 The file is written Unix-style (each line ends with just LF, not CRLF); | 194 The file is written Unix-style (each line ends with just LF, not CRLF); |
| 194 see https://code.google.com/p/skia/issues/detail?id=1815 for reasons.""" | 195 see https://code.google.com/p/skia/issues/detail?id=1815 for reasons.""" |
| 195 with io.open(file_path, mode='w', newline='', encoding='utf-8') as outfile: | 196 with io.open(file_path, mode='w', newline='', encoding='utf-8') as outfile: |
| 196 outfile.write(unicode(json.dumps(json_dict, outfile, sort_keys=True, | 197 outfile.write(unicode(json.dumps(json_dict, outfile, sort_keys=True, |
| 197 indent=2))) | 198 indent=2))) |
| OLD | NEW |