(value)
return mime_parameters
parameter *( ";" parameter )

    That BNF is meant to indicate this routine should only be called after
    finding and handling the leading ';'.  There is no corresponding rule in
    the formal RFC grammar, but it is more convenient for us for the set of
    parameters to be treated as its own TokenList.

    This is 'parse' routine because it consumes the remaining value, but it
    would never be called to parse a full header.  Instead it is called to
    parse everything after the non-parameter value of a specific MIME header.
parameter *( ";" parameter )
parameter * ( ; parameter )
def parse_mime_parameters(value):
    """ parameter *( ";" parameter )

    That BNF is meant to indicate this routine should only be called after
    finding and handling the leading ';'.  There is no corresponding rule in
    the formal RFC grammar, but it is more convenient for us for the set of
    parameters to be treated as its own TokenList.

    This is 'parse' routine because it consumes the remaining value, but it
    would never be called to parse a full header.  Instead it is called to
    parse everything after the non-parameter value of a specific MIME header.

    """
    mime_parameters = MimeParameters()
    while value:
        try:
            token, value = get_parameter(value)
            mime_parameters.append(token)
        except errors.HeaderParseError as err:
            leader = None
            if value[0] in CFWS_LEADER:
                leader, value = get_cfws(value)
            if not value:
                mime_parameters.append(leader)
                return mime_parameters
            if value[0] == ';':
                if leader is not None:
                    mime_parameters.append(leader)
                mime_parameters.defects.append(errors.InvalidHeaderDefect(
                    "parameter entry with no content"))
            else:
                token, value = get_invalid_parameter(value)
                if leader:
                    token[:0] = [leader]
                mime_parameters.append(token)
                mime_parameters.defects.append(errors.InvalidHeaderDefect(
                    "invalid parameter {!r}".format(token)))
        if value and value[0] != ';':
            # Junk after the otherwise valid parameter.  Mark it as
            # invalid, but it will have a value.
            param = mime_parameters[-1]
            param.token_type = 'invalid-parameter'
            token, value = get_invalid_parameter(value)
            param.extend(token)
            mime_parameters.defects.append(errors.InvalidHeaderDefect(
                "parameter with invalid trailing text {!r}".format(token)))
        if value:
            # Must be a ';' at this point.
            mime_parameters.append(ValueTerminal(';', 'parameter-separator'))
            value = value[1:]
    return mime_parameters
def parse_mime_parameters ( value ) : mime_parameters = MimeParameters ( ) while value : try : token , value = get_parameter ( value ) mime_parameters . append ( token ) except errors . HeaderParseError as err : leader = None if value [ 0 ] in CFWS_LEADER : leader , value = get_cfws ( value ) if not value : mime_parameters . append ( leader ) return mime_parameters if value [ 0 ] == ';' : if leader is not None : mime_parameters . append ( leader ) mime_parameters . defects . append ( errors . InvalidHeaderDefect ( "parameter entry with no content" ) ) else : token , value = get_invalid_parameter ( value ) if leader : token [ : 0 ] = [ leader ] mime_parameters . append ( token ) mime_parameters . defects . append ( errors . InvalidHeaderDefect ( "invalid parameter {!r}" . format ( token ) ) ) if value and value [ 0 ] != ';' : # Junk after the otherwise valid parameter.  Mark it as # invalid, but it will have a value. param = mime_parameters [ - 1 ] param . token_type = 'invalid-parameter' token , value = get_invalid_parameter ( value ) param . extend ( token ) mime_parameters . defects . append ( errors . InvalidHeaderDefect ( "parameter with invalid trailing text {!r}" . format ( token ) ) ) if value : # Must be a ';' at this point. mime_parameters . append ( ValueTerminal ( ';' , 'parameter-separator' ) ) value = value [ 1 : ] return mime_parameters