%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/httplib2/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/httplib2/__pycache__/__init__.cpython-312.pyc

�

ZճcA���dZdZdZgd�ZdZdZddlZddlZddlZddl	Z	ddl
Z	ddl	mZddlZ	ddl
Z	ddlZdd	lmZddlZdd
lmZddlmZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl!Z!ddl"Z#ddl$Z$	ddl%Z%ddl'm(Z(ddl)�ddl*m*Z*d�Z+gd�Z,dZ-dZ.dZ/gd�Z0dZ1e2d�Z3ddl4m5Z5e5jl�Z7e8edd�xs	e8ed�Z9					dQd�Z:d�Z;d�Z<ejzd�Z>d�Z?d �Z@ejzd!�ZAejzd"ej��ZCd#�ZDejzd$�ZEd%�ZFd&�ZGd'�ZHdZId(�ZJd)�ZKd*�ZLd+�ZMd,�ZNd-�ZOGd.�d/eP�ZQGd0�d1eQ�ZRGd2�d3eQ�ZSGd4�d5eQ�ZTGd6�d7eQ�ZUGd8�d9eQ�ZVeReUeSeTeVd:�ZWgd;�ZXGd<�d=eP�ZYGd>�d?eP�ZZGd@�dAeZ�Z[GdB�dCeP�Z\GdD�dEeP�Z]dRdF�Z^dSdG�Z_GdH�dIej�j��ZbGdJ�dKej�j��ZdebeddL�ZeGdM�dNeP�ZfGdO�dPeg�Zhy#e&$r
dd
l'm%Z%Y���wxYw)Tz+Small, fast HTTP client library for Python.z!Joe Gregorio (joe@bitworking.org)zCopyright 2006, Joe Gregorio)	�!Thomas Broyer (t.broyer@ltgt.net)zJames AntillzXavier Verges FarrerozJonathan FeinbergzBlair ZajaczSam RubyzLouis NyffeneggerzMark PilgrimzAlex Yu�MITz0.20.4�N)�header)�gettext)�md5)�sha1�)�socks)�auth)�*)�iri2uric�Z�ttd�r|duxr|tjuS|duS)N�_GLOBAL_DEFAULT_TIMEOUT)�hasattr�socketr)�timeouts �3/usr/lib/python3/dist-packages/httplib2/__init__.py�has_timeoutr9s3���v�0�1��d�"�T�w�f�6T�6T�'T�T��$���)�
debuglevel�FailedToDecompressContent�Http�
HttpLib2Error�	ProxyInfo�
RedirectLimit�RedirectMissingLocation�Response�RETRIES�"UnimplementedDigestAuthOptionError�&UnimplementedHmacDigestAuthOptionError��)�
connectionz
keep-alivezproxy-authenticatezproxy-authorization�te�trailers�transfer-encoding�upgrade)�GET�HEAD�OPTIONS�TRACE)�,�-�.�/i3�4)�certs�PROTOCOL_TLS�PROTOCOL_SSLv23c�\�ttd�std��tjt�}|rtj
ntj|_|�It|d�r2t|t�rttj|�}||_ntd��|�It|d�r2t|t�rttj|�}||_
ntd��t|d�r||_|j|�|r|j!|||�|S)N�
SSLContextz0httplib2 requires Python 3.2+ for ssl.SSLContext�maximum_versionzHsetting tls_maximum_version requires Python 3.7 and OpenSSL 1.1 or newer�minimum_versionzHsetting tls_minimum_version requires Python 3.7 and OpenSSL 1.1 or newer�check_hostname)r�ssl�RuntimeErrorr5�DEFAULT_TLS_VERSION�	CERT_NONE�
CERT_REQUIRED�verify_mode�
isinstance�str�getattr�
TLSVersionr6r7r8�load_verify_locations�load_cert_chain)�"disable_ssl_certificate_validation�ca_certs�	cert_file�key_filer6r7�key_password�contexts        r�_build_ssl_contextrK�s���3��%��M�N�N��n�n�0�1�G�+M�#�-�-�SV�Sd�Sd�G���"��7�-�.��/�3�/�")�#�.�.�/�"J��&5�G�#��i�j�j��"��7�-�.��/�3�/�")�#�.�.�/�"J��&5�G�#��i�j�j��w�(�)�%G�!G����!�!�(�+�����	�8�\�B��Nrc�$�tt�}|j|jdd�j	d�D�cgc]}|j���c}�t|j
��D�cgc]	}||vs�|��c}Scc}wcc}w)Nr#��,)�list�
HOP_BY_HOP�extend�get�split�strip�keys)�response�hopbyhop�xrs    r�_get_end2end_headersrY�sk���J��H��O�O����\�2�(F�(L�(L�S�(Q�R�1�Q�W�W�Y�R�S�!%�h�m�m�o�!6�Q�v�&��:P�F�Q�Q��S��Qs�B�7	B
�B
c��t|j�dkDrLt|jdtj�r|jdj
S|j
St
|d�rX|j}t|jdtj�r|jdj
S|j
Sy)Nr�
socket_err)�len�argsr?r�error�errnorr[)�e�e_ints  r�_errno_from_exceptionrb�s���
�1�6�6�{�Q��",�Q�V�V�A�Y����"E�q�v�v�a�y���R�1�7�7�R��q�,������&0����A�����&M�u�z�z�!�}�"�"�^�SX�S^�S^�^�rz9^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?c�t�tj|�j�}|d|d|d|d|dfS)z�Parses a URI using the regex given in Appendix B of RFC 3986.

        (scheme, authority, path, query, fragment) = parse_uri(uri)
    r	����)�URI�match�groups)�urirjs  r�	parse_urirl�s?��
�Y�Y�s�^�
"�
"�
$�F��1�I�v�a�y�&��)�V�A�Y��q�	�B�Brc��t|�\}}}}}|r|std|z��|j�}|j�}|sd}|xrdj||g�xs|}|j�}|dz|z|z}||||fS)Nz(Only absolute URIs are allowed. uri = %s�/�?z://)rl�RelativeURIError�lower�join)rk�scheme�	authority�path�query�fragment�request_uri�
defrag_uris        r�urlnormrz�s���1:�3��.�V�Y��e�X����I�C�O�P�P����!�I�
�\�\�^�F�����3�C�H�H�d�E�]�3�;�t�K�
�\�\�^�F��%��)�+�k�9�J��9�k�:�5�5rz^\w+://z[^\w\-_.()=!]+c�&�t|t�r|}|jd�}n|jd�}t	|�j�}tjd|�}tjd|�}|dd}dj||f�S)z�Return a filename suitable for the cache.
    Strips dangerous and common characters to create a filename we
    can use to store the cache in.
    �utf-8rMN�ZrN)
