| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 JSONKEY_IMAGE_BASE_GS_URL = 'image-base-gs-url' | 97 JSONKEY_IMAGE_BASE_GS_URL = 'image-base-gs-url' |
| 98 | 98 |
| 99 | 99 |
| 100 # Root directory where the buildbots store their actually-generated images... | 100 # Root directory where the buildbots store their actually-generated images... |
| 101 # as a publicly readable HTTP URL: | 101 # as a publicly readable HTTP URL: |
| 102 GM_ACTUALS_ROOT_HTTP_URL = ( | 102 GM_ACTUALS_ROOT_HTTP_URL = ( |
| 103 'http://chromium-skia-gm.commondatastorage.googleapis.com/gm') | 103 'http://chromium-skia-gm.commondatastorage.googleapis.com/gm') |
| 104 # as a GS URL that allows credential-protected write access: | 104 # as a GS URL that allows credential-protected write access: |
| 105 GM_ACTUALS_ROOT_GS_URL = 'gs://chromium-skia-gm/gm' | 105 GM_ACTUALS_ROOT_GS_URL = 'gs://chromium-skia-gm/gm' |
| 106 | 106 |
| 107 # Root directory where buildbots store skimage actual results json files. | |
| 108 SKIMAGE_ACTUALS_BASE_URL = ( | |
| 109 'http://chromium-skia-gm.commondatastorage.googleapis.com/skimage/actuals') | |
| 110 # Root directory inside trunk where skimage expectations are stored. | |
| 111 SKIMAGE_EXPECTATIONS_ROOT = os.path.join('expectations', 'skimage') | |
| 112 | |
| 113 # Pattern used to assemble each image's filename | 107 # Pattern used to assemble each image's filename |
| 114 IMAGE_FILENAME_PATTERN = '(.+)_(.+)\.png' # matches (testname, config) | 108 IMAGE_FILENAME_PATTERN = '(.+)_(.+)\.png' # matches (testname, config) |
| 115 | 109 |
| 116 # Pattern used to create image URLs, relative to some base URL. | 110 # Pattern used to create image URLs, relative to some base URL. |
| 117 GM_RELATIVE_URL_FORMATTER = '%s/%s/%s.png' # pass in (hash_type, test_name, | 111 GM_RELATIVE_URL_FORMATTER = '%s/%s/%s.png' # pass in (hash_type, test_name, |
| 118 # hash_digest) | 112 # hash_digest) |
| 119 GM_RELATIVE_URL_PATTERN = '(.+)/(.+)/(.+).png' # matches (hash_type, test_name, | 113 GM_RELATIVE_URL_PATTERN = '(.+)/(.+)/(.+).png' # matches (hash_type, test_name, |
| 120 # hash_digest) | 114 # hash_digest) |
| 121 GM_RELATIVE_URL_RE = re.compile(GM_RELATIVE_URL_PATTERN) | 115 GM_RELATIVE_URL_RE = re.compile(GM_RELATIVE_URL_PATTERN) |
| 122 | 116 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 | 184 |
| 191 | 185 |
| 192 def WriteToFile(json_dict, file_path): | 186 def WriteToFile(json_dict, file_path): |
| 193 """Writes the JSON summary in json_dict out to file_path. | 187 """Writes the JSON summary in json_dict out to file_path. |
| 194 | 188 |
| 195 The file is written Unix-style (each line ends with just LF, not CRLF); | 189 The file is written Unix-style (each line ends with just LF, not CRLF); |
| 196 see https://code.google.com/p/skia/issues/detail?id=1815 for reasons.""" | 190 see https://code.google.com/p/skia/issues/detail?id=1815 for reasons.""" |
| 197 with io.open(file_path, mode='w', newline='', encoding='utf-8') as outfile: | 191 with io.open(file_path, mode='w', newline='', encoding='utf-8') as outfile: |
| 198 outfile.write(unicode(json.dumps(json_dict, outfile, sort_keys=True, | 192 outfile.write(unicode(json.dumps(json_dict, outfile, sort_keys=True, |
| 199 indent=2))) | 193 indent=2))) |
| OLD | NEW |