-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
Milestone
Description
Bucket.__init__() currently has connection=None as a defaulted argument, and does nothing to "normalize" that value (i.e., by using the one set in _implicit_environ. ISTM that it would be useful to have the following work, assuming the envvars are set:
from gcloud.storage import set_defaults
from gcloud.storage.bucket import Bucket
set_defaults()
bucket = Bucket()
for blob in bucket:
blob.download_to_filename(os.path.join(tmpdir, blob.name))Likewise, Blob.__init__() could use the default bucket:
from gcloud.storage import set_defaults
from gcloud.storage.bucket import Blob
set_defaults()
blob = Blob('foobar.pdf')
blob.download_to_filename(os.path.join(tmpdir, blob.name))Metadata
Metadata
Assignees
Labels
api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.