ok

Mini Shell

Direktori : /proc/self/root/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/
Upload File :
Current File : //proc/self/root/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/lazy_wheel.pyo

�
Bu�_c@sZdZddgZddlmZmZddlmZddlmZddl	m
Z
mZddlm
Z
dd	lmZdd
lmZmZmZddlmZddlmZer!dd
lmZmZmZmZmZmZddlm Z ddlm!Z!ddl"m#Z#nde$fd��YZ%d�Z&de'fd��YZ(dS(sLazy ZIP over HTTPtHTTPRangeRequestUnsupportedtdist_from_wheel_urli����(tbisect_lefttbisect_right(tcontextmanager(tNamedTemporaryFile(t
BadZipfiletZipFile(tCONTENT_CHUNK_SIZE(trange(tHEADERStraise_for_statustresponse_chunks(tMYPY_CHECK_RUNNING(t$pkg_resources_distribution_for_wheel(tAnytDicttIteratortListtOptionaltTuple(tDistribution(tResponse(t
PipSessioncBseZRS((t__name__t
__module__(((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/lazy_wheel.pyRscCs;t||��&}t|�}t|||j�SWdQXdS(s%Return a pkg_resources.Distribution from the given wheel URL.

    This uses HTTP range requests to only fetch the potion of the wheel
    containing metadata, just enough for the object to be constructed.
    If such requests are not supported, HTTPRangeRequestUnsupported
    is raised.
    N(tLazyZipOverHTTPRRtname(Rturltsessiontwheeltzip_file((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/lazy_wheel.pyR"s	RcBs�eZdZed�Zed��Zed��Zd�Zd�Z	ed��Z
dd�Zd	�Zd
d�Z
d�Zdd
�Zd�Zd�Zd�Zed��Zd�Zed�Zd�Zd�ZRS(sFile-like object mapped to a ZIP file over HTTP.

    This uses HTTP range requests to lazily fetch the file's content,
    which is supposed to be fed to ZipFile.  If such requests are not
    supported by the server, raise HTTPRangeRequestUnsupported
    during initialization.
    cCs�|j|dt�}t|�||||_|_|_t|jd�|_t	�|_
|j|j�g|_g|_
d|jjdd�kr�td��n|j�dS(NtheaderssContent-Lengthtbytess
Accept-Rangestnonesrange request is not supported(theadR
Rt_sessiont_urlt_chunk_sizetintR t_lengthRt_filettruncatet_leftt_righttgetRt
_check_zip(tselfRRt
chunk_sizeR#((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/lazy_wheel.pyt__init__=s
		cCsdS(s!Opening mode, which is always rb.trb((R/((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/lazy_wheel.pytmodeLscCs
|jjS(sPath to the underlying file.(R)R(R/((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/lazy_wheel.pyRRscCstS(s9Return whether random access is supported, which is True.(tTrue(R/((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/lazy_wheel.pytseekableXscCs|jj�dS(sClose the file.N(R)tclose(R/((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/lazy_wheel.pyR6]scCs
|jjS(sWhether the file is closed.(R)tclosed(R/((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/lazy_wheel.pyR7bsi����cCs�t||j�}|j�|j}}|dkr:|nt|||�}td||�}|j||d�|jj|�S(s�Read up to size bytes from the object and return them.

        As a convenience, if size is unspecified or -1,
        all bytes until EOF are returned.  Fewer than
        size bytes may be returned if EOF is reached.
        ii(tmaxR&ttellR(tmint	_downloadR)tread(R/tsizet
download_sizetstarttlengthtstop((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/lazy_wheel.pyR<hs%cCstS(s3Return whether the file is readable, which is True.(R4(R/((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/lazy_wheel.pytreadablewsicCs|jj||�S(s-Change stream position and return the new absolute position.

        Seek to offset relative position indicated by whence:
        * 0: Start of stream (the default).  pos should be >= 0;
        * 1: Current position - pos may be negative;
        * 2: End of stream - pos usually negative.
        (R)tseek(R/toffsettwhence((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/lazy_wheel.pyRC|s	cCs
|jj�S(sReturn the current possition.(R)R9(R/((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/lazy_wheel.pyR9�scCs|jj|�S(s�Resize the stream to the given size in bytes.

        If size is unspecified resize to the current position.
        The current stream position isn't changed.

        Return the new file size.
        (R)R*(R/R=((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/lazy_wheel.pyR*�s	cCstS(s
Return False.(tFalse(R/((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/lazy_wheel.pytwritable�scCs|jj�|S(N(R)t	__enter__(R/((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/lazy_wheel.pyRH�s
cGs|jj|�S(N(R)t__exit__(R/texc((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/lazy_wheel.pyRI�sccs*|j�}z	dVWd|j|�XdS(syReturn a context manager keeping the position.

        At the end of the block, seek back to original position.
        N(R9RC(R/tpos((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/lazy_wheel.pyt_stay�s	c
Cs}|jd}xittd||j��D]L}|j||�|j��(yt|�Wntk
rmnXPWdQXq)WdS(s1Check and download until the file is a valid ZIP.iiN(R(treversedR	R&R;RLRR(R/tendR?((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/lazy_wheel.pyR.�s
"

cCsK|j�}dj||�|d<d|d<|jj|jd|dt�S(s:Return HTTP response to a range request from start to end.sbytes={}-{}tRangesno-caches
Cache-ControlR tstream(tcopytformatR$R-R%R4(R/R?RNtbase_headersR ((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/lazy_wheel.pyt_stream_response�s
c
cs�|j||!|j||!}}t|g|d �}}t|g|d�}xEt||�D]4\}}	||kr�||dfVn|	d}qcW||kr�||fVn|g|g|j||+|j||+dS(s/Return an iterator of intervals to be fetched.

        Args:
            start (int): Start of needed interval
            end (int): End of needed interval
            left (int): Index of first overlapping downloaded data
            right (int): Index after last overlapping downloaded data
        ii����N(R+R,R:R8tzip(
R/R?RNtlefttrighttlslicetrslicetitjtk((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/lazy_wheel.pyt_merge�s
!c	Cs�|j���t|j|�}t|j|�}x||j||||�D]b\}}|j||�}|j�|j|�x*t	||j
�D]}|jj|�q�WqJWWdQXdS(s-Download bytes from start to end inclusively.N(
RLRR,RR+R]RTRRCRR&R)twrite(R/R?RNRVRWtresponsetchunk((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/lazy_wheel.pyR;�s
%

N(RRt__doc__RR1tpropertyR3RR5R6R7R<RBRCR9tNoneR*RGRHRIRRLR.R
RTR]R;(((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/lazy_wheel.pyR4s(							
			N()Rat__all__tbisectRRt
contextlibRttempfileRtzipfileRRtpip._vendor.requests.modelsRtpip._vendor.six.movesR	tpip._internal.network.utilsR
RRtpip._internal.utils.typingR
tpip._internal.utils.wheelRttypingRRRRRRtpip._vendor.pkg_resourcesRRtpip._internal.network.sessionRt	ExceptionRRtobjectR(((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/lazy_wheel.pyt<module>s$.	

Zerion Mini Shell 1.0