r?�bytes�decode�encode�_md5�	hexdigest�
re_url_scheme�sub�	re_unsaferr)�filename�filename_bytes�filemd5s   r�safenamer��s���
�(�E�"�!���?�?�7�+��!����1���>�"�,�,�.�G�� � ��X�.�H��}�}�R��*�H����}�H��8�8�X�w�'�(�(rz(?:\r\n)?[ \t]+c���t|j�D��cgc]K\}}t|�j�tjt|�d�j
�f��Mc}}�Scc}}w)N� )�dict�items�_convert_byte_strrq�NORMALIZE_SPACEr�rT)�headers�key�values   r�_normalize_headersr�sg���!(�
�
��	
���e��s�
#�
)�
)�
+�_�-@�-@�AR�SX�AY�[^�-_�-e�-e�-g�i�	
����	
s�AA1
c�>�t|t�st|d�S|S�Nr|)r?r@)�ss rr�r�
s���a����1�g����Hrc���i}d|vr�|djd�}|D��cgc]\}d|jd�k7s�t|jdd�D�cgc] }|j�j	���"c}���^}}}|D�cgc]7}d|jd�k(s�|j�j	�df��9}}t||z�}|Scc}wcc}}wcc}w)N�
cache-controlrN����=r	)rS�find�tuplerTrqr�)r��retval�parts�partrX�parts_with_args�name�
parts_wo_argss        r�_parse_cache_controlr�s���
�F��'�!���(�.�.�s�3��OT�
�GK�XZ�^b�^g�^g�hk�^l�Xl�E�d�j�j��a�.@�A��1�7�7�9�?�?�$�A�B�
��
�@E�]�t��d�i�i�X[�n�H\�$�*�*�,�,�,�.��2�]�
�]��o�
�5�6���M��	B��
��^s(�C�C�%C�8	C�C!�""C!�Cc�"�d}t|�}t|�}d|vr2|dj�jd�dk7r
d}d|vrd|d<|Sd|vrd}|Sd|vrd}|Sd|vrd}|Sd	|vr�tjt
jj|d	��}tj�}td
||z
�}d|vr	t|d�}nSd|vrMt
jj|d�}	d
|	k(rd
}n%td
tj|	�|z
�}nd
}d|vr	t|d�}d|vr	t|d�}
||
z
}||kDrd}|S#t$rd
}Y�AwxYw#t$rd
}Y�?wxYw#t$rd
}
Y�=wxYw)a�Determine freshness from the Date, Expires and Cache-Control headers.

    We don't handle the following:

    1. Cache-Control: max-stale
    2. Age: headers are not used in the calculations.

    Not that this algorithm is simpler than you might think
    because we are operating as a private (non-shared) cache.
    This lets us ignore 's-maxage'. We can also ignore
    'proxy-invalidate' since we aren't a proxy.
    We will never return a stale document as
    fresh as a design decision, and thus the non-implementation
    of 'max-stale'. This also lets us safely ignore 'must-revalidate'
    since we operate as if every server has sent 'must-revalidate'.
    Since we are private we get to ignore both 'public' and
    'private' parameters. We also ignore 'no-transform' since
    we don't do any transformations.
    The 'no-store' parameter is handled at a higher level.
    So the only Cache-Control parameters we look at are:

    no-cache
    only-if-cached
    max-age
    min-fresh
    �STALE�pragmazno-cacher��TRANSPARENTr��only-if-cached�FRESH�daterzmax-age�expiresNz	min-fresh)r�rqr��calendar�timegm�email�utils�parsedate_tz�time�max�int�
ValueError)�response_headers�request_headersr��cc�cc_responser��now�current_age�freshness_lifetimer��	min_freshs           r�_entry_dispositionr�&s���8�F�	�o�	.�B�&�'7�8�K��?�"��x�'@�'F�'F�'H�'M�'M�j�'Y�]_�'_����/�1�/9�O�O�,�J�M�I
�r�	���F�M�E
�{�	"���B�M�A
�R�	���>�M�=
�#�	#����u�{�{�7�7�8H��8P�Q�R���i�i�k���!�S�4�Z�(����#�
'�%(��Y�)?�%@�"��*�
*��k�k�.�.�/?�	�/J�K�G��w��%&�"�%(��H�O�O�G�,D�t�,K�%L�"�!"����?�
'�%(��I��%7�"��"��
���;��0�	�
�9�$�K���+��F��M��/�
'�%&�"�
'���
'�%&�"�
'��
�
��	�
�s6�E�/E/�F�E,�+E,�/E=�<E=�F�
Fc���|}	|jdd�}|dvr�|dk(r7tjtj|���j�}|dk(r%t
j|tj�}tt|��|d<|d|d<|d=|S#ttjf$r+d}ttd	�|jd�z||��wxYw)
N�content-encoding)�gzip�deflater�)�fileobjr��content-lengthz-content-encodingrMzDContent purported to be compressed with %s but failed to decompress.)rRr��GzipFile�io�BytesIO�read�zlib�
decompress�	MAX_WBITSr@r\�IOErrorr^r�_)rV�new_content�content�encodings    r�_decompressContentr�qs����G�
��<�<� 2�D�9���*�*��6�!��-�-��
�
�;�0G�H�M�M�O���9�$��/�/�'�D�N�N�?�C��),�S��\�):�H�%�&�,4�5G�,H�H�(�)��+�,��N��
�T�Z�Z� �
���'�
�T�U�X`�Xd�Xd�ew�Xx�x���
�	
�
�s
�BB$�$AC(c����fd�}|S)Nc����j�D]�\}}td|zd|j��t|tj
�r2t|j
|j��|j���mt	j
||jd|��}t|j
�|j����t|j��y)Nz%s:r�)�end�file)�
maxlinelen)r�r|)r��charset�header_name)r��print�_fpr?r�Headerr��
_maxheaderlen)�self�h�vr��msgs    �r�_write_headersz+_bind_write_headers.<locals>._write_headers�s�����I�I�K�	7�D�A�q��%�!�)��4�8�8�4��!�V�]�]�+��a�h�h�$�*<�*<�h�=�D�H�H�M�!�-�-��d�6H�6H�RY�gh�i���g�n�n�&�T�X�X�6�	7�	�4�8�8�r�)r�r�s` r�_bind_write_headersr��s�����rc�,�|�rMt|�}t|�}d|vsd|vr|j|�ytjj	�}|j�D]\}}	|dvs�|	||<�|j
dd�}
|
rD|
j�jdd�jd�}|D]}d|z}	||||<�|j}
|
dk(rd	}
d
|
z}	|j�}t!j"dd
|�}dj%|j'd�|j'd�|g�}|j)||�yy#t$rY��wxYw#t$r)t|dt|��|j�}Y��wxYw)Nzno-store)�statusr�r&�varyr�rMrN�
-varied-%s�0��zstatus: %d
r�z
(?!
)|(?<!
)
z
rr|)r��deleter��message�Messager�rRrq�replacerS�KeyErrorr��	as_string�UnicodeEncodeError�setattrr��rer�rrr��set)r�r�r��cache�cachekeyr�r��infor�r�r��vary_headersrr��
status_header�
header_str�texts                 r�_updateCacher��s����
!�/�
2��*�+;�<�����z�[�8��L�L��"��=�=�(�(�*�D�.�4�4�6�
&�
��U��Q�Q� %�D��I�
&�$�'�'���5�D��#�z�z�|�3�3�C��<�B�B�3�G��*��F�&��/�C��$3�F�$;��S�	��&�,�,�F���}���,�v�5�M�
.�!�^�^�-�
�
��� 4�f�j�I�J��8�8�]�1�1�'�:�J�<M�<M�g�<V�X_�`�a�D��I�I�h��%�M��($�����&�
.���.�0C�D�0I�J�!�^�^�-�
�
.�s$�E�%E!�	E�E�!/F�Fc���ttj��dtd�D�cgc]}dt	j
dd���c}��j
d��j�}|ddScc}w)N�:��
0123456789r�	r|�)r�r��ctime�range�random�	randranger�r�)�i�digs  r�_cnoncer�sg��
��J�J�L�QV�WY�QZ�"[�A�<��0@�0@��A�0F�#G�"[�	\�d�d�el�m���i�k���s��8�O��#\s� A3c��tjt|�|�|��jd��j	��j�j
d�Sr�)�base64�	b64encode�_shar��digestrTr)�cnonce�iso_now�passwords   r�_wsse_username_tokenr�sJ������6�7�H�E�M�M�g�V�W�^�^�`�a�g�g�i�p�p�qx�y�rc�T�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zy
)�Authenticationc�^�t|�\}}	}
}}|
|_||_||_||_y�N)rlru�host�credentials�http)
r�rrrxr�rVr�rrsrtrurvrws
             r�__init__zAuthentication.__init__�s4��5>�{�5K�2���D�%����	���	�&�����	rc�r�t|�\}}}}}|t|j�djd�S)Nrn)rlr\ru�count)r�rxrsrtrurvrws       r�depthzAuthentication.depth�s8��5>�{�5K�2���D�%���3�t�y�y�>�+�,�2�2�3�7�7rc�|�t|�\}}}}}||jk(xr|j|j�Sr)rlr�
startswithru)r�rrxrsrtrurvrws        r�inscopezAuthentication.inscope�s8��5>�{�5K�2���D�%����	�	�!�A�t���t�y�y�'A�Arc��y)znModify the request headers to add the appropriate
        Authorization header. Over-rise this in sub-classes.Nr��r��methodrxr�r�s     r�requestzAuthentication.request�s��	
rc��y)aGives us a chance to update with new nonces
        or such returned from the last authorized response.
        Over-rise this in sub-classes if necessary.

        Return TRUE is the request is to be retried, for
        example Digest may return stale=true.
        Fr�)r�rVr�s   rrVzAuthentication.response�s��rc��y�NFr��r�rs  r�__eq__zAuthentication.__eq__����rc��y�NTr�r&s  r�__ne__zAuthentication.__ne__����rc��yr*r�r&s  r�__lt__zAuthentication.__lt__�r,rc��yr%r�r&s  r�__gt__zAuthentication.__gt__r(rc��yr*r�r&s  r�__le__zAuthentication.__le__r,rc��yr%r�r&s  r�__ge__zAuthentication.__ge__r(rc��yr*r��r�s r�__bool__zAuthentication.__bool__r,rN)�__name__�
__module__�__qualname__rrrr"rVr'r+r.r0r2r4r7r�rrrr�s?���8�B�

�
�������rrc��eZdZd�Zd�Zy)�BasicAuthenticationc
�<�tj||||||||�yr�rr�r�rrrxr�rVr�rs        rrzBasicAuthentication.__init__� ������k�4��g�x�Y`�bf�grc��dtjd|jzjd��j	�jd�z|d<y)�OModify the request headers to add the appropriate
        Authorization header.zBasic z%s:%sr|�
authorizationN)r	r
rr�rTrr s     rr"zBasicAuthentication.requestsH��$,�f�.>�.>�
�t�'�'�
'�/�/��8�/
�
�%�'�&�&��/�$"��� rN�r8r9r:rr"r�rrr<r<s
��h�"rr<c�$�eZdZdZd�Zdd�Zd�Zy)�DigestAuthenticationzMOnly do qop='auth' and MD5, since that
    is all Apache currently implementsc
��tj||||||||�tj|d�d|_|jjdd�}d|j
�D�	cgc]}	|	j���c}	vxrdxsd|jd<|jd�ttd|z���|jjdd�j�|jd<|jddk7r$ttd|jdz���d	j|jd
d|jdd|jd
g�|_
d
|jd<ycc}	w)N�www-authenticater�qoprzUnsupported value for qop: %s.�	algorithm�MD5�$Unsupported value for algorithm: %s.rMrr��realmr	�nc)rrr�_parse_www_authenticate�	challengerRrSrTrr��upperrrr�A1)
r�rrrxr�rVr�rrIrXs
          rrzDigestAuthentication.__init__s\������k�4��g�x�Y`�bf�g��5�5�h�@R�S�T\�]����n�n� � ���/��!'�s�y�y�{�+K�!�A�G�G�I�+K�!K� W�QW� _�[_����u���>�>�%� �(�4�Q�7W�Z]�7]�5^�_�_�&*�n�n�&8�&8��e�&L�&R�&R�&T����{�#��>�>�+�&�%�/�4��8�4�>�>�+�;V�V�W��
��'�'�4�+�+�A�.��T�^�^�G�5L�c�SW�Sc�Sc�de�Sf�h�i��� ����t���,Ls�*E?Nc��	�d��	�	fd�}dj|d|g�}|xs
t�|jd<d|�	|j�|jd�dd|jd	z�d|jd�d|jd
�d�	|���	�z}d|jd|jd
|jd||jd||jd
|jd	|jdf	z|d<|jjd�r|dxxd|jdzz
cc<|jd	xxdz
cc<y)�Modify the request headersc�R�t|jd��j�Sr�)r�r�r�)rXs r�<lambda>z.DigestAuthentication.request.<locals>.<lambda>0s��d�1�8�8�G�,�-�7�7�9�rc����|�d|���S)Nr�r�)r��d�Hs  �rrVz.DigestAuthentication.request.<locals>.<lambda>1s���!�q�!�,�-�rrMr�r
z"%s"�noncez%08xrNrIzoDigest username="%s", realm="%s", nonce="%s", uri="%s", algorithm=%s, response=%s, qop=%s, nc=%08x, cnonce="%s"rrMrJrC�opaquez
, opaque="%s"r	N)rrrrPrRrrR)
r�r!rxr�r�r
�KD�A2�request_digestrYs
         @rr"zDigestAuthentication.request.sP���9��
-��
�W�W�f�c�;�/�
0��#)�#6�W�Y����x� ��"�
�d�g�g�J����w�'������-�-����x�(����u�%��"��

�
#
�

��
#�
���Q���N�N�7�#��N�N�7�#���N�N�;�'���N�N�5�!��N�N�4� ��N�N�8�$�

�	$
��� ��>�>���h�'��O�$��$�.�.��:R�(R�R�$����t���!�rc�<�d|vr]tj|d�jdi�}d|jd�k(r"|d|jd<d|jd<y	ytj|d�}d
|vr!|d
|jd<d|jd<y)Nzauthentication-inforHr�true�stalerZr	rNT�	nextnonceF)rrOrRrP�_parse_authentication_info)r�rVr�rP�updated_challenges     rrVzDigestAuthentication.responseRs��� ��0��4�4�X�?Q�R�V�V�W_�ac�d�I�����w�/�/�*3�G�*<����w�'�'(����t�$���!%� ?� ?��J_� `���/�/�*;�K�*H����w�'�'(����t�$�rr)r8r9r:�__doc__rr"rVr�rrrFrFs��*�
!�""�H
rrFc�&�eZdZdZdZd�Zd�Zd�Zy)�HmacDigestAuthenticationz@Adapted from Robert Sayre's code and DigestAuthentication above.rc��tj||||||||�tj|d�}|d|_|jjdd�|jd<|jddvrd|jd<|jjdd�|jd<|jjd�st
td	���|jjd
d�|jd
<|jd
dvr$t
td
|jd
z���|jjdd�|jd<|jddvr$t
td|jdz���|jd
dk(rt|_	nt|_	|jddk(rt|_nt|_dj|jdd|jjdj|jd|jdg��j�j!�d|jdg�|_|jj|j"�j�j!�|_y)NrH�
hmacdigest�reason�unauthorized)rk�	integrity�saltrM�snoncezCThe challenge doesn't contain a server nonce, or this one is empty.rJ�
HMAC-SHA-1)ro�HMAC-MD5rLzpw-algorithm�SHA-1)rqrKz'Unsupported value for pw-algorithm: %s.rprKrr�r	rM)rrrrOrPrRr r�r��hashmodr�	pwhashmodrrr�newr�rqr�)	r�rrrxr�rVr�rrPs	         rrz!HmacDigestAuthentication.__init__gs]������k�4��g�x�Y`�bf�g��0�0��;M�N�	�"�<�0���#'�>�>�#5�#5�h��#O����x� ��>�>�(�#�+H�H�'5�D�N�N�8�$�!%���!3�!3�F�B�!?����v���~�~�!�!�(�+�8��W�X��
�'+�n�n�&8�&8��l�&S����{�#��>�>�+�&�.H�H�8��8�4�>�>�+�;V�V�W��
�*.���);�);�N�G�)T����~�&��>�>�.�)�1A�A�8��;�d�n�n�^�>\�\�]��
��>�>�+�&�*�4��D�L��D�L��>�>�.�)�U�2�!�D�N�!�D�N��7�7�� � ��#�����"�"�2�7�7�D�,<�,<�Q�,?����PV�AW�+X�#Y�Z�d�d�f�l�l�n�����w�'�
�
����>�>�%�%�d�h�h�/�9�9�;�A�A�C��rc�l�t|�}dj|D�cgc]}d|z��	c}�}dj|D�cgc]}||��	c}�}tjdtj��}	t�}
|�d|�d|
�d|jd�d|��	}tj|j||j�j�j�}d|jd�d|jd	�d
|jd�d|
�d|�d
|	�d|�d|�d�|d<ycc}wcc}w)rTrMz%s �%Y-%m-%dT%H:%M:%SZr�rnzHMACDigest username="rz
", realm="rMz", snonce="z", cnonce="z", uri="z", created="z
", response="z", headers="�"rCN)rYrrr��strftime�gmtimerrP�hmacrtr�rrr�rqr)r�r!rxr�r�rU�k�keylist�headers_val�createdr
r^s            rr"z HmacDigestAuthentication.request�s���#�G�,���'�'�d�3��5�1�9�3�4���g�g�4�8�a�w�q�z�8�9���-�-� 4�d�k�k�m�D�����-3�[�&�$�.�.�Ya�Jb�do�q�����$�(�(�N�D�L�L�I�S�S�U�[�[�]��
���Q���N�N�7�#��N�N�8�$������
$
��� ��
4��8s
�D,�D1c�x�tj|d�jdi�}|jd�dvryy)NrHrirj)rlraTF)rrOrR)r�rVr�rPs    rrVz!HmacDigestAuthentication.response�s<���0�0��;M�N�R�R�S_�ac�d�	��=�=��"�&<�<��rN)r8r9r:re�
__author__rr"rVr�rrrgrgbs��J�4�J�(D�T
�0rrgc��eZdZdZd�Zd�Zy)�WsseAuthenticationa�This is thinly tested and should not be relied upon.
    At this time there isn't any third party server to test against.
    Blogger and TypePad implemented this algorithm at one point
    but Blogger has since switched to Basic over HTTPS and
    TypePad has implemented it wrong, by never issuing a 401
    challenge but instead requiring your client to telepathically know that
    their endpoint is expecting WSSE profile="UsernameToken".c
�<�tj||||||||�yrr>r?s        rrzWsseAuthentication.__init__�r@rc	���d|d<tjdtj��}t�}t	|||j
d�}d|j
d�d|�d|�d	|�d
�	|d<y)
rBzWSSE profile="UsernameToken"rCrvr	zUsernameToken Username="rz", PasswordDigest="z
", Nonce="z", Created="rwzX-WSSEN)r�rxryrrr)r�r!rxr�r�rr
�password_digests        rr"zWsseAuthentication.request�sj��$B��� ��-�-� 4�d�k�k�m�D�����.�v�w��@P�@P�QR�@S�T�����Q�����	
���rN)r8r9r:rerr"r�rrr�r��s��A�h�
rr�c��eZdZd�Zd�Zy)�GoogleLoginAuthenticationc�*�ddlm}tj||||||||�	j|d�}
|
djdd�}|dk(r|j
d�dkDrd}t|d|d	||d
��}	|jjdd
||	�ddi��\}}|jd�}
t|
D�cgc] }|s�t|jdd	����"c}�}|jdk(rd|_
y|d|_
ycc}w)Nr)�	urlencoderH�googlelogin�service�xapir��clr	�
user-agent)�Email�Passwdr��sourcez+https://www.google.com/accounts/ClientLogin�POSTzContent-Typez!application/x-www-form-urlencoded)r!�bodyr��
r�i�rM�Auth)�urllib.parser�rrrOrRr�r�rr"rSr�r�r�)r�rrrxr�rVr�rr�rrPr��resp�lines�linerXs                rrz"GoogleLoginAuthentication.__init__�s��*�����k�4��g�x�Y`�bf�g�0�D�0�0��;M�N�	��M�*�.�.�y�&�A���f���!1�!1�*�!=��!A��G�
�+�a�.��Q���Y`�am�Yn�p���	�	�)�)�9���4��#�%H�I�	*�
�
��g��
�
�d�#����F���%��
�
�3��*�+�F�G���;�;�#���D�I��&�	�D�I��	Gs�D�
Dc�(�d|jz|d<y)rBzGoogleLogin Auth=rCN)r�r s     rr"z!GoogleLoginAuthentication.request�s��$7����#B��� rNrDr�rrr�r��s
��"�8Crr�)�basic�wsserrir�)rir�rr�r�c�,�eZdZdZefd�Zd�Zd�Zd�Zy)�	FileCachez�Uses a local directory as a store for cached files.
    Not really safe to use if multiple threads or processes are going to
    be running on the same cache.
    c��||_||_tjj	|�s tj
|j�yyr)r��safe�osru�exists�makedirs)r�r�r�s   rrzFileCache.__init__�s5����
���	��w�w�~�~�e�$��K�K��
�
�#�%rc��d}tjj|j|j	|��}	t|d�}|j
�}|j�|S#t$rY|SwxYw)N�rb)	r�rurrr�r��openr��closer�)r�r�r��
cacheFullPath�fs     rrRz
FileCache.getsl���������T�Z�Z����3��@�
�	��]�D�)�A��V�V�X�F�
�G�G�I��
���	���
�	�s�,A+�+	A8�7A8c���tjj|j|j	|��}t|d�}|j
|�|j�y)N�wb)r�rurrr�r�r��writer�)r�r�r�r�r�s     rr�z
FileCache.setsB�������T�Z�Z����3��@�
����%��	�����	���	rc���tjj|j|j	|��}tjj|�rtj|�yyr)r�rurrr�r�r��remove)r�r�r�s   rr�zFileCache.deletesC�������T�Z�Z����3��@�
�
�7�7�>�>�-�(��I�I�m�$�)rN)	r8r9r:rer�rrRr�r�r�rrr�r��s ���
$,�$�	��%rr�c�&�eZdZd�Zdd�Zd�Zd�Zy)�Credentialsc��g|_yr�rr6s rrzCredentials.__init__�
����rc�\�|jj|j�||f�yr�r�appendrq�r�r�r�domains    r�addzCredentials.add s#������������x� @�Arc��g|_yrr�r6s r�clearzCredentials.clear#r�rc#�XK�|jD]\}}}|dk(s||k(s�||f���y�w�NrMr�)r�r��cdomainr�rs     r�iterzCredentials.iter&s;����)-�)9�)9�	'�%�W�d�H��"�}��'� 1��X�&�&�	'�s�*�	*N�rM)r8r9r:rr�r�r�r�rrr�r�s���B��'rr�c��eZdZdZd�Zd�Zy)�KeyCertszNIdentical to Credentials except that
    name/password are mapped to key/cert.c�^�|jj|j�|||f�yrr��r�r��certr�rs     rr�zKeyCerts.add0s%������������d�H� E�Frc#�\K�|jD]\}}}}|dk(s||k(s�|||f���y�wr�r�)r�r�r�r�r�rs      rr�z
KeyCerts.iter3s?����.2�.>�.>�	,�*�W�c�4���"�}��'� 1��D�(�+�+�	,�s�,�
,N)r8r9r:rer�r�r�rrr�r�,s��-�G�,rr�c��eZdZy)�AllHostsN)r8r9r:r�rrr�r�9s��rr�c�<�eZdZdZdZ	d
d�Zd�Zd�Zd�Zd�Z	d	�Z
y)rz,Collect information required to use a proxy.r�Nc���t|t�r|j�}t|t�r|j�}|||||||f\|_|_|_|_|_|_|_	y)a�Args:

          proxy_type: The type of proxy server.  This must be set to one of
          socks.PROXY_TYPE_XXX constants.  For example:  p =
          ProxyInfo(proxy_type=socks.PROXY_TYPE_HTTP, proxy_host='localhost',
          proxy_port=8000)
          proxy_host: The hostname or IP address of the proxy server.
          proxy_port: The port that the proxy server is running on.
          proxy_rdns: If True (default), DNS queries will not be performed
          locally, and instead, handed to the proxy to resolve.  This is useful
          if the network does not allow resolution of non-local names. In
          httplib2 0.9 and earlier, this defaulted to False.
          proxy_user: The username used to authenticate with the proxy server.
          proxy_pass: The password used to authenticate with the proxy server.
          proxy_headers: Additional or modified headers for the proxy connect
          request.
        N)
r?r~r�
proxy_type�
proxy_host�
proxy_port�
proxy_rdns�
proxy_user�
proxy_pass�
proxy_headers)r�r�r�r�r�r�r�r�s        rrzProxyInfo.__init__Bsy��(�j�%�(�#�*�*�,�J��j�%�(�#�*�*�,�J�
�������
�	
��O��O��O��O��O��O��rc��|j|j|j|j|j|j
|jfSr)r�r�r�r�r�r�r�r6s r�astuplezProxyInfo.astuplels?���O�O��O�O��O�O��O�O��O�O��O�O����
�	
rc�R�txr |jdk7xr|jdk7Sr)r
r�r�r6s r�isgoodzProxyInfo.isgoodws$���P�$�/�/�T�1�P����4�8O�Prc�&�|j|�Sr)�bypass_host)r��hostnames  r�
applies_tozProxyInfo.applies_tozs���#�#�H�-�-�-rc���|jturyd|jd�z}|jD]0}|jd�r|j	|�ry|d|zk(s�0yy)z1Has this host been excluded from the proxy configT�.F)�bypass_hostsr��lstripr�endswith)r�r��	skip_names   rr�zProxyInfo.bypass_host}sm������(�������-�-���*�*�	�I��#�#�C�(�X�->�->�y�-I���3��?�*��
	�rc�&�dj|��S)Nz�<ProxyInfo type={p.proxy_type} host:port={p.proxy_host}:{p.proxy_port} rdns={p.proxy_rdns} user={p.proxy_user} headers={p.proxy_headers}>)�p)�formatr6s r�__repr__zProxyInfo.__repr__�s��
@��&�4�&�.�		r)TNNN)r8r9r:rer�rr�r�r�r�r�r�rrrr=s1��6��L�tx�(
�T	
�Q�.�
�rrc���|dvry|dz}tjj|tjj|j���}|syt	||d��S)z4Read proxy info from the environment variables.
    �r�httpsN�_proxy)�noproxy)r��environrRrQ�proxy_info_from_url)r!�env_var�urls   r�proxy_info_from_environmentr��sV���&�&���x��G�
�*�*�.�.��"�*�*�.�.�����"A�
B�C����s�F�D�9�9rc��tjj|�}d}t||j|j
xst
dd��||jxsd|jxsdd��}g}|�>tjjdtjjdd	��}|d
k(rt}n:|j�r*|jd�}tt!t"|��}||_|S)zBConstruct a ProxyInfo from a URL (such as http_proxy env var)
    rdi��P)r�rN)r�r�r�r�r�r��no_proxy�NO_PROXYrMrrN)�urllib�parse�urlparserr��portr��usernamerr�r�rRr�rTrSr��filter�boolr�)r�r!r�r��pir�s      rr�r��s����,�,�
�
��
$�C��J�	���<�<��8�8�?�t�#�B�7��?��<�<�'�4��<�<�'�4��

�B��L����*�*�.�.��R�Z�Z�^�^�J��-K�L���#�~���	�����}�}�S�)���V�D�,�7�8��"�B�O�
�Irc��eZdZdZdd�Zd�Zy)�HTTPConnectionWithTimeoutagHTTPConnection subclass that supports timeouts

    HTTPConnection subclass that supports timeouts

    All timeouts are in seconds. If None is passed for timeout then
    Python's default timeout for sockets will be used. See for example
    the docs of socket.setdefaulttimeout():
    http://docs.python.org/library/socket.html#socket.setdefaulttimeout
    Nc��tjjj||||��||_|rt|t�s|d�|_yyy)N)r�rr)r�client�HTTPConnectionr�
proxy_infor?r)r�rr�rr�s     rrz"HTTPConnectionWithTimeout.__init__�sJ�����"�"�+�+�D�$�T�7�+�S�$����j��Y�?�(��0�D�O�@�:rc�8�|jrt�td��|jrh|jj�rN|jj	|j
�r)d}|jj
�\}}}}}}}|}	|}
nd}|j
}	|j}
d}d}tj|	|
dtj�D�]z}|\}
}}}}	|r=tj|
||�|_|jj|�nUtj|
||�|_|jjtjtj d�t#|j$�r%|jj'|j$�|j(dkDrZt+dj-|j
|j��|r)t+dj-t/f���|jj1|j
|jf|d	dz�n|js|�y#tj2$r�}|}|j(dkDrZt+d
j-|j
|j��|r)t+dj-t/f���|jr|jj5�d|_Yd}~��>d}~wwxYw)z3Connect to the host and port specified in __init__.Nz2Proxy support missing but proxy use was requested!TFrr	z connect: ({0}, {1}) ************zproxy: {0} ************r!�connect fail: ({0}, {1})�
proxy: {0})r�r
�ProxiesUnavailableErrorr�r�rr�r�r�getaddrinfo�SOCK_STREAM�
socksocket�sock�setproxy�
setsockopt�IPPROTO_TCP�TCP_NODELAYrr�
settimeoutrr�r�r@�connectr^r�)r��	use_proxyr�r�r�r�r�r�r�rr�r[�res�af�socktype�proto�	canonname�sar`s                   rr
z!HTTPConnectionWithTimeout.connect�s����?�?�u�}�)�*^�_�_��?�?�t���5�5�7�D�O�O�<V�<V�W[�W`�W`�<a��I����'�'�)�
���������D��D��I��9�9�D��9�9�D��J��
��%�%�d�D�!�V�5G�5G�H�%	�C�14�.�B��%��B�"
�� %� 0� 0��X�u� E�D�I��I�I�&�&�"�J�
�J�
�T^��!'�
�
�b�(�E� B�D�I��I�I�(�(��);�);�V�=O�=O�QR�S��t�|�|�,��I�I�(�(����6��?�?�Q�&��<�C�C�D�I�I�t�y�y�Y�Z� ��5�<�<� #�Z��Z��U_�an�$p� q����	�	�!�!�4�9�9�d�i�i�"8�2�a�b�6�"A�B�
�K%	�L�y�y������<�<�

��
��?�?�Q�&��4�;�;�D�I�I�t�y�y�Q�R� ��(�/�/� #�Z��Z��U_�an�$p� q���
�9�9��I�I�O�O�%� ��	���

�s�#E.I#�#L�6BL�L)NNN)r8r9r:rerr
r�rrr�r��s���1�Brr�c�>��eZdZdZ										d�fd�	Zd�Z�xZS)�HTTPSConnectionWithTimeouta-This class allows communication via SSL.

    All timeouts are in seconds. If None is passed for timeout then
    Python's default timeout for sockets will be used. See for example
    the docs of socket.setdefaulttimeout():
    http://docs.python.org/library/socket.html#socket.setdefaulttimeout
    c	�"��||_|r|nt|_||_|rt	|t
�s
|d�|_t
|j|j|||	|
|��}tt|�'||||��||_
||_||_y)Nr�)r6r7rI)r�rrJ)
rE�CA_CERTSrFr�r?rrK�superrrrHrGrI)r�rr�rHrGrr�rFrE�tls_maximum_version�tls_minimum_versionrIrJ�	__class__s             �rrz#HTTPSConnectionWithTimeout.__init__s����3U��/�$,��(��
�$����j��Y�?�(��1�D�O�$��3�3��M�M���/�/�%�
��	�(�$�8��t�W�g�	9�	
�!��
�"���(��rc�T�|jrh|jj�rN|jj|j�r)d}|jj	�\}}}}}}}|}	|}
nd}|j}	|j
}
d}d}d}t
j|	|
dtj�}|D�]�\}
}}}}	|r.tj|
||�}|j|�nFt
j|
||�}|jtjtjd�t|j �r|j#|j �|j%|j|j
f�|j&j)||j��|_t-|j&d�sE|j.s9	t1j2|j*j5�|j�|j>dkDrZtAdjC|j|j
��|r)tAd	jCtE|f���n|j*s|�y#t6$rE|j*j9tj:�|j*j=��wxYw#t0jFt0jHf$rE}r|j=�|j*r|j*j=�d|_�d}~wtj tjJf$r�tjL$r�}|}|j>dkDrZtAd
jC|j|j
��|r)tAd	jCtE|f���|j*r|j*j=�d|_Yd}~��ed}~wwxYw)z(Connect to a host on a given (SSL) port.TFNrr	)�server_hostnamer8zconnect: ({0}, {1})rr)'r�r�r�rr�r�rrrr
rrr	r
rrrrr
�_context�wrap_socketrrrEr9�match_hostname�getpeercert�	Exception�shutdown�	SHUT_RDWRr�rr�r�r@�SSLError�CertificateError�gaierrorr^)r�rr�r�r�r�r�r�r�rr�r[�address_info�familyrrr�sockaddrrr`s                    rr
z"HTTPSConnectionWithTimeout.connectEsd���?�?�t���5�5�7�D�O�O�<V�<V�W[�W`�W`�<a��I����'�'�)�
���������D��D��I��9�9�D��9�9�D��J� �M��
��)�)�$��a��9K�9K�L��<H�9	�8�F�H�e�Y��7
�� �+�+�F�H�e�D�D��M�M�"�J�
�J�
�T^��"�=�=���5�A�D��O�O�F�$6�$6��8J�8J�A�N��t�|�|�,��O�O�D�L�L�1����d�i�i����3�4� �M�M�5�5�d�D�I�I�5�V��	��t�}�}�.>�?��Ho�Ho���*�*�4�9�9�+@�+@�+B�D�I�I�N��?�?�Q�&��/�6�6�t�y�y�$�)�)�L�M� ��(�/�/� #�Z��Z��U_�an�$p� q���8
�s9	�t�y�y�����K%���	�	�*�*�6�+;�+;�<��	�	���)�����L�L�#�"6�"6�7�
���J�J�L��9�9��I�I�O�O�%� ��	����N�N�F�O�O�4�
���<�<�

