%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/dbus/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/dbus/__pycache__/connection.cpython-312.pyc

�

@ia�i����dZdZddlZddlZddlZddlmZmZm	Z	m
Z
mZmZm
Z
ddlmZddlmZmZmZmZmZddlmZddlmZmZdd	lmZej8d
�Zd�ZGd�d
e�Z Gd�de�Zy))�
Connection�SignalMatch�reStructuredText�N)r�LOCAL_IFACE�
LOCAL_PATH�validate_bus_name�validate_interface_name�validate_member_name�validate_object_path)�
DBusException)�ErrorMessage�HANDLER_RESULT_NOT_YET_HANDLED�MethodCallMessage�MethodReturnMessage�
SignalMessage)�ProxyObject)�is_py2�is_py3)�Stringzdbus.connectionc��y�N�)�args�kwargss  �1/usr/lib/python3/dist-packages/dbus/connection.py�_noopr0s���c�|�eZdZgd�Zee�Z				dd�Zd�Zd�Zd�Z	e
d��Zd�Zd	�Z
d
�Zd�Zd�Zd
�Zy)r)�_sender_name_owner�_member�
_interface�_sender�_path�_handler�_args_match�_rule�_byte_arrays�
_conn_weakref�_destination_keyword�_interface_keyword�_message_keyword�_member_keyword�_sender_keyword�
_path_keyword�_int_args_matchNc��|�t|�|�t|�|�t|�|�t|�d|_tj|�|_||_||_	||_
||_||_||_
d|vrtd��||_||_|	|_||_|
|_||_|
|_||_|sd|_yi|_|D]Z}|j1d�std|z��	t3|dd�}|dks|dkDrtd|z��|||j.|<�\y#t4$rtd|z��wxYw)	N�utf8_strings�*unexpected keyword argument 'utf8_strings'�argz(SignalMatch: unknown keyword argument %s�r�?z9SignalMatch: arg match index must be in range(64), not %d)r
r	rrr&�weakref�refr(r"r!r r#r$r�	TypeErrorr'r-r.r,r*r+r)r%r/�
startswith�int�
ValueError)�self�conn�sender�object_path�dbus_interface�member�handler�byte_arrays�sender_keyword�path_keyword�interface_keyword�member_keyword�message_keyword�destination_keywordr�kwarg�indexs                 r�__init__zSignalMatch.__init__>s����� ��(��%�#�N�3����f�%��"� ��-���
�$�[�[��.������(������ ��
���
�#)����V�#��H�I�I�'���-���)���-���"3��� /���$7��!�!����#'�D� �#%�D� ��
<���'�'��.�#�$N�&+�%,�-�-�-���a�b�	�N�E��1�9���
�#�%8�:?�%@�A�A�.4�U�m��$�$�U�+�
<��"�-�#�$N�&+�%,�-�-�-�s�=D8�8Ec�*�tt|��S�z-SignalMatch objects are compared by identity.)�hash�id�r<s r�__hash__zSignalMatch.__hash__ws���B�t�H�~�rc�
�||uSrNr�r<�others  r�__eq__zSignalMatch.__eq__{s���u�}�rc�
�||uSrNrrTs  r�__ne__zSignalMatch.__ne__s
���5� � rc��|jSr)r"rQs r�<lambda>zSignalMatch.<lambda>�s
��4�<�<�rc�>�|j��dg}|j�|jd|jz�|j�|jd|jz�|j�|jd|jz�|j
�|jd|j
z�|j�8|jj�D]\}}|jd||fz��dj|�|_|jS)Nz
type='signal'zsender='%s'z	path='%s'zinterface='%s'zmember='%s'z
arg%d='%s'�,)	r&r"�appendr#r!r r/�items�join)r<�rulerK�values    r�__str__zSignalMatch.__str__�s����:�:��#�$�D��|�|�'����M�D�L�L�8�9��z�z�%����K�$�*�*�4�5����*����,�t���>�?��|�|�'����M�D�L�L�8�9��#�#�/�$(�$8�$8�$>�$>�$@�?�L�E�5��K�K���u�~� =�>�?����$��D�J��z�z�rc�j�d|jt|�|j|j�fzS)Nz<%s at %x "%s" on conn %r>)�	__class__rPr&r(rQs r�__repr__zSignalMatch.__repr__�s2��,��>�>�2�d�8�T�Z�Z��9K�9K�9M�N�O�	Prc��||_yr)r)r<�new_names  r�set_sender_name_ownerz!SignalMatch.set_sender_name_owner�s
��"*��rc���|d|jfvry||jk7ry||jk7ry||jk7ry||jk7ry||j
k7ryy)NFT)r$r"r#r!r r%)r<r>r?r@rArBrs       r�matches_removal_specz SignalMatch.matches_removal_spec�sf���4����/�/���T�\�\�!���$�*�*�$���T�_�_�,���T�\�\�!���T�%�%�%��rc��d}|jd|j�fvry|j�ktd��}|jdi|��}|jj�D]0\}}|t
|�k\st||t�r	|||k7s�0y|jd|j�fvry|jd|j�fvry|jd|j�fvry	|�|js|j	|j��}i}|j �|j�||j <|j"�|j%�||j"<|j&�|j�||j&<|j(�|j�||j(<|j*�|j�||j*<|j,�|||j,<|j.|i|��y#t1j2�t4j7dd��YyxYw)NFT�rCz&Exception in handler for D-Bus signal:���exc_infor)r�
get_senderr/�dict�
get_args_listr^�len�
isinstancerr �
get_memberr!�
get_interfacer#�get_pathr'r-r)�get_destinationr.r,r*r+r$�logging�basicConfig�_logger�error)r<�messagerrrKras      r�maybe_handle_messagez SignalMatch.maybe_handle_message�s?�����"�"�4��1C�1C�1E�*F�F�����+��d�+�F�(�7�(�(�2�6�2�D� $� 4� 4� :� :� <�
!���u��S��Y�&�%�d�5�k�6�:��E�{�e�+� �	
!��<�<��g�&8�&8�&:�;�;���?�?�4��)>�)>�)@�"A�A���:�:�d�G�$4�$4�$6�7�7��	P��|�4�#4�#4��,�,��9J�9J�,�K���F��#�#�/�/6�/A�/A�/C��t�+�+�,��(�(�4�4;�4K�4K�4M��t�0�0�1��!�!�-�-4�-=�-=�-?��t�)�)�*��#�#�/�/6�/A�/A�/C��t�+�+�,��&�&�2�29�2G�2G�2I��t�.�.�/��$�$�0�07��t�,�,�-��D�M�M�4�*�6�*���	P����!��M�M�B�Q�M�O��s
�7D&H�-I
c��|j�}|�J|j||j|j|j|j
fi|j��yyr)r(�remove_signal_receiverr r!r"r#r%)r<r=s  r�removezSignalMatch.remove�sW���!�!�#����'�D�'�'��d�l�l�(,������(,�
�
�
<�+/�*:�*:�
<�r)FNNNNNN)�__name__�
__module__�__qualname__�_slots�tuple�	__slots__rLrRrVrX�propertyr>rbrerhrjr~r�rrrrr4se��E�F��f�
�I�/4�37�8<�;?�	7<�r��!��/�
0�F��&P�+�� 1�f<rrc���eZdZdZeZ�fd�Zd�Zd
d�Z				dd�Z	d�Z
				dd�Zd�Zd	�Z
		dd
