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:
fromgcloud.storageimportset_defaultsfromgcloud.storage.bucketimportBucketset_defaults()
bucket=Bucket()
forblobinbucket:
blob.download_to_filename(os.path.join(tmpdir, blob.name))
Likewise, Blob.__init__() could use the default bucket:
fromgcloud.storageimportset_defaultsfromgcloud.storage.bucketimportBlobset_defaults()
blob=Blob('foobar.pdf')
blob.download_to_filename(os.path.join(tmpdir, blob.name))
Bucket.__init__()currently hasconnection=Noneas 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:Likewise,
Blob.__init__()could use the default bucket: