+
    ic@  c                   s"   ^ RI HtHt ^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHt ^ RIHtHtHt ^ R	It]P(                  ! R
R4       ]P(                  ! RR4       ^ RIHtHt . ROt ! R R]4      t ! R R]R7      t ! R R]4      tR	# )i    )ABCMetaabstractmethod)partial)PropertyProxy)ErrorMapper)Signal)DBUS_FLAG_NONEDBusSpecification)get_variantget_variant_typeunwrap_variantNGioz2.0GLib)r   r   
GLibClientAbstractClientObjectHandlerClientObjectHandlerc                   s   a  ] tR t^+t o Rt]P                  t]]	]3R l4       t
]R]	]3R l4       t]R 4       t]R]	3R l4       t]R 4       t]R 4       t]R 4       t]R	 4       t]R
 4       t]R 4       tRtV tR# )r   z0The low-level DBus client library based on GLib.c
                s4    VP                  VVVVVVVV	R4	      # )zFSynchronously call a DBus method.

:return: a result of the DBus call
N)Z	call_sync)
cls
connectionservice_nameobject_pathinterface_namemethod_name
parameters
reply_typeflagstimeouts
   &&&&&&&&&&:/usr/lib/python3.14/site-packages/dasbus/client/handler.py	sync_callZGLibClient.sync_call1   s2     ##

 
	
    c                sR    VP                  VVVVVVV
VV P                  W3R7
       R# )z"Asynchronously call a DBus method.callback	user_dataN)call_async_call_finish)r   r   r   r   r   r   r   r   r   callback_argsr   r   s   &&&&&&&&&&&&r   
async_callZGLibClient.async_callE   s<     	++/ 	 	
r   c                s0   aa Vw  rEV! VV3R l.VO5!   R# )z(Finish an asynchronous DBus method call.c                  &   < SP                  S 4      # N)Zcall_finish)result_objectsource_object   r   <lambda>Z/GLibClient._async_call_finish.<locals>.<lambda>`   s    M--m<r   N )r   r(   r'   r    r   r#   s   &ff&  r   r"   ZGLibClient._async_call_finishX   s"     #, 	<	
	
r   c	                sx    VP                  VVVVRVV P                  Wg3R7      p	\        V P                  VV	4      # )z;Subscribe to a signal.

:return: a callback to unsubscribe
Nr   )Zsignal_subscribe_signal_callbackr   _unsubscribe_signal)
r   r   r   r   r   signal_namer   r#   r   subscription_ids
   &&&&&&&&& r   subscribe_signalZGLibClient.subscribe_signald   sX     %55))/ 6 	
 ##
 	
r   c                s"    Vw  rV! V.V	O5!   R# z8A callback that is called when a DBus signal is emitted.Nr+   )
r   r   Zsender_namer   r   r.   r   r    r   r#   s
   &&&&&&&&  r   r,   ZGLibClient._signal_callback}   s    
 #, 	,m,r   c                s(    VP                  V4       R# )zUnsubscribe from a signal.N)Zsignal_unsubscribe)r   r   r/      &&&r   r-   ZGLibClient._unsubscribe_signal   s     	%%o6r   c                s    \        V\        P                  4      ;'       d>    VP                  \        P
                  ! 4       \        P                  P                  4      # )zIs it a timeout error?)
isinstancer   ErrorZmatchesr   Zio_error_quarkZIOErrorEnumZ	TIMED_OUTr   error   &&r   is_timeout_errorZGLibClient.is_timeout_error   sE     %, O Oc002COO4M4MN	Or   c                s    \        V\        P                  4      ;'       d     \        P                  P                  V4      # )zIs it a remote DBus error?)r3   r   r4   r   	DBusErroris_remote_errorr5   r7   r   r:   ZGLibClient.is_remote_error   s3     %, 5 5--e4	5r   c                s@    \         P                  P                  V4      # )z)Get a DBus name of the remote DBus error.)r   r9   Zget_remote_errorr5   r7   r   get_remote_error_nameZ GLibClient.get_remote_error_name   s     }}--e44r   c                s    V P                  V4      pVP                  pRP                  RV4      pVP                  V4      '       d   V\	        V4      R # V# )z'Get a message of the remote DBus error.z{}:{}: zGDBus.ErrorN)r;   messageformatZ
startswithlen)r   r6   namer<   Zprefixs   &&   r   get_remote_error_messageZ#GLibClient.get_remote_error_message   sV     ((/--!!-6f%%3v;<((r   r+   N)__name__
__module____qualname____firstlineno____doc__r   ZMAXINTZDBUS_TIMEOUT_NONEZclassmethodr   r   r$   r"   r0   r,   r-   r8   r:   r;   r@   __static_attributes____classdictcell____classdict__   @r   r   r   +   s     : =K+
 
