예제 #1
0
 def _makeOne(self, client=None, name=None, properties=None):
     from gcloud.storage.bucket import Bucket
     if client is None:
         connection = _Connection()
         client = _Client(connection)
     bucket = Bucket(client, name=name)
     bucket._properties = properties or {}
     return bucket
예제 #2
0
 def _makeOne(self, client=None, name=None, properties=None):
     from gcloud.storage.bucket import Bucket
     if client is None:
         connection = _Connection()
         client = _Client(connection)
     bucket = Bucket(client, name=name)
     bucket._properties = properties or {}
     return bucket
예제 #3
0
    def get_items_from_response(self, response):
        """Factory method which yields :class:`.Bucket` items from a response.

        :type response: dict
        :param response: The JSON API response for a page of buckets.
        """
        for item in response.get('items', []):
            name = item.get('name')
            bucket = Bucket(name, connection=self.connection)
            bucket._properties = item
            yield bucket
예제 #4
0
 def _makeOne(self, *args, **kw):
     from gcloud.storage.bucket import Bucket
     properties = kw.pop('properties', None)
     bucket = Bucket(*args, **kw)
     bucket._properties = properties or {}
     return bucket
예제 #5
0
 def _makeOne(self, *args, **kw):
     from gcloud.storage.bucket import Bucket
     properties = kw.pop('properties', None)
     bucket = Bucket(*args, **kw)
     bucket._properties = properties or {}
     return bucket