Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Unified Diff: tools/get_uploaded_hashes.py

Issue 1066603002: Change get_uploaded_hashes.py to query Gold for hashes instead of GS (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/get_uploaded_hashes.py
diff --git a/tools/get_uploaded_hashes.py b/tools/get_uploaded_hashes.py
index 0ea7c02ca51ef31f412b4fbae06e2e1dd04bd76a..7bc8b3b214011641d52ab1070475e50b6d54992f 100644
--- a/tools/get_uploaded_hashes.py
+++ b/tools/get_uploaded_hashes.py
@@ -6,32 +6,22 @@
# found in the LICENSE file.
-import os
-import subprocess
+import contextlib
import sys
+import urllib2
-sys.path.insert(0, os.path.join('common', 'py', 'utils'))
-import gs_utils
+HASHES_URL = 'https://gold.skia.org/2/_/hashes'
-def get_uploaded_hashes(gs_bucket, gs_dir):
- _, files = gs_utils.GSUtils().list_bucket_contents(gs_bucket, subdir=gs_dir)
- hashes = []
- for line in files:
- hashes.append(os.path.basename(line).split('.')[0])
- return hashes
-
-def main(gs_bucket, gs_dir, output_file):
- hashes = get_uploaded_hashes(gs_bucket, gs_dir)
+def main(output_file):
with open(output_file, 'w') as f:
- for h in hashes:
- f.write(h + '\n')
+ with contextlib.closing(urllib2.urlopen(HASHES_URL)) as w:
+ f.write(w.read())
if __name__ == '__main__':
- if len(sys.argv) != 4:
- print >> sys.stderr , ('Usage: %s <gs_bucket> <gs_subdir> <output_file>' %
- sys.argv[0])
+ if len(sys.argv) != 2:
+ print >> sys.stderr , 'Usage: %s <output_file>' % sys.argv[0]
sys.exit(1)
main(*sys.argv[1:])
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698