Viewing File: /opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/session.pyc


t_c@sdZddlZddlZddlZddlZddlZddlZddlZddl	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,rddl/m0Z0m1Z1m2Z2m3Z3m4Z4ddl5m6Z6e3e7e7e2e4e8e7ffZ9nej:e;Z<e	j=dded+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.
iN(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_CIcCstdtDS(s?
    Return whether it looks like pip is running under CI.
    css|]}|tjkVqdS(N(tostenviron(t.0tname((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/session.pys	<genexpr>`s(tanytCI_ENVIRONMENT_VARIABLES(((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/session.pyt
looks_like_ciXsc	CsIiidd6td6d6tjd6itjd6d6}|dddkrgtj|dd<n|dddkrtjjd	krtjd
 }n	tj}djg|D]}t|^q|dd<nV|dddkrtj|dd<n+|ddd
kr/tj|dd<ntjj	drddl
m}tt
dtdddg|j}tt
dtddgt}|r||d<n|r||d<qntjj	drtjdridd6tjdd6|d<ntjrFtj|jdid<ntjrqtj|jdid<ntjrtj|d<ntrddl}|j|d<ntd}|dk	r||d <ntrtnd|d!<tjjd"}|dk	r||d#<nd$j d%|d&t!j"|d'd+d*tS(,s6
    Return a string representing the user agent.
    tpipR)tversiont	installertpythontimplementationtCPythontPyPytfinalit.tJythont
IronPythontlinuxi(tdistrocSs|dS(Ni((tx((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/session.pyt<lambda>stidcSs|dS(Ni((R:((sN/opt/alt/python35/lib/python3.5/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/python35/lib/python3.5/site-packages/pip/_internal/network/session.pyt
user_agentcsd
	-$
"%	

	tLocalFSAdaptercBs)eZddddddZdZRS(c
Cst|j}t}d|_|j|_ytj|}	Wn%tk
rg}
d|_|
|_n}Xtj	j
|	jdt}t
j|dpd}ti|d6|	jd6|d6|_t|d	|_|jj|_|S(
Niitusegmtis
text/plainsContent-TypesContent-Lengths
Last-Modifiedtrb(RturlRtstatus_codeR&tstattOSErrortrawtemailtutilst
formatdatetst_mtimeRdt	mimetypest
guess_typeRtst_sizetheaderstopentclose(
tselftrequesttstreamttimeouttverifytcerttproxiestpathnametresptstatstexctmodifiedtcontent_type((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/session.pytsends$			

cCsdS(N((R}((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/session.pyR|sN(t__name__t
__module__RcRR|(((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/session.pyRkstInsecureHTTPAdaptercBseZdZRS(c	Cs/tt|jd|d|dtd|dS(NtconnRnRR(tsuperRtcert_verifytFalse(R}RRnRR((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/session.pyRs(RRR(((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/session.pyRstInsecureCacheControlAdaptercBseZdZRS(c	Cs/tt|jd|d|dtd|dS(NRRnRR(RRRR(R}RRnRR((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/session.pyRs(RRR(((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/session.pyRst
PipSessioncBsAeZdZdZdedZdZdZdZ	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||jdtx!|D]}	|j|	dtqYWdS(sj
        :param trusted_hosts: Domains not to emit warnings for when not using
            HTTPS.
        tretriesitcachet
trusted_hostst
index_urlss
User-Agentttotaltstatus_forcelistiiiitbackoff_factorg?tmax_retriesshttps://shttp://sfile://tsuppress_loggingN(tpopRcRRt__init__tpip_trusted_originsRjRzRtauthRtRetryRRRRt_trusted_host_adapterRtmountRktadd_trusted_hostRd(
R}targstkwargsRRRRtinsecure_adaptertsecure_adapterthost((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/session.pyRs6					
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(
RfRctloggertinfoRRtappendRRR(R}RtsourceRtmsgt	host_port((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/session.pyR4s



ccsTxtD]}|VqWx7|jD],\}}d||dkrDdn|fVq WdS(NR(tSECURE_ORIGINSRRc(R}t
secure_originRtport((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/session.pytiter_secure_originsQs
	cCsjtjt|}|j|j|j}}}|jddd}x|jD]}|\}}}	||kr|dkrqUnyFtj	|dkrdntj|}
tj
tj|}WnAtk
r|r$|j|jkr$|dkr$qUq$nX|
|kr$qUn||	krN|	dkrN|	dk	rNqUntSWtjd||tS(Nt+iiRsThe 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_parseturlparseRWtschemethostnameRtrsplitRRt
ip_addressRcRtensure_textt
ip_networkt
ValueErrortlowerRdRtwarningR(R}tlocationtparsedtorigin_protocoltorigin_hosttorigin_portRtsecure_protocoltsecure_hosttsecure_porttaddrtnetwork((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/session.pytis_secure_originXs<

cOs2|jd|jtt|j||||S(NR(R_RRRR~(R}tmethodRnRR((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/session.pyR~sN(
RRRcRRRRRRR~(((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/session.pyRs	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.urllibRRtpip._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	getLoggerRRtfilterwarningsRcRR+R,RjRkRRtSessionR(((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/session.pyt<module>sZ($	
		P!
Back to Directory File Manager