+
    ic[  c                   s    ^ RI t ^ RIHt ^ RIHt ^ RIHt ^ RIt]P                  ! RR4       ^ RI	H
t
 ] P                  ! ]4      t. ROt ! R R]4      t ! R R
]4      t ! R R	]4      tR# )i    N)partial)DBUS_FLAG_NONE)SignalGioz2.0)r   DBusObserverErrorDBusObserverGLibMonitoringc                   s    ] tR t^(tRtRtR# )r   z'Exception class for the DBus observers. N)__name__
__module____qualname____firstlineno____doc____static_attributes__r       ;/usr/lib/python3.14/site-packages/dasbus/client/observer.pyr   r   (   s    1r   c                   sn   a  ] tR t^-t o Rt]]RR3R l4       t]R 4       t]R 4       t	]R 4       t
RtV tR# )r   z4The low-level DBus monitoring library based on GLib.Nc                s    RpRpV'       d   \        V P                  VR3R7      pV'       d   \        V P                  VR3R7      p\        P                  ! VVVVV4      p\        V P
                  VV4      # )z,Watch a service name on the DBus connection.N)	user_datar   )r    _name_appeared_callback_name_vanished_callbackr   Zbus_watch_name_on_connection_unwatch_name)	cls
connectionnameZflagsZname_appearedZname_vanishedZname_appeared_closureZname_vanished_closureregistration_ids	   &&&&&&   r   
watch_nameZGLibMonitoring.watch_name0   s     !% $$+++("-%!
 $+++("-%!
 ::!!
 
 	
r   c                s"    Vw  rVV! V.VO5!   R# )zCallback for watch_name..Nr   )r   r   r   Z
name_ownerr   callbackcallback_argss   &&&&&  r   r   Z&GLibMonitoring._name_appeared_callbackQ   s     #, 	,m,r   c                s    Vw  rEV! V!   R# )zCallback for watch_name.Nr   )r   r   r   r   r   r   s   &&&&  r   r   Z&GLibMonitoring._name_vanished_callbackZ   s     #, 	- r   c                s2    \         P                  ! V4       R# )z5Stops watching a service name on the DBus connection.N)r   Zbus_unwatch_name)r   r   r   s   &&&r   r   ZGLibMonitoring._unwatch_namec   s     	_-r   r   )r   r	   r
   r   r   Zclassmethodr   r   r   r   r   r   __classdictcell__Z__classdict__   @r   r   r   -   s_     >0>!%T
 
@ - - ! ! . .r   c                   s   a  ] tR t^it o Rt]3R lt]R 4       t]R 4       t	]R 4       t
]R 4       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R# )r   a  Base class for DBus observers.

This class is recommended to use only to watch the availability
of a service on DBus. It doesn't provide any support for accessing
objects provided by the service.

Usage:

.. code-block:: python

    # Create the observer and connect to its signals.
    observer = DBusObserver(SystemBus, "org.freedesktop.NetworkManager")

    def callback1(observer):
        print("Service is available!")

    def callback2(observer):
        print("Service is unavailable!")

    observer.service_available.connect(callback1)
    observer.service_unavailable.connect(callback2)

    # Connect to the service once it is available.
    observer.connect_once_available()

    # Disconnect the observer.
    observer.disconnect()

c                s    Wn         W n        RV n        \        4       V n        \        4       V n        W0n        . V n        R# )zrCreates a DBus service observer.

:param message_bus: a message bus
:param service_name: a DBus name of a service
FN)_message_bus_service_name_is_service_availabler   _service_available_service_unavailable_monitoring_subscriptions)selfZmessage_busservice_nameZ
monitorings   &&&&r   __init__ZDBusObserver.__init__   s:     ()%*""(($*H!% r   c                    V P                   # )zReturns a DBus name.r   r%      &r   r&   ZDBusObserver.service_name   s     !!!r   c                r(   )zThe proxy can be accessed.)r    r*   r+   r   is_service_availableZ!DBusObserver.is_service_available   s     )))r   c                r(   )zSignal that emits when the service is available.

Signal emits this class as an argument. You have to
call the watch method to activate the signals.
)r!   r*   r+   r   service_availableZDBusObserver.service_available   s     &&&r   c                r(   )zSignal that emits when the service is unavailable.

Signal emits this class as an argument. You have to
call the watch method to activate the signals.
)r"   r*   r+   r   service_unavailableZ DBusObserver.service_unavailable   s     (((r   c                s&    V P                  4        R# )zConnect to the service once it is available.

The observer is not connected to the service until it
emits the service_available signal.
N)_watchr*   r+   r   connect_once_availableZ#DBusObserver.connect_once_available   s     	r   c                sn    V P                  4        V P                  '       d   V P                  4        R# R# )zqDisconnect from the service.

Disconnect from the service if it is connected and stop
watching its availability.
N)_unwatchr,   _disable_servicer*   r+   r   
disconnectZDBusObserver.disconnect   s*     	$$$!!# %r   c                s    V P                   P                  V P                  P                  V P                  \
        V P                  V P                  4      pV P                  P                  V4       R# )zWatch the service name on DBus.N)
r#   r   r   r   r&   r   _service_name_appeared_callback_service_name_vanished_callbackr$   Zappend)r%   Zsubscription   & r   r/   ZDBusObserver._watch   s[    ''22((0000
 	""<0r   c                sp    V P                   '       d$   V P                   P                  4       pV! 4        K5  R# )z'Stop to watch the service name on DBus.N)r$   Zpop)r%   r   r6   r   r1   ZDBusObserver._unwatch   s,    !!!**..0HJ "r   c                J    RV n         V P                  P                  V 4       R# )zEnable the service.TN)r    r!   emitr*   r+   r   _enable_serviceZDBusObserver._enable_service   s    %)"$$T*r   c                r7   )zDisable the service.FN)r    r"   r8   r*   r+   r   r2   ZDBusObserver._disable_service   s    %*"!!&&t,r   c                sN    V P                   '       g   V P                  4        R# R# zCallback for the watch method.N)r,   r9   r%   Zargs   &*r   r4   Z,DBusObserver._service_name_appeared_callback   s    (((  " )r   c                sN    V P                   '       d   V P                  4        R# R# r:   )r,   r2   r;   r<   r   r5   Z,DBusObserver._service_name_vanished_callback   s    $$$!!# %r   c                r(   )z(Returns a string version of this object.r)   r*   r+   r   __str__ZDBusObserver.__str__   s    !!!r   c                sb    RP                  V P                  P                  V P                  4      # )z Returns a string representation.z{}({}))ZformatZ	__class__r   r   r*   r+   r   __repr__ZDBusObserver.__repr__   s)    NN##
 	
r   )r    r   r#   r!   r   r"   r$   N)r   r	   r
   r   r   r   r'   Zpropertyr&   r,   r-   r.   r0   r3   r/   r1   r9   r2   r4   r5   r=   r>   r   r   r   r   r   r   r   i   s     < >L !  " " * * ' ' ) )	$
1+
-
#
$
"
 
r   )r   r   r   )ZloggingZ	functoolsr    Zdasbus.constantsr   Zdasbus.signalr   ZgiZrequire_versionZgi.repositoryr   Z	getLoggerr   ZlogZ__all__Z	Exceptionr   Zobjectr   r   r   r   r   <module>r?      sg   *   +   	   5%   !		 	
9.V 9.xM
6 M
r   