ok

Mini Shell

Direktori : /lib64/python2.7/
Upload File :
Current File : //lib64/python2.7/xdrlib.pyc

�
]цdc@s�dZddlZyddlmZWn!ek
rIddlmZnXddddgZdefd��YZdefd	��YZ	ddd
��YZ
dd
d��YZdS(sRImplements (a subset of) Sun XDR -- eXternal Data Representation.

See: RFC 1014

i����N(tStringIOtErrortPackertUnpackertConversionErrorcBs)eZdZd�Zd�Zd�ZRS(s�Exception class for this module. Use:

    except xdrlib.Error, var:
        # var has the Error instance for the exception

    Public ivars:
        msg -- contains the message

    cCs
||_dS(N(tmsg(tselfR((s/usr/lib64/python2.7/xdrlib.pyt__init__scCs
t|j�S(N(treprR(R((s/usr/lib64/python2.7/xdrlib.pyt__repr__scCs
t|j�S(N(tstrR(R((s/usr/lib64/python2.7/xdrlib.pyt__str__s(t__name__t
__module__t__doc__RR	R(((s/usr/lib64/python2.7/xdrlib.pyRs			cBseZRS((RR
(((s/usr/lib64/python2.7/xdrlib.pyR"scBs�eZdZd�Zd�Zd�ZeZd�Zd�ZeZ	d�Z
d�ZeZd�Z
d	�Zd
�ZeZd�ZeZeZd�Zd
�Zd�ZRS(s0Pack various data representations into a buffer.cCs|j�dS(N(treset(R((s/usr/lib64/python2.7/xdrlib.pyR*scCst�|_dS(N(t	_StringIOt_Packer__buf(R((s/usr/lib64/python2.7/xdrlib.pyR-scCs
|jj�S(N(Rtgetvalue(R((s/usr/lib64/python2.7/xdrlib.pyt
get_buffer0scCs |jjtjd|��dS(Ns>L(Rtwritetstructtpack(Rtx((s/usr/lib64/python2.7/xdrlib.pyt	pack_uint5scCs |jjtjd|��dS(Ns>l(RRRR(RR((s/usr/lib64/python2.7/xdrlib.pytpack_int8scCs-|r|jjd�n|jjd�dS(Ntt(RR(RR((s/usr/lib64/python2.7/xdrlib.pyt	pack_bool=scCs*|j|d?d@�|j|d@�dS(Ni l��(R(RR((s/usr/lib64/python2.7/xdrlib.pytpack_uhyperAscCsFy |jjtjd|��Wntjk
rA}t|�nXdS(Ns>f(RRRRterrorR(RRR((s/usr/lib64/python2.7/xdrlib.pyt
pack_floatGs cCsFy |jjtjd|��Wntjk
rA}t|�nXdS(Ns>d(RRRRRR(RRR((s/usr/lib64/python2.7/xdrlib.pytpack_doubleLs cCs`|dkrtd�n|| }|ddd}||t|�d}|jj|�dS(Nis fstring size must be nonnegativeiit(t
ValueErrortlenRR(Rtntstdata((s/usr/lib64/python2.7/xdrlib.pytpack_fstringQs
cCs-t|�}|j|�|j||�dS(N(R#RR'(RR%R$((s/usr/lib64/python2.7/xdrlib.pytpack_string[s
cCs9x%|D]}|jd�||�qW|jd�dS(Nii(R(Rtlistt	pack_itemtitem((s/usr/lib64/python2.7/xdrlib.pyt	pack_listcs

cCs=t|�|krtd�nx|D]}||�q%WdS(Nswrong array size(R#R"(RR$R)R*R+((s/usr/lib64/python2.7/xdrlib.pytpack_farrayis
cCs0t|�}|j|�|j|||�dS(N(R#RR-(RR)R*R$((s/usr/lib64/python2.7/xdrlib.pyt
pack_arrayos
(RR
RRRRtget_bufRRt	pack_enumRRt
pack_hyperRR R'tpack_fopaqueR(tpack_opaquet
pack_bytesR,R-R.(((s/usr/lib64/python2.7/xdrlib.pyR's*													cBs�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
e
Zd	�Zd
�Z
d�Zd�Zd
�Zd�ZeZd�ZeZeZd�Zd�Zd�ZRS(s;Unpacks various data representations from the given buffer.cCs|j|�dS(N(R(RR&((s/usr/lib64/python2.7/xdrlib.pyRyscCs||_d|_dS(Ni(t_Unpacker__buft_Unpacker__pos(RR&((s/usr/lib64/python2.7/xdrlib.pyR|s	cCs|jS(N(R6(R((s/usr/lib64/python2.7/xdrlib.pytget_position�scCs
||_dS(N(R6(Rtposition((s/usr/lib64/python2.7/xdrlib.pytset_position�scCs|jS(N(R5(R((s/usr/lib64/python2.7/xdrlib.pyR�scCs+|jt|j�kr'td��ndS(Nsunextracted data remains(R6R#R5R(R((s/usr/lib64/python2.7/xdrlib.pytdone�scCs�|j}|d|_}|j||!}t|�dkrEt�ntjd|�d}yt|�SWntk
r}|SXdS(Nis>Li(R6R5R#tEOFErrorRtunpacktintt
OverflowError(RtitjR&R((s/usr/lib64/python2.7/xdrlib.pytunpack_uint�s		
cCsY|j}|d|_}|j||!}t|�dkrEt�ntjd|�dS(Nis>li(R6R5R#R;RR<(RR?R@R&((s/usr/lib64/python2.7/xdrlib.pyt
unpack_int�s		cCst|j��S(N(tboolRB(R((s/usr/lib64/python2.7/xdrlib.pytunpack_bool�scCs*|j�}|j�}t|�d>|BS(Ni (RAtlong(Rthitlo((s/usr/lib64/python2.7/xdrlib.pyt
unpack_uhyper�scCs)|j�}|dkr%|d}n|S(Nll(RH(RR((s/usr/lib64/python2.7/xdrlib.pytunpack_hyper�s
cCsY|j}|d|_}|j||!}t|�dkrEt�ntjd|�dS(Nis>fi(R6R5R#R;RR<(RR?R@R&((s/usr/lib64/python2.7/xdrlib.pytunpack_float�s		cCsY|j}|d|_}|j||!}t|�dkrEt�ntjd|�dS(Nis>di(R6R5R#R;RR<(RR?R@R&((s/usr/lib64/python2.7/xdrlib.pyt
unpack_double�s		cCsp|dkrtd�n|j}||ddd}|t|j�krUt�n||_|j|||!S(Nis fstring size must be nonnegativeii(R"R6R#R5R;(RR$R?R@((s/usr/lib64/python2.7/xdrlib.pytunpack_fstring�s			cCs|j�}|j|�S(N(RARL(RR$((s/usr/lib64/python2.7/xdrlib.pyt
unpack_string�scCsag}xT|j�}|dkr%Pn|dkrDtd|f�n|�}|j|�q	|S(Niis0 or 1 expected, got %r(RARtappend(Rtunpack_itemR)RR+((s/usr/lib64/python2.7/xdrlib.pytunpack_list�s	cCs1g}x$t|�D]}|j|��qW|S(N(trangeRN(RR$ROR)R?((s/usr/lib64/python2.7/xdrlib.pyt
unpack_farray�scCs|j�}|j||�S(N(RARR(RROR$((s/usr/lib64/python2.7/xdrlib.pytunpack_array�s(RR
RRRR7R9RR:RARBtunpack_enumRDRHRIRJRKRLtunpack_fopaqueRMt
unpack_opaquetunpack_bytesRPRRRS(((s/usr/lib64/python2.7/xdrlib.pyRvs.														
			(((RRt	cStringIORRtImportErrort__all__t	ExceptionRRRR(((s/usr/lib64/python2.7/xdrlib.pyt<module>s
O

Zerion Mini Shell 1.0