(self, **blob_meta_args)
return meta
Get a new `BlobMeta` object

        :param **blob_meta_args: See `AbstractBlobDB.put` for argument
        documentation. If the given `meta` argument is a `BlobMeta`
        object it will be returned instead of creating a new instance.
Get a new `BlobMeta` object
Get a new BlobMeta object
def new(self, **blob_meta_args):
        """Get a new `BlobMeta` object

        :param **blob_meta_args: See `AbstractBlobDB.put` for argument
        documentation. If the given `meta` argument is a `BlobMeta`
        object it will be returned instead of creating a new instance.
        """
        if "meta" in blob_meta_args:
            if len(blob_meta_args) > 1:
                raise ValueError(
                    "keyword arguments are incompatible with `meta` argument")
            return blob_meta_args["meta"]
        timeout = blob_meta_args.pop("timeout", None)
        if blob_meta_args.get('type_code') == CODES.form_xml:
            blob_meta_args['compressed_length'] = -1
        meta = BlobMeta(**blob_meta_args)
        if not meta.domain:
            raise TypeError("domain is required")
        if not meta.parent_id:
            raise TypeError("parent_id is required")
        if not isinstance(meta.parent_id, str):
            raise TypeError("parent_id must be a string")
        if meta.type_code is None:
            raise TypeError("type_code is required")
        if timeout is not None:
            if "expires_on" in blob_meta_args:
                raise ValueError("pass one: timeout or expires_on")
            meta.expires_on = _utcnow() + timedelta(minutes=timeout)
        return meta
def new ( self , * * blob_meta_args ) : if "meta" in blob_meta_args : if len ( blob_meta_args ) > 1 : raise ValueError ( "keyword arguments are incompatible with `meta` argument" ) return blob_meta_args [ "meta" ] timeout = blob_meta_args . pop ( "timeout" , None ) if blob_meta_args . get ( 'type_code' ) == CODES . form_xml : blob_meta_args [ 'compressed_length' ] = - 1 meta = BlobMeta ( * * blob_meta_args ) if not meta . domain : raise TypeError ( "domain is required" ) if not meta . parent_id : raise TypeError ( "parent_id is required" ) if not isinstance ( meta . parent_id , str ) : raise TypeError ( "parent_id must be a string" ) if meta . type_code is None : raise TypeError ( "type_code is required" ) if timeout is not None : if "expires_on" in blob_meta_args : raise ValueError ( "pass one: timeout or expires_on" ) meta . expires_on = _utcnow ( ) + timedelta ( minutes = timeout ) return meta