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/download.pyo

�
Bu�_c@s�dZddlZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZddl
mZddlmZmZmZdd	lmZmZmZdd
lmZerddlmZmZddlmZdd
lmZddlm Z nej!e"�Z#d�Z$d�Z%d�Z&d�Z'd�Z(d�Z)de*fd��YZ+de*fd��YZ,dS(s)Download files with progress indicators.
i����N(tCONTENT_CHUNK_SIZE(tDownloadProgressProvider(tNetworkConnectionError(tPyPI(t
is_from_cache(tHEADERStraise_for_statustresponse_chunks(tformat_sizetredact_auth_from_urltsplitext(tMYPY_CHECK_RUNNING(tIterabletOptional(tResponse(tLink(t
PipSessioncCs7yt|jd�SWntttfk
r2dSXdS(Nscontent-length(tinttheaderst
ValueErrortKeyErrort	TypeErrortNone(tresp((sO/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/download.pyt_get_http_response_size%scCst|�}|jtjkr*|j}n	|j}t|�}|r`dj|t|��}nt	|�rt
jd|�nt
jd|�t
j�t
jkr�t}n?t	|�r�t}n*|s�t}n|dkr�t}nt}t|t�}|s|St|d|�|�S(Ns{} ({})sUsing cached %ssDownloading %si(i�tmaxi@�(RtnetlocRtfile_storage_domaintshow_urlturl_without_fragmentR	tformatRRtloggertinfotgetEffectiveLeveltloggingtINFOtFalsetTrueRRR(Rtlinktprogress_barttotal_lengthturlt
logged_urlt
show_progresstchunks((sO/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/download.pyt_prepare_download-s2					cCstjj|�S(sJ
    Sanitize the "filename" value from a Content-Disposition header.
    (tostpathtbasename(tfilename((sO/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/download.pytsanitize_content_filenameYscCsCtj|�\}}|jd�}|r9t|�}n|pB|S(s�
    Parse the "filename" value from a Content-Disposition header, and
    return the default filename if the result is empty.
    R1(tcgitparse_headertgetR2(tcontent_dispositiontdefault_filenamet_typetparamsR1((sO/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/download.pytparse_content_dispositionas
cCs�|j}|jjd�}|r3t||�}nt|�d}|s}tj|jjdd��}|r}||7}q}n|r�|j|jkr�tj	j|j�d}|r�||7}q�n|S(soGet an ideal filename from the given HTTP response, falling back to
    the link filename if not provided.
    scontent-dispositioniscontent-typet(
R1RR5R:R
t	mimetypestguess_extensionR)R.R/(RR&R1R6text((sO/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/download.pyt_get_http_response_filenameps	cCsB|jjdd�d}|j|dtdt�}t|�|S(Nt#iiRtstream(R)tsplitR5RR%R(tsessionR&t
target_urlR((sO/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/download.pyt_http_get_download�s
tDownloadcBseZd�ZRS(cCs||_||_||_dS(N(tresponseR1R,(tselfRGR1R,((sO/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/download.pyt__init__�s		(t__name__t
__module__RI(((sO/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/download.pyRF�st
DownloadercBseZd�Zd�ZRS(cCs||_||_dS(N(t_sessiont
_progress_bar(RHRCR'((sO/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/download.pyRI�s	cCspyt|j|�}Wn/tk
rG}tjd|jj|��nXt|t||�t	|||j
��S(NsHTTP error %s while getting %s(RERMRRtcriticalRGtstatus_codeRFR?R-RN(RHR&Rte((sO/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/download.pyt__call__�s(RJRKRIRR(((sO/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/download.pyRL�s		(-t__doc__R3R"R<R.tpip._vendor.requests.modelsRtpip._internal.cli.progress_barsRtpip._internal.exceptionsRtpip._internal.models.indexRtpip._internal.network.cacheRtpip._internal.network.utilsRRRtpip._internal.utils.miscRR	R
tpip._internal.utils.typingRttypingRR
Rtpip._internal.models.linkRtpip._internal.network.sessionRt	getLoggerRJRRR-R2R:R?REtobjectRFRL(((sO/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/download.pyt<module>s4		,				

Zerion Mini Shell 1.0