�Z		dd�Zd�Z�xZS)rzzA connection to another application. In this base class there is
    assumed to be no bus daemon.

    :Since: 0.81.0
    c����tt|�
|i|��t|d�sVd|_g|_i|_	tj�|_		|j|jj�yy)N�_dbus_Connection_initializedrm)
�superrrL�hasattrr��"_Connection__call_on_disconnection�!_signal_recipients_by_object_path�	threading�Lock�
_signals_lock�add_message_filterrd�_signal_func)r<rrrds   �rrLzConnection.__init__�sr���
�j�$�(�$�9�&�9��t�;�<�01�D�-�+-�D�(�57�D�2�
>�"+���!1�D��=��#�#�D�N�N�$?�$?�@�=rc��|S)aReturn the unique name for the given bus name, activating it
        if necessary and possible.

        If the name is already unique or this connection is not to a
        bus daemon, just return it.

        :Returns: a bus name. If the given `bus_name` exists, the returned
            name identifies its current owner; otherwise the returned name
            does not exist.
        :Raises DBusException: if the implementation has failed
            to activate the given bus name.
        :Since: 0.81.0
        r)r<�bus_names  r�activate_name_ownerzConnection.activate_name_owners	���rc��|jdd�}|�$|�td��ddlm}|dtd��|}|r+td	d
j|j
��z��|j||||��S)a�Return a local proxy for the given remote object.

        Method calls on the proxy are translated into method calls on the
        remote object.

        :Parameters:
            `bus_name` : str
                A bus name (either the unique name or a well-known name)
                of the application owning the object. The keyword argument
                named_service is a deprecated alias for this.
            `object_path` : str
                The object path of the desired object
            `introspect` : bool
                If true (default), attempt to introspect the remote
                object to find out supported methods and their signatures

        :Returns: a `dbus.proxies.ProxyObject`
        �
named_serviceN�3bus_name and named_service cannot both be specifiedr��warnziPassing the named_service parameter to get_object by name is deprecated: please use positional parameters���
stacklevelz4get_object does not take these keyword arguments: %sz, )�
introspect)�popr8�warningsr��DeprecationWarningr_�keys�ProxyObjectClass)r<r�r?r�rr�r�s       r�
get_objectzConnection.get_objects���(�
�
�?�D�9�
��$��#��!/�0�0�%��C�#��
3�%�H���,�.2�i�i����
�.F�G�H�
H��$�$�T�8�[�0:�%�<�	<rc��|j�|jdd�}|�$|�td��|}ddlm}|dt
d��t
||||||fi|��}	|jj�	|jj|i�}
|
j|i�}|j|g�}|j|	�|jj�|	S#|jj�wxYw)	aArrange for the given function to be called when a signal matching
        the parameters is received.

        :Parameters:
            `handler_function` : callable
                The function to be called. Its positional arguments will
                be the arguments of the signal. By default it will receive
                no keyword arguments, but see the description of
                the optional keyword arguments below.
            `signal_name` : str
                The signal name; None (the default) matches all names
            `dbus_interface` : str
                The D-Bus interface name with which to qualify the signal;
                None (the default) matches all interface names
            `bus_name` : str
                A bus name for the sender, which will be resolved to a
                unique name if it is not already; None (the default) matches
                any sender.
            `path` : str
                The object path of the object which must have emitted the
                signal; None (the default) matches any object path
        :Keywords:
            `utf8_strings` : bool
                If True, the handler function will receive any string
                arguments as dbus.UTF8String objects (a subclass of str
                guaranteed to be UTF-8). If False (default) it will receive
                any string arguments as dbus.String objects (a subclass of
                unicode).
            `byte_arrays` : bool
                If True, the handler function will receive any byte-array
                arguments as dbus.ByteArray objects (a subclass of str).
                If False (default) it will receive any byte-array
                arguments as a dbus.Array of dbus.Byte (subclasses of:
                a list of ints).
            `sender_keyword` : str
                If not None (the default), the handler function will receive
                the unique name of the sending endpoint as a keyword
                argument with this name.
            `destination_keyword` : str
                If not None (the default), the handler function will receive
                the bus name of the destination (or None if the signal is a
                broadcast, as is usual) as a keyword argument with this name.
            `interface_keyword` : str
                If not None (the default), the handler function will receive
                the signal interface as a keyword argument with this name.
            `member_keyword` : str
                If not None (the default), the handler function will receive
                the signal name as a keyword argument with this name.
            `path_keyword` : str
                If not None (the default), the handler function will receive
                the object-path of the sending object as a keyword argument
                with this name.
            `message_keyword` : str
                If not None (the default), the handler function will receive
                the `dbus.lowlevel.SignalMessage` as a keyword argument with
                this name.
            `arg...` : unicode or UTF-8 str
                If there are additional keyword parameters of the form
                ``arg``\ *n*, match only signals where the *n*\ th argument
                is the value given for that keyword parameter. As of this
                time only string arguments can be matched (in particular,
                object paths and signatures can't).
            `named_service` : str
                A deprecated alias for `bus_name`.
        r�Nr�rr�zrPassing the named_service parameter to add_signal_receiver by name is deprecated: please use positional parametersr�r�)
�_require_main_loopr�r8r�r�r�rr��acquirer��
setdefaultr]�release)
r<�handler_function�signal_namer@r��path�keywordsr�r��match�by_interface�	by_member�matchess
             r�add_signal_receiverzConnection.add_signal_receiver=s��N	
���!� ���_�d�;�
��$��#��!,�-�-�$�H�%��K�#��
3��D�(�D�.�'�)9�G�=E�G��	
���"�"�$�	)��A�A�L�L��"��L�$�/�/���C�I��*�*�;��;�G��N�N�5�!����&�&�(����
���&�&�(�s
�5AC"�"C>c#�K�|�d|f}nd}|�d|f}nd}|�d|f}nd}|D]c}|jj|�}|��!|D]>}|j|d�}|��|D]"}|j|d�}	|	��|	D]}
|
����$�@�ey�w)Nr)r��get)r<r�r@rA�	path_keys�interface_keys�member_keysr�r�r��ms           r�_iter_easy_matcheszConnection._iter_easy_matches�s��������t��I��I��%�"�N�3�N�$�N�����.�K�!�K��
	 �D��A�A�E�E�d�K�L��#��"0�	
 ��(�,�,�^�T�B�	��$��)� �F�'�m�m�F�D�9�G��� �$� ���� �	 �		
 �	
	 �s�BBc�P�|jdd�}|�$|�td��|}ddlm}|dtd��g}	g}
|j
j
�	|jj|d�}|�	|j
j�y|j|d�}|�	|j
j�y|j|d�}
|
�	|j
j�y|
D]@}||us|j|||||fi|��r|
j|��0|	j|��B|	r|	||<n||=|s||=|s
|j|=|j
j�|
D]}|j|��y#|j
j�wxYw)Nr�r�rr�zuPassing the named_service parameter to remove_signal_receiver by name is deprecated: please use positional parametersr�r�)
r�r8r�r�r�r�r�r�r�r�rjr]�_clean_up_signal_match)r<�handler_or_matchr�r@r�r�r�r�r��new�	deletionsr�r�r�r�s               rr�z!Connection.remove_signal_receiver�s���!���_�d�;�
��$��#��!,�-�-�$�H�%��)�$��
3�
���	����"�"�$�!	)��A�A�E�E�d�FJ�L�L��#��:
���&�&�(�9%�(�(���>�I�� ��4
���&�&�(�3 �m�m�K��6�G����.
���&�&�(�+!�

&��$��-�1�u�1�1�(�26�2@�2=�2B�	>�
5=�>��$�$�U�+��J�J�u�%�

&��),�	�+�&��k�*� �$�^�4�'� �B�B�4�H����&�&�(��	/�E��'�'��.�	/��
���&�&�(�s�F	�F	�F	�2A$F	�	F%c��yrr)r<r�s  rr�z!Connection._clean_up_signal_match�s��rc���t|t�stS|j�}|j	�}|j�}|j
|||�D]}|j|��|tk(r(|tk(r|dk(r|jD]}	||��
tS#t$r.tj�tjdd��Y�JwxYw)zvD-Bus filter function. Handle signals by dispatching to Python
        callbacks kept in the match-rule tree.
        �Disconnectedz-Exception in handler for Disconnected signal:rmrn)rtrrrvrwrur�r~rrr��	Exceptionryrzr{r|)r<r}r@r�r�r��cbs       rr�zConnection._signal_func�s���
�'�=�1�1�1� �.�.�0�����!���(�(�*���,�,�T�>�-8�:�	0�E��&�&�w�/�	0�
�k�)��J���>�)��2�2�
/��/��t�H�
/�.�-��
!�/��'�'�)��M�M�#"�,-�"�/�/�s�B'�'4C�Cc�����|tk(rtdtz��|tk(rtdtz��t|
���d|vrt	d��t||||��}
	|
