%PDF- %PDF-
Mini Shell

Mini Shell

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

�

Ϫ�f���t�dZddlZddlmZmZmZddlmZddlm	Z	ddl
mZddlm
Z
dd	lmZGd
�d�Zy)z
File-like object that logs.
�N)�AnyStr�Iterable�Optional)�
NamedConstant)�Version)�deprecatedProperty�)�LogLevel)�Loggerc	��eZdZdZdZeedddd��d��Zejd��Ze	jdfd	ed
ede
eddfd
�Zedefd��Zedefd��Zedefd��Zedd��Zedefd��Zdd�Zdd�Zdefd�Zdefd�Zdeddfd�Zdeeddfd�Zde ddfd�Z!e!Z"e!Z#e!Z$e!Z%e!Z&e!Z'e!Z(e!Z)y)�LoggingFileac
    File-like object that turns C{write()} calls into logging events.

    Note that because event formats are L{str}, C{bytes} received via C{write()}
    are converted to C{str}, which is the opposite of what C{file} does.

    @ivar softspace: Attribute to make this class more file-like under Python 2;
        value is zero or one.  Do not use.
    r�Twisted��c��|jS�N��
_softspace��selfs �4/usr/lib/python3/dist-packages/twisted/logger/_io.py�	softspacezLoggingFile.softspace!s������c��||_yrr)r�values  rrzLoggingFile.softspace%s	����rN�logger�level�encoding�returnc��||_||_|�tj�|_n||_d|_d|_y)a
        @param logger: the logger to log through.
        @param level: the log level to emit events with.
        @param encoding: The encoding to expect when receiving bytes via
            C{write()}.  If L{None}, use C{sys.getdefaultencoding()}.
        N�F)r�log�sys�getdefaultencoding�	_encoding�_buffer�_closed)rrrrs    r�__init__zLoggingFile.__init__)s=����
������ �3�3�5�D�N�%�D�N������rc��|jS)zm
        Read-only property.  Is the file closed?

        @return: true if closed, otherwise false.
        �r'rs r�closedzLoggingFile.closed@s���|�|�rc��|jS)zU
        Read-only property.   File encoding.

        @return: an encoding.
        )r%rs rrzLoggingFile.encodingIs���~�~�rc��y)zG
        Read-only property.  File mode.

        @return: "w"
        �w�rs r�modezLoggingFile.modeRs��rc��y)z_
        Read-only property.  Types of newlines encountered.

        @return: L{None}
        Nr/rs r�newlineszLoggingFile.newlines[s��rc��dj|jj|jj|j
j�S)z�
        The name of this file; a repr-style string giving information about its
        namespace.

        @return: A file name.
        z
<{} {}#{}>)�format�	__class__�__name__r"�	namespacer�namers rr8zLoggingFile.nameds<���"�"��N�N�#�#��H�H����J�J�O�O�
�	
rc��d|_y)zD
        Close this file so it can no longer be written to.
        TNr*rs r�closezLoggingFile.closers����rc��y)z3
        No-op; this file does not buffer.
        Nr/rs r�flushzLoggingFile.flushxs��	
rc��y)zp
        Returns an invalid file descriptor, since this is not backed by an FD.

        @return: C{-1}
        ���r/rs r�filenozLoggingFile.fileno~s��rc��y)zK
        A L{LoggingFile} is not a TTY.

        @return: C{False}
        Fr/rs r�isattyzLoggingFile.isatty�s��r�messagec�F�|jrtd��t|t�r|j	|j
�}n|}|j|zjd�}|d|_|dd}|D]*}|jj|jd|���,y)zW
        Log the given message.

        @param message: The message to write.
        zI/O operation on closed file�
r>rz{log_io})r4�log_ioN)r'�
ValueError�
isinstance�bytes�decoder%r&�splitr"�emitr)rrB�text�lines�lines     r�writezLoggingFile.write�s����<�<��;�<�<��g�u�%��>�>�$�.�.�1�D��D�����$�+�+�D�1���R�y����a�����	F�D��H�H�M�M�$�*�*�Z��M�E�	FrrMc�4�|D]}|j|��y)zj
        Log each of the given lines as a separate message.

        @param lines: Data to write.
        N)rO)rrMrNs   r�
writelineszLoggingFile.writelines�s���	�D��J�J�t��	r�argsc��td��)zW
        Template for unsupported operations.

        @param args: Arguments.
        zunsupported operation)�OSError)rrRs  r�_unsupportedzLoggingFile._unsupported�s���-�.�.r)rN)*r6�
__module__�__qualname__�__doc__rrrr�setterr
�inforrr�strr(�property�boolr+rr0r2r8r:r<�intr?rArrOrrQ�objectrU�read�next�readline�	readlines�
xreadlines�seek�tell�truncater/rrr
r
s�����J���	�2�q�!�4�5��6����� �� � (�}�}�"&�	������3�-�	�

��.��������#������c���������
�c�
��
��
�������F�V�F��F�*��� 0��T��/�&�/�T�/��D��D��H��I��J��D��D��Hrr
)rXr#�typingrrr�
constantlyr�incrementalr�twisted.python.deprecater�_levelsr
�_loggerrr
r/rr�<module>rns0��
��-�-�$��7���g�gr

Zerion Mini Shell 1.0