+
    ic^-  c                   sJ   ^ RI t ^ RIt^ RIHtHt ^ RIHtHt ^ RIH	t	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]R7      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      tR# )i    N)ABCMetaabstractmethod) DBUS_NAME_FLAG_ALLOW_REPLACEMENT%DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER)ObjectProxyInterfaceProxy)ErrorMapper)ServerObjectHandlerGioz2.0)r   GLibConnection
MessageBusSystemMessageBusSessionMessageBusAddressedMessageBusc                   s   a  ] tR t^.t o Rt]P                  P                  ]P                  P                  ,          t	]
RR l4       t]
RR l4       t]
]	RR3R l4       tRtV tR# )r	   z4The low-level DBus connection library based on GLib.Nc                    \         P                  R4       \        P                  ! \        P                  P
                  V 4      # )zGet a system bus connection.Connecting to the system bus.)loginfor   bus_get_syncBusTypeZSYSTEMcancellable   &6/usr/lib/python3.14/site-packages/dasbus/connection.pyget_system_bus_connectionZ(GLibConnection.get_system_bus_connection6   s4     	01KK
 	
    c                r   )zGet a session bus connection.Connecting to the session bus.)r   r   r   r   r   ZSESSIONr   r   r   get_session_bus_connectionZ)GLibConnection.get_session_bus_connection?   s4     	12KK
 	
r   c                sF    \         P                  P                  V VVV4      # )3Get a connection to a bus at the specified address.)r   ZDBusConnectionZnew_for_address_sync)Zbus_addressflagsZobserverr   s   &&&&r   get_addressed_bus_connectionZ+GLibConnection.get_addressed_bus_connectionH   s)     !!66	
 	
r    N)__name__
__module____qualname____firstlineno____doc__r   ZDBusConnectionFlagsZAUTHENTICATION_CLIENTZMESSAGE_BUS_CONNECTIONZDEFAULT_FLAGSZstaticmethodr   r   r   __static_attributes____classdictcell____classdict__   @r   r	   r	   .   sv     > 	5566	7 
 
 
 
 
 8E.2
 
r   c                   s   a  ] tR t^Tt o Rt]]R 4       4       tR t]R
R l4       t	]R 4       t
]R 4       t]R 4       tR	tV tR# )AbstractMessageBuszAbstract representation of a message bus.

The property connection represents a connection to the bus. You can
register a service name with register_service, or publish an object
with publish_object and get a proxy of a remote object with get_proxy.
c                    R# )The DBus connection.Nr   selfr   r   
connectionZAbstractMessageBus.connection\   s     r   c                s~     V P                   RJ#   \         d"   p\        P                  RT4        Rp?R# Rp?ii ; i)z^Check if the connection is set up.

:return: True if the connection is set up otherwise False
NzConnection can't be created:
%sF)r0   Z	Exceptionr   Zwarning)r/   Zes   & r   check_connectionZ#AbstractMessageBus.check_connectionb   s8    
	??$.. 	KK:A>	s    <7<Nc                r,   )zReturns a proxy of a remote DBus object.

:param service_name: a DBus name of a service
:param object_path: a DBus path of an object
:param interface_name: a DBus name of an interface or None
:return: a proxy object
Nr   )r/   service_nameobject_pathinterface_namekwargss   &&&&,r   	get_proxyZAbstractMessageBus.get_proxym        	r   c                r,   )zRegister a service on DBus.

A service can be registered by requesting its name on DBus.
This method should be called only after all of the required
objects of the service are published on DBus.

:param service_name: a DBus name of a service
Nr   )r/   r2   r5   s   &&,r   register_serviceZ#AbstractMessageBus.register_servicey   r7   r   c                r,   )zPublish an object on DBus.

