ok

Mini Shell

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

�
���[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�|jtjks�t�t|_|jr�|j�n	||_|S(s!Get the response from the server.iN(t_HTTPConnection__responsetisclosedRt_HTTPConnection__stateRRt
debugleveltresponse_classtsockRR	RRRRtbegint
will_closeRt_UNKNOWNtAssertionErrorRtclose(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(R5R3R4RR.R6R7(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(R6R7tdefault_porttstrRt
putrequestt_add_proxy_headers(R
tmethodturlR>thostnametnewurl((s3/usr/lib/python2.7/site-packages/rhn/connections.pyRA�s	cCsV|js
dSd|j|jf}tj|�jdd�}|jdd|�dS(Ns%s:%ss
tsProxy-AuthorizationsBasic %s(R8R9tbase64tencodestringtreplacet	putheader(R
tuserpasstenc_userpass((s3/usr/lib/python2.7/site-packages/rhn/connections.pyRB�s
	N(	RRRR0R1RR.RARB(((s3/usr/lib/python2.7/site-packages/rhn/connections.pyR2ps
	
	tHTTPSConnectioncBs8eZeZejjZddej	d�Z
d�ZRS(cCs2tj|||d|�|p"g}||_dS(NR(RRt
trusted_certs(R
RRROR((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+R0t	SSLSocketROR&tinit_ssl(R
tresultstrtaftsocktypetprotot	canonnametsaR&tmsgte((s3/usr/lib/python2.7/site-packages/rhn/connections.pyR.�s*

N(RRRR%RRNR?RR0R1RR.(((s3/usr/lib/python2.7/site-packages/rhn/connections.pyRN�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(R2RRO(R
R:RRR;R<ROR((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�(R2R.R6R7RRARBt
endheadersR%R`R-R+tstatust	xmlrpclibt
ProtocolErrortreasonR^R0RUR&RORV(R
RR%R,((s3/usr/lib/python2.7/site-packages/rhn/connections.pyR.�s 


			

	icCstj|||d|�S(NR>(RRA(R
RCRDR>((s3/usr/lib/python2.7/site-packages/rhn/connections.pyRA�scCs$tj|�|jd|j�dS(Ns
User-Agent(R2RBRKR(R
((s3/usr/lib/python2.7/site-packages/rhn/connections.pyRB�s
N(RRRNR?RR0R1RR.RARB(((s3/usr/lib/python2.7/site-packages/rhn/connections.pyRa�s			cCs!|dkrdS|jd�SdS(sE Convert Internationalized domain name from Pune encoding to Unicode tidnaN(Rtdecode(RE((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-8RhN(RRtunicodetencode(RE((s3/usr/lib/python2.7/site-packages/rhn/connections.pytidn_ascii_to_pune�s
(tsysRHR0RRRetencodings.idnat	encodingsRPtplatformRRRRRRR2RNR`RaRjRm(((s3/usr/lib/python2.7/site-packages/rhn/connections.pyt<module>
s"S)&.	

Zerion Mini Shell 1.0