Your IP : 3.144.116.34


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/xdrlib.cpython-310.opt-2.pyc

o

6��f�@sr	ddlZddlmZddlmZgd�ZGdd�de�ZGdd�de�Zd	d
�Z	Gdd�d�Z
Gd
d�d�ZdS)�N)�BytesIO��wraps)�Error�Packer�Unpacker�ConversionErrorc@s&eZdZ	dd�Zdd�Zdd�ZdS)rcC�
||_dS�N)�msg)�selfr�r
�-/opt/alt/python310/lib64/python3.10/xdrlib.py�__init__�
zError.__init__cC�
t|j�Sr
)�reprr�rr
r
r�__repr__rzError.__repr__cCrr
)�strrrr
r
r�__str__rz
Error.__str__N)�__name__�
__module__�__qualname__rrrr
r
r
rrs
	rc@seZdZdS)rN)rrrr
r
r
rr srcs	t���fdd��}|S)Nc
s8z�||�WStjy}zt|jd�d�d}~ww�Nr)�struct�errorr�args)r�value�e��functionr
r�result&s��z&raise_conversion_error.<locals>.resultr)r!r"r
r r�raise_conversion_error#sr#c@s�eZdZ	dd�Zdd�Zdd�ZeZedd��Zed	d
��Z	e	Z
dd�Zd
d�ZeZ
edd��Zedd��Zdd�ZeZdd�ZeZeZdd�Zdd�Zdd�ZdS)rcCs|��dSr
��resetrr
r
rr2�zPacker.__init__cCst�|_dSr
)r�_Packer__bufrr
r
rr%5r&zPacker.resetcCs
|j��Sr
)r'�getvaluerr
r
r�
get_buffer8rzPacker.get_buffercC�|j�t�d|��dS)N�>L�r'�writerZpack�r�xr
r
r�	pack_uint=�zPacker.pack_uintcCr*)N�>lr,r.r
r
r�pack_intAr1zPacker.pack_intcCs$|r
|j�d�dS|j�d�dS)Nss)r'r-r.r
r
r�	pack_boolGszPacker.pack_boolc
Cs�z|�|d?d@�Wnttjfy"}zt|jd�d�d}~wwz
|�|d@�WdSttjfyD}zt|jd�d�d}~ww)N� l��r)r0�	TypeErrorrrrr)rr/rr
r
r�pack_uhyperKs����zPacker.pack_uhypercCr*)N�>fr,r.r
r
r�
pack_floatWr1zPacker.pack_floatcCr*)N�>dr,r.r
r
r�pack_double[r1zPacker.pack_doublecCsP|dkrtd��|d|�}|ddd}||t|�d}|j�|�dS)Nr� fstring size must be nonnegative���)�
ValueError�lenr'r-)r�n�s�datar
r
r�pack_fstring_szPacker.pack_fstringcCs"t|�}|�|�|�||�dSr
)rAr0rE)rrCrBr
r
r�pack_stringis
zPacker.pack_stringcCs*|D]}|�d�||�q|�d�dS)N�r)r0)r�list�	pack_item�itemr
r
r�	pack_listqs

zPacker.pack_listcCs*t|�|kr
td��|D]}||�qdS)Nzwrong array size)rAr@)rrBrHrIrJr
r
r�pack_farrayws

�zPacker.pack_farraycCs$t|�}|�|�|�|||�dSr
)rAr0rL)rrHrIrBr
r
r�
pack_array}s
zPacker.pack_arrayN)rrrrr%r)Zget_bufr#r0r3Z	pack_enumr4r7Z
pack_hyperr9r;rEZpack_fopaquerFZpack_opaqueZ
pack_bytesrKrLrMr
r
r
rr/s4




rc@s�eZdZ	dd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
e
Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZeZdd�ZeZeZdd �Zd!d"�Zd#d$�Zd%S)&rcCs|�|�dSr
r$�rrDr
r
rr�szUnpacker.__init__cCs||_d|_dSr)�_Unpacker__buf�_Unpacker__posrNr
r
rr%�s
zUnpacker.resetcC�|jSr
�rPrr
r
r�get_position��zUnpacker.get_positioncCr	r
rR)rZpositionr
r
r�set_position�rzUnpacker.set_positioncCrQr
)rOrr
r
rr)�rTzUnpacker.get_buffercCs|jt|j�krtd��dS)Nzunextracted data remains)rPrArOrrr
r
r�done�s�z
Unpacker.donecC�B|j}|d|_}|j||�}t|�dkrt�t�d|�dS)Nr>r+r�rPrOrA�EOFErrorrZunpack�r�i�jrDr
r
r�unpack_uint��zUnpacker.unpack_uintcCrW)Nr>r2rrXrZr
r
r�
unpack_int�r^zUnpacker.unpack_intcCst|���Sr
)�boolr_rr
r
r�unpack_bool�r&zUnpacker.unpack_boolcCs |��}|��}t|�d>|BS)Nr5)r]�int)r�hi�lor
r
r�
unpack_uhyper�szUnpacker.unpack_uhypercCs|��}|dkr|d}|S)Nll)rer.r
r
r�unpack_hyper�szUnpacker.unpack_hypercCrW)Nr>r8rrXrZr
r
r�unpack_float�r^zUnpacker.unpack_floatcCrW)N�r:rrXrZr
r
r�
unpack_double�r^zUnpacker.unpack_doublecCsT|dkrtd��|j}||ddd}|t|j�krt�||_|j|||�S)Nrr<r=r>)r@rPrArOrY)rrBr[r\r
r
r�unpack_fstring�szUnpacker.unpack_fstringcCs|��}|�|�Sr
)r]rj)rrBr
r
r�
unpack_string�s
zUnpacker.unpack_stringcCsBg}	|��}|dkr
|S|dkrtd|f��|�}|�|�q)NrGrz0 or 1 expected, got %r)r]r�append)r�unpack_itemrHr/rJr
r
r�unpack_list�s�
�zUnpacker.unpack_listcCs"g}t|�D]}|�|��q|Sr
)�rangerl)rrBrmrHr[r
r
r�
unpack_farray�szUnpacker.unpack_farraycCs|��}|�||�Sr
)r]rp)rrmrBr
r
r�unpack_array�szUnpacker.unpack_arrayN)rrrrr%rSrUr)rVr]r_Zunpack_enumrarerfrgrirjZunpack_fopaquerkZ
unpack_opaqueZunpack_bytesrnrprqr
r
r
rr�s0
r)r�ior�	functoolsr�__all__�	Exceptionrrr#rrr
r
r
r�<module>sU

?>