
    V#gsD                     $   S r SrSSKrSSKrSSKJrJrJrJrJ	r	J
r
JrJrJrJrJrJrJrJrJrJrJrJrJrJrJrJrJr  SSKJr  SSKJr  SSK J!r!  SSK"J#r#  S	\< S
\< S\< S3r$ Sr%\RL                  " S5      r' " S S\(5      r) " S S\5      r*g))BusConnectionreStructuredText    N)BUS_DAEMON_IFACEBUS_DAEMON_NAMEBUS_DAEMON_PATHBUS_SESSIONBUS_STARTER
BUS_SYSTEM DBUS_START_REPLY_ALREADY_RUNNINGDBUS_START_REPLY_SUCCESSNAME_FLAG_ALLOW_REPLACEMENTNAME_FLAG_DO_NOT_QUEUENAME_FLAG_REPLACE_EXISTINGRELEASE_NAME_REPLY_NON_EXISTENTRELEASE_NAME_REPLY_NOT_OWNERRELEASE_NAME_REPLY_RELEASED REQUEST_NAME_REPLY_ALREADY_OWNERREQUEST_NAME_REPLY_EXISTSREQUEST_NAME_REPLY_IN_QUEUE REQUEST_NAME_REPLY_PRIMARY_OWNERvalidate_bus_namevalidate_error_namevalidate_interface_namevalidate_member_namevalidate_object_path)
Connection)DBusException)HANDLER_RESULT_NOT_YET_HANDLED)is_py2ztype='signal',sender='z',interface='z"',member='NameOwnerChanged',path='z',arg0='%s'z)org.freedesktop.DBus.Error.NameHasNoOwnerzdbus.busc                   $    \ rS rSrSrS rS rSrg)NameOwnerWatch<   )_match_pending_callc           
         ^^ [        T5        U4S jnUU4S jnUR                  US[        [        [        TS9U l        UR                  [        [        [        SST4TU5      U l        g )Nc                    > T" U5        g N )owned	old_owner	new_ownercallbacks      */usr/lib/python3/dist-packages/dbus/bus.py	signal_cb*NameOwnerWatch.__init__.<locals>.signal_cbB   s    Y    c                    > U R                  5       [        :X  a	  T" S5        g [        R                  " 5         [        R                  STU R                  U S 4S9  g )N zGetNameOwner(%s) failed:)exc_info)get_dbus_name_NAME_HAS_NO_OWNERloggingbasicConfig_loggerdebug	__class__)ebus_namer,   s    r-   error_cb)NameOwnerWatch.__init__.<locals>.error_cbE   sJ     $66##%8(()Q'=  ?r0   NameOwnerChanged)arg0GetNameOwners)r   add_signal_receiverr   r   r   r#   
call_asyncr$   )selfbus_connr<   r,   r.   r=   s     ``  r-   __init__NameOwnerWatch.__init__?   sm    (#	 	? 2293E3C3B3B8@ 3 B &001@1A1?14xk198Er0   c                     U R                   b  U R                   R                  5         U R                  b  U R                  R                  5         S U l         S U l        g r'   )r#   remover$   cancelrE   s    r-   rK   NameOwnerWatch.cancelZ   sI    ;;"KK )%%'!r0   N)__name__
__module____qualname____firstlineno__	__slots__rG   rK   __static_attributes__r(   r0   r-   r!   r!   <   s    +IE6"r0   r!   c                      ^  \ rS rSrSr\r \r \	r
 \r\r\S4S jr   SU 4S jjrS rS r  SS jrS	 rSS
 jrSS jrS rS rS rS rS rS rS rS rS rS r Sr!U =r"$ )r   c   zlA connection to a D-Bus daemon that implements the
``org.freedesktop.DBus`` pseudo-service.

:Since: 0.81.0
Nc                 h    U R                  XS9n[        R                  " 5       Ul        0 Ul         U$ )N)mainloop)_new_for_busweakrefWeakValueDictionary
_bus_names_signal_sender_matches)clsaddress_or_typerW   buss       r-   __new__BusConnection.__new__w   s7    B !446%'"5
r0   c                 j  >^ UR                  SS 5      nUb"  Ub  [        S5      eUnSSKJn  U" S[        SS9  [
        [        U ]  " XX4U40 UD6mUbE  U[        :w  a;  US S S	:X  a  U4S
 jn	OTR                  n	U R                  XI5      n
XR                  T'   U R                  [        T5      5        T$ )Nnamed_service3bus_name and named_service cannot both be specifiedr   warnzrPassing the named_service parameter to add_signal_receiver by name is deprecated: please use positional parameters   
stacklevel   :c                 4   > U S:X  a  TR                  5         g g )Nr2   )rJ   )r+   matchs    r-   r,   3BusConnection.add_signal_receiver.<locals>.callback   s     B 'r0   )pop	TypeErrorwarningsrf   DeprecationWarningsuperr   rC   r   set_sender_name_ownerwatch_name_ownerr\   add_match_stringstr)rE   handler_functionsignal_namedbus_interfacer<   pathkeywordsrc   rf   r,   watchrm   r:   s              @r-   rC   !BusConnection.add_signal_receiver   s     !_d;$# !, - -$H% K#3 mT> ~" "  X%@|s"' !66))(=E16''.c%j)r0   c                     U R                  [        U5      5        U R                  R                  US 5      nUb  UR	                  5         g g r'   ) remove_match_string_non_blockingrw   r\   ro   rK   )rE   rm   r}   s      r-   _clean_up_signal_match$BusConnection._clean_up_signal_match   s@    --c%j9++//t<LLN r0   c                     Ub%  US S S:w  a  U[         :w  a   U R                  U5      $ U$ ! [         aE  nUR                  5       [        :w  a  e U R                  U5        U R                  U5      s S nA$ S nAff = f)Nrj   rk   )r   get_name_ownerr   r4   r5   start_service_by_name)rE   r<   r;   s      r-   activate_name_owner!BusConnection.activate_name_owner   s~     Xbq\S%8O+5**844 O ! 5??$(::**84**8445s   + 
A::A5/A:5A:c                 &   U(       a  U R                  5         UR                  SS5      nUb"  Ub  [        S5      eSSKJn  U" S[
        SS9  UnU(       a+  [        S	S
R                  UR                  5       5      -  5      eU R                  XUUUS9$ )aj  Return a local proxy for the given remote object.

Method calls on the proxy are translated into method calls on the
remote object.

:Parameters:
    `bus_name` : str
        A bus name (either the unique name or a well-known name)
        of the application owning the object. The keyword argument
        named_service is a deprecated alias for this.
    `object_path` : str
        The object path of the desired object
    `introspect` : bool
        If true (default), attempt to introspect the remote
        object to find out supported methods and their signatures
    `follow_name_owner_changes` : bool
        If the object path is a well-known name and this parameter
        is false (default), resolve the well-known name to the unique
        name of its current owner and bind to that instead; if the
        ownership of the well-known name changes in future,
        keep communicating with the original owner.
        This is necessary if the D-Bus API used is stateful.

        If the object path is a well-known name and this parameter
        is true, whenever the well-known name changes ownership in
        future, bind to the new owner, if any.

        If the given object path is a unique name, this parameter
        has no effect.

:Returns: a `dbus.proxies.ProxyObject`
:Raises `DBusException`: if resolving the well-known name to a
    unique name fails
rc   Nrd   r   re   ziPassing the named_service parameter to get_object by name is deprecated: please use positional parametersrg   rh   z4get_object does not take these keyword arguments: %sz, )
introspectfollow_name_owner_changes)	_require_main_loopro   rp   rq   rf   rr   joinkeysProxyObjectClass)rE   r<   object_pathr   r   kwargsrc   rf   s           r-   
get_objectBusConnection.get_object   s    H %##%

?D9$# !/ 0 0% C#3 %H ,.2ii.FG H H $$T[0:?X % Z 	Zr0   c                 ^    [        U5        U R                  [        [        [        SSU45      $ )zGet the numeric uid of the process owning the given bus name.

:Parameters:
    `bus_name` : str
        A bus name, either unique or well-known
:Returns: a `dbus.UInt32`
:Since: 0.80.0
GetConnectionUnixUserrB   r   call_blockingr   r   r   rE   r<   s     r-   get_unix_userBusConnection.get_unix_user   s0     	(#!!/?"24K"%{4 	4r0   c           
      b    [        U5        SU R                  [        [        [        SSX45      4$ )a  Start a service which will implement the given bus name on this Bus.

:Parameters:
    `bus_name` : str
        The well-known bus name to be activated.
    `flags` : dbus.UInt32
        Flags to pass to StartServiceByName (currently none are
        defined)

:Returns: A tuple of 2 elements. The first is always True, the
    second is either START_REPLY_SUCCESS or
    START_REPLY_ALREADY_RUNNING.

:Raises `DBusException`: if the service could not be started.
:Since: 0.80.0
TStartServiceByNamesur   )rE   r<   flagss      r-   r   #BusConnection.start_service_by_name   s;    " 	(#d((/)9)=)-/@B C 	Cr0   c           	      \    [        USS9  U R                  [        [        [        SSX45      $ )a  Request a bus name.

:Parameters:
    `name` : str
        The well-known name to be requested
    `flags` : dbus.UInt32
        A bitwise-OR of 0 or more of the flags
        `NAME_FLAG_ALLOW_REPLACEMENT`,
        `NAME_FLAG_REPLACE_EXISTING`
        and `NAME_FLAG_DO_NOT_QUEUE`
:Returns: `REQUEST_NAME_REPLY_PRIMARY_OWNER`,
    `REQUEST_NAME_REPLY_IN_QUEUE`,
    `REQUEST_NAME_REPLY_EXISTS` or
    `REQUEST_NAME_REPLY_ALREADY_OWNER`
:Raises `DBusException`: if the bus daemon cannot be contacted or
    returns an error.
Fallow_uniqueRequestNamer   r   )rE   namer   s      r-   request_nameBusConnection.request_name  s1    $ 	$U3!!/?"2M"&7 	7r0   c                 \    [        USS9  U R                  [        [        [        SSU45      $ )a+  Release a bus name.

:Parameters:
    `name` : str
        The well-known name to be released
:Returns: `RELEASE_NAME_REPLY_RELEASED`,
    `RELEASE_NAME_REPLY_NON_EXISTENT`
    or `RELEASE_NAME_REPLY_NOT_OWNER`
:Raises `DBusException`: if the bus daemon cannot be contacted or
    returns an error.
Fr   ReleaseNamerB   r   )rE   r   s     r-   release_nameBusConnection.release_name/  s1     	$U3!!/?"2M"%w0 	0r0   c                 F    U R                  [        [        [        SSS5      $ )zqReturn a list of all currently-owned names on the bus.

:Returns: a dbus.Array of dbus.UTF8String
:Since: 0.81.0
	ListNamesr2   r(   r   r   r   r   rL   s    r-   
list_namesBusConnection.list_names@  s%     !!/?"2K"$b* 	*r0   c                 F    U R                  [        [        [        SSS5      $ )zwReturn a list of all names that can be activated on the bus.

:Returns: a dbus.Array of dbus.UTF8String
:Since: 0.81.0
ListActivatableNamesr2   r(   r   rL   s    r-   list_activatable_names$BusConnection.list_activatable_namesJ  s&     !!/?"24J"$b* 	*r0   c                 \    [        USS9  U R                  [        [        [        SSU45      $ )zReturn the unique connection name of the primary owner of the
given name.

:Raises `DBusException`: if the `bus_name` has no owner
:Since: 0.81.0
Fr   rA   rB   r   r   s     r-   r   BusConnection.get_name_ownerT  s1     	(7!!/?"2N"%{4 	4r0   c                     [        XU5      $ )zWatch the unique connection name of the primary owner of the
given name.

`callback` will be called with one argument, which is either the
unique connection name, or the empty string (meaning the name is
not owned).

:Since: 0.81.0
)r!   )rE   r<   r,   s      r-   ru   BusConnection.watch_name_owner`  s     dh77r0   c           
      Z    [        U R                  [        [        [        SSU45      5      $ )zReturn True iff the given bus name has an owner on this bus.

:Parameters:
    `bus_name` : str
        The bus name to look up
:Returns: a `bool`
NameHasOwnerrB   )boolr   r   r   r   r   s     r-   name_has_ownerBusConnection.name_has_ownerl  s.     D&&'7'*XK9 : 	:r0   c                 J    U R                  [        [        [        SSU45        g)Arrange for this application to receive messages on the bus that
match the given rule. This version will block.

:Parameters:
    `rule` : str
        The match rule
:Raises `DBusException`: on error.
:Since: 0.80.0
AddMatchrB   Nr   rE   rules     r-   rv   BusConnection.add_match_stringx  s"     	?O+Ztg	Gr0   c           
      N    U R                  [        [        [        SSU4SS5        g)Arrange for this application to receive messages on the bus that
match the given rule. This version will not block, but any errors
will be ignored.


:Parameters:
    `rule` : str
        The match rule
:Raises `DBusException`: on error.
:Since: 0.80.0
r   rB   NrD   r   r   r   r   s     r-   add_match_string_non_blocking+BusConnection.add_match_string_non_blocking  s$     	(*cD7d	$r0   c                 J    U R                  [        [        [        SSU45        g)r   RemoveMatchrB   Nr   r   s     r-   remove_match_string!BusConnection.remove_match_string  s"     	?O+]C$	Jr0   c           
      N    U R                  [        [        [        SSU4SS5        g)r   r   rB   Nr   r   s     r-   r   .BusConnection.remove_match_string_non_blocking  s$     	(-tgd	$r0   r(   )NNNN)TF)r   )#rN   rO   rP   rQ   __doc__r   TYPE_SESSIONr
   TYPE_SYSTEMr	   TYPE_STARTERr   START_REPLY_SUCCESSr   START_REPLY_ALREADY_RUNNINGr`   rC   r   r   r   r   r   r   r   r   r   r   ru   r   rv   r   r   r   rS   __classcell__)r:   s   @r-   r   r   c   s     "LH KHL$ 3"B%1D 	 AE:>!%@ <@-27Zr4C27.0"**
4
8
:G$ J$ $r0   r   )+__all____docformat__r6   rY   _dbus_bindingsr   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   dbus.connectionr   dbus.exceptionsr   dbus.lowlevelr   dbus._compatr   _NAME_OWNER_CHANGE_MATCHr5   	getLoggerr8   objectr!   r   r(   r0   r-   <module>r      s   2 "  	I 	I 	I 	I 	I 	I 	I ' ) 8   /0@.	0 
 A 


J
'$"V $"NO$J O$r0   