コード例 #1
0
    def delete_object(self, object_name):
        """
        Permanently remove a storage object.

        >>> container.list_objects()
        ['new_object', 'old_object']
        >>> container.delete_object('old_object')
        >>> container.list_objects()
        ['new_object']

        @param object_name: the name of the object to retrieve
        @type object_name: str
        """
        if isinstance(object_name, Object):
            object_name = object_name.name
        if not object_name:
            raise InvalidObjectName(object_name)
        response = self.conn.make_request('DELETE', [self.name, object_name])
        if (response.status < 200) or (response.status > 299):
            response.read()
            raise ResponseError(response.status, response.reason)
        response.read()
コード例 #2
0
ファイル: storage_object.py プロジェクト: kahihia/Gigsgenei
 def _name_check(self, name=None):
     if name is None:
         name = self.name
     if len(name) > consts.object_name_limit:
         raise InvalidObjectName(name)
コード例 #3
0
 def _name_check(self):
     if len(self.name) > consts.object_name_limit:
         raise InvalidObjectName(self.name)