Your IP : 3.133.122.95


Current Path : /opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyc

�
�Rec@s�dZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZmZm
Z
ddlmZddlmZmZddlmZddlmZddlmZdd	lmZdd
lmZddlmZddl m!Z!dd
l"m#Z#m$Z$ddl%m&Z&ddl'm(Z(m)Z)m*Z*ddl+m,Z,ddl-m.Z.e,r�ddl/m0Z0m1Z1m2Z2m3Z3m4Z4ddl5m6Z6e3e7e7e2e4e8e7ffZ9nej:e;�Z<e	j=dde�d+d,d-d.d/d0gZ?d1Z@d!�ZAd"�ZBd#efd$��YZCd%efd&��YZDd'efd(��YZEd)ejFfd*��YZGdS(2shPipSession and supporting code, containing all pip-specific
network request configuration and behavior.
i����N(trequeststsixturllib3(tCacheControlAdapter(tBaseAdaptertHTTPAdapter(tResponse(tCaseInsensitiveDict(tparse(tInsecureRequestWarning(t__version__(tMultiDomainBasicAuth(t
SafeFileCache(thas_tlst	ipaddress(tlibc_ver(tbuild_url_from_netloctget_installed_versiontparse_netloc(tMYPY_CHECK_RUNNING(turl_to_path(tIteratortListtOptionaltTupletUnion(tLinktignoretcategorythttpst*t	localhosts127.0.0.0/8s::1/128tfiletssht
BUILD_BUILDIDtBUILD_IDtCIt	PIP_IS_CIcCstd�tD��S(s?
    Return whether it looks like pip is running under CI.
    css|]}|tjkVqdS(N(tostenviron(t.0tname((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pys	<genexpr>`s(tanytCI_ENVIRONMENT_VARIABLES(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyt
looks_like_ciXsc	
CsIiidd6td6d6tj�d6itj�d6d6}|dddkrgtj�|dd<n�|dddkr�tjjd	kr�tjd
 }n	tj}djg|D]}t|�^q��|dd<nV|dddkrtj�|dd<n+|ddd
kr/tj�|dd<ntjj	d�r�ddl
m}tt
d�tdddg|j����}tt
d�tddgt����}|r�||d<n|r�||d<q�ntjj	d�rtj�dridd6tj�dd6|d<ntj�rFtj�|jdi�d<ntj�rqtj�|jdi�d<ntj�r�tj�|d<nt�r�ddl}|j|d<ntd�}|dk	r�||d <nt�r�tnd|d!<tjjd"�}|dk	r||d#<nd$j d%|d&t!j"|d'd+d*t��S(,s6
    Return a string representing the user agent.
    tpipR)tversiont	installertpythontimplementationtCPythontPyPytfinalit.tJythont
IronPythontlinuxi����(tdistrocSs|dS(Ni((tx((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyt<lambda>�ttidcSs|dS(Ni((R:((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyR;�R<tlibtlibcR9tdarwinitmacOStsystemtreleasetcpuNtopenssl_versiont
setuptoolstsetuptools_versiontcitPIP_USER_AGENT_USER_DATAt	user_datas9{data[installer][name]}/{data[installer][version]} {json}tdatatjsont
separatorst,t:t	sort_keys(RNRO(#R
tplatformtpython_versiontpython_implementationtsystpypy_version_infotreleaseleveltjointstrt
startswithtpip._vendorR9tdicttfiltertziptlinux_distributionRtmac_verRBt
setdefaultRCtmachineR
t_ssltOPENSSL_VERSIONRtNoneR,tTrueR&R'tgettformatRLtdumps(	RKRUR:R9tdistro_infosR?tsslRGRJ((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyt
user_agentcsd
	-$
"%	

	tLocalFSAdaptercBs)eZdddddd�Zd�ZRS(c
Cs�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(RturlRtstatus_codeR&tstattOSErrortrawtemailtutilst
formatdatetst_mtimeRet	mimetypest
guess_typeRtst_sizetheaderstopentclose(
tselftrequesttstreamttimeouttverifytcerttproxiestpathnametresptstatstexctmodifiedtcontent_type((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pytsend�s$			

cCsdS(N((R~((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyR}�sN(t__name__t
__module__RdR�R}(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyRl�stInsecureHTTPAdaptercBseZd�ZRS(c	Cs/tt|�jd|d|dtd|�dS(NtconnRoR�R�(tsuperR�tcert_verifytFalse(R~R�RoR�R�((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyR��s(R�R�R�(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyR��stInsecureCacheControlAdaptercBseZd�ZRS(c	Cs/tt|�jd|d|dtd|�dS(NR�RoR�R�(R�R�R�R�(R~R�RoR�R�((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyR��s(R�R�R�(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyR��st
PipSessioncBsAeZdZd�Zded�Zd�Zd�Zd�Z	RS(c
Osz|jdd�}|jdd�}|jdg�}|jdd�}tt|�j||�g|_t�|jd<td|�|_	t
jd|dd	d
ddgd
d�}td|�}|rt
dt|�d|�}tdt|�d|�|_ntd|�}||_|jd|�|jd|�|jdt��x!|D]}	|j|	dt�qYWdS(sj
        :param trusted_hosts: Domains not to emit warnings for when not using
            HTTPS.
        tretriesitcachet
trusted_hostst
index_urlss
User-Agentttotaltstatus_forcelisti�i�iitbackoff_factorg�?tmax_retriesshttps://shttp://sfile://tsuppress_loggingN(tpopRdR�R�t__init__tpip_trusted_originsRkR{RtauthRtRetryR�RRR�t_trusted_host_adapterRtmountRltadd_trusted_hostRe(
R~targstkwargsR�R�R�R�tinsecure_adaptertsecure_adapterthost((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyR��s6					
cCs�|sGdj|�}|dk	r7|dj|�7}ntj|�nt|�}||jkru|jj|�n|jt|�d|j	�|ds�|jt|�d|j	�ndS(s�
        :param host: It is okay to provide a host that has previously been
            added.
        :param source: An optional source string, for logging where the host
            string came from.
        sadding trusted host: {!r}s
 (from {})t/iRON(
RgRdtloggertinfoRR�tappendR�RR�(R~R�tsourceR�tmsgt	host_port((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyR�4s



ccsTxtD]}|VqWx7|jD],\}}d||dkrDdn|fVq WdS(NR(tSECURE_ORIGINSR�Rd(R~t
secure_originR�tport((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pytiter_secure_originsQs
	cCsjtjt|��}|j|j|j}}}|jdd�d}x|j�D]�}|\}}}	||kr�|dkr�qUnyFtj	|dkr�dntj|��}
tj
tj|��}WnAtk
r|r$|j�|j�kr$|dkr$qUq$nX|
|kr$qUn||	krN|	dkrN|	dk	rNqUntSWtjd||�tS(Nt+ii����Rs�The repository located at %s is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host %s'.(turllib_parseturlparseRXtschemethostnameR�trsplitR�Rt
ip_addressRdRtensure_textt
ip_networkt
ValueErrortlowerReR�twarningR�(R~tlocationtparsedtorigin_protocoltorigin_hosttorigin_portR�tsecure_protocoltsecure_hosttsecure_porttaddrtnetwork((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pytis_secure_originXs<

cOs2|jd|j�tt|�j||||�S(NR�(R`R�R�R�R(R~tmethodRoR�R�((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyR�sN(
R�R�RdR�R�R�R�R�R�R(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyR��s	L		H(RRR(RRR(Rs127.0.0.0/8R(Rs::1/128R(R RN(R!RR(R"R#R$R%(Ht__doc__temail.utilsRtRLtloggingRxR&RQRTtwarningsRZRRRtpip._vendor.cachecontrolRtpip._vendor.requests.adaptersRRtpip._vendor.requests.modelsRtpip._vendor.requests.structuresRtpip._vendor.six.moves.urllibRR�tpip._vendor.urllib3.exceptionsR	R-R
tpip._internal.network.authRtpip._internal.network.cacheRtpip._internal.utils.compatR
Rtpip._internal.utils.glibcRtpip._internal.utils.miscRRRtpip._internal.utils.typingRtpip._internal.utils.urlsRttypingRRRRRtpip._internal.models.linkRRXtinttSecureOrigint	getLoggerR�R�tfilterwarningsRdR�R+R,RkRlR�R�tSessionR�(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyt<module>sZ($	
		P!

?>