예제 #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)
예제 #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)
예제 #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)
예제 #4
0
파일: common.py 프로젝트: bocoup/wpt-docs
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)
예제 #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)
예제 #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)