%PDF- %PDF-
Mini Shell

Mini Shell

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

�

+�c+����ddlmZddlmZddl�gd�ZGd�d�ZGd�d	e�Zd
�Zdd�Z	dd
�Z
dd�Zdd�ZGd�d�Z
Gd�d�ZGd�d�ZGd�de
�ZGd�de�Zdefd�Zy)�)�Union)�warn�)�*)	�DBusAddress�new_method_call�new_method_return�	new_error�
new_signal�MessageGenerator�
Properties�Introspectable�DBusErrorResponsec�$�eZdZdZdd�Zd�Zd�Zy)raAThis identifies the object and interface a message is for.

    e.g. messages to display desktop notifications would have this address::

        DBusAddress('/org/freedesktop/Notifications',
                    bus_name='org.freedesktop.Notifications',
                    interface='org.freedesktop.Notifications')
    Nc�.�||_||_||_y�N)�object_path�bus_name�	interface)�selfrrrs    �2/usr/lib/python3/dist-packages/jeepney/wrappers.py�__init__zDBusAddress.__init__s��&��� ��
�"���c��djt|�j|j|j|j
�S)Nz'{}({!r}, bus_name={!r}, interface={!r}))�format�type�__name__rrr�rs r�__repr__zDBusAddress.__repr__ s8��8�?�?��T�
�@S�@S��$�$�d�m�m�T�^�^�E�	Erc�P�t|�|j|j|�Sr)rrr)rrs  r�with_interfacezDBusAddress.with_interface$s!���t�D�z�$�*�*�D�M�M�9�E�Er�NN)r�
__module__�__qualname__�__doc__rrr!�rrrrs���#�
E�Frrc� ��eZdZd�fd�	Z�xZS)�
DBusObjectc�B��t�|�|||�tdd��y)Nz)Deprecated alias, use DBusAddress instead�)�
stacklevel)�superrr)rrrr�	__class__s    �rrzDBusObject.__init__(s���
����h�	�:��
8�Q�Grr")rr#r$r�
__classcell__)r-s@rr(r('s���H�Hrr(c	�B�ttj|ddddi��S)Nrr���)�flags�protocol_version�body_length�serial�fields)�Header�
Endianness�little)�msg_types r�
new_headerr:,s$���*�#�#�X�Q�� ��B�8�8rNc���ttj�}|j|jt
j<|j�td��|j|jt
j<|j�'|j|jt
j<||jt
j<|�||jt
j<t||�S)a�Construct a new method call message

    This is a relatively low-level method. In many cases, this will be called
    from a :class:`MessageGenerator` subclass which provides a more convenient
    API.

    :param DBusAddress remote_obj: The object to call a method on
    :param str method: The name of the method to call
    :param str signature: The DBus signature of the body data
    :param tuple body: Body data (i.e. method parameters)
    z3remote_obj.bus_name cannot be None for method calls)r:�MessageType�method_callrr5�HeaderFields�pathr�
ValueError�destinationr�member�	signature�Message)�
remote_obj�methodrC�body�headers     rrr0s�����/�/�
0�F�'1�'=�'=�F�M�M�,�#�#�$����"��N�O�O�.8�.A�.A�F�M�M�,�*�*�+����'�0:�0D�0D��
�
�l�,�,�-�)/�F�M�M�,�%�%�&���09��
�
�l�,�,�-��6�4� � rc��ttj�}|jj|j
tj<|jj
jtjd�}|�||j
tj<|�||j
tj<t||�S)z�Construct a new response message

    :param Message parent_msg: The method call this is a reply to
    :param str signature: The DBus signature of the body data
    :param tuple body: Body data
    N)
r:r<�
method_returnrHr4r5r>�reply_serial�get�senderrArCrD)�
parent_msgrCrGrHrMs     rr	r	Is�����1�1�
2�F�/9�/@�/@�/G�/G�F�M�M�,�+�+�,�
�
�
�
%�
%�
)�
)�,�*=�*=�t�
D�F�
��28��
�
�l�.�.�/���09��
�
�l�,�,�-��6�4� � rc���ttj�}|jj|j
tj<||j
tj<|jj
jtjd�}|�||j
tj<|�||j
tj<t||�S)z�Construct a new error response message

    :param Message parent_msg: The method call this is a reply to
    :param str error_name: The name of the error
    :param str signature: The DBus signature of the body data
    :param tuple body: Body data
    N)r:r<�errorrHr4r5r>rK�
error_namerLrMrArCrD)rNrQrCrGrHrMs      rr
r
Ys�����)�)�
*�F�/9�/@�/@�/G�/G�F�M�M�,�+�+�,�-7�F�M�M�,�)�)�*�
�
�
�
%�
%�
)�
)�,�*=�*=�t�
D�F�
��28��
�
�l�.�.�/���09��
�
�l�,�,�-��6�4� � rc��ttj�}|j|jt
j<|j�td��|j|jt
j<||jt
j<|�||jt
j<t||�S)z�Construct a new signal message

    :param DBusAddress emitter: The object sending the signal
    :param str signal: The name of the signal
    :param str signature: The DBus signature of the body data
    :param tuple body: Body data
    z,emitter.interface cannot be None for signals)r:r<�signalrr5r>r?rr@rBrCrD)�emitterrSrCrGrHs     rrrks�����*�*�
+�F�'.�':�':�F�M�M�,�#�#�$���� ��G�H�H�,3�,=�,=�F�M�M�,�(�(�)�)/�F�M�M�,�%�%�&���09��
�
�l�,�,�-��6�4� � rc��eZdZdZd�Zd�Zy)rz�Subclass this to define the methods available on a DBus interface.
    
    jeepney.bindgen can automatically create subclasses using introspection.
    c� �||_||_yr)rr)rrrs   rrzMessageGenerator.__init__�s��&��� ��
rc�v�djt|�j|j|j�S)Nz{}({!r}, bus_name={!r}))rrrrrrs rrzMessageGenerator.__repr__�s2��(�/�/��T�
�0C�0C�04�0@�0@�$�-�-�Q�	QrN)rr#r$r%rrr&rrrr~s���!�Qrrc�"�eZdZdZd�Zd�Zd�Zy)�	ProxyBasez�A proxy is an IO-aware wrapper around a MessageGenerator
    
    Calling methods on a proxy object will send a message and wait for the
    reply. This is a base class for proxy implementations in jeepney.io.
    c��||_yr)�_msggen)r�msggens  rrzProxyBase.__init__�s	����rc��|jd�rt|��t|j|d�}t	|�r|j|�St|��)N�__)�
startswith�AttributeError�getattrr[�callable�_method_call)r�item�make_msgs   r�__getattr__zProxyBase.__getattr__�sO���?�?�4� � ��&�&��4�<�<��t�4���H���$�$�X�.�.��T�"�"rc��td��)Nz#Needs to be implemented in subclass)�NotImplementedError)rres  rrczProxyBase._method_call�s��!�"G�H�HrN)rr#r$r%rrfrcr&rrrYrY�s���
�#�IrrYc�8�eZdZdZdeeeffd�Zd�Zd�Z	d�Z
y)r
z�Build messages for accessing object properties

    If a D-Bus object has multiple interfaces, each interface has its own
    set of properties.

    This uses the standard DBus interface ``org.freedesktop.DBus.Properties``
    �objc�`�||_t|j|jd��|_y)Nzorg.freedesktop.DBus.Properties)rr)rjrrr�props_if)rrjs  rrzProperties.__init__�s%�����#�C�O�O�c�l�l�.O�Q��
rc�^�t|jdd|jj|f�S)z$Get the value of the property *name*�Get�ss�rrlrjr)r�names  rrLzProperties.get�s+���t�}�}�e�T��H�H�&�&��-�/�	/rc�\�t|jdd|jjf�S)z*Get all property values for this interface�GetAll�srprs r�get_allzProperties.get_all�s)���t�}�}�h�� $��� 2� 2�4�6�	6rc	�d�t|jdd|jj|||ff�S)z?Set the property *name* to *value* (with appropriate signature)�Set�ssvrp)rrqrC�values    r�setzProperties.set�s4���t�}�}�e�U��H�H�&�&��y�%�.@�A�C�	CrN)rr#r$r%rrrrrLrurzr&rrr
r
�s0���Q�E�+�/?�"?�@�Q�
/�
6�
Crr
c��eZdZdZd�Zy)rz#org.freedesktop.DBus.Introspectablec��t|d�S)z3Request D-Bus introspection XML for a remote object�
Introspect)rrs rr}zIntrospectable.Introspect�s���t�\�2�2rN)rr#r$rr}r&rrrr�s��5�I�3rrc��eZdZdZd�Zd�Zy)rz?Raised by proxy method calls when the reply is an error messagec��|jjjtj�|_|j|_yr)rHr5rLr>rQrqrG�data)r�msgs  rrzDBusErrorResponse.__init__�s/���J�J�%�%�)�)�,�*A�*A�B��	��H�H��	rc�N�dj|j|j�S)Nz[{}] {})rrqr�rs r�__str__zDBusErrorResponse.__str__�s������	�	�4�9�9�5�5rN)rr#r$r%rr�r&rrrr�s��I��6rrr�c�~�|jjtjk(rt	|��|j
S)z�Get the body of a message, raising DBusErrorResponse for error messages

    This is to be used with replies to method_call messages, which may be
    method_return or error.
    )rH�message_typer<rPrrG)r�s r�
unwrap_msgr��s0���z�z���+�"3�"3�3���$�$��8�8�Or)Nr&)�typingr�warningsr�	low_level�__all__rr(r:rr	r
rrrYr
r�	ExceptionrrDr�r&rr�<module>r�s������
��F�F�*H��H�
8�!�2!� !�$!�&Q�Q�I�I�,C�C�83�%�3�6�	�6�	�G�	r

Zerion Mini Shell 1.0