HEX
Server: Apache
System: Linux msm5694.mjhst.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: camjab_ssh (1000)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: //lib/python2.7/site-packages/requests_toolbelt/utils/deprecated.pyc
ó
Óµ Yc@sŒdZddlZddlZddlmZejddejƒjZejddejƒjZ	ejdƒjZ
d„Zd	„ZdS(
s7A collection of functions deprecated in requests.utils.iÿÿÿÿN(tutilss!<meta.*?charset=["\']*(.+?)["\'>]tflagss+<meta.*?content=["\']*;?charset=(.+?)["\'>]s$^<\?xml.*?encoding=["\']*(.+?)["\'>]cCsht|ƒt|ƒt|ƒ}dtjko:dknrdg|D]}|jdƒ^qF}n|S(s™Return encodings from given content string.

    .. code-block:: python

        import requests
        from requests_toolbelt.utils import deprecated

        r = requests.get(url)
        encodings = deprecated.get_encodings_from_content(r)

    :param content: bytestring to extract encodings from
    :type content: bytes
    :return: encodings detected in the provided content
    :rtype: list(str)
    iiitutf8(ii(ii(tfind_charsettfind_pragmatfind_xmltsystversion_infotdecode(tcontentt	encodingstencoding((sF/usr/lib/python2.7/site-packages/requests_toolbelt/utils/deprecated.pytget_encodings_from_contents %cCstƒ}tj|jƒ}|r_yt|j|ƒSWq_tk
r[|j|jƒƒq_Xnt	|jƒ}xa|D]Y}|jƒ}||kr™qunyt|j|ƒSWqutk
rÍ|j|ƒquXquW|r	yt|j|ddƒSWq	t
k
rq	Xn|jS(sMReturn the requested content back in unicode.

    This will first attempt to retrieve the encoding from the response
    headers. If that fails, it will use
    :func:`requests_toolbelt.utils.deprecated.get_encodings_from_content`
    to determine encodings from HTML elements.

    .. code-block:: python

        import requests
        from requests_toolbelt.utils import deprecated

        r = requests.get(url)
        text = deprecated.get_unicode_from_response(r)

    :param response: Response object to get unicode content from.
    :type response: requests.models.Response
    terrorstreplace(tsetRtget_encoding_from_headerstheaderststrR	tUnicodeErrortaddtlowerRt	TypeErrorttext(tresponsettried_encodingsRR
t	_encoding((sF/usr/lib/python2.7/site-packages/requests_toolbelt/utils/deprecated.pytget_unicode_from_response,s,	



(
t__doc__treRtrequestsRtcompiletItfindallRRRRR(((sF/usr/lib/python2.7/site-packages/requests_toolbelt/utils/deprecated.pyt<module>s