Ë
    @iasD  ã                   ó  — d Z dZddlZddlZddlmZmZmZmZm	Z	m
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ ddlmZ ddlmZ ddl m!Z! ddl"m#Z# d	e›d
e›de›d�Z$	 dZ% ejL                  d«      Z' G d„ de(«      Z) G d„ de«      Z*y))Ú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                   ó   — e Zd ZdZd„ Zd„ Zy)ÚNameOwnerWatch)Ú_matchÚ_pending_callc           
      óØ   ‡‡— t        ‰«       ˆfd„}ˆˆfd„}|j                  |dt        t        t        ‰¬«      | _        |j                  t        t        t        dd‰f‰|«      | _        y )Nc                 ó   •—  ‰|«       y ©N© )ÚownedÚ	old_ownerÚ	new_ownerÚcallbacks      €ú*/usr/lib/python3/dist-packages/dbus/bus.pyÚ	signal_cbz*NameOwnerWatch.__init__.<locals>.signal_cbB   s   ø€ Ù�YÕó    c                 ó¸   •— | j                  «       t        k(  r	 ‰d«       y t        j                  «        t        j                  d‰| j                  | d f¬«       y )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_cbz)NameOwnerWatch.__init__.<locals>.error_cbE   sJ   ø€ Ø�‰Ó Ô$6Ò6Ù˜•ä×#Ñ#Ô%Ü—‘Ð8¸(Ø()¯©°Q¸Ð'=ð õ ?r.   ÚNameOwnerChanged)Úarg0ÚGetNameOwnerÚs)r   Úadd_signal_receiverr   r   r   r"   Ú
call_asyncr#   )ÚselfÚbus_connr:   r+   r-   r;   s     ``  r,   Ú__init__zNameOwnerWatch.__init__?   sm   ù€ Ü˜(Ô#ô	 õ	?ð ×2Ñ2°9Ø3EÜ3CÜ3BÜ3BØ8@ð 3ó BˆŒð &×0Ñ0´Ü1@Ü1AØ1?Ø14°x°kØ19¸8óEˆÕr.   c                 ó¸   — | j                   �| j                   j                  «        | j                  �| j                  j                  «        d | _         d | _        y r&   )r"   Úremover#   Úcancel©rB   s    r,   rG   zNameOwnerWatch.cancelZ   sI   € Ø�;‰;Ð"Ø�K‰K×ÑÔ Ø×ÑÐ)Ø×Ñ×%Ñ%Ô'ØˆŒØ!ˆÕr.   N)Ú__name__Ú
__module__Ú__qualname__Ú	__slots__rD   rG   r'   r.   r,   r!   r!   <   s   „ Ø+€IòEó6"r.   r!   c                   óº   ‡ — e Zd ZdZeZ	 eZ	 eZ		 e
ZeZedfd„Z	 	 	 dˆ fd„	Zd„ Zd„ Z	 	 dd„Zd„ Zdd	„Zdd
„Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zˆ xZ S )r   zxA connection to a D-Bus daemon that implements the
    ``org.freedesktop.DBus`` pseudo-service.

    :Since: 0.81.0
    Nc                 ón   — | j                  ||¬«      }t        j                  «       |_        i |_        	 |S )N)Úmainloop)Ú_new_for_busÚweakrefÚWeakValueDictionaryÚ
_bus_namesÚ_signal_sender_matches)ÚclsÚaddress_or_typerO   Úbuss       r,   Ú__new__zBusConnection.__new__w   s9   € Ø×Ñ˜¸ÐÓBˆô !×4Ñ4Ó6ˆŒà%'ˆÔ"Ø5àˆ
r.   c                 ój  •‡— |j                  dd «      }|�$|�t        d«      ‚|}ddlm}  |dt        d¬«       t        t        | �  |||||fi |¤ŽŠ|�D|t        k7  r;|d d d	k(  rˆfd
„}	n‰j                  }	| j                  ||	«      }
|
| j                  ‰<   | j                  t        ‰«      «       ‰S )NÚnamed_serviceú3bus_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                 ó2   •— | dk(  r‰j                  «        y y )Nr0   )rF   )r*   Úmatchs    €r,   r+   z3BusConnection.add_signal_receiver.<locals>.callback–   s   ø€ Ø  B’ØŸ™�ð 'r.   )ÚpopÚ	TypeErrorÚwarningsr]   ÚDeprecationWarningÚsuperr   r@   r   Úset_sender_name_ownerÚwatch_name_ownerrT   Úadd_match_stringÚstr)rB   Úhandler_functionÚsignal_nameÚdbus_interfacer:   ÚpathÚkeywordsrZ   r]   r+   Úwatchrd   r8   s              @€r,   r@   z!BusConnection.add_signal_receiver‚   sÝ   ù€ ð !Ÿ™ _°dÓ;ˆØÐ$ØÐ#Üð !,ó -ð -à$ˆHÝ%Ùð Kä#°õ3ô ”m TÑ>Ø  +¨~¸xØñ"à ñ"ˆð Ð  X´Ò%@Ø˜˜ˆ|˜sÒ"õ'ð !×6Ñ6�Ø×)Ñ)¨(°HÓ=ˆEØ16ˆD×'Ñ'¨Ñ.à×Ñœc %›jÔ)àˆr.   c                 ó–   — | j                  t        |«      «       | j                  j                  |d «      }|�|j	                  «        y y r&   )Ú remove_match_string_non_blockingrm   rT   re   rG   )rB   rd   rs   s      r,   Ú_clean_up_signal_matchz$BusConnection._clean_up_signal_match¢   s@   € à×-Ñ-¬c°%«jÔ9Ø×+Ñ+×/Ñ/°°tÓ<ˆØÐØ�L‰L�Nð r.   c                 óð   — |�#|d d dk7  r|t         k7  r	 | j                  |«      S |S # t        $ rD}|j                  «       t        k7  r‚ | j                  |«       | j                  |«      cY d }~S d }~ww xY w)Nra   rb   )r   Úget_name_ownerr   r2   r3   Ústart_service_by_name)rB   r:   r9   s      r,   Úactivate_name_ownerz!BusConnection.activate_name_owner©   s~   € ØÐ  X¨b¨q \°SÒ%8ØœOÒ+ð5Ø×*Ñ*¨8Ó4Ð4ð ˆOøô !ò 5Ø—?‘?Ó$Ô(:Ò:Øà×*Ñ*¨8Ô4Ø×*Ñ*¨8Ó4Õ4ûð5ús   •( ¨	A5±9A0Á*A5Á0A5c                 ó  — |r| j                  «        |j                  dd«      }|�$|�t        d«      ‚ddlm}  |dt
        d¬«       |}|r+t        d	d
j                  |j                  «       «      z  «      ‚| j                  | ||||¬«      S )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
        rZ   Nr[   r   r\   ziPassing the named_service parameter to get_object by name is deprecated: please use positional parametersr^   r_   z4get_object does not take these keyword arguments: %sz, )Ú
introspectÚfollow_name_owner_changes)	Ú_require_main_loopre   rf   rg   r]   rh   ÚjoinÚkeysÚProxyObjectClass)rB   r:   Úobject_pathr|   r}   ÚkwargsrZ   r]   s           r,   Ú
get_objectzBusConnection.get_object¸   s¶   € ñH %Ø×#Ñ#Ô%àŸ
™
 ?°DÓ9ˆØÐ$ØÐ#Üð !/ó 0ð 0å%Ùð Cä#°õ3ð %ˆHÙÜð ,Ø.2¯i©i¸¿¹»Ó.FñGó Hð Hð ×$Ñ$ T¨8°[Ø0:Ø?Xð %ó Zð 	Zr.   c                 ó^   — t        |«       | j                  t        t        t        dd|f«      S )zêGet 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
        ÚGetConnectionUnixUserr?   ©r   Úcall_blockingr   r   r   ©rB   r:   s     r,   Úget_unix_userzBusConnection.get_unix_userñ   s0   € ô 	˜(Ô#Ø×!Ñ!¤/´?Ü"2Ð4KØ"%¨ {ó4ð 	4r.   c           
      ód   — t        |«       d| j                  t        t        t        dd||f«      fS )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‡   )rB   r:   Úflagss      r,   ry   z#BusConnection.start_service_by_nameÿ   s=   € ô" 	˜(Ô#Ø�d×(Ñ(¬¼/Ü)9Ø)=Ø)-°¸%Ð/@óBð Cð 	Cr.   c           	      ód   — t        |d¬«       | j                  t        t        t        dd||f«      S )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‡   )rB   ÚnamerŽ   s      r,   Úrequest_namezBusConnection.request_name  s3   € ô$ 	˜$¨UÕ3Ø×!Ñ!¤/´?Ü"2°MØ"&¨¨u¨ó7ð 	7r.   c                 ób   — t        |d¬«       | j                  t        t        t        dd|f«      S )as  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�   ÚReleaseNamer?   r‡   )rB   r“   s     r,   Úrelease_namezBusConnection.release_name/  s1   € ô 	˜$¨UÕ3Ø×!Ñ!¤/´?Ü"2°MØ"%¨ wó0ð 	0r.   c                 óF   — | j                  t        t        t        ddd«      S )z‰Return a list of all currently-owned names on the bus.

        :Returns: a dbus.Array of dbus.UTF8String
        :Since: 0.81.0
        Ú	ListNamesr0   r'   ©rˆ   r   r   r   rH   s    r,   Ú
list_nameszBusConnection.list_names@  s%   € ð ×!Ñ!¤/´?Ü"2°KØ"$ bó*ð 	*r.   c                 óF   — | j                  t        t        t        ddd«      S )z�Return a list of all names that can be activated on the bus.

        :Returns: a dbus.Array of dbus.UTF8String
        :Since: 0.81.0
        ÚListActivatableNamesr0   r'   rš   rH   s    r,   Úlist_activatable_namesz$BusConnection.list_activatable_namesJ  s&   € ð ×!Ñ!¤/´?Ü"2Ð4JØ"$ bó*ð 	*r.   c                 ób   — t        |d¬«       | j                  t        t        t        dd|f«      S )z²Return 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�   r>   r?   r‡   r‰   s     r,   rx   zBusConnection.get_name_ownerT  s1   € ô 	˜(°Õ7Ø×!Ñ!¤/´?Ü"2°NØ"%¨ {ó4ð 	4r.   c                 ó   — t        | ||«      S )a  Watch 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!   )rB   r:   r+   s      r,   rk   zBusConnection.watch_name_owner`  s   € ô ˜d H¨hÓ7Ð7r.   c           
      óZ   — t        | j                  t        t        t        dd|f«      «      S )z»Return 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`
        ÚNameHasOwnerr?   )Úboolrˆ   r   r   r   r‰   s     r,   Úname_has_ownerzBusConnection.name_has_ownerl  s.   € ô �D×&Ñ&¤¼Ü'7¸Ø'*¨X¨Kó9ó :ð 	:r.   c                 óJ   — | j                  t        t        t        dd|f«       y)á  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
        ÚAddMatchr?   Nrš   ©rB   Úrules     r,   rl   zBusConnection.add_match_stringx  s"   € ð 	×Ñœ?¬OÜ+¨Z¸¸t¸gõ	Gr.   c           
      óN   — | j                  t        t        t        dd|fdd«       y)á=  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§   r?   N©rA   r   r   r   r¨   s     r,   Úadd_match_string_non_blockingz+BusConnection.add_match_string_non_blocking‡  s$   € ð 	�‰œ¬Ü(¨*°c¸D¸7Ø˜dõ	$r.   c                 óJ   — | j                  t        t        t        dd|f«       y)r¦   ÚRemoveMatchr?   Nrš   r¨   s     r,   Úremove_match_stringz!BusConnection.remove_match_string—  s"   € ð 	×Ñœ?¬OÜ+¨]¸CÀ$Àõ	Jr.   c           
      óN   — | j                  t        t        t        dd|fdd«       y)r«   r¯   r?   Nr¬   r¨   s     r,   ru   z.BusConnection.remove_match_string_non_blocking¤  s$   € ð 	�‰œ¬Ü(¨-¸¸t¸gØ˜dõ	$r.   )NNNN)TF)r   )!rI   rJ   rK   Ú__doc__r   ÚTYPE_SESSIONr
   ÚTYPE_SYSTEMr	   ÚTYPE_STARTERr   ÚSTART_REPLY_SUCCESSr   ÚSTART_REPLY_ALREADY_RUNNINGrX   r@   rv   rz   r„   rŠ   ry   r”   r—   r›   rž   rx   rk   r¤   rl   r­   r°   ru   Ú__classcell__)r8   s   @r,   r   r   c   s­   ø„ ñð "€LØHà €KØHà€Lð$ð 3ÐØ"BÐà%1¸Dó 	ð AEØ:>Ø!%õò@òð <@Ø-2ó7Zòr4óCó27ò.0ò"*ò*ò
4ò
8ò
:òGò$ò Jö$r.   r   )+Ú__all__Ú__docformat__r4   rQ   Ú_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_MATCHr3   Ú	getLoggerr6   Úobjectr!   r   r'   r.   r,   ú<module>rÃ      s�   ðð2 €Ø"€ã Û ÷	I÷ 	I÷ 	I÷ 	I÷ 	I÷ 	Iñ 	Iõ 'Ý )Ý 8Þ ò  /Ò0@Ú.ð	0Ð ð
ð AÐ à
ˆ'×
Ñ
˜JÓ
'€ô$"�Vô $"ôNO$�Jõ O$r.   