# Path: openid/yadis/accept.py
# def generateAcceptHeader(*elements):
#     """Generate an accept header value
# 
#     [six.text_type or (six.text_type, float)] -> six.text_type
#     """
#     parts = []
#     for element in elements:
#         if isinstance(element, six.string_types):
#             qs = "1.0"
#             mtype = string_to_text(element,
#                                    "Binary values for generateAcceptHeader are deprecated. Use text input instead.")
#         else:
#             mtype, q = element
#             mtype = string_to_text(mtype,
#                                    "Binary values for generateAcceptHeader are deprecated. Use text input instead.")
#             q = float(q)
#             if q > 1 or q <= 0:
#                 raise ValueError('Invalid preference factor: %r' % q)
# 
#             qs = '%0.1f' % (q,)
# 
#         parts.append((qs, mtype))
# 
#     parts.sort()
#     chunks = []
#     for q, mtype in parts:
#         if q == '1.0':
#             chunks.append(mtype)
#         else:
#             chunks.append('%s; q=%s' % (mtype, q))
# 
#     return ', '.join(chunks)


from openid.yadis.accept import generateAcceptHeader
from __future__ import unicode_literals


__all__ = ['YADIS_HEADER_NAME', 'YADIS_CONTENT_TYPE', 'YADIS_ACCEPT_HEADER']

YADIS_HEADER_NAME = 'X-XRDS-Location'
YADIS_CONTENT_TYPE = 'application/xrds+xml'

# A value suitable for using as an accept header when performing YADIS
# discovery, unless the application has special requirements
YADIS_ACCEPT_HEADER = generateAcceptHeader(

# Path: openid/yadis/accept.py
# def generateAcceptHeader(*elements):
#     """Generate an accept header value
# 
#     [six.text_type or (six.text_type, float)] -> six.text_type
#     """
#     parts = []
#     for element in elements:
#         if isinstance(element, six.string_types):
#             qs = "1.0"
#             mtype = string_to_text(element,
#                                    "Binary values for generateAcceptHeader are deprecated. Use text input instead.")
#         else:
#             mtype, q = element
#             mtype = string_to_text(mtype,
#                                    "Binary values for generateAcceptHeader are deprecated. Use text input instead.")
#             q = float(q)
#             if q > 1 or q <= 0:
#                 raise ValueError('Invalid preference factor: %r' % q)
# 
#             qs = '%0.1f' % (q,)
# 
#         parts.append((qs, mtype))
# 
#     parts.sort()
#     chunks = []
#     for q, mtype in parts:
#         if q == '1.0':
#             chunks.append(mtype)
#         else:
#             chunks.append('%s; q=%s' % (mtype, q))
# 
#     return ', '.join(chunks)


# Path: openid/yadis/constants.py
from openid.yadis.accept import generateAcceptHeader

from __future__ import unicode_literals


__all__ = ['YADIS_HEADER_NAME', 'YADIS_CONTENT_TYPE', 'YADIS_ACCEPT_HEADER']

YADIS_HEADER_NAME = 'X-XRDS-Location'
YADIS_CONTENT_TYPE = 'application/xrds+xml'

# A value suitable for using as an accept header when performing YADIS
# discovery, unless the application has special requirements
YADIS_ACCEPT_HEADER = generateAcceptHeader(

    ('text/html', 0.3),