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

Unified Diff: build/android/pylib/utils/google_storage_helper.py

Issue 2933993002: Add local results details pages.
Patch Set: Fix some of Johns comments. Created 3 years, 4 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 | « build/android/pylib/results/presentation/test_results_presentation.py ('k') | build/android/test_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/utils/google_storage_helper.py
diff --git a/build/android/pylib/utils/google_storage_helper.py b/build/android/pylib/utils/google_storage_helper.py
index a9130734048b77017c3087447cc4b217736fbc81..c48543fcdfe10769aeb70493e19b924358007dba 100644
--- a/build/android/pylib/utils/google_storage_helper.py
+++ b/build/android/pylib/utils/google_storage_helper.py
@@ -9,7 +9,6 @@ Due to logdog not having image or HTML viewer, those instead should be uploaded
to Google Storage directly using this module.
"""
-import hashlib
import logging
import os
import sys
@@ -61,21 +60,6 @@ def upload(name, filepath, bucket, content_type=None, authenticated_link=True):
return get_url_link(name, bucket, authenticated_link)
-def upload_content_addressed(
- filepath, bucket, content_type=None, authenticated_link=True):
- """Uploads data to Google Storage with filename as sha1 hash.
-
- If file already exists in bucket with hash name, nothing is uploaded.
- """
- sha1 = hashlib.sha1()
- with open(filepath, 'rb') as f:
- sha1.update(f.read())
- sha1_hash = sha1.hexdigest()
- if not exists(sha1_hash, bucket):
- upload(sha1_hash, filepath, bucket, content_type, authenticated_link)
- return get_url_link(sha1_hash, bucket, authenticated_link)
-
-
@decorators.NoRaiseException(default_return_value=False)
def exists(name, bucket):
bucket = _format_bucket_name(bucket)
@@ -89,6 +73,7 @@ def exists(name, bucket):
return False
+# TODO(jbudorick): Delete this function. Only one user of it.
def unique_name(basename, suffix='', timestamp=True, device=None):
"""Helper function for creating a unique name for a file to store in GS.
« no previous file with comments | « build/android/pylib/results/presentation/test_results_presentation.py ('k') | build/android/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698