:param object_path: a DBus path of an object
:param obj: an instance of @dbus_interface or @dbus_class
Nr   )r/   r3   objr5   s   &&&,r   publish_objectZ!AbstractMessageBus.publish_object   s     	r   c                r,   )Disconnect from DBus.Nr   r.   r   r   
disconnectZAbstractMessageBus.disconnect        	r   r   r    )r!   r"   r#   r$   r%   propertyr   r0   r1   r6   r8   r:   r<   r&   r'   r(   r*   r   r+   r+   T   s{        	 	 	 	 	    r   r+   )Z	metaclassc                   s   a a ] tR t^t oRtR]3V 3R llt]R 4       t]	R 4       t
]R 4       tRR ltR t]3R	 lt]3R
 ltR tR tR tR tRtVtV ;t# )r
   z/Representation of a message bus based on D-Bus.Nc                s   < \         SV `  4        W n        T;'       g    \        4       V n        RV n        RV n        / V n        \        4       V n	        R# )ztCreate a new message bus.

:param error_mapper: a DBus error mapper
:param provider: a provider of DBus connections
N)
super__init__	_providerr   _error_mapper_connection_proxy_registrationsset_requested_names)r/   error_mapperZprovider	__class__s   &&&r   r@   ZMessageBus.__init__   sH     	!)::[]  #r   c                sh    V P                   '       g   V P                  4       V n         V P                   # )r-   )rC   _get_connectionr.   r   r   r0   ZMessageBus.connection   s-     #335Dr   c                r,   )zReturn a DBus connection.Nr   r.   r   r   rJ   ZMessageBus._get_connection   r=   r   c                sl    V P                   '       g   V P                  RR4      V n         V P                   # )zThe proxy of DBus.zorg.freedesktop.DBusz/org/freedesktop/DBus)rD   r6   r.   r   r   proxyZMessageBus.proxy   s/     {{{..&'DK
 {{r   c                s    V P                  V4       V'       g   V'       d   \        M\        pV'       d   W5R&   V! V VV3RV P                  /VB # )aJ  Returns a proxy of a remote DBus object.

If the proxy factory is not specified, we will use a default
one. If the interface name is set, we will choose InterfaceProxy,
otherwise ObjectProxy.

If the interface name is set, we will add it to the additional
arguments for the proxy factory.

:param service_name: a DBus name of a service
:param object_path: a DBus path of an object
:param interface_name: a DBus name of an interface or None
:param proxy_factory: a factory of a DBus object proxy
:param proxy_arguments: additional arguments for the proxy factory
:return: a proxy object
r4   rH   )_check_service_accessr   r   rB   )r/   r2   r3   r4   Zproxy_factoryZproxy_argumentss   &&&&&,r   r6   ZMessageBus.get_proxy   sZ    $ 	""<0.<N+M0>,-
 ++	

 
 	
r   c                s    WP                   9  d   R# \        P                  ! 4       \        P                  ! 4       Jd   R# \	        RP                  V4      4      h)a  Check if we can access a DBus service.

FIXME: This is a temporary check that should be later removed.

This is useful during the transition of the Anaconda code from
UI to DBus modules. This check prevents a deadlock in case that
a DBus module tries to access a service, that it provides, from
the main thread.

:param service_name: a DBus name of a service
:raises: RuntimeError if the service cannot be accessed
Nz4Can't access DBus service '{}' from the main thread.)rG   	threadingZcurrent_threadZmain_threadZRuntimeErrorformatr/   r2      &&r   rL   Z MessageBus._check_service_access   sL     444##%Y-B-B-DD%vl3
 	
r   c                s  a a \         P                  RS4       S P                  P                  SV4      pV\        8w  d   \        RP                  V4      4      hS P                  P                  S4       V V3R lS P                  S&   R# )zRegister a service on DBus.

:param service_name: a DBus name of a service
:param flags: the flags argument of the RequestName DBus method
zRegistering a service name %s.zName request has failed: {}c                  s:   < S P                   P                  S4      # r    )rK   ZReleaseNamerO   s   r   Z<lambda>Z-MessageBus.register_service.<locals>.<lambda>  s    DJJ**<8r   N)
r   debugrK   ZRequestNamer   ZConnectionErrorrN   rG   ZaddrE   )r/   r2   r   Zresults   ff& r   r8   ZMessageBus.register_service   sv     			2LA''e<::!"?"F"Fv"NOO!!	
 9 	L)r   c                s    \         P                  RV4       V! V VV3RV P                  /VB pVP                  4        VP                  V P
                  V&   R# )a	  Publish an object on DBus.

:param object_path: a DBus path of an object
:param obj: an instance of @dbus_interface or @dbus_class
:param server_factory: a factory of a DBus server object handler
:param server_arguments: additional arguments for the server factory
zPublishing an object at %s.rH   N)r   rQ   rB   Zconnect_objectZdisconnect_objectrE   )r/   r3   r9   Zserver_factoryZserver_argumentsZobject_handlers   &&&&, r   r:   ZMessageBus.publish_object  sd     			/='
 ++	

 
 	%%'+9+K+KK(r   c                sn    WP                   9   d%   V P                   P                  V4      pV! 4        R# R# )zRemove Object from DBus.N)rE   Zpop)r/   r3   callbacks   && r   _unregisterZMessageBus._unregister&  s0     ---**..{;HJ .r   c                T    \         P                  R V4       V P                  V4       R# )z Removing object %s from the bus.Nr   rQ   rS   r/   r3   rP   r   unpublish_objectZMessageBus.unpublish_object-  s    		4kB%r   c                rT   )z!Removing service %s from the bus.NrU   rV   rP   r   unregister_serviceZMessageBus.unregister_service1  s    		5{C%r   c                s    \         P                  R4       V P                  '       d&   V P                  P                  4       w  rV! 4        K7  RV n        \        4       V n        R# )r;   zDisconnecting from the bus.N)r   rQ   rE   ZpopitemrC   rF   rG   )r/   Z_rR   s   &  r   r<   ZMessageBus.disconnect5  sH    		/0!!!--557KAJ #r   )rC   rB   rA   rD   rE   rG   )NN)r!   r"   r#   r$   r%   r	   r@   r>   r0   r   rJ   rK   r6   rL   r   r8   r   r:   rS   rW   rX   r<   r&   r'   __classcell__rI   r)      @@r   r
   r
      s     9$(> &         
D
8  @
, ':L,&&	& 	&r   c                   *   a  ] tR tRt o RtR tRtV tR# )r   iA  z*Representation of a system bus connection.c                `    \         P                  R4       V P                  P                  4       # )zGet a system DBus connection.r   )r   r   rA   r   r.   r   r   rJ   Z SystemMessageBus._get_connectionD  s"    01~~7799r   r   Nr!   r"   r#   r$   r%   rJ   r&   r'   r(   r*   r   r   r   A  s     4: :r   c                   r\   )r   iJ  z+Representation of a session bus connection.c                r]   )zGet a session DBus connection.r   )r   r   rA   r   r.   r   r   rJ   Z!SessionMessageBus._get_connectionM  s"    12~~88::r   r   Nr^   r(   r*   r   r   r   J  s     5; ;r   c                   sL   a a ] tR tRt oRtV 3R lt]R 4       tR tRt	Vt
V ;t# )r   iS  z9Representation of a connection for the specified address.c                s4   < \         SV `  ! V/ VB  Wn        R# )zLCreate a new representation of a connection.

:param address: a bus address
N)r?   r@   _address)r/   addressZargsr5   rI   s   &&*,r   r@   ZAddressedMessageBus.__init__V  s    
 	$)&)r   c                s    V P                   # )zThe bus address.r_   r.   r   r   r`   ZAddressedMessageBus.address^  s     }}r   c                s    \         P                  RV P                  4       V P                  P	                  V P                  4      # )r   zConnecting to a bus at %s.)r   r   r_   rA   r   r.   r   r   rJ   Z#AddressedMessageBus._get_connectionc  s.    -t}}=~~::4==IIr   ra   )r!   r"   r#   r$   r%   r@   r>   r`   rJ   r&   r'   rY   rZ   r[   r   r   r   S  s-     C   J Jr   )r	   r
   r   r   r   )ZloggingrM   Zabcr    r   Zdasbus.constantsr   r   Zdasbus.client.proxyr   r   Zdasbus.errorr   Zdasbus.server.handlerr   ZgiZrequire_versionZgi.repositoryr   Z	getLoggerr!   r   Z__all__Zobjectr	   r+   r
   r   r   r   r   r   r   <module>rb      s   *   '* ; $ 5 	   5%   !#
V #
L=7 =@j&# j&Z:z :;
 ;J* Jr   