| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 | 7 |
| 8 """ Look through skia-autogen, searching for all checksums which should have | 8 """ Look through skia-autogen, searching for all checksums which should have |
| 9 corresponding files in Google Storage, and verify that those files exist. """ | 9 corresponding files in Google Storage, and verify that those files exist. """ |
| 10 | 10 |
| 11 | 11 |
| 12 import json | 12 import json |
| 13 import posixpath | 13 import posixpath |
| 14 import re | 14 import re |
| 15 import subprocess | 15 import subprocess |
| 16 import sys | 16 import sys |
| 17 | 17 |
| 18 | 18 |
| 19 # TODO(borenet): Replace some/all of these with constants from gm/gm_json.py |
| 19 AUTOGEN_URL = 'http://skia-autogen.googlecode.com/svn/gm-actual' | 20 AUTOGEN_URL = 'http://skia-autogen.googlecode.com/svn/gm-actual' |
| 20 GS_URL = 'gs://chromium-skia-gm/gm' | 21 GS_URL = 'gs://chromium-skia-gm/gm' |
| 21 TEST_NAME_PATTERN = re.compile('(\S+)_(\S+).png') | 22 TEST_NAME_PATTERN = re.compile('(\S+)_(\S+).png') |
| 22 | 23 |
| 23 | 24 |
| 24 def FileNameToGSURL(filename, hash_type, hash_value): | 25 def FileNameToGSURL(filename, hash_type, hash_value): |
| 25 """ Convert a file name given in a checksum file to the URL of the | 26 """ Convert a file name given in a checksum file to the URL of the |
| 26 corresponding image file in Google Storage. | 27 corresponding image file in Google Storage. |
| 27 | 28 |
| 28 filename: string; the file name to convert. Takes the form specified by | 29 filename: string; the file name to convert. Takes the form specified by |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 def Main(): | 153 def Main(): |
| 153 urls = FindURLs(AUTOGEN_URL) | 154 urls = FindURLs(AUTOGEN_URL) |
| 154 missing = VerifyURLs(urls) | 155 missing = VerifyURLs(urls) |
| 155 if missing: | 156 if missing: |
| 156 print 'Found %d Missing files.' % len(missing) | 157 print 'Found %d Missing files.' % len(missing) |
| 157 return 1 | 158 return 1 |
| 158 | 159 |
| 159 | 160 |
| 160 if __name__ == '__main__': | 161 if __name__ == '__main__': |
| 161 sys.exit(Main()) | 162 sys.exit(Main()) |
| OLD | NEW |