j|d|i�����|j|
�y	��t���t����fd
�}|j|
||	|��S#t$r=}tj�tjd|||j|��d	}~wwxYw)aSCall the given method, asynchronously.

        If the reply_handler is None, successful replies will be ignored.
        If the error_handler is None, failures will be ignored. If both
        are None, the implementation may request that no reply is sent.

        :Returns: The dbus.lowlevel.PendingCall.
        :Since: 0.81.0
        �1Methods may not be called on the reserved path %s�6Methods may not be called on the reserved interface %srlr1r2��destinationr��	interface�method�	signature�<Unable to set arguments %r according to signature %r: %s: %sNc���t|t�r�|jdi����yt|t�r.�t	|j�d|j�i��y�t
d|z��y)N�namez%Unexpected type for reply message: %rr)rtrrrr
r�get_error_namer8)r}�
error_handler�
get_args_opts�
reply_handlers ���r�msg_reply_handlerz0Connection.call_async.<locals>.msg_reply_handlerLs�����'�#6�7��4�w�4�4�E�}�E�F��G�\�2��m�-4�-B�-B�-D�F��1G�1G�1I�F�G��i�)6�8?�)@�A�Br)�require_main_loop)rrrrqr8rr]r�ryrzr{r|rd�send_messager�send_message_with_reply)r<r�r?r@r�r�rr�r��timeoutrCr�rr}�er�r�s       ``       @r�
call_asynczConnection.call_asyncs8����*�$��!*�,6�!7�8�
8��[�(��!/�1<�!=�>�
>���5�
��V�#��H�I�I�#��)4�.<�+1�3��
	��G�N�N��6�Y�6�� �]�%:����g�&��� �!�M�� �!�M�	B��+�+�G�5F�(/�:K�,�M�	M��5�	����!��M�M�1��	�1�;�;��
;�
��	�s�%B9�9	C?�8C:�:C?c	��|tk(rtdtz��|tk(rtdtz��t|��}
d|	vrt	d��t||||��}	|j|d|i�|j||�}
|
jdi|
��}t|�d
k(ry	t|�dk(r|d
St!|�S#t$r=}tj�tjd|||j|��d	}~wwxYw)
zECall the given method, synchronously.
        :Since: 0.81.0
        r�r�rlr1r2r�r�r�Nrrmr)rrrrqr8rr]r�ryrzr{r|rd�!send_message_with_reply_and_blockrrrsr�)r<r�r?r@r�r�rr�rCrr�r}r��
reply_message�	args_lists               r�
call_blockingzConnection.call_blockingYs2���*�$��!*�,6�!7�8�
8��[�(��!/�1<�!=�>�
>���5�
��V�#��H�I�I�#��)4�.<�+1�3��
	��G�N�N��6�Y�6��>�>��W��
�/�M�/�/�@�-�@�	��y�>�Q���
��^�q�
 ��Q�<����#�#��!�	����!��M�M�1��	�1�;�;��
;�
��	�s�"C�	D�8D�Dc�:�|jj|�y)z�Arrange for `callable` to be called with one argument (this
        Connection object) when the Connection becomes
        disconnected.

        :Since: 0.83.0
        N)r�r])r<�callables  r�call_on_disconnectionz Connection.call_on_disconnection�s��	
�$�$�+�+�H�5r)NNT)NNNN)��FT)r�F)r�r�r��__doc__rr�rLr�r�r�r�r�r�r�r�r�r��
__classcell__)rds@rrr�s|����#��A�&� #<�L/3�15�+/�'+�	b�H �<,0�.2�(,�$(�	9/�v
�.�@.3�%)�<M�~04�"'�)$�V6rr)!�__all__�
__docformat__ryr�r6�_dbus_bindingsr�_Connectionrrrr	r
r�dbus.exceptionsr�
dbus.lowlevelr
rrrr�dbus.proxiesr�dbus._compatrrr�	getLoggerr{r�objectrrrr�<module>r�s}��2(��"�
����I�I�I�*�(�(�%�'�!��'�
�
�-�
.��	�u<�&�u<�p_6��_6r

Zerion Mini Shell 1.0