CasperSecurity

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

o

�b��@sndZddlZddlmZmZmZddlmZddlm	Z	ddl
mZddlm
Z
dd	lmZGd
d�d�ZdS)z
File-like object that logs.
�N)�AnyStr�Iterable�Optional)�
NamedConstant)�Version)�deprecatedProperty�)�LogLevel)�Loggerc	@sBeZdZdZdZeedddd��dd��Zejdd��Ze	j
d	fd
edede
ed
d	fdd�Zed
efdd��Zed
efdd��Zed
efdd��Zed+dd��Zed
efdd��Zd+dd�Zd+dd�Zd
efdd�Zd
efd d!�Zd"ed
d	fd#d$�Zd%eed
d	fd&d'�Zd(e d
d	fd)d*�Z!e!Z"e!Z#e!Z$e!Z%e!Z&e!Z'e!Z(e!Z)d	S),�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��cC�|jS�N��
_softspace��self�r�4/usr/lib/python3/dist-packages/twisted/logger/_io.py�	softspace!szLoggingFile.softspacecCs
||_dSrr)r�valuerrrr%s
N�logger�level�encoding�returncCs6||_||_|durt��|_n||_d|_d|_dS)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)rrrrrrr�__init__)s
zLoggingFile.__init__cCr)zm
        Read-only property.  Is the file closed?

        @return: true if closed, otherwise false.
        �r#rrrr�closed@�zLoggingFile.closedcCr)zU
        Read-only property.   File encoding.

        @return: an encoding.
        )r!rrrrrIr'zLoggingFile.encodingcC�dS)zG
        Read-only property.  File mode.

        @return: "w"
        �wrrrrr�modeR�zLoggingFile.modecCr()z_
        Read-only property.  Types of newlines encountered.

        @return: L{None}
        Nrrrrr�newlines[r+zLoggingFile.newlinescCsd�|jj|jj|jj�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�namerrrrr1ds
�zLoggingFile.namecCs
d|_dS)zD
        Close this file so it can no longer be written to.
        TNr%rrrr�closers
zLoggingFile.closecCr()z3
        No-op; this file does not buffer.
        Nrrrrr�flushxszLoggingFile.flushcCr()zp
        Returns an invalid file descriptor, since this is not backed by an FD.

        @return: C{-1}
        ���rrrrr�fileno~�zLoggingFile.filenocCr()zK
        A L{LoggingFile} is not a TTY.

        @return: C{False}
        Frrrrr�isatty�r6zLoggingFile.isatty�messagecCsr|jrtd��t|t�r|�|j�}n|}|j|�d�}|d|_|dd�}|D]}|jj	|j
d|d�q*dS)zW
        Log the given message.

        @param message: The message to write.
        zI/O operation on closed file�
r4rz{log_io})r-�log_ioN)r#�
ValueError�
isinstance�bytes�decoder!r"�splitr�emitr)rr8�text�lines�linerrr�write�s

�zLoggingFile.writerBcCs|D]}|�|�qdS)zj
        Log each of the given lines as a separate message.

        @param lines: Data to write.
        N)rD)rrBrCrrr�
writelines�s�zLoggingFile.writelines�argscGstd��)zW
        Template for unsupported operations.

        @param args: Arguments.
        zunsupported operation)�OSError)rrFrrr�_unsupported�szLoggingFile._unsupported)rN)*r/�
__module__�__qualname__�__doc__rrrr�setterr	�infor
rr�strr$�property�boolr&rr*r,r1r2r3�intr5r7rrDrrE�objectrH�read�next�readline�	readlines�
xreadlines�seek�tell�truncaterrrrrsV


����
�

	r)rKr�typingrrr�
constantlyr�incrementalr�twisted.python.deprecater�_levelsr	�_loggerr
rrrrr�<module>s
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY