-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/mercurial/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/mercurial/url.pyc


\,Tc@sddlZddlZddlZddlZddlZddlZddlZddlmZddl	Z	ddl
Z
ddlZddlZ
dejfdYZdejfdYZdZe
jedZer#y
ejZWq#ek
reZedd	Zq#Xnd
e	jfdYZdZd
Zde	jfdYZerdej fdYZ!de	j"ej#fdYZ$ndej%fdYZ&dej'fdYZ(gZ)ddZ*ddZ+dS(iN(t_tpasswordmgrcBs,eZdZdZdZdZRS(cCstjj|||_dS(N(turllib2tHTTPPasswordMgrWithDefaultRealmt__init__tui(tselfR((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyRsc
Cstjj|||}|\}}|rJ|rJ|j||||fS|sX|rtj|j||}|r|\}}|jd|jd}}|jjd|qn|s|rt	j
|}	d|	_|jj
st	jtdt	jt|	n|jjtdt	jt|	|jjtd||r|jjtd|n|jjtdd	d}|s|jj}qn|j|||||j||||fS(
Ntusernametpasswords#using auth.%s.* for authentication
s"http authorization required for %ss#http authorization required for %s
s
realm: %s
s	user: %s
suser:tdefault(RRtfind_user_passwordt_writedebugthttpconnectionmodtreadauthforuriRtgettdebugtutilturltNonetquerytinteractivetAbortRthidepasswordtstrtwritetprompttgetpasstadd_password(
Rtrealmtauthuritauthinfotusertpasswdtrestgrouptauthtu((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyR
s:	
	cCs@td}|jj|||r1dt|p4dfdS(Ns http auth: user %s, password %s
t*snot set(RRRtlen(RRR tmsg((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyR8scCstjj|d|S(N(RRR
R(RR((s1/usr/lib/python2.7/dist-packages/mercurial/url.pytfind_stored_password<s	(t__name__t
__module__RR
RR((((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyRs		$	tproxyhandlercBseZdZdZRS(cCs|jddptjd}|r|jdpB|jdsVd|d}ntj|}|js|jdd|_|jdd|_nd	d
g}|jg|j	ddD]}|j
^q|jgtjdd
jdD]$}|jr|jj
^q|j
ddrDg|_n	||_t|}i|d6|d6}|jd|j|jfni}|jddrxNdddgD]:}y |tjkrtj|=nWqtk
rqXqWntjj||||_dS(Nt
http_proxythostshttp:shttps:shttp://t/RR t	localhosts	127.0.0.1tnotno_proxytt,talwaysthttpthttpssproxying through http://%s:%s
t
HTTP_PROXY(tconfigtostgetenvt
startswithRRRR textendt
configlisttlowertsplittstript
configbooltno_listRRR-tporttenvirontOSErrorRtProxyHandlerRR(RRtproxyurltproxyRBtptproxiestenv((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyRAs@!		)	%		
cs|jjdd}xm|jD]b}||kr9dS|jdr_|j|dr_dS|jdr#|j|dr#dSq#W|jdffdY}||_tjj	||||S(	Nt:is*.it.it_requestcseZfdZRS(cs4|jdkr!|j}nj|||S(Nsproxy-authorization(R>R@t
add_header(Rtkeytval(t	baseclass(s1/usr/lib/python2.7/dist-packages/mercurial/url.pyROs(R)R*RO((RR(s1/usr/lib/python2.7/dist-packages/mercurial/url.pyRN~s(
tget_hostR?RBRR;tendswitht	__class__RRFt
proxy_open(RtreqRHttype_R-teRN((RRs1/usr/lib/python2.7/dist-packages/mercurial/url.pyRVqs""		(R)R*RRV(((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyR+@s	0csfd}|S(NcsZt|tjrI|jdx4tj|D]}||q/Wn
||dS(Ni(t
isinstanceRthttpsendfiletseekRt
filechunkiter(Rtdatatchunk(torgsend(s1/usr/lib/python2.7/dist-packages/mercurial/url.pyt	_sendfiles

((R`Ra((R`s1/usr/lib/python2.7/dist-packages/mercurial/url.pyt
_gen_sendfiles	tHTTPSHandlerc
Csd}|\}}xtj||dtjD]}|\}}}	}
}d}y\tj|||	}|tk	r|j|n|r|j|n|j||SWq.tjk
r}|dk	r|j	qq.Xq.Wtj|dS(Ns!getaddrinfo returns an empty listi(
tsockettgetaddrinfotSOCK_STREAMRt_GLOBAL_DEFAULT_TIMEOUTt
settimeouttbindtconnectterrortclose(
taddressttimeouttsource_addressR'R-RCR!taftsocktypetprotot	canonnametsatsock((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyt_create_connections""
thttpconnectioncBs,eZeejjZdZdZRS(cCstrs|jrstjtjtj|_|jj|j|jft	|rt
j|jdd|_qnt
jj|dS(N(t	has_httpstrealhostportRdtAF_INETRfRuRjR-RCt_generic_proxytunneltsslutiltssl_wrap_socketRt	keepalivetHTTPConnection(R((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyRjs!cCsKt|dd}|r;|jr.|jnd|_|Stjj|S(Ntproxyres(tgetattrRt
will_closeRlRR~Rtgetresponse(RR((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyRs	
	(R)R*RbR~RtsendRjR(((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyRws	
cCst|dd}|r>|d d	kr5d|}nt}n|j}t}|sh||jkrtj|}|s|jdkrdj	|j
|jpdg|_|j
j|_
|j
j|jjdSnd|_d|_
dS(
Nt_tunnel_hostishttp://shttps:/shttps://R6RLt443(shttp://shttps:/(RRtTruetget_selectortFalsetget_full_urlRRtschemetjoinR-RCRytheaderstcopytupdatetparentt
addheaders(thandlerthRWttunnel_hostt
new_tunnelR$((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyt_generic_start_transactions 
	$	cCstg|jD].}|jjdr
||j|f^q
}|jd|jx%|jD]}|jd|qeW|jd|j|jd|j	d|j
}x^tr|j\}}}|t
jkrPnx)tr
|jjj}|sPqqWqW||_|j|_|jdkrix)trd|jj}	|	dkr<Pq<q<WtS|dkrd	|_nB|jd
rd|_n'|dkrd
|_nt
j||jd
kr	d|_d|_d|_t
jtj|_tSt
j|j|_d|j_|jjd}
|
ri|
jdkrid|_d|_ n	d|_|j!|_|jjd}|r|jryt"||_Wnt#k
rd|_qX|jdkrd|_qn	d|_|t
j$ksC|t
j%ksCd|ko/dknsC|j
dkrOd|_n|jr~|jr~|jdkr~d|_n||_&tS(Nsproxy-sCONNECT %s HTTP/1.0
s%s: %s
s
tstricttmethodisHTTP/1.0i
sHTTP/1.isHTTP/0.9i	iistransfer-encodingtchunkedscontent-lengthidtHEAD('tdictRR>R;RRyt	iteritemstresponse_classRuRt_methodRt_read_statusthttplibtCONTINUEtfptreadlineR@tstatustreasontversiontUnknownProtocolRtlengthRRtHTTPMessaget	cStringIOtStringIOR'Rt	getheadert
chunk_leftt_check_closetintt
ValueErrort
NO_CONTENTtNOT_MODIFIEDR(RtxtproxyheaderstheaderR!RRRtskiptlinettrencR((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyR{s1
										

	

	thttphandlercBseZdZdZRS(cCs|jt|S(N(tdo_openRw(RRW((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyt	http_openBscCs&t|||tjj|||S(N(RR~tHTTPHandlert_start_transaction(RRRW((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyREs(R)R*RR(((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyRAs	thttpsconnectioncBs;eZejZeejZeje	j
ZdZRS(cCst|j|jf|_|j}|jrSt||jjddd}ntj|j|j	|j
tj|j||_tj
|j||jdS(NRLii(RvR-RCRuRyR{trsplitR|R}tkey_filet	cert_filet	sslkwargsRt	validator(RR-((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyRjPs		
(
R)R*R~tHTTPResponseRRbtsafesendRtwrapgetresponseRtHTTPSConnectionRRj(((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyRJs	thttpshandlercBs/eZdZdZdZddZRS(cCs?tjj|tjj|||_t|j|_dS(N(R~tKeepAliveHandlerRRRcRRtpwmgr(RR((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyR]s	cCs&t|||tjj|||S(N(RR~RR(RRRW((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyRcscCs|j}|jj|\}}tj|j||}|rn|\}}||_|jjd|n	d|_|j	|j
|S(Ns#using auth.%s.* for authentication
(RRR(RR
RR#RRRt_makeconnection(RRWRRRR!R"R#((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyt
https_opengs		cOsd}d}t|dkr+|d}nt|dkrJ|d}n|d}|jrd|jkrd|jkr|jd}|jd}nt||||||}|j|_|S(NiiiRPtcert(RR&R#RR(RR-RCtargstkwargstkeyfiletcertfiletconn((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyRus


'
	N(R)R*RRRRR(((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyR\s			thttpdigestauthhandlercBs#eZdZdZdZRS(cOs#tjj|||d|_dS(N(RtHTTPDigestAuthHandlerRRtretried_req(RRR((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyRscCsdS(N((R((s1/usr/lib/python2.7/dist-packages/mercurial/url.pytreset_retry_countscCs||jk	r$||_d|_ny tjj|||||SWn6tk
r|}|jd}|jdrvdSnXdS(Nis'AbstractDigestAuthHandler doesn't know (RtretriedRRthttp_error_auth_reqedRRR;(Rtauth_headerR-RWRtinsttarg((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyRs		
(R)R*RRR(((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyRs		thttpbasicauthhandlercBs>eZdZdZdZdZdZdZRS(cOs,d|_tjj|||d|_dS(N(RR#RtHTTPBasicAuthHandlerRR(RRR((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyRs	cCs&|jr"|j|j|jn|S(N(R#tadd_unredirected_headerR(Rtrequest((s1/usr/lib/python2.7/dist-packages/mercurial/url.pythttp_requests	cCs&|jr"|j|j|jn|S(N(R#RR(RR((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyt
https_requests	cCsdS(N((R((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyRscCs@||jk	r$||_d|_ntjj|||||S(Ni(RRRRR(RRR-RWR((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyRs
		cCs|jj||j\}}|dk	rd||f}dtj|j}|jj|j	d|krxdS||_
|j|j	||jj
|SdSdS(Ns%s:%ssBasic %s(R R
RRtbase64t	b64encodeR@RRRR#RRtopen(RR-RWRRtpwtrawR#((s1/usr/lib/python2.7/dist-packages/mercurial/url.pytretry_http_basic_auths!	(R)R*RRRRRR(((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyRs					cCsM|jddtr3tj|t|g}n(tg}tr[|jt|n|jt	|t|}|dk	r|j||dd!\}}|jd||rdt
|pdfn|jt|t|f|jgtD]}|||^qtj|}d
g|_|jjd|S(se
    construct an opener suitable for urllib2
    authinfo will be added to the password manager
    Rtusehttp2iis http auth: user %s, password %s
R%snot sets
User-agentsmercurial/proto-1.0tAcceptsapplication/mercurial-0.1N(s
User-agentsmercurial/proto-1.0(Rsapplication/mercurial-0.1(RARRthttp2handlerRRRxtappendRR+RRRR&R<RRthandlerfuncsRtbuild_openerR(RRthandlerstpassmgrRR Rtopener((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyRs&
	')cCstj|}|jr?|jj|_|j\}}n4tjtjj|}dt	j
|}d}t||j
||S(Nsfile://(RRRR>RtnormpathR9tpathtabspathturllibtpathname2urlRRR(Rturl_R^R$RR((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyRs	(,RRRR9RdRRti18nRR~RR|RwRRRRFR+RbtsafehasattrRxtcreate_connectionRvtAttributeErrortobjectRgRRRR{RRRRRRcRRRRRRRR(((s1/usr/lib/python2.7/dist-packages/mercurial/url.pyt<module>
s4T$1G	

			a".-

Copyright © 2017 || Recoded By Mr.Bumblebee