%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/jeepney/io/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/jeepney/io/__pycache__/common.cpython-312.pyc

�

+�c�
���ddlmZddlmZddlmZmZmZmZGd�d�Z	Gd�d�Z
Gd�d	�ZGd
�de�Z
defd
�Zy)�)�contextmanager)�count)�HeaderFields�Message�MessageFlag�MessageTypec��eZdZd�Zd�Zy)�MessageFiltersc�0�i|_t�|_y�N)�filtersr�
filter_ids��selfs �3/usr/lib/python3/dist-packages/jeepney/io/common.py�__init__zMessageFilters.__init__s������'���c#�K�|jj�D]"}|jj|�s�|���$y�wr)r
�values�rule�matches)r�message�handles   rrzMessageFilters.matchess9�����l�l�)�)�+�	�F��{�{�"�"�7�+���	�s
�9A�AN)�__name__�
__module__�__qualname__rr�rrr
r
s��"�rr
c�*�eZdZdefd�Zd�Zd�Zd�Zy)�FilterHandler
c��||_t|j�|_||_||_||jj|j<yr)�_filters�nextr�
_filter_idr�queuer
)rr
rr$s    rrzFilterHandle.__init__sA����
��w�1�1�2�����	���
�15��
�
���d�o�o�.rc�F�|jj|j=yr)r!r
r#rs r�closezFilterHandle.closes���M�M�!�!�$�/�/�2rc��|jSr)r$rs r�	__enter__zFilterHandle.__enter__s���z�z�rc�$�|j�y)NF)r&)r�exc_type�exc_val�exc_tbs    r�__exit__zFilterHandle.__exit__ s���
�
��rN)rrrr
rr&r(r-rrrrrs��6��6�3��rrc�6�eZdZd�Zed��Zd�Zddefd�Zy)�ReplyMatcherc��i|_yr��_futuresrs rrzReplyMatcher.__init__&s	����
rc#�rK�||j|<	|��|j|=y#|j|=wxYw�w)z>Context manager to capture a reply for the given serial numberNr1)r�serial�futures   r�catchzReplyMatcher.catch)s8����!'��
�
�f��	&��L��
�
�f�%���
�
�f�%�s�7�%�7�4�7c���|jjjtjd�}||j
vr|j
|j
|�yy)zDispatch an incoming message which may be a reply

        Returns True if a task was waiting for it, otherwise False.
        ���TF)�header�fields�getr�reply_serialr2�
set_result)r�msg�
rep_serials   r�dispatchzReplyMatcher.dispatch3sO��
�Z�Z�&�&�*�*�<�+D�+D�b�I�
�����&��M�M�*�%�0�0��5��rN�excc��|�td�}|jic}|_|j�D]}|j|��y)z4Throw an error in any task still waiting for a replyNz(D-Bus router closed before reply arrived)�RouterClosedr2r�
set_exception)rrA�futures�futs    r�drop_allzReplyMatcher.drop_all?sH���;��I�J�C�!%���������>�>�#�	#�C����c�"�	#rr)	rrrrrr6r@�	ExceptionrGrrrr/r/%s,����&��&�
�#�I�#rr/c��eZdZdZy)rCaRaised in tasks waiting for a reply when the router is closed

    This will also be raised if the receiver task crashes, so tasks are not
    stuck waiting for a reply that can never come. The router object will not
    be usable after this is raised.
    N)rrr�__doc__rrrrCrCHs���	rrCr>c��|jjtjk7r#t	d|jj�d���t
j|jjzrtd��y)z4Raise an error if we wouldn't expect a reply for msgz,Only method call messages have replies (not �)z/This message has the no_reply_expected flag setN)	r9�message_typer�method_call�	TypeErrorr�no_reply_expected�flags�
ValueError)r>s r�check_replyablerSRsl��
�z�z���+�"9�"9�9�� � #�
�
� 7� 7�8��;�<�	<��$�$�s�z�z�'7�'7�7��J�K�K�8rN)�
contextlibr�	itertoolsr�jeepneyrrrrr
rr/rHrCrSrrr�<module>rWsJ��%��C�C�����( #� #�F	�9�	�L��Lr

Zerion Mini Shell 1.0