CasperSecurity

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

o

�b��@sZdZddlmZddlmZmZddlmZddlm	Z	m
Z
dZee	�Gdd	�d	��Zd
S)z'
Log observer that maintains a buffer.
�)�deque)�Deque�Optional)�implementer�)�ILogObserver�LogEventic@sNeZdZdZefdeeddfdd�Zdeddfdd	�Z	d
e
ddfdd�ZdS)
�LimitedHistoryLogObservera�
    L{ILogObserver} that stores events in a buffer of a fixed size::

        >>> from twisted.logger import LimitedHistoryLogObserver
        >>> history = LimitedHistoryLogObserver(5)
        >>> for n in range(10): history({'n': n})
        ...
        >>> repeats = []
        >>> history.replayTo(repeats.append)
        >>> len(repeats)
        5
        >>> repeats
        [{'n': 5}, {'n': 6}, {'n': 7}, {'n': 8}, {'n': 9}]
        >>>
    �size�returnNcCst|d�|_dS)zx
        @param size: The maximum number of events to buffer.  If L{None}, the
            buffer is unbounded.
        )�maxlenN)r�_buffer)�selfr
�r�8/usr/lib/python3/dist-packages/twisted/logger/_buffer.py�__init__%sz"LimitedHistoryLogObserver.__init__�eventcCs|j�|�dS)N)r
�append)rrrrr�__call__,sz"LimitedHistoryLogObserver.__call__�
otherObservercCs|jD]}||�qdS)z�
        Re-play the buffered events to another log observer.

        @param otherObserver: An observer to replay events to.
        N)r
)rrrrrr�replayTo/s

�z"LimitedHistoryLogObserver.replayTo)�__name__�
__module__�__qualname__�__doc__�_DEFAULT_BUFFER_MAXIMUMr�intrrrrrrrrrr	s
r	N)
r�collectionsr�typingrr�zope.interfacer�_interfacesrrrr	rrrr�<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