Ejemplo n.º 1
0
    def get_formatted_string(self):
        formatted_params = [self._name]
        for param_name, param_value in self._parameters:
            if param_value is None:
                formatted_params.append(param_name)
            else:
                quoted_value = http_header_util.quote_if_necessary(param_value)
                formatted_params.append('%s=%s' % (param_name, quoted_value))

        return '; '.join(formatted_params)
Ejemplo n.º 2
0
def format_extension(extension):
    """Format an ExtensionParameter object."""
    formatted_params = [extension.name()]
    for param_name, param_value in extension.get_parameters():
        if param_value is None:
            formatted_params.append(param_name)
        else:
            quoted_value = http_header_util.quote_if_necessary(param_value)
            formatted_params.append('%s=%s' % (param_name, quoted_value))
    return '; '.join(formatted_params)
Ejemplo n.º 3
0
    def get_formatted_string(self):
        formatted_params = [self._name]
        for param_name, param_value in self._parameters:
            if param_value is None:
                formatted_params.append(param_name)
            else:
                quoted_value = http_header_util.quote_if_necessary(param_value)
                formatted_params.append('%s=%s' % (param_name, quoted_value))

        return '; '.join(formatted_params)
Ejemplo n.º 4
0
def format_extension(extension):
    """Format an ExtensionParameter object."""
    formatted_params = [extension.name()]
    for param_name, param_value in extension.get_parameters():
        if param_value is None:
            formatted_params.append(param_name)
        else:
            quoted_value = http_header_util.quote_if_necessary(param_value)
            formatted_params.append('%s=%s' % (param_name, quoted_value))
    return '; '.join(formatted_params)
Ejemplo n.º 5
0
def format_extensions(extension_list):
    formatted_extension_list = []
    for extension in extension_list:
        formatted_params = [extension.name()]
        for param_name, param_value in extension.get_parameters():
            if param_value is None:
                formatted_params.append(param_name)
            else:
                quoted_value = http_header_util.quote_if_necessary(param_value)
                formatted_params.append('%s=%s' % (param_name, quoted_value))

        formatted_extension_list.append('; '.join(formatted_params))

    return ', '.join(formatted_extension_list)
Ejemplo n.º 6
0
def format_extensions(extension_list):
    formatted_extension_list = []
    for extension in extension_list:
        formatted_params = [extension.name()]
        for param_name, param_value in extension.get_parameters():
            if param_value is None:
                formatted_params.append(param_name)
            else:
                quoted_value = http_header_util.quote_if_necessary(param_value)
                formatted_params.append('%s=%s' % (param_name, quoted_value))

        formatted_extension_list.append('; '.join(formatted_params))

    return ', '.join(formatted_extension_list)