&  "$>,
 
$ 	
 	
  (*
 
0 - - 7 7 O O
 5 5
 5 5 	 	r   c                   s   a  ] tR t^t o Rt. ROtR t]R 4       t]R 4       t	]R 4       t
]R 4       tR tR tR	 t]R
 4       t]R 4       t]R 4       t]R 4       tRtV tR# )r   z-The abstract handler of a remote DBus object.c                s8    Wn         W n        W0n        RV n        R# )zCreate a new handler.

:param message_bus: a message bus
:param service_name: a DBus name of the service
:param object_path: a DBus path the object
N_message_bus_service_name_object_path_specification)selfmessage_busr   r   s   &&&&r   __init__Z$AbstractClientObjectHandler.__init__   s     ()'"r   c                    V P                   # )z)DBus service name.

:return: a DBus name
)rM   rP      &r   r   Z(AbstractClientObjectHandler.service_name   s     !!!r   c                rS   )z(DBus object path.

:return: a DBus path
)rN   rT   rU   r   r   Z'AbstractClientObjectHandler.object_path   s        r   c                sh    V P                   '       g   V P                  4       V n         V P                   # )zDBus specification.)rO   _get_specificationrT   rU   r   specificationZ)AbstractClientObjectHandler.specification   s-     """"&"9"9";D"""r   c                s    \        4       # )z;Introspect the DBus object.

:return: a DBus specification
r   rT   rU   r   rV   Z.AbstractClientObjectHandler._get_specification   s     !""r   c                sh    V P                  W4      pV P                  \        V4      4      pV! V4      # )zCreate a member of the DBus object.

:param interface_name: a name of the interface
:param member_name: a name of the member
:return: a signal, a method or a property
)_find_member_spec_find_handlertype)rP   r   member_nameZspecZhandlers   &&&  r   create_memberZ)AbstractClientObjectHandler.create_member   s2     %%nB$$T$Z0t}r   c                s8    V P                   P                  W4      # )zFind a specification of the DBus member.

:param interface_name: a name of the interface
:param member_name: a name of the member
:return: a specification of the member
)rW   Z
get_member)rP   r   r[   r2   r   rX   Z-AbstractClientObjectHandler._find_member_spec   s      !!,,
 	
r   c                s
   V\         P                  J d   V P                  # V\         P                  J d   V P                  # V\         P
                  J d   V P                  # \        RP                  VP                  4      4      h)zhFind a handler for the given member type.

:param member_type: a type of the member
:return: a callback
zUnsupported type: {})
r   ZProperty_get_propertyZMethod_get_methodr   _get_signalZ	TypeErrorr=   rA   )rP   Zmember_typer7   r   rY   Z)AbstractClientObjectHandler._find_handler   sv     +444%%%+222###+222###"))+*>*>?
 	
r   c                    R# )zmGet a proxy of the DBus property.

:param property_spec: a property_specification
:return: a property object
Nr+   )rP   property_specr7   r   r]   Z)AbstractClientObjectHandler._get_property	       	r   c                r`   )zgGet a proxy of the DBus method.

:param method_spec: a method specification
:return: a callable object
Nr+   rP   Zmethod_specr7   r   r^   Z'AbstractClientObjectHandler._get_method  rb   r   c                r`   )zeGet a proxy of the DBus signal.