��
��?�?�Q�&��4�;�;�D�I�I�t�y�y�Q�R� ��(�/�/� #�Z��Z��U_�an�$p� q���
�9�9��I�I�O�O�%� ��	���

�sA�DK(�$8J�A)K(�AK%�%K(�(#P'�AM�9P'�BP"�"P')
NNNNNNFNNN)r8r9r:rerr
�
__classcell__)rs@rrrs4����������+0� � ��$)�LVrrr�c�x�eZdZdZddeddddfd�Zd�Zd�Zd�Zd�Z	dd	�Z
dd
�Zd�Zd�Z
d
�Zd�Zdddedfd�Zy)rz�An HTTP client that handles:

    - all methods
    - caching
    - ETags
    - compression,
    - HTTPS
    - Basic
    - Digest
    - WSSE

    and more.
    NFc��||_||_||_||_||_i|_|r!t
|t�rt|�|_	n||_	t�|_t�|_
g|_d|_t |_ddg|_t't(�|_d|_d|_d|_||_d|_y)a�If 'cache' is a string then it is used as a directory name for
        a disk cache. Otherwise it must be an object that supports the
        same interface as FileCache.

        All timeouts are in seconds. If None is passed for timeout
        then Python's default timeout for sockets will be used. See
        for example the docs of socket.setdefaulttimeout():
        http://docs.python.org/library/socket.html#socket.setdefaulttimeout

        `proxy_info` may be:
          - a callable that takes the http scheme ('http' or 'https') and
            returns a ProxyInfo instance per request. By default, uses
            proxy_info_from_environment.
          - a ProxyInfo instance (static proxy config).
          - None (proxy disabled).

        ca_certs is the path of a file containing root CA certificates for SSL
        server certificate validation.  By default, a CA cert file bundled with
        httplib2 is used.

        If disable_ssl_certificate_validation is true, SSL cert validation will
        not be performed.

        tls_maximum_version / tls_minimum_version require Python 3.7+ /
        OpenSSL 1.1.0g+. A value of "TLSv1_3" requires OpenSSL 1.1.1+.
        T�PUT�PATCHFN)r�rFrErr�connectionsr?r@r�r�r�rr��certificates�authorizations�follow_redirects�REDIRECT_CODES�redirect_codes�optimistic_concurrency_methodsrO�SAFE_METHODS�safe_methods�follow_all_redirects�ignore_etag�force_exception_to_status_coder�forward_authorization_headers)r�r�rr�rFrErrs        rrz
Http.__init__�s���H%��� ��
�2T��/�#6�� �#6�� �����Z��s�+�"�5�)�D�J��D�J�'�=���%�J���!���!%���,���05�g�.>��+� ��.���%*��!� ���.3��+����.3��*rc���|jic}|_|j�D]\}}|j��|jj	�|j�y)z�Close persistent connections, clear sensitive data.
        Not thread-safe, requires external synchronization against concurrent requests.
        N)r1r�r�r2r��clear_credentials)r��existingr��cs    rr�z
Http.closesZ��&*�%5�%5�r�"��$�"��N�N�$�	�D�A�q�
�G�G�I�	������!���� rc�`�tj|j�}d|vr|d=d|vr|d=|S)Nr"r1)�copy�__dict__)r��
state_dicts  r�__getstate__zHttp.__getstate__s<���Y�Y�t�}�}�-�
��
�"��9�%��J�&��=�)��rc�H�|jj|�i|_yr)rD�updater1)r��states  r�__setstate__zHttp.__setstate__s���
�
���U�#���rc#��K�tj|d�}|jj|�D](}tD]}||vs�t||||||||�����*y�w)zcA generator that creates Authorization objects
           that can be applied to requests.
        rHN)rrOrr��AUTH_SCHEME_ORDER�AUTH_SCHEME_CLASSES)	r�rrxr�rVr��
challenges�credrss	         r�_auth_from_challengezHttp._auth_from_challengesu�����1�1�(�<N�O�
��$�$�)�)�$�/�	q�D�+�
q���Z�'�-�f�5�d�D�+�w�X`�bi�ko�p�p�
q�	q�s�AA �A c�>�|jj|||�y)z]Add a name and password that will be used
        any time a request requires authentication.N)rr�r�s    r�add_credentialszHttp.add_credentials(s��	
�����T�8�V�4rc�@�|jj||||�y)zXAdd a key and cert that will be used
        any time a request requires authentication.N)r2r�r�s     r�add_certificatezHttp.add_certificate-s��	
�����c�4���:rc�F�|jj�g|_y)zKRemove all the names and passwords
        that are used for authenticationN)rr�r3r6s rr?zHttp.clear_credentials2s��	
