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))
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: