%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/
Upload File :
Create Path :
Current File : //opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.pyo

�
�wMVc@s�ddlZddlZddlZddlmZddlmZddlmZ	m
Z
ddlmZej
e�Zdefd��YZd	�Zd
ejfd��YZdS(i����Ni(tHTTPHeaderDict(tDecodeError(tstring_typestbinary_type(tis_fp_closedtDeflateDecodercBs#eZd�Zd�Zd�ZRS(cCs(t|_t�|_tj�|_dS(N(tTruet
_first_tryRt_datatzlibt
decompressobjt_obj(tself((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.pyt__init__s	cCst|j|�S(N(tgetattrR(Rtname((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.pyt__getattr__scCs�|js|jj|�S|j|7_y|jj|�SWnTtjk
r�t|_tjtj�|_z|j|j�SWdd|_XnXdS(N(
RRt
decompressRR	terrortFalseR
t	MAX_WBITStNone(Rtdata((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.pyRs		(t__name__t
__module__R
RR(((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.pyRs		cCs'|dkr tjdtj�St�S(Ntgzipi(R	R
RR(tmode((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.pyt_get_decoder/stHTTPResponsecBs�eZdZddgZdddddgZddd	d	dd	eedddd
�Zd�Zd�Z	e
d
��Zd�Zdde
d�Zddd�Zed��Zd�Zdd�Zd�Ze
d��Zd�Zd�Zd�ZRS(s
    HTTP Response container.

    Backwards-compatible to httplib's HTTPResponse but the response ``body`` is
    loaded and decoded on-demand when the ``data`` property is accessed.

    Extra parameters for behaviour not present in httplib.HTTPResponse:

    :param preload_content:
        If True, the response's body will be preloaded during construction.

    :param decode_content:
        If True, attempts to decode specific content-encoding's based on headers
        (like 'gzip' and 'deflate') will be skipped and raw data will be used
        instead.

    :param original_response:
        When this HTTPResponse wrapper is generated from an httplib.HTTPResponse
        object, it's convenient to include the original for debug purposes. It's
        otherwise unused.
    Rtdeflatei-i.i/i3i4ticCs�t�|_|r%|jj|�n||_||_||_||_||_d|_	|rvt
|t�rv|nd|_d|_
|	|_d|_|
|_||_t|d�r�||_
n|r�|jr�|jd|�|_ndS(Nitreadtdecode_content(RtheaderstupdatetstatustversiontreasontstrictR Rt_decodert
isinstancet
basestringt_bodyt_fpt_original_responset_fp_bytes_readt_poolt_connectionthasattrR(RtbodyR!R#R$R%R&tpreload_contentR toriginal_responsetpoolt
connection((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.pyR
Ps&						$					cCs&|j|jkr"|jjd�StS(s
        Should we redirect and where to?

        :returns: Truthy redirect location string if we got a redirect status
            code and valid location. ``None`` if redirect status and no
            location. ``False`` if not a redirect status code.
        tlocation(R#tREDIRECT_STATUSESR!tgetR(R((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.pytget_redirect_locationlscCs8|js|jrdS|jj|j�d|_dS(N(R.R/t	_put_connR(R((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.pytrelease_connyscCs-|jr|jS|jr)|jdt�SdS(Nt
cache_content(R*R+RR(R((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.pyR�s		cCs|jS(s�
        Obtain the number of bytes pulled over the wire so far. May differ from
        the amount of content returned by :meth:``HTTPResponse.read`` if bytes
        are encoded on the wire (e.g, compressed).
        (R-(R((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.pyttell�sc	Cs�|jjdd�j�}|jdkrN||jkrNt|�|_qNn|dkrf|j}n|jdkrydSt	}z2|dkr�|jj
�}t}nAt	}|jj
|�}|dkr�|r�|jj�t}n|j
t|�7_
y(|r#|jr#|jj|�}nWn/ttjfk
rU}td||��nX|r�|r�|jr�|jjt��}|||jj�7}n|r�||_n|SWd|jr�|jj�r�|j�nXdS(sP
        Similar to :meth:`httplib.HTTPResponse.read`, but with two additional
        parameters: ``decode_content`` and ``cache_content``.

        :param amt:
            How much of the content to read. If specified, caching is skipped
            because it doesn't make sense to cache partial content as the full
            response.

        :param decode_content:
            If True, will attempt to decode the body based on the
            'content-encoding' header.

        :param cache_content:
            If True, will save the returned data such that the same result is
            returned despite of the state of the underlying file object. This
            is useful if you want the ``.data`` property to continue working
            after having ``.read()`` the file object. (Overridden if ``amt`` is
            set.)
        scontent-encodingRNisEReceived response with content-encoding: %s, but failed to decode it.(R!R8tlowerR'RtCONTENT_DECODERSRR R+RRRtcloseR-tlenRtIOErrorR	RRRtflushR*R,tisclosedR;(	RtamtR R<tcontent_encodingt
flush_decoderRtetbuf((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.pyR�sF	
	
iiccs@x9t|j�s;|jd|d|�}|r|VqqWdS(s_
        A generator wrapper for the read() method. A call will block until
        ``amt`` bytes have been read from the connection or until the
        connection is closed.

        :param amt:
            How much of the content to read. The generator will return up to
            much data per iteration, but may return less. This is particularly
            likely when using compressed data. However, the empty string will
            never be returned.

        :param decode_content:
            If True, will attempt to decode the body based on the
            'content-encoding' header.
        RER N(RR+R(RRER R((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.pytstream�scKs�t�}x*|j�D]\}}|j||�qWt|dd�}|d|d|d|jd|jd|jd|d||�S(	s
        Given an :class:`httplib.HTTPResponse` instance ``r``, return a
        corresponding :class:`urllib3.response.HTTPResponse` object.

        Remaining parameters are passed to the HTTPResponse constructor, along
        with ``original_response=r``.
        R&iR1R!R#R$R%R3(Rt
getheaderstaddRR#R$R%(tResponseClstrtresponse_kwR!tktvR&((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.pytfrom_httplib�s
				cCs|jS(N(R!(R((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.pyRKscCs|jj||�S(N(R!R8(RRtdefault((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.pyt	getheaderscCs|js|jj�ndS(N(tclosedR+R@(R((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.pyR@s	cCsV|jdkrtSt|jd�r/|jjSt|jd�rN|jj�StSdS(NRURD(R+RRR0RURD(R((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.pyRUs

cCsM|jdkrtd��n+t|jd�r=|jj�Std��dS(Ns-HTTPResponse has no file to get a fileno fromtfilenosPThe file-like object  this HTTPResponse is wrapped around has no file descriptor(R+RRBR0RV(R((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.pyRV&s

cCs2|jdk	r.t|jd�r.|jj�SdS(NRC(R+RR0RC(R((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.pyRC/s!cCstS(N(R(R((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.pytreadable3sNi(RRt__doc__R?R7RRR
R9R;tpropertyRR=RRRJtclassmethodRRRKRTR@RURVRCRW(((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.pyR6s(		
			N					(tloggingR	tiot_collectionsRt
exceptionsRtpackages.sixRR)RtutilRt	getLoggerRtlogtobjectRRtIOBaseR(((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.pyt<module>s	

Zerion Mini Shell 1.0