
    >a+                         S SK Jr  S SKJr  SSK7  / SQr " S S5      r " S S	\5      rS
 rSS jr	SS jr
SS jrSS jr " S S5      r " S S5      r " S S5      r " S S\5      r " S S\5      rS\4S jrg)    )Union)warn   )*)	DBusAddressnew_method_callnew_method_return	new_error
new_signalMessageGenerator
PropertiesIntrospectableDBusErrorResponsec                   .    \ rS rSrSrSS jrS rS rSrg)	r      a-  This 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                 (    Xl         X l        X0l        g N)object_pathbus_name	interface)selfr   r   r   s       0lib/python3.13/site-packages/jeepney/wrappers.py__init__DBusAddress.__init__   s    & "    c                     SR                  [        U 5      R                  U R                  U R                  U R
                  5      $ )Nz'{}({!r}, bus_name={!r}, interface={!r}))formattype__name__r   r   r   r   s    r   __repr__DBusAddress.__repr__    s8    8??T
@S@S$$dmmT^^E 	Er   c                 P    [        U 5      " U R                  U R                  U5      $ r   )r   r   r   )r   r   s     r   with_interfaceDBusAddress.with_interface$   s    Dz$**DMM9EEr   )r   r   r   NN)	r   
__module____qualname____firstlineno____doc__r   r!   r$   __static_attributes__ r   r   r   r      s    #
EFr   r   c                   ,   ^  \ rS rSrSU 4S jjrSrU =r$ )
DBusObject'   c                 :   > [         TU ]  XU5        [        SSS9  g )Nz)Deprecated alias, use DBusAddress instead   )
stacklevel)superr   r   )r   r   r   r   	__class__s       r   r   DBusObject.__init__(   s    	:8QGr   r,   r&   )r   r'   r(   r)   r   r+   __classcell__)r4   s   @r   r.   r.   '   s    H Hr   r.   c           
      <    [        [        R                  U SSSS0 S9$ )Nr   r   )flagsprotocol_versionbody_lengthserialfields)Header
Endiannesslittle)msg_types    r   
new_headerrB   ,   s$    *##XQ B8 8r   Nc                    [        [        R                  5      nU R                  UR                  [
        R                  '   U R                  c  [        S5      eU R                  UR                  [
        R                  '   U R                  b'  U R                  UR                  [
        R                  '   XR                  [
        R                  '   Ub  X$R                  [
        R                  '   [        XC5      $ )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)rB   MessageTypemethod_callr   r=   HeaderFieldspathr   
ValueErrordestinationr   member	signatureMessage)
remote_objmethodrK   bodyheaders        r   r   r   0   s     //0F'1'='=FMM,##$"NOO.8.A.AFMM,**+'0:0D0Dl,,-)/MM,%%&09l,,-6  r   c                    [        [        R                  5      nU R                  R                  UR
                  [        R                  '   U R                  R
                  R                  [        R                  S5      nUb  XCR
                  [        R                  '   Ub  XR
                  [        R                  '   [        X25      $ )zConstruct 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)rB   rD   method_returnrP   r<   r=   rF   reply_serialgetsenderrI   rK   rL   )
parent_msgrK   rO   rP   rU   s        r   r	   r	   I   s     112F/9/@/@/G/GFMM,++,%%)),*=*=tDF28l../09l,,-6  r   c                    [        [        R                  5      nU R                  R                  UR
                  [        R                  '   XR
                  [        R                  '   U R                  R
                  R                  [        R                  S5      nUb  XTR
                  [        R                  '   Ub  X$R
                  [        R                  '   [        XC5      $ )zConstruct 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)rB   rD   errorrP   r<   r=   rF   rS   
error_namerT   rU   rI   rK   rL   )rV   rY   rK   rO   rP   rU   s         r   r
   r
   Y   s     ))*F/9/@/@/G/GFMM,++,-7MM,))*%%)),*=*=tDF28l../09l,,-6  r   c                    [        [        R                  5      nU R                  UR                  [
        R                  '   U R                  c  [        S5      eU R                  UR                  [
        R                  '   XR                  [
        R                  '   Ub  X$R                  [
        R                  '   [        XC5      $ )zConstruct 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)rB   rD   signalr   r=   rF   rG   r   rH   rJ   rK   rL   )emitterr[   rK   rO   rP   s        r   r   r   k   s     **+F'.':':FMM,##$ GHH,3,=,=FMM,(())/MM,%%&09l,,-6  r   c                   $    \ rS rSrSrS rS rSrg)r   ~   zSubclass this to define the methods available on a DBus interface.

jeepney.bindgen can automatically create subclasses using introspection.
c                     Xl         X l        g r   )r   r   )r   r   r   s      r   r   MessageGenerator.__init__   s    & r   c                 v    SR                  [        U 5      R                  U R                  U R                  5      $ )Nz{}({!r}, bus_name={!r}))r   r   r   r   r   r    s    r   r!   MessageGenerator.__repr__   s2    (//T
0C0C040@0@$--Q 	Qr   )r   r   N)r   r'   r(   r)   r*   r   r!   r+   r,   r   r   r   r   ~   s    !Qr   r   c                   *    \ rS rSrSrS rS rS rSrg)	ProxyBase   zA 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                     Xl         g r   _msggen)r   msggens     r   r   ProxyBase.__init__   s    r   c                     UR                  S5      (       a  [        U5      e[        U R                  US 5      n[	        U5      (       a  U R                  U5      $ [        U5      e)N__)
startswithAttributeErrorgetattrrh   callable_method_call)r   itemmake_msgs      r   __getattr__ProxyBase.__getattr__   sU    ??4   &&4<<t4H$$X..T""r   c                     [        S5      e)Nz#Needs to be implemented in subclass)NotImplementedError)r   rs   s     r   rq   ProxyBase._method_call   s    !"GHHr   rg   N)	r   r'   r(   r)   r*   r   rt   rq   r+   r,   r   r   rd   rd      s    
#Ir   rd   c                   B    \ rS rSrSrS\\\4   4S jrS r	S r
S rSrg	)
r      zBuild 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                 X    Xl         [        UR                  UR                  SS9U l        g )Nzorg.freedesktop.DBus.Properties)r   r   )r{   r   r   r   props_if)r   r{   s     r   r   Properties.__init__   s#    #COOcll.OQr   c                 ^    [        U R                  SSU R                  R                  U45      $ )z$Get the value of the property *name*Getssr   r}   r{   r   )r   names     r   rT   Properties.get   s+    t}}eTHH&&-/ 	/r   c                 \    [        U R                  SSU R                  R                  45      $ )z*Get all property values for this interfaceGetAllsr   r    s    r   get_allProperties.get_all   s)    t}}h $ 2 246 	6r   c           	      b    [        U R                  SSU R                  R                  XU445      $ )z?Set the property *name* to *value* (with appropriate signature)Setssvr   )r   r   rK   values       r   setProperties.set   s2    t}}eUHH&&%.@AC 	Cr   )r{   r}   N)r   r'   r(   r)   r*   r   r   r   r   rT   r   r   r+   r,   r   r   r   r      s0    QE+/?"?@ Q
/
6
Cr   r   c                       \ rS rSrSrS rSrg)r      z#org.freedesktop.DBus.Introspectablec                     [        U S5      $ )z3Request D-Bus introspection XML for a remote object
Introspect)r   r    s    r   r   Introspectable.Introspect   s    t\22r   r,   N)r   r'   r(   r)   r   r   r+   r,   r   r   r   r      s    5I3r   r   c                   $    \ rS rSrSrS rS rSrg)r      z?Raised by proxy method calls when the reply is an error messagec                     UR                   R                  R                  [        R                  5      U l        UR                  U l        g r   )rP   r=   rT   rF   rY   r   rO   data)r   msgs     r   r   DBusErrorResponse.__init__   s/    JJ%%)),*A*AB	HH	r   c                 N    SR                  U R                  U R                  5      $ )Nz[{}] {})r   r   r   r    s    r   __str__DBusErrorResponse.__str__   s    		49955r   )r   r   N)r   r'   r(   r)   r*   r   r   r+   r,   r   r   r   r      s    I6r   r   r   c                     U R                   R                  [        R                  :X  a  [	        U 5      eU R
                  $ )zGet 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.
)rP   message_typerD   rX   r   rO   )r   s    r   
unwrap_msgr      s0     zz+"3"33$$88Or   )Nr,   )typingr   warningsr   	low_level__all__r   r.   rB   r   r	   r
   r   r   rd   r   r   	Exceptionr   rL   r   r,   r   r   <module>r      s      
F F*H H
8!2! !$!&Q QI I,C C83% 36	 6	G 	r   