:param signal_spec: a signal specification
:return: a signal object
Nr+   )rP   signal_specr7   r   r_   Z'AbstractClientObjectHandler._get_signal  rb   r   c                r`   )zDisconnect members of the DBus object.

Unsubscribe from DBus signals and disconnect all
registered callbacks of the proxy signals.
Nr+   rT   rU   r   disconnect_membersZ.AbstractClientObjectHandler.disconnect_members$  rb   r   )rL   rN   rM   rO   NrK   )rA   rB   rC   rD   rE   	__slots__rR   Zpropertyr   r   rW   r   rV   r\   rX   rY   r]   r^   r_   re   rF   rG   rH   rJ   r   r   r      s     7I
# " " ! ! # # # #		

&        r   )Z	metaclassc                   s   a a ] tR tRt oRt. ROtR]]3V 3R lltR t	R t
R tR tR	 tR
 tR tR tR tR tR tR tR tRtVtV ;t# )r   i.  z$The client handler of a DBus object.Nc                s   < \         SV `  WV4       WPn        W`n        T;'       g    \	        4       V n        . V n        R# )a
  Create a new handler.

:param message_bus: a message bus
:param service_name: a DBus name of the service
:param object_path: a DBus path the object
:param error_mapper: a DBus error mapper
:param client: a DBus client library
:param signal_factory: a signal factory
N)ZsuperrR   _client_signal_factoryr   _error_mapper_subscriptions)rP   rQ   r   r   Zerror_mapperZclientZsignal_factory	__class__s   &&&&&&&r   rR   ZClientObjectHandler.__init__8  s9     	K@-)::[] r   c                sV    V P                  RRRR4      p\        P                  ! V4      # )zIntrospect the DBus object.z#org.freedesktop.DBus.IntrospectableZ
IntrospectNz(s))_call_methodr   Zfrom_xml)rP   Zxml   & r   rV   Z&ClientObjectHandler._get_specificationJ  s1    1	
 !))#..r   c           
     s   V P                  4       pV P                  P                  V P                  P                  V P
                  V P                  VP                  VP                  V P                  VP                  3R7      pV P                  P                  V4       V P                  P                  VP                  4       V# )zGet a proxy of the DBus signal.)r   r#   )rh   rg   r0   rL   r   rM   rN   r   r?   r,   Zemitrj   ZappendZ
disconnect)rP   rd   ZsignalZunsubscribe   &&  r   r_   ZClientObjectHandler._get_signalU  s     %%' ll33((&&**!;;. 4 
 	"";/""6#4#45r   c                s$    V! \        V4      !   R# r1   )r   )rP   r   r   r2   r   r,   Z$ClientObjectHandler._signal_callbackk  s    .,-r   c                s    RpRpVP                   '       d   \        V P                  V4      pVP                  '       d   \        V P                  V4      p\        W#4      # )z!Get a proxy of the DBus property.N)Zreadabler   _get_property_valueZwritable_set_property_valuer   )rP   ra   getterZsetterrn   r   r]   Z!ClientObjectHandler._get_propertyo  sS    !!!T55}EF!!!T55}EFV,,r   c                sl    V P                  RRRRVP                  VP                  4      p\        V4      # )z!Get a value of the DBus property.org.freedesktop.DBus.PropertiesZGetz(ss)z(v))rl   r   r?   r   )rP   ra   Zvariant   && r   ro   Z'ClientObjectHandler._get_property_value|  s=    ##-((
 g&&r   c                s    V P                  RRRRVP                  VP                  \        VP                  V4      4      # )z!Set a value of the DBus property.rr   ZSetz(ssv)N)rl   r   r?   r	   rZ   )rP   ra   Zproperty_valuer2   r   rp   Z'ClientObjectHandler._set_property_value  sC      -((**N;
 	
r   c                s    \        V P                  VP                  VP                  VP                  VP
                  4      # )z(Get a callable proxy of the DBus method.)r   rl   r   r?   in_typeout_typerc   r7   r   r^   ZClientObjectHandler._get_method  s<    &&  
 	
r   c           	     s   V'       g   RpVe   \        W54      pRpVe   \        V4      pV P                  P                  V P                  V P
                  VVVV3pVP                  RR4      p	VP                  R\        4       4      p
V	'       g+   V P                  ! V P                  P                  .VO5/ VB # V P                  P                  ! V/ VBRV P                  RW3/B # )z;Call a DBus method.

:return: a result of the call or None
Nr   r#   )r	   r
   rL   r   rM   rN   popZtuple_get_method_replyrg   r   r$   _method_callback)rP   r   r   rt   ru   r   kwargsr   argsr   r#   s   &&&&&*,    r   rl   Z ClientObjectHandler._call_method  s    J$W9J 
)(3J ((
 ::j$/

?EG< ))&&   <<** ..  (7	 r   c                s(   a a V! VV 3R l.VO5!   R# )z/A callback of an asynchronous DBus method call.c                  r%   r&   )rw   )rq   rP   r)   r   r*   Z6ClientObjectHandler._method_callback.<locals>.<lambda>  s    D**62r   Nr+   )rP   rq   r   r#   s   ff&&r   rx   Z$ClientObjectHandler._method_callback  s    2	
	
r   c                s     V! V/ VB pV P                  V4      #   \         d   pT P                  T4      u Rp?# Rp?ii ; i)zGet a result of a DBus call.

:param call: a callback
:param args: arguments of the callback
:param kwargs: keyword arguments of the callback
:return: a result of the callback
:raise: an exception raised by the callback
N)_handle_method_resultZ	Exception_handle_method_error)rP   r!   rz   ry   resultr6   s   &&*,  r   rw   Z%ClientObjectHandler._get_method_reply  sH    	44*6*F--f55 	4,,U33	4s    A<AAc                sf   V P                   P                  V4      '       dc   V P                   P                  V4      pV P                  P	                  V4      pV P                   P                  V4      pV! V4      pW%n        VRhV P                   P                  V4      '       d   \        R4      RhVh)a  Handle an error of a DBus call.

If the call returned a DBus error, it will be mapped
to a Python exception based on the rules defined in
the available error mapper. It should be a subclass
of DBusError.

:param error: an exception raised during the call
:raise Exception: if the call unexpectedly failed
:raise TimeoutError: if the DBus call timed out
:raise DBusError: if the call returned a DBus error
Nz"The DBus call timeout was reached.)	rg   r:   r;   ri   Zget_exception_typer@   Z	dbus_namer8   ZTimeoutError)rP   r6   r?   r   r<   Z	exceptions   &&    r   r|   Z(ClientObjectHandler._handle_method_error  s     <<''..<<55e<D$$77=Cll;;EBG GI"& %<<((//4
 r   c                sb    \        V4      pV'       g   R# \        V4      ^8X  d
   V^ ,          # V# )z@Handle a result of a DBus call.

:param result: a variant tuple
N)r   r>   )rP   r}   Zvaluesrs   r   r{   Z)ClientObjectHandler._handle_method_result  s5      '  v;!!9 r   c                sp    V P                   '       d$   V P                   P                  4       pV! 4        K5  R# )z&Disconnect members of the DBus object.N)rj   rv   )rP   r   rm   r   re   Z&ClientObjectHandler.disconnect_members  s,    !!!**..0HJ "r   )rg   ri   rh   rj   )rg   rh   ri   rj   )rA   rB   rC   rD   rE   rf   r   r   rR   rV   r_   r,   r]   ro   rp   r^   rl   rx   rw   r|   r{   re   rF   rG   Z__classcell__)rk   rI   s   @@r   r   r   .  sf     .I #: &!$	/,.-
'


/b
4!F& r   )r   r   r   )Zabcr    r   Z	functoolsr   Zdasbus.client.propertyr   Zdasbus.errorr   Zdasbus.signalr   Zdasbus.constantsr   Zdasbus.specificationr   Zdasbus.typingr	   r
   r   ZgiZrequire_versionZgi.repositoryr   r   Z__all__Zobjectr   r   r   r+   r   r   <module>r~      s|   * (  0 $   + 2 G G 	   5%     65 ! #| |~AG AHq5 qr   