����� � ��rc���d}d}|tkr�|dz
}	|j�|j�|j||||�	|j%�}
d}|dk(r|j
�n|
j'�}t)|
�}
|dk7r
t+|
|�}		|
|fS
fS#tj
$r|j
��tj$r)|j
�td|jz��tj$rB}t|�}	|	tjtjfvr|tkrYd}~��J�d}~wtj j"$r|j�@|tdz
kr#|j
�|j�Y���|j
��|tdz
kr#|j
�|j�Y���Y���wxYw#tj j,tj j.f$r@|s,|dk(r'd}d}|j
�|j�Y��R|j
��tj
$r�tjtj j"f$r:|j
�|dk(r#|j
�|j�Y��ڂwxYw)NrFr	zUnable to find the server at %srr)T)rrr
r"rrr�r(�ServerNotFoundErrorrr^rbr_�ENETUNREACH�
EADDRNOTAVAILrr��
HTTPException�getresponser�rr��
BadStatusLine�ResponseNotReady)r��connrxr!r�r�r�seen_bad_status_liner`�errno_rVr�s            r�
_conn_requestzHttp._conn_request8s\��
��$���'�k�
��F�A�
��9�9�$��L�L�N����V�[�$��@�8!
D��+�+�-��2���V�#��J�J�L�&�m�m�o�G�#�H�-���V�#�0��7�C�G���'�"�"��'�"�"���>�>�
��
�
����?�?�
Y��
�
��)�*K�d�i�i�*W�X�X��<�<�
�.�q�1���e�/�/��1D�1D�E�E�!�g�+�����;�;�,�,�
��9�9�$��7�Q�;���
�
������ ��
�
����w��{�?��J�J�L��L�L�N���
��$�K�K�-�-�t�{�{�/K�/K�L�
�,��Q���A�+/�(��J�J�L��L�L�N���J�J�L���>�>�
���L�L�$�+�+�";�";�<�
��
�
����6��J�J�L��L�L�N���
�sE�0B#�G2�#A0G/�6E�E�AG/�+=G/�.G/�2A"K!�BK!�K!c
��|jD�
cgc]*}
|
j||�s�|
j|�|
f��,}}
|xrt|�ddxsd}
|
r|
j||||�|j|||||�\}}
|
rG|
j||�r4|
j||||�|j|||||�\}}
d|_|jdk(r�|j|||||
�D]l}|j	||||�|j|||||�\}}
|jdk7s�?|jj|�|j
||�n|js||jvs|jdv�r�|j�rq|j|jv�rX|�rDd|vr%|jdk7rtt!d�||
��d|vr>|d}t#|�\}}}}}|dk(r#t$j&j)||�|d<|jd	k(s|jd
k(r8||jvr*|d|d<d|vr||d<t+|||
|j,|	�d
|vr|d
=d|vr|d=d|vr|j.s|d=d|vrk|d}t1j2|�}d|vr||d<|}|jdvrd}d}|j	|||||dz
��\}}
||_||
fSt7d||
��||
fS|jdvr0||jvr"d|vr||d<t+|||
|j,|	�||
fScc}
w)zmDo the actual request using the connection object
        and also follow one level of redirects if necessaryrr	Ni�)r/r0�locationr,z:Redirected but the response is missing a Location: header.r0r-�-x-permanent-redirect-urlzcontent-location�
if-none-match�if-modified-sincerC)r.r/r()r!r�r��redirections�4Redirected more times than redirection_limit allows.)r���)r3rr�sortedr"rarV�
_stale_digestr�rPr�r:r9r4r6rr�rlr�r��urljoinr�r�r=rC�deepcopy�previousr)r�r^r�absolute_urirxr!r�r�rgr�r�authsrVr�rCrcrsrtrurvrw�old_response�redirect_methods                       r�_requestz
Http._request�s���>B�=P�=P�t�T�T`�TX�T`�T`�ae�gr�Ts�*�$�*�*�[�)�4�0�t��t��,����q�)�!�,�4�����D�L�L���g�t�<�"�0�0��{�F�D�RY�Z���7���t�}�}�X�t�,�����V�[�'�4�@�&*�&8�&8��{�F�TX�Za�&b�#��7�)*��&��?�?�c�!�!%�!:�!:�4��g�W_�ah�!i�
�
��%�%�f�k�7�D�I�&*�&8�&8��{�F�TX�Za�&b�#��7��?�?�c�)��'�'�.�.�}�=�!�*�*�8�T�:��

��$�$��$�2C�2C�(C�x���Zd�Gd��$�$����D�<O�<O�)O� �!��1�h�o�o��6L�5��Z�[�]e�gn���"�X�-�#+�J�#7��EN�x�EX�B���D�%��$��,�39�<�<�3G�3G��V^�3_�H�Z�0����#�-�(�/�/�S�2H�f�X\�Xi�Xi�Ni�@H��@T��!<�=�-�X�=�;G�H�%7�8�$�W�h�����X�V�&�'�1�#�O�4�*�g�5�#�$7�8�&�'�1�$�:\�:\�#�O�4�!�X�-�#+�J�#7��'+�}�}�X�'>��-�\�A�?K�L�);�<�*0��#�?�?�j�8�.3�O�#'�D�.2�l�l�$�_�4�QX�gs�vw�gw�/;�/�+��7�-9��)��'�"�"�(�N�PX�Za����'�"�"�
���J�.�6�T�=N�=N�3N�%�X�5�3?�H�/�0��W�h�����X�N��'�"�"��Ous
�M
�M
c��t|�Sr)r�)r�r�s  rr�zHttp._normalize_headers�s
��!�'�*�*rr(c
�.�d}	|�i}n|j|�}d|vrdtz|d<t|�}|jdd�jdd�jd	d
�}t	|�\}}	}
}|dz|	z}|j
j
|�}|��O|s	t|}t|jj|	��}
t|t�r�|
rp||	|
dd|
dd
|j|j|j|j |j"|j$|
dd��
x}|j
|<n�||	|j|j|j|j |j"|j$��x}|j
|<n.||	|j|j��x}|j
|<|j't(�d|vr	d|vrd|d<t*j,j/�}d}d}|j0r�|}|j0j
|�}|r�	|j3dd
�\}}t+j4|�}|j7�D]a\}}|j9d�s�|j;d�s�*|j=|t?t*j@jC|�d���c	||jJvr(|j0rd|vr|jLsd|vr|d|d<|j0r+|r)||jNvr|j0jI|�||jNvrbd|vr^|d}|jQ�jdd�j3d�}|D]%}d|z}||}|j
|d�|k7s�#d}n|j0�r�|�r�||jNvs	|ddk(�r�d|v�r�|}|ddvrd }d!|vrR|dkr
tSd"id��|jU|d!|||d
z
�#�\}}tW|�|_,d$|jX_-n{t]||�}|d%k(rtW|�}d$|_-|fS|d&k(r-d|vr|jLsd'|vr|d|d'<d(|vrd(|vr|d(|d)<n|d*k(r	|j_||	||
|||||�	\}}|j`d+k(ro|d k(rjtc|�D]
}||||<�tW|�}te|d,�r|jf|_3ti|||j0|�|}d-|_0d$|_-nn|j`d-k(r|}n\|j0jI|�|}n>tk|�}d.|vrd/|d<tW|�}d0}n|j_||	||
|||||�	\}}||fS#tDtFf$r#|j0jI|�d}d}Y��wxYw#tl$�r}to|tpj�} | r.|j
js|d�}|r|ju�|jvr�to|tx�r0|jz}|j|}d1|_0t?|�|_?nwto|tpj�r"d2}tWd3d4t�|�d5��}d6|_?n;t?|�j�d7�}tWd3d8t�|�d5��}d9|_?n�Yd}~||fSd}~wwxYw):a� Performs a single HTTP request.
The 'uri' is the URI of the HTTP resource and can begin
with either 'http' or 'https'. The value of 'uri' must be an absolute URI.

The 'method' is the HTTP method to perform, such as GET, POST, DELETE, etc.
There is no restriction on the methods allowed.

The 'body' is the entity body to be sent with the request. It is a string
object.

Any extra headers that are to be sent with the request should be provided in the
'headers' dictionary.

The maximum number of redirect to follow before raising an
exception is 'redirections. The default is 5.

The return value is a tuple of (response, content), the first
being and instance of the 'Response' class, the second being
a string that contains the response entity body.
        rMNr�zPython-httplib2/%s (gzip)r�z%20�
z%0Dr�z%0Ar�rr	r!)	rHrGrr�rFrErrrI)rr�rFrErr)rr�rzaccept-encodingz
gzip, deflates

z=?z?=�etagzif-matchr�rNr�r��308)�307rxr(rdrh)r!r�rgTr�r�rez
last-modifiedrfr�r�rkr�r��504ri�sRequest Timeoutz
text/plain�408)zcontent-typer�r�zRequest Timeoutr|�400zBad Request)Br��__version__r
r�rzr1rR�SCHEME_TO_CONNECTIONrOr2r��
issubclassrrr�rFrErr�set_debuglevelrr�r�r�r�rS�message_from_bytesr�rr��replace_headerr@r�
decode_header�
IndexErrorr�r�r7r;r9rqrr"rrn�	fromcacher�rsr�rYrrkr�r�r#r?r�popr�r<�HttpLib2ErrorWithResponserVr�rjr\r�)!r�rkr!r�r�rg�connection_type�conn_keyrsrtrxryr^r1r�r��cached_valuer�r{r�r�r�rr�r�rrrVr��entry_disposition�merged_responser�r`�
is_timeouts!                                 rr"zHttp.request�sE��.��M	������1�1�'�:���7�*�(C�k�(Q���%��#�,�C��+�+�c�5�)�1�1�$��>�F�F�t�U�S�C�;B�3�<�8�V�Y��Z���|�i�/�H��#�#�'�'��1�D��|�&�&:�6�&B�O��T�.�.�3�3�I�>�?���o�/I�J��<K�%�%*�1�X�a�[�&+�A�h�q�k�$(�L�L�'+���%)�]�]�?C�?f�?f�04�0H�0H�04�0H�0H�).�q��!��=���t�/�/��9�=L�%�$(�L�L�'+���%)�]�]�?C�?f�?f�04�0H�0H�04�0H�0H�=���t�/�/��9�9H�!�4�<�<�D�O�O�9��D�4�+�+�H�5��#�#�J�/��g�%�*;�7�*J�-<��)�*��=�=�(�(�*�D��H��L��z�z�%��#�z�z�~�~�h�7���	,�(4�(:�(:�;��(J�
��g�$�7�7��=��$(�J�J�L�_�D�A�q� �|�|�D�1�a�j�j��6F� $� 3� 3�A�s�E�L�L�<V�<V�WX�<Y�Z[�<\�7]� ^�_��$�=�=�=��J�J��d�N��(�(��g�-�'+�6�l��
�#�
�z�z�h�6��9J�9J�+J��
�
�!�!�(�+���*�*�*�v��~��F�|��#�z�z�|�3�3�C��<�B�B�3�G��*��F�&��/�C� ��I�E��{�{�6�4�0�E�9�'+�����
�
� ��t�0�0�0�D��N�e�4K��7�*�"(����>��7�&+�O�.�$�6�#�q�(�+�R�TV�XZ���/3�l�l��8�9�.� '�%1�A�%5�	/;�/�+�X�{�)1���H�%�26�H�%�%�/�);�4��(I�%�(�G�3�#+�D�>��-1��*� (�'�2�2�(�G�3�!�T�>�$�2B�2B�?�^e�Ke�7;�F�|�G�O�4�*�d�2�?�g�;U�;?��;P�G�$7�8�*�m�;��.2�m�m��i��k�6�4��R^�`h�/�+�X�{��?�?�c�)�f��o� 4�H�=�2��$,�S�M��S�	�2�&.�t�n�O��x��9�8@�8N�8N��5� ��/�7�D�J�J�PX�Y�.�H�&)�H�O�)-�H�&��_�_��+�)�G��J�J�%�%�h�/�)�G�)�'�2��#�r�)�%*�D��N�'��~�H�!�G�*.�-�-��i��k�6�4��R^�`h�+�'�X�w�6�'�"�"��W'�
�3�,��
�
�)�)�(�3�#'��'+��,��f�	�#�A�v�~�~�6�J���'�'�+�+�H�d�;����J�J�L��2�2��a�!:�;� �z�z�H��i�i�G�&)�H�O�&)�!�f�H�O���6�>�>�2�0�G�'��QV�jm�nu�jv�(x�y�H�&7�H�O�!�!�f�m�m�G�4�G�'��QV�jm�nu�jv�(x�y�H�&3�H�O����'�"�"��1	�sY�IW0�AV;�V;�+:V;�%CW0�>B8W0�7EW0�;.W-�)W0�,W-�-W0�0
\�:D
\�\r�r)r8r9r:rer�rr�rFrJrPrRrTr?rarsr��DEFAULT_MAX_REDIRECTSr"r�rrrr�sq��� ��.��+0� � �Q3�f!���q�5�
;�
!�H#�TM#�^+� �d�D�G\�nr�h#rrc�8�eZdZdZ	dZ	dZ	dZ	dZdZd�Z	d�Z
y)	rz<An object more like email.message than httplib.HTTPResponse.F�r��OkNc��t|tjj�r�|j	�D]@\}}|j�}|j
|�}|�dj||f�}|||<�B|j|_t|j�|d<|j|_
|j|_yt|tjj�rHt|j!��D]\}}|||j�<�t#|d�|_y|j!�D]\}}|||j�<�t#|j
d|j��|_y)Nz, r�)r?rr��HTTPResponse�
getheadersrqrRrrr�r@rj�versionr�r�r�rOr�r�)r�r�r�r��prevs     rrzResponse.__init__�s6���d�D�K�K�4�4�5�"�o�o�/�
"�
��U��i�i�k���x�x��}���#� �I�I�t�U�m�4�E�!��S�	�
"��+�+�D�K� ����-�D��N��+�+�D�K��<�<�D�L�
��e�m�m�3�3�
4�"�4�:�:�<�0�
*�
��U�$)��S�Y�Y�[�!�
*��d�8�n�-�D�K�"�j�j�l�
*�
��U�$)��S�Y�Y�[�!�
*��d�h�h�x����=�>�D�Krc�&�|dk(r|St|��)Nr�)�AttributeError)r�r�s  r�__getattr__zResponse.__getattr__�s���6�>��K� ��&�&r)r8r9r:rer�r�r�rjrnrr�r�rrrr�s8��F�/��I���G�&�
�F�+�
�F��H�?�.'rr)NNNNN)r)rN)irer��
__copyright__�__contributors__�__license__r}r	r�rCr��email.feedparserr�
email.message�email.utilsr_rr�r��hashlibrr�rrrz�http.clientrr�r�rr�rr9�sysr�r�r�r�r
�ImportErrorrMrr^r
r�__all__rrr�rPr8�	frozensetr5�httplib2r1�whererrAr;rKrYrb�compilerhrlrzr��ASCIIr�r�r�r�r�r��USE_WWW_AUTH_STRICT_PARSINGr�r�r�r�rr�objectrr<rFrgr�r�rMrLr�r�r�r�rr�r�r�r�r��HTTPSConnectionrr~rr�rr�rr�<module>r�s���1�
0�
�.�
�
������
��������� ��� ���	�	�
�	�
�
�
������
�������
���*��	�
�3���9�:����5�;�;�=���c�>�4�8�[�G�C�IZ�<[���
����*�ZR���b�j�j�M�N��C�
6�"��
�
�:�&�
��B�J�J�(�"�(�(�3�	�)�0�"�*�*�/�0���
�	�  ��H�V�.�"'&�T��3�V�3�l	"�.�	"�D�>�D�NK�~�K�\
��
�6 C�� C�H!��"�*�,���M�� %�� %�F
'�&�
'� 
,�{�
,�	�v�	�T��T�n
:��<T���� :� :�T�nE����!<�!<�E�R
&�
'���\#�6�\#�~-'�t�-'��g4�����s�<I�I�I

Zerion Mini Shell 1.0