ok

Mini Shell

Direktori : /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

�
x�_c@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((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pys	<genexpr>`s(tanytCI_ENVIRONMENT_VARIABLES(((sN/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((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyt<lambda>�stidcSs|dS(Ni((R:((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyR;�stlibtlibcR9tdarwinitmacOStsystemtreleasetcpuNtopenssl_versiont
setuptoolstsetuptools_versiontcitPIP_USER_AGENT_USER_DATAt	user_datas9{data[installer][name]}/{data[installer][version]} {json}tdatatjsont
separatorst,t:t	sort_keys(RMRN(#R
tplatformtpython_versiontpython_implementationtsystpypy_version_infotreleaseleveltjointstrt
startswithtpip._vendorR9tdicttfiltertziptlinux_distributionRtmac_verRAt
setdefaultRBtmachineR
t_ssltOPENSSL_VERSIONRtNoneR,tTrueR&R'tgettformatRKtdumps(	RJRTR:R9tdistro_infosR>tsslRFRI((sN/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_mtimeRdt	mimetypest
guess_typeRtst_sizetheaderstopentclose(
tselftrequesttstreamttimeouttverifytcerttproxiestpathnametresptstatstexctmodifiedtcontent_type((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pytsend�s$			

cCsdS(N((R}((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyR|�sN(t__name__t
__module__RcR�R|(((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyRk�stInsecureHTTPAdaptercBseZd�ZRS(c	Cs/tt|�jd|d|dtd|�dS(NtconnRnR�R�(tsuperR�tcert_verifytFalse(R}R�RnR�R�((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyR��s(R�R�R�(((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyR��stInsecureCacheControlAdaptercBseZd�ZRS(c	Cs/tt|�jd|d|dtd|�dS(NR�RnR�R�(R�R�R�R�(R}R�RnR�R�((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyR��s(R�R�R�(((sN/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(tpopRcR�R�t__init__tpip_trusted_originsRjRzRtauthRtRetryR�RRR�t_trusted_host_adapterRtmountRktadd_trusted_hostRd(
R}targstkwargsR�R�R�R�tinsecure_adaptertsecure_adapterthost((sN/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/iRNN(
RfRctloggertinfoRR�tappendR�RR�(R}R�tsourceR�tmsgt	host_port((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyR�4s



ccsTxtD]}|VqWx7|jD],\}}d||dkrDdn|fVq WdS(NR(tSECURE_ORIGINSR�Rc(R}t
secure_originR�tport((sN/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_parseturlparseRWtschemethostnameR�trsplitR�Rt
ip_addressRcRtensure_textt
ip_networkt
ValueErrortlowerRdR�twarningR�(R}tlocationtparsedtorigin_protocoltorigin_hosttorigin_portR�tsecure_protocoltsecure_hosttsecure_porttaddrtnetwork((sN/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}tmethodRnR�R�((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyR~�sN(
R�R�RcR�R�R�R�R�R�R~(((sN/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(sfileRN(R!RR(R"R#R$R%(Ht__doc__temail.utilsRsRKtloggingRwR&RPRStwarningsRYRRRtpip._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.linkRRWtinttSecureOrigint	getLoggerR�R�tfilterwarningsRcR�R+R,RjRkR�R�tSessionR�(((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/network/session.pyt<module>sZ($	
		P!

Zerion Mini Shell 1.0