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/transports.pyc

�
���[c@s�ddlZddlZddlZddlmZmZmZddlmZddlmZddl	Z	ddl
Z
dZdZde
fd��YZd	e
jfd
��YZdefd��YZd
efd��YZdefd��YZdd d��YZddd�Zdddd�Zdd!d��YZdd"d��YZdd�Zdd�ZeZdd#d��YZdS($i����N(tIntTypet
StringTypetListType(tSmartIO(tUserDictCases2.5.65-8.el7itNotProcessedcBseZRS((t__name__t
__module__(((s2/usr/lib/python2.7/site-packages/rhn/transports.pyRst	TransportcBs�eZdeZddddddd�Zdd�Zd�Zd�Zd�Z	ddd�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zdd�Zd�Zd�Zd�Zd�ZRS(srhn.rpclib.py/%sicCs�idd6dd6|_|jd|d|�t�|_d|_d|_d|_d|_||_	||_
d|_d|_d|_
d|_d|_||_||_dS(NittransfertencodingtPOSTi@(t_transport_flagstset_transport_flagsRt_headerstverbosetNonet
connectiontmethodt_langtrefreshCallbacktprogressCallbackt
bufferSizet
headers_intresponse_statustresponse_reasont_redirectedt
_use_datetimettimeout(tselfR	R
RRtuse_datetimeR((s2/usr/lib/python2.7/site-packages/rhn/transports.pyt__init__%s 												i@cCs||_||_dS(N(RR(RRR((s2/usr/lib/python2.7/site-packages/rhn/transports.pytset_progress_callback9s	cCs
||_dS(N(R(RR((s2/usr/lib/python2.7/site-packages/rhn/transports.pytset_refresh_callback>scCs"|dkrd}n||_dS(Ni@(RR(RR((s2/usr/lib/python2.7/site-packages/rhn/transports.pytset_buffer_sizeDs	cCs)|dkrtd|�n||_dS(NtGETRsUnknown request method %s(R#sPOST(tIOErrorR(RR((s2/usr/lib/python2.7/site-packages/rhn/transports.pyt
set_methodLscKsV|jj|�|dk	r,||jd<n|dk	rH||jd<n|j�dS(NR	R
(RtupdateRtvalidate_transport_flags(RR	R
tkwargs((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR
RscCs
|jj�S(N(Rtcopy(R((s2/usr/lib/python2.7/site-packages/rhn/transports.pytget_transport_flags]scCsf|jjd�}t|dd�}||jd<|jjd�}t|dd�}||jd<dS(NR	tstrictiR
(RtgettlookupTransfertlookupEncoding(RR	R
((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR'`s
cCsTt|�tg�td�gkr=tt|�|j|<nt|�|j|<dS(N((ttypetmaptstrR(Rtnametarg((s2/usr/lib/python2.7/site-packages/rhn/transports.pyt
set_headerks$cCse|jj|�r=|j|}t|t�sN|g}qNng}|j|<|jt|��dS(N(Rthas_keyt
isinstanceRtappendR1(RR2R3tvlist((s2/usr/lib/python2.7/site-packages/rhn/transports.pyt
add_headerrs
cCs|jj�dS(N(Rtclear(R((s2/usr/lib/python2.7/site-packages/rhn/transports.pyt
clear_headers{scCsH|jrd|fGHn|jr7tj|d|j�Stj|�SdS(NsConnecting via http to %sR(RRtconnectionstHTTPConnection(Rthost((s2/usr/lib/python2.7/site-packages/rhn/transports.pytget_connection~s
		cCs�||_|j|�\}}}|s0g}n|j|�}|j|j�|jro|j|jd�ntd|d|j�}t|j	d|j
�|jd|j�x1|jj
�|D]\}	}
|j|	|
�q�W|jdd�|j|�x!ddgD]}|j|�qW|j||�\}}
|jrzd	GHx,|j
�D]\}	}
d
|	|
fGHqXWn|
jdkr�|d
|_|
j|_dS||_|
j|_|
j|_|j|
|�S(NiRRs
User-AgentsContent-Typestext/xmlsContent-LengthtHostsIncoming headers:s	%s : %si-i.tLocation((i-i.(Rt
get_host_infoR?tset_user_agentt
user_agenttset_debugleveltOutputRtapplyR
RR4Rtitemstprocesstclear_headert	send_httptstatusRRRRtreasonRt_process_response(RR>thandlertrequest_bodyRt
extra_headerstx509Rtreqtheadertvalueththeaderstfd((s2/usr/lib/python2.7/site-packages/rhn/transports.pytrequest�s<			 
	
	cCs�t|jd|jd|j�}|j|�}t|t�r|t|j|j	|j
d|jd|j�}|j|_|S|j�|j|�S(NRR(
tInputRRRtdecodeR6tInputStreamtFileRXtlengthR2tclosetparse_response(RRXRtresptf((s2/usr/lib/python2.7/site-packages/rhn/transports.pyRN�s!
cCs|jS(N(R(R((s2/usr/lib/python2.7/site-packages/rhn/transports.pyt
redirected�scCs�|j�\}}xZ|jd�}|s.Pn|jrD|j�n|jr_dGt|�GHn|j|�q|j�|j�|j�S(Nisbody:(t	getparsertreadRRtreprtfeedR_(RRbtptutresponse((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR`�s	
	

cCs
||_dS(N(R(Rtlang((s2/usr/lib/python2.7/site-packages/rhn/transports.pytsetlang�sN(RRt__version__RDRRR R!R"R%R
R*R'R4R9R;R?RYRNRcR`Rl(((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR"s&
											8			t
SafeTransportcBs5eZddddddd�Zd�Zd�ZRS(ic
CsVtj|||d|d|d|�g|_x!|p:gD]}|j|�q;WdS(NRRR(RRt
trusted_certstadd_trusted_cert(RR	R
RRRoRtcertfile((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR�s	cCs9tj|tj�s%td|�n|jj|�dS(Ns%Certificate file %s is not accessible(tostaccesstR_OKt
ValueErrorRoR7(RRq((s2/usr/lib/python2.7/site-packages/rhn/transports.pyRpscCsr|j|�\}}}|jr0d|fGHn|jrXtj|d|jd|j�Stj|d|j�SdS(NsConnecting via https to %sRoR(RBRRR<tHTTPSConnectionRo(RR>RQRR((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR?s		N(RRRRRpR?(((s2/usr/lib/python2.7/site-packages/rhn/transports.pyRn�s		tProxyTransportcBs/eZdddddddd�Zd�ZRS(ic		
CsDtj|||d|d|d|�||_||_||_dS(NRRR(RRt_proxyt_proxy_usernamet_proxy_password(	Rtproxyt
proxyUsernamet
proxyPasswordR	R
RRR((s2/usr/lib/python2.7/site-packages/rhn/transports.pyRs		c	Cs�|jr*d||j|j|jfGHn|jratj|j|d|jd|jd|j�Stj|j|d|jd|j�SdS(Ns8Connecting via http to %s proxy %s, username %s, pass %stusernametpasswordR(RRxRyRzRR<tHTTPProxyConnection(RR>((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR?s		
N(RRRRR?(((s2/usr/lib/python2.7/site-packages/rhn/transports.pyRwstSafeProxyTransportc	Bs;eZddddddddd�Zd�Zd�ZRS(ic
Csktj||d|d|d|d|d|d|d|	�g|_x!|pOgD]}
|j|
�qPWdS(NR|R}R	R
RRR(RwRRoRp(RR{R|R}R	R
RRRoRRq((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR*s	cCs9tj|tj�s%td|�n|jj|�dS(Ns%Certificate file %s is not accessible(RrRsRtRuRoR7(RRq((s2/usr/lib/python2.7/site-packages/rhn/transports.pyRp7scCs�|jr*d||j|j|jfGHn|jrjtj|j|d|jd|jd|jd|j�Stj|j|d|jd|jd|j�SdS(Ns9Connecting via https to %s proxy %s, username %s, pass %sR~RRoR(RRxRyRzRR<tHTTPSProxyConnectionRo(RR>((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR?<s		N(RRRRRpR?(((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR�)s
		RZcBsDeZddddd�Zejd�Zejd�Zd�ZRS(ii@cCsYd|_d|_d|_d|_d|_d|_||_||_||_	|sPt
jjd�r�t
jdj
�|_nt
jjd�r�t
jdj
�|_nt
jjd�r�t
jdj
�|_nt
jjd�rtt
jd�|_nt
jjd�r(t
jd|_nt
jjd	�rLt
jd	|_qLn�x�|j�D]�}||}|j
�}|d
kr�yt|�|_WqHtk
r�d|_qHXq]|dkr�|j
�|_q]|dkr�|j
�|_q]|d
kr|j
�|_q]|dkr0|j
�|_q]|dkr]||_q]q]Wd|_dS(NitCttHTTP_CONTENT_TRANSFER_ENCODINGtHTTP_CONTENT_ENCODINGsCONTENT-TYPEtCONTENT_LENGTHtHTTP_ACCEPT_LANGUAGEtHTTP_X_PACKAGE_FILENAMEscontent-lengthscontent-transfer-encodingscontent-encodingscontent-typesaccept-languagesx-package-filename(RR	R
R/R^RkR2RRtmax_mem_sizeRrtenvironR5tlowertinttkeysRutio(RRWRRR�RTRURV((s2/usr/lib/python2.7/site-packages/rhn/transports.pyRbsR									

c	Cs�|jdkrdS|jrOt||jd|jd|jd|j�|_nt|�|_|jsw|jdkr{dS|jdkr�ddl	}|j}|j
dd�td|j�|_|j||j�nt
|j��dS(	Nsapplication/octet-streamRRR�tbinarytbase64i����i(R/R^t_smart_readRRR�R�t_smart_total_readR	R�tseekRR[tNotImplementedError(RRXR�told_io((s2/usr/lib/python2.7/site-packages/rhn/transports.pyRe�s"				cCs�|jdkr.t||j|jd|j�S|jsG|j|�nt|d�rc|j�n|js�|jdkrnd|jdkrddl	}|j
�}|jjdd�|j|jj��|j
�}~t|�|_td|j�|_|jj|�n�|jdkr�ddl}|jjdd�|jddd
td|j�}|j�}t|�|_td|j�|_|jj|�n<|jdkr�t|j|j��nt|j|j��|jjdd�|jS(Nsapplication/octet-streamR_t__plainsx-zlibtdeflatei����iR�sx-gziptgziptmodetrbt
compressleveltfileobjsx-gpg(sx-zlibR�(sx-gzipsgzip(R/R\R^R2R_R�RethasattrR
tzlibt
decompressobjR�t
decompresstflushtlenRR�twriteR�tGzipFiletCOMPRESS_LEVELR�R	(RRXR�tobjtdataR�tgz((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR[�s>	
"cCs|jS(N(Rk(R((s2/usr/lib/python2.7/site-packages/rhn/transports.pytgetlang�sN(	RRRRtsyststdinReR[R�(((s2/usr/lib/python2.7/site-packages/rhn/transports.pyRZas
	70ii@cCs?td|�}x)|j|�}|s+Pn|j|�q|S(s�
    Tries to read data from the supplied stream, and puts the results into a
    StmartIO object. The data will be in memory or in a temporary file,
    depending on how much it's been read
    Returns a SmartIO object
    R�(RReR�(RXRR�R�tchunk((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR��scCs0tj�}|}td|�}|}x�|dkrtj�}	t||�}
|j|
�}t|�}
|
svPn||
}|j|�|dkr�q*n|	|dks�|dkr*|	}t||�}||	|d}
|dkr�d}n
||
}||||
|�q*q*W|jdd�|S(NR�iig���ư>(	ttimeRtminReR�R�RtfloatR�(RXtamtRRR�t	startTimetlastTimetbuftorigsizetcurTimetlR�t	bytesReadtspeedtsecs((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR��s2

	
R\cBs eZddd�Zd�ZRS(s	<unknown>cCs.||_t|�|_||_||_dS(N(RXR�R^R2R_(RRXR^R2R_((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR7s		cCsd|j|jfS(Ns0Input data is a stream of %d bytes for file %s.
(R^R2(R((s2/usr/lib/python2.7/site-packages/rhn/transports.pyt__repr__=sN(RRRRR�(((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR\6st
BaseOutputcBs�eZdZdZdZdZdZdZdZddgddgddgd	ggZ
dd
dgZddddd
�Zd�Z
d�Zd�Zddd�Zdd�Zd�Zd�ZRS(iiiiR�sx-gzipR�sx-zlibR�sx-gpgR�R�RcCs�|r*t|tj�s*td��q*n||_||_d|_t�|_	d|_
d|_i|_d|_
d|_d|_d|_d|_d|_|jd|d|�d|_dS(Ns&Expected an HTTPConnection type objectiR	R
(R6R<R=t	ExceptionRt_connectionRR�RRWR
R	ttransport_flagsR~Rt_hostt_handlert
_http_typet	_protocolR
t_BaseOutput__processed(RR	R
RR((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR]s$												cCs]t|�tg�td�gkrFdjtt|��|j|<nt|�|j|<dS(Nt,((R/tjoinR0R1RW(RR2R3((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR4{s$"cCs#|jj|�r|j|=ndS(N(RWR5(RR2((s2/usr/lib/python2.7/site-packages/rhn/transports.pyRJ�scCs||_|j|jkr�ddl}|j|jd}|jd|�tdd�}|jdddtd	|�}|j	|�|j
�|j�|_|j
�n�|j|jkrddl
}|j|jd}|jd|�|jt�}|j|�|j�|_nN|j|jkrit|j|j��|j|jd}|jd|�n|j|jkr�|j|j}|jd
|�|jdd�nf|j|jkrddl}	|j|j}|jd
|�|jdd
�|	j|j�|_n|jdt|j��t}
ttj��dkr^tj�d}
n|jdd|
�d|_dS(Ni����isContent-Encodingt	force_memiR�twbR�R�sContent-Transfer-EncodingsContent-Typesapplication/binarystext/base64sContent-LengthsX-Transport-Infos=Extended Capabilities Transport (C) Red Hat, Inc (version %s)(R�R
tENCODE_GZIPR�t	encodingsR4RR�R�R�R_tgetvaluetENCODE_ZLIBR�tcompressobjtcompressR�t
ENCODE_GPGR�R	tTRANSFER_BINARYt	transferstTRANSFER_BASE64R�tencodestringR�RmtsplitR�(RR�R�t
encoding_nameRbR�R�R�t
transfer_nameR�trpc_version((s2/usr/lib/python2.7/site-packages/rhn/transports.pyRI�sP		


	cKs&||_||_|jj|�dS(N(R	R
R�R&(RR	R
R(((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR
�s		s/RPC2cCs�|jst�n||_|jdkr9td��n|jj�|jj|j|d|j	d|j
�|jj�}|j|�s�t
jd|j|f|j|j|j��n|j|fS(NsNo connection object foundtbodyRWs%s %s(R�RR�R�RR�tconnectRYRR�RWtgetresponsetresponse_acceptablet	xmlrpclibt
ProtocolErrorRLRMtmsg(RR>RORj((s2/usr/lib/python2.7/site-packages/rhn/transports.pyRK�s			

	
cCsj|jdkrdS|jd
kr&dS|jdkr9dS|jjd�sOdS|jdd	krfdSdS(s*Returns true if the response is acceptablei�ii-i.i�itallow_partial_contentsContent-Typesapplication/octet-stream(i-i.(RLR�R,R�(RRj((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR��scCs&|jr"|jj�d|_ndS(N(R�R_R(R((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR_�s	
N(RRtENCODE_NONER�R�R�t
TRANSFER_NONER�R�RR�R�RR4RJRIR
RKR�R_(((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR�Cs,							5	icCs�|dkrdSt|t�rHd|ko?ttj�knrH|St|t�r�x=tttj��D]#}tj||j�krm|SqmWn|r�t	d|��ndS(sTGiven a string or numeric representation of a transfer, return the
    transfer codeisUnsupported transfer %sN(
RR6RR�RFR�RtrangeR�Ru(R	R+ti((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR-�s4cCs�|dkrdSt|t�rHd|ko?ttj�knrH|St|t�r�x=tttj��D]#}|j�tj|krm|SqmWn|r�t	d|��ndS(sUGiven a string or numeric representation of an encoding, return the
    encoding codeisUnsupported encoding %sN(
RR6RR�RFR�RR�R�Ru(R
R+R�((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR.s4R]cBsMeZddddd�Zd�Zdd�Zd�Zd�Zd�ZRS(	ii@cCs`||_||_|j|_||_d|_|rS||jd�d|_n||_dS(NR�t/i(R^tfile_objR_RR2trfindR(RR�R^R2RR((s2/usr/lib/python2.7/site-packages/rhn/transports.pyRs				cCs|jS(N(R^(R((s2/usr/lib/python2.7/site-packages/rhn/transports.pyt__len__'scCs2|dkr"|j�}|j�S|jj|�S(N(Rt	_get_fileReR�(RR�RX((s2/usr/lib/python2.7/site-packages/rhn/transports.pyRe*s
cCs?|j�}x,|j|j�}|s+Pn|j|�q|S(sHCopies the contents of this File object into another file
        object(R�ReRR�(RtfileRXR�((s2/usr/lib/python2.7/site-packages/rhn/transports.pytread_to_file2scCso|jrCt|j|jd|jd|j�}|jdd�nt|jd|j�}|jdd�|S(s�Read everything into a temporary file and call the progress
        callbacks if the file length is defined, or just reads till EOFRRi(R^R�R�RRR�R�(RR�((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR�=s		cCs#|jr|j�d|_ndS(N(R_R(R((s2/usr/lib/python2.7/site-packages/rhn/transports.pyt__del__Ks	
N(	RRRRR�ReR�R�R�(((s2/usr/lib/python2.7/site-packages/rhn/transports.pyR]s
			(((((RrR�R�ttypesRRRRRR<R�RmR�R�RRRnRwR�RZR�RR�R\R�R-R.RFR](((s2/usr/lib/python2.7/site-packages/rhn/transports.pyt<module>s0�8�;
�

Zerion Mini Shell 1.0