ok

Mini Shell

Direktori : /proc/thread-self/root/usr/lib/python2.7/site-packages/rhn/
Upload File :
Current File : //proc/thread-self/root/usr/lib/python2.7/site-packages/rhn/connections.pyo

�
���[c@s,ddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZmZm
Z
dejfd��YZdejfd��YZdefd	��YZd
efd��YZdefd
��YZdefd��YZd�Zd�ZdS(i����N(tpython_version(t_CS_REQ_SENTt_CS_IDLEtResponseNotReadytHTTPResponsecBseZd�ZRS(cCsMt|jtj�s-tj|j�|_n|jj|||||�dS(N(t
isinstancetfptnonblockingtNonBlockingFiletset_callback(tselftrstwstext	user_datatcallback((s3/usr/lib/python2.7/site-packages/rhn/connections.pyR	s(t__name__t
__module__R	(((s3/usr/lib/python2.7/site-packages/rhn/connections.pyRstHTTPConnectioncBsDeZeZdejd�Zd�Zd�Z	d�Z
d�ZRS(cCs�t�dkr.tjj|||d|�ntjj|||�g|_g|_g|_d|_d|_	d|_
||_dS(Ns2.6.1ttimeouts#rhn.connections $Revision$ (python)(RthttplibRt__init__t_cb_rst_cb_wst_cb_extNonet
_cb_user_datat_cb_callbackt_user_agentR(R
thosttportR((s3/usr/lib/python2.7/site-packages/rhn/connections.pyR s						cCs1||_||_||_||_||_dS(N(RRRRR(R
RRR
RR((s3/usr/lib/python2.7/site-packages/rhn/connections.pyR	-s
				cCs
||_dS(N(R(R
t
user_agent((s3/usr/lib/python2.7/site-packages/rhn/connections.pytset_user_agent5scCs�|jr$|jj�r$d|_n|jtks<|jrHt��n|jdkrr|j|j|j�}n|j|j�}|j	r�|j
|j|j|j
|j|j	�n|j�t|_|jr�|j�n	||_|S(s!Get the response from the server.iN(t_HTTPConnection__responsetisclosedRt_HTTPConnection__stateRRt
debugleveltresponse_classtsockRR	RRRRtbeginRt
will_closetclose(R
tresponse((s3/usr/lib/python2.7/site-packages/rhn/connections.pytgetresponse:s 	
		
	cCs'tjj|�|jj|j�dS(N(RRtconnectR&t
settimeoutR(R
((s3/usr/lib/python2.7/site-packages/rhn/connections.pyR,ksN(RRRR%RtSSLtDEFAULT_TIMEOUTRR	R R+R,(((s3/usr/lib/python2.7/site-packages/rhn/connections.pyRs
			1tHTTPProxyConnectioncBs>eZdddejd�Zd�Zdd�Zd�ZRS(cCsntj||d|�|j|j|_|_|j||�|j|j|_|_||_	||_
dS(NR(RRRRt_HTTPProxyConnection__proxyt _HTTPProxyConnection__proxy_portt
_set_hostportt_hostt_portt_HTTPProxyConnection__usernamet_HTTPProxyConnection__password(R
tproxyRRtusernametpasswordR((s3/usr/lib/python2.7/site-packages/rhn/connections.pyRqs	cCs=|j|j|j�tj|�|j|j|j�dS(N(R3R1R2RR,R4R5(R
((s3/usr/lib/python2.7/site-packages/rhn/connections.pyR,s
icCsl|j}|j|jkr5|dt|j�}nd||f}tj|||d|�|j�dS(Nt:shttp://%s%st	skip_host(R4R5tdefault_porttstrRt
putrequestt_add_proxy_headers(R
tmethodturlR<thostnametnewurl((s3/usr/lib/python2.7/site-packages/rhn/connections.pyR?�s	cCsV|js
dSd|j|jf}tj|�jdd�}|jdd|�dS(Ns%s:%ss
tsProxy-AuthorizationsBasic %s(R6R7tbase64tencodestringtreplacet	putheader(R
tuserpasstenc_userpass((s3/usr/lib/python2.7/site-packages/rhn/connections.pyR@�s
	N(	RRRR.R/RR,R?R@(((s3/usr/lib/python2.7/site-packages/rhn/connections.pyR0ps
	
	tHTTPSConnectioncBs8eZeZejjZddej	d�Z
d�ZRS(cCs2tj|||d|�|p"g}||_dS(NR(RRt
trusted_certs(R
RRRMR((s3/usr/lib/python2.7/site-packages/rhn/connections.pyR�scCs&tj|j|jtjtj�}x�|D]�}|\}}}}}ytj|||�}Wntjk
r�}	d}q+nXy-|j|j|jf�|j	|j
�Wn)tjk
r�}
|j�d}q+nXPq+W|dkr�tjd��ntj
||j�|_|jj�dS(s'Connect to a host on a given (SSL) ports0Unable to connect to the host and port specifiedN(tsockettgetaddrinfoRRt	AF_UNSPECtSOCK_STREAMterrorRR,R-RR)R.t	SSLSocketRMR&tinit_ssl(R
tresultstrtaftsocktypetprotot	canonnametsaR&tmsgte((s3/usr/lib/python2.7/site-packages/rhn/connections.pyR,�s*

N(RRRR%RRLR=RR.R/RR,(((s3/usr/lib/python2.7/site-packages/rhn/connections.pyRL�s
tHTTPSProxyResponsecBseZd�ZRS(cCstj|�d|_dS(Ni(RR'R((R
((s3/usr/lib/python2.7/site-packages/rhn/connections.pyR'�s
(RRR'(((s3/usr/lib/python2.7/site-packages/rhn/connections.pyR^�stHTTPSProxyConnectioncBsJeZejZddddejd�Zd�Zdd�Z	d�Z
RS(c	Cs;tj||||||d|�|p+g}||_dS(NR(R0RRM(R
R8RRR9R:RMR((s3/usr/lib/python2.7/site-packages/rhn/connections.pyR�s
cCs�tj|�d|j|jf}tj|d|�|j�tj|�|j}t	|_tj
|�}||_|j�|jdkr�|j�t
j||j|j|j��ntj|j|j�|_|jj�dS(Ns%s:%stCONNECTi�(R0R,R4R5RR?R@t
endheadersR%R^R+R)tstatust	xmlrpclibt
ProtocolErrortreasonR\R.RSR&RMRT(R
RR%R*((s3/usr/lib/python2.7/site-packages/rhn/connections.pyR,�s 


			

	icCstj|||d|�S(NR<(RR?(R
RARBR<((s3/usr/lib/python2.7/site-packages/rhn/connections.pyR?�scCs$tj|�|jd|j�dS(Ns
User-Agent(R0R@RIR(R
((s3/usr/lib/python2.7/site-packages/rhn/connections.pyR@�s
N(RRRLR=RR.R/RR,R?R@(((s3/usr/lib/python2.7/site-packages/rhn/connections.pyR_�s			cCs!|dkrdS|jd�SdS(sE Convert Internationalized domain name from Pune encoding to Unicode tidnaN(Rtdecode(RC((s3/usr/lib/python2.7/site-packages/rhn/connections.pytidn_pune_to_unicode�scCsB|dkrdSt|t�s1t|d�}n|jd�SdS(sU Convert domain name to Pune encoding. Hostname can be instance of string or Unicode sutf-8RfN(RRtunicodetencode(RC((s3/usr/lib/python2.7/site-packages/rhn/connections.pytidn_ascii_to_pune�s
(tsysRFR.RRRctencodings.idnat	encodingsRNtplatformRRRRRRR0RLR^R_RhRk(((s3/usr/lib/python2.7/site-packages/rhn/connections.pyt<module>
s"S)&.	

Zerion Mini Shell 1.0