%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/trial/_dist/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/trial/_dist/__pycache__/stream.cpython-312.pyc

�

Ϫ�f�	����dZddlmZddlmZmZmZmZddlm	Z	m
Z
ddlmZm
Z
mZmZed�ZGd�de
�ZGd	�d
e
�Ze
Gd�d��Zd
ededeefd�Zdedeedefd�Zy)z
Buffer byte streams.
�)�count)�Dict�Iterator�List�TypeVar)�Factory�define)�AMP�Command�Integer�String�Tc�$�eZdZdZde�fgZy)�
StreamOpenz
    Open a new stream.
    �streamIdN)�__name__�
__module__�__qualname__�__doc__r�response���</usr/lib/python3/dist-packages/twisted/trial/_dist/stream.pyrrs����g�i�(�)�Hrrc�4�eZdZdZde�fde�fgZy)�StreamWritez,
    Write a chunk of data to a stream.
    rsdataN)rrrrr�Bytes�	argumentsrrrrrs$���

�g�i� �	�%�'���Irrc��eZdZUdZe�Zeeed<e	e
�Zeee
efed<defd�Zdededdfd	�Zdede
efd
�Zy)�StreamReceiverz9
    Buffering de-multiplexing byte stream receiver.
    �_counter�_streams�returnc�N�t|j�}g|j|<|S)zE
        Open a new stream and return its unique identifier.
        )�nextr r!)�self�newIds  r�openzStreamReceiver.open+s%���T�]�]�#��!��
�
�e���r�streamId�chunkNc�@�|j|j|�y)z�
        Write to an open stream using its unique identifier.

        @raise KeyError: If there is no such open stream.
        N)r!�append)r%r(r)s   r�writezStreamReceiver.write3s��	
�
�
�h��&�&�u�-rc�8�|jj|�S)z�
        Indicate an open stream may receive no further data and return all of
        its current contents.

        @raise KeyError: If there is no such open stream.
        )r!�pop)r%r(s  r�finishzStreamReceiver.finish;s���}�}� � ��*�*r)rrrrrr r�int�__annotations__r�dictr!rr�bytesr'r,r/rrrrr"sr���$�g�H�h�s�m�%�'.�t�}�H�d�3��U��#�$�4��c��.�c�.�%�.�D�.�+�s�+�t�E�{�+rr�data�	chunkSizer"c#�jK�d}|t|�kr||||z��||z
}|t|�kr�yy�w)a
    Break a byte string into pieces of no more than ``chunkSize`` length.

    @param data: The byte string.

    @param chunkSize: The maximum length of the resulting pieces.  All pieces
        except possibly the last will be this length.

    @return: The pieces.
    rN)�len)r4r5�poss   rr)r)Es@�����C�

��D�	�/��3��y��)�)��y�����D�	�/�s�.3�3�amp�chunksc���K�|jt��d{���d}t|t�sJ�|D]"}|jt||���d{����$|S7�B7�
�w)z�
    Send the given stream chunks, one by one, over the given connection.

    The chunks are sent using L{StreamWrite} over a stream opened using
    L{StreamOpen}.

    @return: The identifier of the stream over which the chunks were sent.
    Nr()r(r4)�
callRemoter�
isinstancer0r)r9r:r(�oneChunks    r�streamr?Vsh�����n�n�Z�0�0�*�=�H��h��$�$�$��L���n�n�[�8�(�n�K�K�K�L��O�1��	L�s!�A"�A�9A"�A �	A"� A"N)r�	itertoolsr�typingrrrr�attrsrr	�twisted.protocols.ampr
rrr
rrrrrr3r0r)r?rrr�<module>rDs�����0�0�!�H�H��C�L��*��*��'���+�+��+�D���#��(�5�/��"�c��8�E�?��s�r

Zerion Mini Shell 1.0