AlkantarClanX12

Your IP : 18.225.195.4


Current Path : /opt/alt/python312/lib64/python3.12/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/__pycache__/xdrlib.cpython-312.opt-1.pyc

�

�Q�f6���dZddlZddlmZddlmZddlZejed��gd�Z	Gd�d	e
�ZGd
�de�Zd�Z
Gd
�d�ZGd�d�Zy)zRImplements (a subset of) Sun XDR -- eXternal Data Representation.

See: RFC 1014

�N)�BytesIO��wraps)��
)�remove)�Error�Packer�Unpacker�ConversionErrorc�"�eZdZdZd�Zd�Zd�Zy)r	z�Exception class for this module. Use:

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

    Public ivars:
        msg -- contains the message

    c��||_y�N)�msg)�selfrs  �-/opt/alt/python312/lib64/python3.12/xdrlib.py�__init__zError.__init__s	�����c�,�t|j�Sr)�reprr�rs r�__repr__zError.__repr__s���D�H�H�~�rc�,�t|j�Sr)�strrrs r�__str__z
Error.__str__s���4�8�8�}�rN)�__name__�
__module__�__qualname__�__doc__rrr�rrr	r	s�����rr	c��eZdZy)rN)rrrr rrrr#s��rrc�.��t���fd��}|S)z5 Wrap any raised struct.errors in a ConversionError. c���	�||�S#tj$r}t|jd�d�d}~wwxYw�Nr)�struct�errorr�args)r�value�e�functions   �r�resultz&raise_conversion_error.<locals>.result)s>���	7��D�%�(�(���|�|�	7�!�!�&�&��)�,�$�6��	7�s��=�8�=r)r*r+s` r�raise_conversion_errorr,&s"����8�_�7��7�
�Mrc��eZdZdZd�Zd�Zd�ZeZed��Z	ed��Z
e
Zd�Zd�Z
e
Zed	��Zed
��Zd�ZeZd�ZeZeZd
�Zd�Zd�Zy)r
z0Pack various data representations into a buffer.c�$�|j�yr��resetrs rrzPacker.__init__5s���
�
�rc�"�t�|_yr)r�_Packer__bufrs rr0zPacker.reset8s���Y��
rc�6�|jj�Sr)r2�getvaluers r�
get_bufferzPacker.get_buffer;s���z�z�"�"�$�$rc�b�|jjtjd|��y)N�>L�r2�writer%�pack�r�xs  r�	pack_uintzPacker.pack_uint@����
�
������T�1�-�.rc�b�|jjtjd|��y)N�>lr8r;s  r�pack_intzPacker.pack_intDr>rc�v�|r|jjd�y|jjd�y)Nss)r2r9r;s  r�	pack_boolzPacker.pack_boolJs(���d�j�j���{�+��j�j���{�+rc�F�	|j|dz	dz�	|j|dz�y#ttjf$r}t	|j
d�d�d}~wwxYw#ttjf$r}t	|j
d�d�d}~wwxYw)N� l��r)r=�	TypeErrorr%r&rr')rr<r)s   r�pack_uhyperzPacker.pack_uhyperNs���	7��N�N�1�b�5�:�-�.�	7��N�N�1�z�>�*���6�<�<�(�	7�!�!�&�&��)�,�$�6��	7���6�<�<�(�	7�!�!�&�&��)�,�$�6��	7�s,�/�A)�A&�A!�!A&�)B �B�B c�b�|jjtjd|��y)N�>fr8r;s  r�
pack_floatzPacker.pack_floatZr>rc�b�|jjtjd|��y)N�>dr8r;s  r�pack_doublezPacker.pack_double^r>rc��|dkrtd��|d|}|dzdzdz}||t|�z
dzz}|jj|�y)Nr� fstring size must be nonnegativer��)�
ValueError�lenr2r9)r�n�s�datas    r�pack_fstringzPacker.pack_fstringbsZ���q�5��?�@�@���!�u����c�A�X�q�L���q�3�t�9�}��-�-���
�
����rc�`�t|�}|j|�|j||�yr)rSr=rW)rrUrTs   r�pack_stringzPacker.pack_stringls'����F�����q�����!�Q�rc�f�|D]}|jd�||��|jd�y)N�r)r=)r�list�	pack_item�items    r�	pack_listzPacker.pack_listts-���D��N�N�1���d�O��	
���q�rc�T�t|�|k7rtd��|D]
}||��y)Nzwrong array size)rSrR)rrTr\r]r^s     r�pack_farrayzPacker.pack_farrayzs*���t�9��>��/�0�0��D��d�O�rc�b�t|�}|j|�|j|||�yr)rSr=ra)rr\r]rTs    r�
pack_arrayzPacker.pack_array�s)����I�����q������D�)�,rN)rrrrrr0r5�get_bufr,r=rA�	pack_enumrCrG�
pack_hyperrJrMrW�pack_fopaquerY�pack_opaque�
pack_bytesr_rarcr rrr
r
2s���:���%��G��/��/��/��/��I�,�7��J��/��/��/��/�� �L� �
�K��J���-rr
c��eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�ZeZd
�Z
d�Zd�Zd
�Zd�Zd�ZeZd�ZeZeZd�Zd�Zd�Zy)rz;Unpacks various data representations from the given buffer.c�&�|j|�yrr/�rrVs  rrzUnpacker.__init__�s���
�
�4�rc� �||_d|_yr$)�_Unpacker__buf�_Unpacker__posrls  rr0zUnpacker.reset�s����
���
rc��|jSr�rors r�get_positionzUnpacker.get_position�����z�z�rc��||_yrrq)r�positions  r�set_positionzUnpacker.set_position�s	����
rc��|jSr)rnrs rr5zUnpacker.get_buffer�rsrc�^�|jt|j�krtd��y)Nzunextracted data remains)rorSrnr	rs r�donez
Unpacker.done�s'���:�:��D�J�J��'��2�3�3�(rc��|j}|dzx|_}|j||}t|�dkrt�t	j
d|�dS)NrPr7r�rornrS�EOFErrorr%�unpack�r�i�jrVs    r�unpack_uintzUnpacker.unpack_uint��P���J�J���1����
�Q��z�z�!�A����t�9�q�=��N��}�}�T�4�(��+�+rc��|j}|dzx|_}|j||}t|�dkrt�t	j
d|�dS)NrPr@rr{r~s    r�
unpack_intzUnpacker.unpack_int�r�rc�4�t|j��Sr)�boolr�rs r�unpack_boolzUnpacker.unpack_bool�s���D�O�O�%�&�&rc�d�|j�}|j�}t|�dz|zS)NrE)r��int)r�hi�los   r�
unpack_uhyperzUnpacker.unpack_uhyper�s1��
�
�
�
��
�
�
�
���2�w��{�R��rc�:�|j�}|dk\r|dz
}|S)Nll)r�r;s  r�unpack_hyperzUnpacker.unpack_hyper�s)����� ���"�"��'�'�A��rc��|j}|dzx|_}|j||}t|�dkrt�t	j
d|�dS)NrPrIrr{r~s    r�unpack_floatzUnpacker.unpack_float�r�rc��|j}|dzx|_}|j||}t|�dkrt�t	j
d|�dS)N�rLrr{r~s    r�
unpack_doublezUnpacker.unpack_double�r�rc���|dkrtd��|j}||dzdzdzz}|t|j�kDrt�||_|j|||zS)NrrOrrP)rRrorSrnr|)rrTrr�s    r�unpack_fstringzUnpacker.unpack_fstring�sd���q�5��?�@�@��J�J��
��1��q���
�N���s�4�:�:����N���
��z�z�!�A�a�C� � rc�D�|j�}|j|�Sr)r�r�)rrTs  r�
unpack_stringzUnpacker.unpack_string�s!��������"�"�1�%�%rc��g}|j�x}dk7rA|dk7rtd|����|�}|j|�|j�x}dk7r�A|S)Nrr[z0 or 1 expected, got )r�r�append)r�unpack_itemr\r<r^s     r�unpack_listzUnpacker.unpack_list�sd�����$�$�&�&�q�1�,��A�v�%�1�&F�G�G��=�D��K�K���	�$�$�&�&�q�1�,�
�rc�V�g}t|�D]}|j|���|Sr)�ranger�)rrTr�r\rs     r�
unpack_farrayzUnpacker.unpack_farray�s(�����q��A��K�K��
�&���rc�F�|j�}|j||�Sr)r�r�)rr�rTs   r�unpack_arrayzUnpacker.unpack_array�s#��������!�!�!�[�1�1rN)rrrrrr0rrrvr5ryr�r��unpack_enumr�r�r�r�r�r��unpack_fopaquer��
unpack_opaque�unpack_bytesr�r�r�r rrrr�sy��E������4�,�,��K�'� �
�,�,�!�$�N�&�"�M� �L���2rr)rr%�ior�	functoolsr�warnings�_deprecatedr�__all__�	Exceptionr	rr,r
rr rr�<module>r�se�����������X�g�.�
<���I��$	�e�	�	�Q-�Q-�jk2�k2r