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

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

Issue 2933993002: Add local results details pages.
Patch Set: More doc fixes. 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
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..25fa2c878eb11881943da377d0843d55dbcaa8a8 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(mikecase): Delete this function. Only one user of it.
jbudorick 2017/08/23 16:16:20 Similarly, TODO someone else or TODO a bug.
mikecase (-- gone --) 2017/08/24 05:29:08 You asked for it!
def unique_name(basename, suffix='', timestamp=True, device=None):
"""Helper function for creating a unique name for a file to store in GS.

Powered by Google App Engine
This is Rietveld 408576698