
    V#gO"                         S r SSKJr  SrSrSSKJ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  SSKJr  SSKJr  SS	KJr   " S
 S\5      r " S S\5      r " S S\5      r " S S\5      rg)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                      ^  \ rS rSrSr0 r\R                  SS4S jrU 4S jr	S r
\" \
SSS5      rSS	 jr\" \5      rSS
 jr\" \5      rSS jr\" \5      rS r\rSrU =r$ )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                 2   U(       d  XR                   ;   a  U R                   U   $ U[        :X  a  [        nO0U[        :X  a  [        nOU[
        :X  a  [        nO[        SU-  5      e[        R                  " XAUS9nXl
        U(       d  XPR                   U'   U$ )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   Bus.__new__9   s    2 H(=(==((22 {"!H# H$!H2X=>>##HJ .1!!(+
    c                    > U R                   nU R                  R                  R                  U5      U L a  U R                  R                  U	 [        [
        U ]  5         g )N)r    	__class__r   getsuperr   close)selftr*   s     r&   r-   	Bus.closel   sH    NN>>++//2d:003c4 r(   c                     U $ )zReturn 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_connectionBus.get_connectionr   s	     r(   zself._connection == self, for backwards
                           compatibility with earlier dbus-python versions
                           where Bus was not a subclass of Connection.c                     [        U S9$ )zStatic method that returns a connection to the session bus.

:Parameters:
    `private` : bool
        If true, do not return a shared connection.
r#   )r   r6   s    r&   get_sessionBus.get_session~        '**r(   c                     [        U S9$ )zStatic method that returns a connection to the system bus.

:Parameters:
    `private` : bool
        If true, do not return a shared connection.
r6   )r   r6   s    r&   
get_systemBus.get_system   s     ))r(   c                     [        U S9$ )zStatic method that returns a connection to the starter bus.

:Parameters:
    `private` : bool
        If true, do not return a shared connection.
r6   )r   r6   s    r&   get_starterBus.get_starter   r9   r(   c                    U R                   [        :X  a  SnO0U R                   [        :X  a  SnOU R                   [        :X  a  SnOSnSU R                  R
                  U R                  R                  U[        U 5      4-  $ )Nsessionsystemstarterzunknown bus typez<%s.%s (%s) at %#x>)r    r   r   r   r*   
__module____name__id)r.   names     r&   __repr__Bus.__repr__   sn    >>[(D^^z)D^^{*D%D$(A(A(,(?(?(,bh(8 8 	8r(   r2   )F)rE   rD   __qualname____firstlineno____doc__r   r   TYPE_SESSIONr   r-   r3   property_connectionr7   staticmethodr;   r>   rH   __str____static_attributes____classcell__)r*   s   @r&   r   r   .   s     +88%1f! >4JKK
+ {+K* j)J+ {+K8 Gr(   r   c                   "    \ rS rSrSrSS jrSrg)r      zThe system-wide message bus.Nc                 J    [         R                  U [         R                  UUS9$ )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   SystemBus.__new__   s'     {{3(#*  , 	,r(   r2   FNrE   rD   rJ   rK   rL   r   rR   r2   r(   r&   r   r      s
    &,r(   r   c                   "    \ rS rSrSrSS jrSrg)r      z(The session (current login) message bus.Nc                 J    [         R                  U [         R                  UUS9$ )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   rM   rX   s      r&   r   SessionBus.__new__   )     {{3 0 0'$,  . 	.r(   r2   rZ   r[   r2   r(   r&   r   r      s
    2.r(   r   c                   "    \ rS rSrSrSS jrSrg)r      zbThe bus that activated this process (only valid if
this process was launched by DBus activation).
Nc                 J    [         R                  U [         R                  UUS9$ )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.
r_   )r   r   TYPE_STARTERrX   s      r&   r   StarterBus.__new__   ra   r(   r2   rZ   r[   r2   r(   r&   r   r      s    .r(   r   N)rL   
__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   r2   r(   r&   <module>ro      sp    ?: "
:" )I I I I
 # ' - H, ,". .". .r(   