KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache
System : Linux cs317.bluehost.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : andertr9 ( 1047)
PHP Version : 8.2.18
Disable Function : NONE
Directory :  /lib/python2.7/site-packages/pip/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python2.7/site-packages/pip/download.pyc
�
>�P_c
@@sqddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZyddlZeZWnek
r�eZnXddlmZddlmZddlZddlmZmZddlmZddlm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)ddl*m+Z+dd	l,m-Z-dd
l.m/Z/ddl0m1Z1ddl2m3Z3m4Z4dd
l5m6Z6ddl7m8Z8ddl9m:Z:m;Z;ddl<m=Z=m>Z>ddl?m@Z@mAZAddlBmCZCmDZDddlEmFZFddlGmHZHddlImJZJddlKmLZLddlMmNZNddlOmPZPdddddddd d!d"d#d$d%g
ZQejReS�ZTd&�ZUd'e@fd(��YZVd)e=fd*��YZWd+eLfd,��YZXd-e>fd.��YZYd/e:jZfd0��YZ[ddd1�Z]ej^d2ej_�Z`ej^d3ej_�Zad4�Zbd5�Zcd6�Zdd7�Zed8�Zfd9�Zgd:�Zhd;�Zid<�Zjd=�Zkd>�Zld?�Zmdddd@�ZndddA�ZodB�ZpdCePjqfdD��YZrdedddE�ZsdF�ZtdG�ZudH�ZvdI�ZwdS(Ji(tabsolute_importN(tparse(trequest(tInstallationErrortHashMismatch(tPyPI(
tsplitexttrmtreetformat_sizetdisplay_patht
backup_dirtask_path_existstunpack_filetARCHIVE_EXTENSIONStconsumetcall_subprocess(tauto_decode(tcheck_path_owner(t
indent_log(tSETUPTOOLS_SHIM(tDownloadProgressBartDownloadProgressSpinner(twrite_delete_marker_file(tvcs(trequeststsix(tBaseAdaptertHTTPAdapter(tAuthBaset
HTTPBasicAuth(tCONTENT_CHUNK_SIZEtResponse(tCaseInsensitiveDict(turllib3(tCacheControlAdapter(t	FileCache(t	LockError(t
xmlrpc_clienttget_file_contenttis_urlturl_to_pathtpath_to_urltis_archive_filetunpack_vcs_linktunpack_file_urlt
is_vcs_urltis_file_urltunpack_http_urlt
unpack_urltparse_content_dispositiontsanitize_content_filenamecC@s�iidd6tjd6d6tj�d6itj�d6d6}|dddkrjtj�|dd<n�|dddkr�tjjd	kr�tjd
 }n	tj}djg|D]}t	|�^q��|dd<nV|dddkrtj�|dd<n+|ddd
kr2tj�|dd<ntjj
d�r�ttd�t
dddgtj����}ttd�t
ddgtj����}|r�||d<n|r�||d<q�ntjj
d�rtj�dridd6tj�dd6|d<ntj�r<tj�|jdi�d<ntj�rgtj�|jdi�d<ntj�r�tj�|d<ntr�tjd d%kr�tj|d<ndjd|d tj|d!d&d$t��S('s6
    Return a string representing the user agent.
    tpiptnametversiont	installertpythontimplementationtCPythontPyPytfinalit.tJythont
IronPythontlinuxcS@s|dS(Ni((tx((s0/usr/lib/python2.7/site-packages/pip/download.pyt<lambda>]stidcS@s|dS(Ni((R@((s0/usr/lib/python2.7/site-packages/pip/download.pyRAastlibtlibctdistrotdarwinisOS Xtsystemtreleasetcpuiitopenssl_versions9{data[installer][name]}/{data[installer][version]} {json}tdatatjsont
separatorst,t:t	sort_keys(ii(RNRO(R3t__version__tplatformtpython_versiontpython_implementationtsystpypy_version_infotreleaseleveltjointstrt
startswithtdicttfiltertziptlinux_distributiontlibc_vertmac_verRGt
setdefaultRHtmachinetHAS_TLStversion_infotssltOPENSSL_VERSIONtformatRLtdumpstTrue(RKRVR@RERD((s0/usr/lib/python2.7/site-packages/pip/download.pyt
user_agent>sR
	-$!
"%	tMultiDomainBasicAuthcB@s/eZed�Zd�Zd�Zd�ZRS(cC@s||_i|_dS(N(t	promptingt	passwords(tselfRl((s0/usr/lib/python2.7/site-packages/pip/download.pyt__init__�s	cC@s�tj|j�}|jjdd�d}tj|d |f|d�|_|jj|d�\}}|dkr�|j	|j�\}}n|s�|r�||f|j|<t
|p�d|p�d�|�}n|jd|j�|S(Nt@ii����ittresponse(NN(
turllib_parseturlparseturltnetloctrsplitt
urlunparseRmtgettNonetparse_credentialsRt
register_hookt
handle_401(RntreqtparsedRvtusernametpassword((s0/usr/lib/python2.7/site-packages/pip/download.pyt__call__�s%$cK@s�|jdkr|S|js |Stj|j�}tjjd|j�}t	j	d�}|sf|r||f|j
|j<n|j|jj
�t|p�d|p�d�|j�}|jj||�}|jj|�|S(Ni�s
User for %s: s
Password: Rq(tstatus_codeRlRsRtRuRtmovestinputRvtgetpassRmtcontenttrawtrelease_connRRt
connectiontsendthistorytappend(RntresptkwargsRR�R�R~tnew_resp((s0/usr/lib/python2.7/site-packages/pip/download.pyR}�s	
$cC@sLd|krH|jdd�d}d|kr>|jdd�S|dfSdS(NRpiiRO(NN(RwtsplitRz(RnRvtuserinfo((s0/usr/lib/python2.7/site-packages/pip/download.pyR{�s
(t__name__t
__module__RiRoR�R}R{(((s0/usr/lib/python2.7/site-packages/pip/download.pyRks		"tLocalFSAdaptercB@s)eZdddddd�Zd�ZRS(c
C@s�t|j�}t�}d|_|j|_ytj|�}	Wn%tk
rg}
d|_|
|_n}Xtj	j
|	jdt�}t
j|�dp�d}ti|d6|	jd6|d6�|_t|d	�|_|jj|_|S(
Ni�i�tusegmtis
text/plainsContent-TypesContent-Lengths
Last-Modifiedtrb(R(RuRR�toststattOSErrorR�temailtutilst
formatdatetst_mtimeRit	mimetypest
guess_typeR tst_sizetheaderstopentclose(
RnRtstreamttimeouttverifytcerttproxiestpathnameR�tstatstexctmodifiedtcontent_type((s0/usr/lib/python2.7/site-packages/pip/download.pyR��s$			

cC@sdS(N((Rn((s0/usr/lib/python2.7/site-packages/pip/download.pyR��sN(R�R�RzR�R�(((s0/usr/lib/python2.7/site-packages/pip/download.pyR��st
SafeFileCachecB@s2eZdZd�Zd�Zd�Zd�ZRS(sw
    A file based cache which is safe to use even when the target directory may
    not be accessible or writable.
    cO@sKtt|�j||�t|j�sGtjd|j�d|_ndS(Ns�The directory '%s' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.(tsuperR�RoRt	directorytloggertwarningRz(RntargsR�((s0/usr/lib/python2.7/site-packages/pip/download.pyRo�s
cO@sQ|jdkrdSytt|�j||�SWntttfk
rLnXdS(N(R�RzR�R�RyR$R�tIOError(RnR�R�((s0/usr/lib/python2.7/site-packages/pip/download.pyRyscO@sQ|jdkrdSytt|�j||�SWntttfk
rLnXdS(N(R�RzR�R�tsetR$R�R�(RnR�R�((s0/usr/lib/python2.7/site-packages/pip/download.pyR�scO@sQ|jdkrdSytt|�j||�SWntttfk
rLnXdS(N(R�RzR�R�tdeleteR$R�R�(RnR�R�((s0/usr/lib/python2.7/site-packages/pip/download.pyR�!s(R�R�t__doc__RoRyR�R�(((s0/usr/lib/python2.7/site-packages/pip/download.pyR��s
		
	
tInsecureHTTPAdaptercB@seZd�ZRS(cC@sd|_d|_dS(Nt	CERT_NONE(t	cert_reqsRztca_certs(RntconnRuR�R�((s0/usr/lib/python2.7/site-packages/pip/download.pytcert_verify1s	(R�R�R�(((s0/usr/lib/python2.7/site-packages/pip/download.pyR�/st
PipSessioncB@s eZdZd�Zd�ZRS(c	O@s5|jdd�}|jdd�}|jdg�}tt|�j||�t�|jd<t�|_t	j
d|ddgd	d
�}|r�tdt|dt
�d|�}ntd|�}td|�}|jd
|�|jd|�|jdt��x'|D]}|jdj|�|�qWdS(Ntretriesitcachetinsecure_hostss
User-Agentttotaltstatus_forcelisti�tbackoff_factorg�?tuse_dir_locktmax_retriesshttps://shttp://sfile://shttps://{0}/(tpopRzR�R�RoRjR�RktauthR!tRetryR"R�RiRR�tmountR�Rg(	RnR�R�R�R�R�tsecure_adaptertinsecure_adapterthost((s0/usr/lib/python2.7/site-packages/pip/download.pyRo:s*			
cO@s2|jd|j�tt|�j||||�S(NR�(RaR�R�R�R(RntmethodRuR�R�((s0/usr/lib/python2.7/site-packages/pip/download.pyRvsN(R�R�RzR�RoR(((s0/usr/lib/python2.7/site-packages/pip/download.pyR�6s	<c
C@s�|dkrtd��ntj|�}|r[|jd�j�}|dkr|r|jd�rtd||f��n|dkr/|jdd�d}|j	dd�}t
j|�}|r�|jd�d|jd	d�d}ntj
|�}|jd�r&d|jd�}n|}q[|j|�}|j�|j|jfSny.t|d
��}t|j��}WdQXWn)tk
r�}	tdt|	���nX||fS(
s�Gets the content of a file; it may be a filename, file: URL, or
    http: URL.  Returns (location, content).  Content is unicode.sAget_file_content() missing 1 required keyword argument: 'session'itfilethttps6Requirements file %s references URL %s, which is localROs\t/t|R�Ns$Could not open requirements file: %s(Rzt	TypeErrort
_scheme_retsearchtgrouptlowerRZRR�treplacet_url_slash_drive_retmatchRstunquotetlstripRytraise_for_statusRuttextR�RtreadR�RY(
Rut
comes_fromtsessionR�tschemetpathR�tfR�R�((s0/usr/lib/python2.7/site-packages/pip/download.pyR&~s>*	
s^(http|https|file):s/*([a-z])\|cC@sId|krtS|jdd�dj�}|ddddgtjkS(s)Returns true if the name looks like a URLROiiR�thttpsR�tftp(tFalseR�R�Rtall_schemes(R4R�((s0/usr/lib/python2.7/site-packages/pip/download.pyR'�scC@sg|jd�std|��tj|�\}}}}}|rPd|}ntj||�}|S(s(
    Convert a file: URL to a path.
    sfile:s4You can only turn file: urls into filenames (not %r)s\\(RZtAssertionErrorRsturlsplitturllib_requestturl2pathname(Rut_RvR�((s0/usr/lib/python2.7/site-packages/pip/download.pyR(�s

cC@s=tjjtjj|��}tjdtj|��}|S(sh
    Convert a path to a file: URL.  The path will be made absolute and have
    quoted path parts.
    sfile:(R�R�tnormpathtabspathRsturljoinR�tpathname2url(R�Ru((s0/usr/lib/python2.7/site-packages/pip/download.pyR)�scC@s*t|�dj�}|tkr&tStS(s9Return True if `name` is a considered as an archive file.i(RR�R
RiR�(R4text((s0/usr/lib/python2.7/site-packages/pip/download.pyR*�scC@st|�}|j|�dS(N(t_get_used_vcs_backendtunpack(tlinktlocationtvcs_backend((s0/usr/lib/python2.7/site-packages/pip/download.pyR+�scC@s=x6tjD]+}|j|jkr
||j�}|Sq
WdS(N(RtbackendsR�tschemesRu(R�tbackendR�((s0/usr/lib/python2.7/site-packages/pip/download.pyR��scC@stt|��S(N(tboolR�(R�((s0/usr/lib/python2.7/site-packages/pip/download.pyR-�scC@s|jj�jd�S(Nsfile:(RuR�RZ(R�((s0/usr/lib/python2.7/site-packages/pip/download.pyR.�scC@st|j�}tjj|�S(s�Return whether a file:// Link points to a directory.

    ``link`` must not have any other scheme but file://. Call is_file_url()
    first.

    (R(turl_without_fragmentR�R�tisdir(R�t	link_path((s0/usr/lib/python2.7/site-packages/pip/download.pyt
is_dir_url�scO@s|S(N((titerableR�R�((s0/usr/lib/python2.7/site-packages/pip/download.pyt_progress_indicator�sc
@s�yt�jd�}Wn tttfk
r9d}nXt�dt�}tj�t	j
krjt}n9|ryt}n*|d
kr�t}n|s�t}nt}|j}�fd�}�fd�}	t
}
|jtjkr�|}n	|j}|rM|r.tjd|t|��td	|�j}
qvtjd
|�t�j}
n)|rftjd|�ntjd
|�tjd|�|	|
|t�t��}|r�|j|�n
t|�dS(Nscontent-lengthit
from_cachei(i�c3@sry,x%�jj|dt�D]}|VqWWn?tk
rmx/tri�jj|�}|saPn|Vq?WnXdS(Ntdecode_content(R�R�R�tAttributeErrorRiR�(t
chunk_sizetchunk(R�(s0/usr/lib/python2.7/site-packages/pip/download.pyt	resp_reads


	c3@s'x |D]}�j|�|VqWdS(N(twrite(tchunksR(tcontent_file(s0/usr/lib/python2.7/site-packages/pip/download.pytwritten_chunks3s

sDownloading %s (%s)tmaxsDownloading %ssUsing cached %ssDownloading from URL %si@�(tintR�t
ValueErrortKeyErrorR�tgetattrR�R�tgetEffectiveLeveltloggingtINFORitshow_urlRRvRR�tinfoRRtiterRtdebugRtcheck_against_chunksR(
R�R�Rthashesttotal_lengthtcached_respt
show_progressRRRtprogress_indicatorRutdownloaded_chunks((RR�s0/usr/lib/python2.7/site-packages/pip/download.pyt
_download_url�sL
					%			cC@st}tjj||j�}tjj|�r�tdt|�d�}|dkr^t}q�|dkr�t	j
dt|��tj|�q�|dkr�t|�}t	j
dt|�t|��t
j||�q�n|rt
j||�t	jdt|��ndS(	Ns/The file %s exists. (i)gnore, (w)ipe, (b)ackup titwtbsDeleting %ssBacking up %s to %ssSaved %s(R!R"R#(RiR�R�RXtfilenametexistsRR	R�R�R�tremoveR
tshutiltmovetcopyR(R$R�R�R)tdownload_locationRrt	dest_file((s0/usr/lib/python2.7/site-packages/pip/download.pyt
_copy_fileYs*		
c	C@s�|dkrtd��ntjdd�}d}|rNt|||�}n|rp|}tj|�d}nt||||�\}}t||||�|r�|r�t	|||�n|s�t
j|�nt|�dS(Ns@unpack_http_url() missing 1 required keyword argument: 'session's-unpackspip-i(
RzR�ttempfiletmkdtempt_check_download_dirR�R�t_download_http_urlRR,R�tunlinkR(	R�R�tdownload_dirR�Rttemp_dirtalready_downloaded_patht	from_pathR�((s0/usr/lib/python2.7/site-packages/pip/download.pyR/rs,
cC@st|j�}t|�rjtjj|�r:t|�ntj||dt	�|rft
jd�ndS|r�|j|�nd}|r�t|||�}n|r�|}n|}tj|�d}t||||�|r�|r�t|||�ndS(s�Unpack link into location.

    If download_dir is provided and link points to a file, make a copy
    of the link file inside download_dir.
    tsymlinkss*Link is a directory, ignoring download_dirNi(R(R�RR�R�R�RR'tcopytreeRiR�Rtcheck_against_pathRzR/R�R�RR,(R�R�R2RR�R4R5R�((s0/usr/lib/python2.7/site-packages/pip/download.pyR,�s,
	
c
C@s�tjj|�rt|�nd}tjg}|jd�|jt|�|jd�|d|g7}tj	d|�t
��t|d|dt�WdQXtjj
|tj|�d	�}tj	d
||�t||dddd�dS(
s�Copy distribution files in `link_path` to `location`.

    Invoked when user requests to install a local directory. E.g.:

        pip install .
        pip install ~/dev/git-repos/python-prompt-toolkit

    ssetup.pys-ctsdists
--dist-dirsRunning setup.py sdist for %stcwdtshow_stdoutNisUnpacking sdist %s into %sR�R�(R�R�R�RRUt
executableR�RR�RRRR�RXtlistdirRRz(R�R�tsetup_pyt
sdist_argsR9((s0/usr/lib/python2.7/site-packages/pip/download.pyt_copy_dist_from_dir�s



"tPipXmlrpcTransportcB@s&eZdZed�Zed�ZRS(sRProvide a `xmlrpclib.Transport` implementation via a `PipSession`
    object.
    cC@s;tjj||�tj|�}|j|_||_dS(N(R%t	TransportRoRsRtR�t_schemet_session(Rnt	index_urlR�tuse_datetimetindex_parts((s0/usr/lib/python2.7/site-packages/pip/download.pyRo�sc
C@s�|j||dddf}tj|�}yXidd6}|jj|d|d|dt�}|j�||_|j	|j
�SWn2tjk
r�}	t
jd|	jj|��nXdS(Nstext/xmlsContent-TypeRKR�R�sHTTP error %s while getting %s(RCRzRsRxRDtpostRiR�tverbosetparse_responseR�Rt	HTTPErrorR�tcriticalRrR�(
RnR�thandlertrequest_bodyRItpartsRuR�RrR�((s0/usr/lib/python2.7/site-packages/pip/download.pyR�s

	(R�R�R�R�RoR(((s0/usr/lib/python2.7/site-packages/pip/download.pyRA�scC@s�t|�rt||�nVt|�rAt|||d|�n1|dkrYt�}nt||||d|�|r�t|�ndS(svUnpack link.
       If link is a VCS link:
         if only_download, export into download_dir and ignore location
          else unpack into location
       for other types of link:
         - unpack into location
         - if download_dir, copy the file into download_dir
         - if only_download, mark location for deletion

    :param hashes: A Hashes object, one of whose embedded hashes must match,
        or HashMismatch will be raised. If the Hashes is empty, no matches are
        required, and unhashable types of requirements (like VCS ones, which
        would ordinarily raise HashUnsupported) are allowed.
    RN(R-R+R.R,RzR�R/R(R�R�R2t
only_downloadR�R((s0/usr/lib/python2.7/site-packages/pip/download.pyR0	scC@stjj|�S(sJ
    Sanitize the "filename" value from a Content-Disposition header.
    (R�R�tbasename(R$((s0/usr/lib/python2.7/site-packages/pip/download.pyR21scC@sCtj|�\}}|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.
    R$(tcgitparse_headerRyR2(tcontent_dispositiontdefault_filenamet_typetparamsR$((s0/usr/lib/python2.7/site-packages/pip/download.pyR19s
c

C@s�|jjdd�d}y0|j|didd6dt�}|j�Wn2tjk
r}}tjd|j	j
|��nX|jjd	d
�}|j}|jjd�}	|	r�t
|	|�}nt|�d}
|
stj|�}
|
r||
7}qn|
rI|j|jkrItjj|j�d}
|
rI||
7}qIntjj||�}t|d��}t||||�Wd
QX||fS(s6Download link url into temp_dir using provided sessiont#iiR�tidentitysAccept-EncodingR�sHTTP error %s while getting %sscontent-typeRqscontent-dispositiontwbN(RuR�RyRiR�RRKR�RLRrR�R�R$R1RR�tguess_extensionR�R�RXR�R (
R�R�R3Rt
target_urlR�R�R�R$RTR�t	file_pathR((s0/usr/lib/python2.7/site-packages/pip/download.pyR0Hs:
		cC@s�tjj||j�}tjj|�r�tjd|�|r�y|j|�Wq�tk
r�tj	d|�tj
|�dSXn|SdS(s� Check download_dir for previously downloaded file with correct hash
        If a correct file is found return its path else None
    sFile was already downloaded %ss;Previously-downloaded file %s has bad hash. Re-downloading.N(R�R�RXR$R%R�RR8RR�R1Rz(R�R2Rt
download_path((s0/usr/lib/python2.7/site-packages/pip/download.pyR/�s

(xt
__future__RRRtemail.utilsR�R�RLRR�R�RRtreR'RUR-ReRiRctImportErrorR�tpip._vendor.six.moves.urllibRRsRR�R3tpip.exceptionsRRt
pip.modelsRt	pip.utilsRRRR	R
RRR
RRtpip.utils.encodingRtpip.utils.filesystemRtpip.utils.loggingRtpip.utils.setuptools_buildRtpip.utils.uiRRt
pip.locationsRtpip.vcsRtpip._vendorRRtpip._vendor.requests.adaptersRRtpip._vendor.requests.authRRtpip._vendor.requests.modelsRRtpip._vendor.requests.structuresR tpip._vendor.requests.packagesR!tpip._vendor.cachecontrolR"tpip._vendor.cachecontrol.cachesR#tpip._vendor.lockfileR$tpip._vendor.six.movesR%t__all__t	getLoggerR�R�RjRkR�R�R�tSessionR�RzR&tcompiletIR�R�R'R(R)R*R+R�R-R.RRR R,R/R,R@RBRAR0R2R1R0R/(((s0/usr/lib/python2.7/site-packages/pip/download.pyt<module>s�


F			AM!BH)			
								`	&0	$'			8

Anon7 - 2021