Ë
    @iaO"  ã                   óÜ   — d Z ddlmZ dZdZddlm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 ddlmZ ddlmZ dd	lmZ  G d
„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Zy)z9Implementation for dbus.Bus. Not to be imported directly.é    )Ú
generators)ÚBusÚ	SystemBusÚ
SessionBusÚ
StarterBusÚreStructuredText)ÚDBusException)ÚBUS_DAEMON_IFACEÚBUS_DAEMON_NAMEÚBUS_DAEMON_PATHÚBUS_SESSIONÚBUS_STARTERÚ
BUS_SYSTEMÚ DBUS_START_REPLY_ALREADY_RUNNINGÚDBUS_START_REPLY_SUCCESSÚvalidate_bus_nameÚvalidate_interface_nameÚvalidate_member_nameÚvalidate_object_path)ÚBusConnection)ÚSignalMessage)Úis_py2c                   ó¶   ‡ — e Zd ZdZi Zej                  ddfd„Zˆ fd„Zd„ Z	 e
e	ddd«      Zdd„Z ee«      Zdd	„Z ee«      Zdd
„Z ee«      Zd„ ZeZˆ xZS )r   a   A connection to one of three possible standard buses, the SESSION,
    SYSTEM, or STARTER bus. This class manages shared connections to those
    buses.

    If you're trying to subclass `Bus`, you may be better off subclassing
    `BusConnection`, which doesn't have all this magic.
    FNc                 ó   — |s|| j                   v r| j                   |   S |t        k(  rt        }n.|t        k(  rt        }n|t
        k(  rt        }nt        d|z  «      ‚t        j                  |||¬«      }||_
        |s|| j                   |<   |S )aË  Constructor, returning an existing instance where appropriate.

        The returned instance is actually always an instance of `SessionBus`,
        `SystemBus` or `StarterBus`.

        :Parameters:
            `bus_type` : cls.TYPE_SESSION, cls.TYPE_SYSTEM or cls.TYPE_STARTER
                Connect to the appropriate bus
            `private` : bool
                If true, never return an existing shared instance, but instead
                return a private connection.

                :Deprecated: since 0.82.3. Use dbus.bus.BusConnection for
                    private connections.

            `mainloop` : dbus.mainloop.NativeMainLoop
                The main loop to use. The default is to use the default
                main loop if one has been set up, or raise an exception
                if none has been.
        :Changed: in dbus-python 0.80:
            converted from a wrapper around a Connection to a Connection
            subclass.
        zinvalid bus_type %s)Úmainloop)Ú_shared_instancesr   r   r   r   r   r   Ú
ValueErrorr   Ú__new__Ú	_bus_type)ÚclsÚbus_typeÚprivater   ÚsubclassÚbuss         ú,/usr/lib/python3/dist-packages/dbus/_dbus.pyr   zBus.__new__9   s’   € ñ2 ˜H¨×(=Ñ(=Ñ=Ø×(Ñ(¨Ñ2Ð2ð ”{Ò"Ü!‰HØœÒ#Ü ‰HØœÒ$Ü!‰HäÐ2°XÑ=Ó>Ð>ä×#Ñ# H¨hÀÔJˆà ˆŒáØ.1ˆC×!Ñ! (Ñ+àˆ
ó    c                 ó¾   •— | j                   }| j                  j                  j                  |«      | u r| j                  j                  |= t        t
        | �  «        y )N)r   Ú	__class__r   ÚgetÚsuperr   Úclose)ÚselfÚtr(   s     €r%   r+   z	Bus.closel   sH   ø€ Ø�N‰NˆØ�>‰>×+Ñ+×/Ñ/°Ó2°dÑ:Ø—‘×0Ñ0°Ð3ÜŒc�4ÑÕ r&   c                 ó   — | S )zªReturn self, for backwards compatibility with earlier dbus-python
        versions where Bus was not a subclass of Connection.

        :Deprecated: since 0.80.0
        © )r,   s    r%   Úget_connectionzBus.get_connectionr   s	   € ð ˆr&   z¹self._connection == self, for backwards
                           compatibility with earlier dbus-python versions
                           where Bus was not a subclass of Connection.c                 ó   — t        | ¬«      S )z³Static method that returns a connection to the session bus.

        :Parameters:
            `private` : bool
                If true, do not return a shared connection.
        ©r"   )r   r2   s    r%   Úget_sessionzBus.get_session~   ó   € ô  'Ô*Ð*r&   c                 ó   — t        | ¬«      S )z²Static method that returns a connection to the system bus.

        :Parameters:
            `private` : bool
                If true, do not return a shared connection.
        r2   )r   r2   s    r%   Ú
