Ejemplo n.º 1
0
 def _open(self, name, mode):
     """
     Retrieves the specified file from storage.
     """
     return Blob(name, self._bucket)
Ejemplo n.º 2
0
 def url(self, name):
     """
     Returns an absolute URL where the file's contents can be accessed
     directly by a Web browser.
     """
     return Blob(name, self._bucket).public_url
Ejemplo n.º 3
0
 def __contains__(self, blob_name):
     blob = Blob(blob_name, bucket=self)
     return blob.exists()
Ejemplo n.º 4
0
 def _makeOne(self, *args, **kw):
     from gcloud.storage.blob import Blob
     properties = kw.pop('properties', None)
     blob = Blob(*args, **kw)
     blob._properties = properties or {}
     return blob
Ejemplo n.º 5
0
 def test_new_blob_existing(self):
     from gcloud.storage.blob import Blob
     bucket = self._makeOne()
     existing = Blob(None, bucket=bucket)
     self.assertTrue(bucket.new_blob(existing) is existing)
Ejemplo n.º 6
0
 def _makeOne(self, *args, **kw):
     from gcloud.storage.blob import Blob
     return Blob(*args, **kw)