Your IP : 18.222.67.8


Current Path : /lib64/python2.7/Demo/pdist/
Upload File :
Current File : //lib64/python2.7/Demo/pdist/client.pyo

�
��^c@s�dZddlZddlZddlZddlZddlZdZddd��YZddlm	Z	dee	fd��YZ
d	dd
��YZdS(
sRPC Client module.i����NitClientcBs�eZdZed�Zed�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
d�Zd�Zd�Zd�ZRS(sCRPC Client class.  No need to derive a class -- it's fully generic.cCs|j||�|j�dS(N(t	_pre_initt
_post_init(tselftaddresstverbose((s)/usr/lib64/python2.7/Demo/pdist/client.pyt__init__scCs�t|�td�kr'd|f}n||_||_|jrTdt|�GHntjtjtj�|_|jj|�|jr�dGHnd|_	d|_
i|_|jjd�|_
|jjd�|_dS(NitsConnecting to %s ...s
Connected.itrtw(ttypet_addresst_verbosetreprtsockettAF_INETtSOCK_STREAMt_sockettconnectt_lastidt_nextidt_repliestmakefilet_rft_wf(RRR((s)/usr/lib64/python2.7/Demo/pdist/client.pyRs							cCs|jd�|_dS(Ns.methods(t_callt_methods(R((s)/usr/lib64/python2.7/Demo/pdist/client.pyR%scCs|j�dS(N(t_close(R((s)/usr/lib64/python2.7/Demo/pdist/client.pyt__del__(scCsj|jr|jj�nd|_|jr;|jj�nd|_|jr]|jj�nd|_dS(N(RtclosetNoneRR(R((s)/usr/lib64/python2.7/Demo/pdist/client.pyR+s					cCs?||jkr2t||�}t|||�|St|�dS(N(Rt_stubtsetattrtAttributeError(Rtnametmethod((s)/usr/lib64/python2.7/Demo/pdist/client.pyt__getattr__3s
cCs
||_dS(N(R(RR((s)/usr/lib64/python2.7/Demo/pdist/client.pyt_setverbose:scGs|j||�S(N(t_vcall(RR"targs((s)/usr/lib64/python2.7/Demo/pdist/client.pyR=scCs|j|j||��S(N(t_recvt_vsend(RR"R'((s)/usr/lib64/python2.7/Demo/pdist/client.pyR&@scGs|j||�S(N(R)(RR"R'((s)/usr/lib64/python2.7/Demo/pdist/client.pyt_sendCscGs|j||d�S(Ni(R)(RR"R'((s)/usr/lib64/python2.7/Demo/pdist/client.pyt
_send_noreplyFscCs|j||d�S(Ni(R)(RR"R'((s)/usr/lib64/python2.7/Demo/pdist/client.pyt_vsend_noreplyIsicCsy|j}|d|_|s&|}n|||f}|jdkrVdt|�GHntj|j�}|j|�|S(Nissending request: %s(RRR
tpickletPicklerRtdump(RR"R't	wantreplytidtrequesttwp((s)/usr/lib64/python2.7/Demo/pdist/client.pyR)Ls	


cCs�|j|�\}}}||kr:td||f�n|dkrJ|S|}tt|�rqtt|�}n|dkr�tj}n||kr�|}n||�dS(Ns request/reply id mismatch: %d/%dsposix.errors	mac.error(sposix.errors	mac.error(t_vrecvtRuntimeErrorRthasattrt__builtin__tgetattrtosterror(RR1t	exceptiontvaluetridtx((s)/usr/lib64/python2.7/Demo/pdist/client.pyR(Vs	cCs@|j�|jj|�rR|jdkr7d|GHn|j|}|j|=|St|�}x�|jdkr|d|GHntj|j�}|j�}~|jdkr�dt	|�GHn|d}t|�}||kr�|jdkr�dGHn|S||j|<||kra|jdkr+dGHndd|fSqaWdS(Nis"retrieving previous reply, id = %dswaiting for reply, id = %ds
got reply: %sisgot itsgot higher id, assume all ok(t_flushRthas_keyRtabsR-t	UnpicklerRtloadR
R(RR1treplytaidtrpR=tarid((s)/usr/lib64/python2.7/Demo/pdist/client.pyR4es6




cCs|jj�dS(N(Rtflush(R((s)/usr/lib64/python2.7/Demo/pdist/client.pyR?}s(t__name__t
__module__t__doc__tVERBOSERRRRRR$R%RR&R*R+R,R)R(R4R?(((s)/usr/lib64/python2.7/Demo/pdist/client.pyRs"										
		(tSecuritytSecureClientcBseZd�ZRS(cGs�ddl}t|j|�tj|�|jj�|jj�}|j	|j
|��}|j|�}tt
|��}|ddkr�|d }n|jj|d�|jj�|j�dS(Ni����tLls
(tstringtapplyRRMRRRHRtreadlinetatoitstript_encode_challengeR
tlongtwriteR(RR'RPtlinet	challengetresponse((s)/usr/lib64/python2.7/Demo/pdist/client.pyR�s



(RIRJR(((s)/usr/lib64/python2.7/Demo/pdist/client.pyRN�sRcBs eZdZd�Zd�ZRS(sJHelper class for Client -- each instance serves as a method of the client.cCs||_||_dS(N(t_clientt_name(RtclientR"((s)/usr/lib64/python2.7/Demo/pdist/client.pyR�s	cGs|jj|j|�S(N(R[R&R\(RR'((s)/usr/lib64/python2.7/Demo/pdist/client.pyt__call__�s(RIRJRKRR^(((s)/usr/lib64/python2.7/Demo/pdist/client.pyR�s	(((RKtsysRR-R7R9RLRtsecurityRMRNR(((s)/usr/lib64/python2.7/Demo/pdist/client.pyt<module>ss

?>