get_systemzBus.get_system‰   s   € ô  Ô)Ð)r&   c                 ó   — t        | ¬«      S )z³Static method that returns a connection to the starter bus.

        :Parameters:
            `private` : bool
                If true, do not return a shared connection.
        r2   )r   r2   s    r%   Úget_starterzBus.get_starter•   r4   r&   c                 óþ   — | j                   t        k(  rd}n.| j                   t        k(  rd}n| j                   t        k(  rd}nd}d| j                  j
                  | j                  j                  |t        | «      fz  S )NÚsessionÚsystemÚstarterzunknown bus typez<%s.%s (%s) at %#x>)r   r   r   r   r(   Ú
__module__Ú__name__Úid)r,   Únames     r%   Ú__repr__zBus.__repr__    sn   € Ø�>‰>œ[Ò(Ø‰DØ�^‰^œzÒ)Ø‰DØ�^‰^œ{Ò*Ø‰Dà%ˆDà$¨¯©×(AÑ(AØ(,¯©×(?Ñ(?Ø(,¬b°«hð(8ñ 8ð 	8r&   )F)r>   r=   Ú__qualname__Ú__doc__r   r   ÚTYPE_SESSIONr   r+   r0   ÚpropertyÚ_connectionr3   Ústaticmethodr6   r8   rA   Ú__str__Ú__classcell__)r(   s   @r%   r   r   .   s†   ø„ ñð Ðà+×8Ñ8À%Øó1ôf!òñ ˜>¨4°ðJóK€Kó
+ñ ˜{Ó+€Kó*ñ ˜jÓ)€Jó+ñ ˜{Ó+€Kò8ð „Gr&   r   c                   ó   — e Zd ZdZdd„Zy)r   zThe system-wide message bus.Nc                 óP   — t         j                  | t         j                  ||¬«      S )aÆ  Return a connection to the system bus.

        :Parameters:
            `private` : bool
                If true, never return an existing shared instance, but instead
                return a private connection.
            `mainloop` : dbus.mainloop.NativeMainLoop
                The main loop to use. The default is to use the default
                main loop if one has been set up, or raise an exception
                if none has been.
        )r   r"   )r   r   ÚTYPE_SYSTEM©r    r"   r   s      r%   r   zSystemBus.__new__´   s'   € ô �{‰{˜3¤§¡¸(Ø#*ð ó ,ð 	,r&   ©FN©r>   r=   rB   rC   r   r/   r&   r%   r   r   ²   s
   „ Ù&ô,r&   r   c                   ó   — e Zd ZdZdd„Zy)r   z(The session (current login) message bus.Nc                 óP   — t         j                  | t         j                  ||¬«      S )aÇ  Return a connection to the session bus.

        :Parameters:
            `private` : bool
                If true, never return an existing shared instance, but instead
                return a private connection.
            `mainloop` : dbus.mainloop.NativeMainLoop
                The main loop to use. The default is to use the default
                main loop if one has been set up, or raise an exception
                if none has been.
        ©r"   r   )r   r   rD   rM   s      r%   r   zSessionBus.__new__Å   ó)   € ô �{‰{˜3¤× 0Ñ 0¸'Ø$,ð ó .ð 	.r&   rN   rO   r/   r&   r%   r   r   Ã   s
   „ Ù2ô.r&   r   c                   ó   — e Zd ZdZdd„Zy)r   zjThe bus that activated this process (only valid if
    this process was launched by DBus activation).
    Nc                 óP   — t         j                  | t         j                  ||¬«      S )aÛ  Return a connection to the bus that activated this process.

        :Parameters:
            `private` : bool
                If true, never return an existing shared instance, but instead
                return a private connection.
            `mainloop` : dbus.mainloop.NativeMainLoop
                The main loop to use. The default is to use the default
                main loop if one has been set up, or raise an exception
                if none has been.
        rR   )r   r   ÚTYPE_STARTERrM   s      r%   r   zStarterBus.__new__Ø   rS   r&   rN   rO   r/   r&   r%   r   r   Ô   s   „ ñô.r&   r   N)rC   Ú
__future__r   Ú__all__Ú__docformat__Údbus.exceptionsr	   Ú_dbus_bindingsr
   r   r   r   r   r   r   r   r   r   r   r   Údbus.busr   Údbus.lowlevelr   Údbus._compatr   r   r   r   r   r/   r&   r%   ú<module>r_      sp   ðÙ ?õ: "à
:€Ø"€å )÷I÷ I÷ Ió Iõ
 #Ý 'Ý ôˆ-ô ôH,�ô ,ô".�ô .ô".�õ .r&   