@iaO"dZddlmZdZdZddlmZddlmZm Z m Z m Z m Z m Z mZmZmZmZmZmZddlmZddlmZdd lmZGd d eZGd d eZGddeZGddeZy)z9Implementation for dbus.Bus. Not to be imported directly.) generators)Bus SystemBus SessionBus StarterBusreStructuredText) DBusException) BUS_DAEMON_IFACEBUS_DAEMON_NAMEBUS_DAEMON_PATH BUS_SESSION BUS_STARTER BUS_SYSTEM DBUS_START_REPLY_ALREADY_RUNNINGDBUS_START_REPLY_SUCCESSvalidate_bus_namevalidate_interface_namevalidate_member_namevalidate_object_path) BusConnection) SignalMessage)is_py2ceZdZdZiZej ddfdZfdZdZ e e dddZ d dZ e e Z d d Ze eZd d Ze eZd ZeZxZS) ra 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||jvr|j|S|tk(rt}n.|tk(rt}n|t k(rt }ntd|ztj|||}||_ |s||j|<|S)aConstructor, 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. zinvalid bus_type %s)mainloop) _shared_instancesr rrrrr ValueErrorr__new__ _bus_type)clsbus_typeprivatersubclassbuss ,/usr/lib/python3/dist-packages/dbus/_dbus.pyrz Bus.__new__9s2H(=(==((2 2 { "!H  # H  $!H2X=> >##HhJ  .1C ! !( + c|j}|jjj||ur|jj|=tt |y)N)r __class__rgetsuperrclose)selftr(s r%r+z Bus.closelsH NN >> + + / / 2d :003 c4 r&c|S)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_connectionzBus.get_connectionrs  r&zself._connection == self, for backwards compatibility with earlier dbus-python versions where Bus was not a subclass of Connection.ct|S)zStatic method that returns a connection to the session bus. :Parameters: `private` : bool If true, do not return a shared connection. r")rr2s r% get_sessionzBus.get_session~'**r&ct|S)zStatic method that returns a connection to the system bus. :Parameters: `private` : bool If true, do not return a shared connection. r2)rr2s r% get_systemzBus.get_systems))r&ct|S)zStatic method that returns a connection to the starter bus. :Parameters: `private` : bool If true, do not return a shared connection. r2)rr2s r% get_starterzBus.get_starterr4r&c|jtk(rd}n.|jtk(rd}n|jtk(rd}nd}d|jj |jj |t|fzS)Nsessionsystemstarterzunknown bus typez<%s.%s (%s) at %#x>)rr rrr( __module____name__id)r,names r%__repr__z Bus.__repr__sn >>[ (D ^^z )D ^^{ *D%D$(A(A(,(?(?(,bh(88 8r&)F)r>r= __qualname____doc__rr TYPE_SESSIONrr+r0property _connectionr3 staticmethodr6r8rA__str__ __classcell__)r(s@r%rr.s+88%1f! >4JKK +{+K*j)J+{+K 8Gr&rceZdZdZddZy)rzThe system-wide message bus.NcPtj|tj||S)aReturn 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. )rr")rr TYPE_SYSTEMr r"rs r%rzSystemBus.__new__s'{{3(#*, ,r&FNr>r=rBrCrr/r&r%rrs & ,r&rceZdZdZddZy)rz(The session (current login) message bus.NcPtj|tj||S)aReturn 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)rrrDrMs r%rzSessionBus.__new__){{3 0 0'$,. .r&rNrOr/r&r%rrs 2 .r&rceZdZdZddZy)rzjThe bus that activated this process (only valid if this process was launched by DBus activation). NcPtj|tj||S)aReturn 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)rr TYPE_STARTERrMs r%rzStarterBus.__new__rSr&rNrOr/r&r%rrs  .r&rN)rC __future__r__all__ __docformat__dbus.exceptionsr _dbus_bindingsr r r r rrrrrrrrdbus.busr dbus.lowlevelr dbus._compatrrrrrr/r&r%r_sp?:" :" )IIII #'-H,,".."..r&