Package dbus :: Module _dbus :: Class Bus
[hide private]
[frames] | no frames]

Class Bus

source code

               object --+            
                        |            
_dbus_bindings.Connection --+        
                            |        
        connection.Connection --+    
                                |    
                bus.BusConnection --+
                                    |
                                   Bus
Known Subclasses:
SessionBus, StarterBus, SystemBus

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.



Nested Classes [hide private]

Inherited from connection.Connection: ProxyObjectClass

Instance Methods [hide private]
 
close(self)
Close the connection.
source code
 
get_connection(self)
Return self, for backwards compatibility with earlier dbus-python versions where Bus was not a subclass of Connection.
source code
 
__repr__(self)
str(x)
source code
 
__str__(self)
str(x)
source code

Inherited from bus.BusConnection: activate_name_owner, add_match_string, add_match_string_non_blocking, add_signal_receiver, get_name_owner, get_object, get_unix_user, list_activatable_names, list_names, name_has_owner, release_name, remove_match_string, remove_match_string_non_blocking, request_name, start_service_by_name, watch_name_owner

Inherited from bus.BusConnection (private): _clean_up_signal_match

Inherited from connection.Connection: __init__, call_async, call_blocking, call_on_disconnection, remove_signal_receiver

Inherited from _dbus_bindings.Connection: add_message_filter, flush, get_is_authenticated, get_is_connected, get_peer_unix_process_id, get_peer_unix_user, get_unique_name, get_unix_fd, list_exported_child_objects, remove_message_filter, send_message, send_message_with_reply, send_message_with_reply_and_block, set_exit_on_disconnect, set_unique_name

Inherited from _dbus_bindings.Connection (private): _new_for_bus, _register_object_path, _require_main_loop, _unregister_object_path

Inherited from object: __delattr__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __setattr__

Static Methods [hide private]
 
__new__(cls, bus_type=0, private=False, mainloop=None)
Constructor, returning an existing instance where appropriate.
source code
 
get_session(private=False)
Static method that returns a connection to the session bus.
source code
 
get_system(private=False)
Static method that returns a connection to the system bus.
source code
 
get_starter(private=False)
Static method that returns a connection to the starter bus.
source code
Class Variables [hide private]
  _shared_instances = {}

Inherited from bus.BusConnection: START_REPLY_ALREADY_RUNNING, START_REPLY_SUCCESS, TYPE_SESSION, TYPE_STARTER, TYPE_SYSTEM

Instance Variables [hide private]
Properties [hide private]
  _connection
self._connection == self, for backwards compatibility with earlier dbus-python versions where Bus was not a subclass of Connection.

Inherited from object: __class__

Method Details [hide private]

__new__(cls, bus_type=0, private=False, mainloop=None)
Static Method

source code 

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.
  • 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.
Overrides: bus.BusConnection.__new__

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

Change Log: in dbus-python 0.80: converted from a wrapper around a Connection to a Connection subclass.

close(self)

source code 
Close the connection.
Overrides: _dbus_bindings.Connection.close
(inherited documentation)

get_connection(self)

source code 
Return self, for backwards compatibility with earlier dbus-python versions where Bus was not a subclass of Connection.

Deprecated: since 0.80.0

get_session(private=False)
Static Method

source code 
Static method that returns a connection to the session bus.
Parameters:
  • private (bool) - If true, do not return a shared connection.

get_system(private=False)
Static Method

source code 
Static method that returns a connection to the system bus.
Parameters:
  • private (bool) - If true, do not return a shared connection.

get_starter(private=False)
Static Method

source code 
Static method that returns a connection to the starter bus.
Parameters:
  • private (bool) - If true, do not return a shared connection.

__repr__(self)
(Representation operator)

source code 
str(x)
Overrides: object.__repr__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 
str(x)
Overrides: object.__str__
(inherited documentation)

Property Details [hide private]

_connection

self._connection == self, for backwards compatibility with earlier dbus-python versions where Bus was not a subclass of Connection.
Get Method:
dbus._dbus.Bus.get_connection(self) - Return self, for backwards compatibility with earlier dbus-python versions where Bus was not a subclass of Connection.