dasbus.connection module
- class AddressedMessageBus(address, *args, **kwargs)[source]
Bases:
MessageBus
Representation of a connection for the specified address.
- property address
The bus address.
- class GLibConnection[source]
Bases:
object
The low-level DBus connection library based on GLib.
- DEFAULT_FLAGS = <flags G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT | G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION of type Gio.DBusConnectionFlags>
- class MessageBus(error_mapper=None, provider=<class 'dasbus.connection.GLibConnection'>)[source]
Bases:
AbstractMessageBus
Representation of a message bus based on D-Bus.
- property connection
The DBus connection.
- get_proxy(service_name, object_path, interface_name=None, proxy_factory=None, **proxy_arguments)[source]
Returns a proxy of a remote DBus object.
If the proxy factory is not specified, we will use a default one. If the interface name is set, we will choose InterfaceProxy, otherwise ObjectProxy.
If the interface name is set, we will add it to the additional arguments for the proxy factory.
- Parameters
service_name – a DBus name of a service
object_path – a DBus path of an object
interface_name – a DBus name of an interface or None
proxy_factory – a factory of a DBus object proxy
proxy_arguments – additional arguments for the proxy factory
- Returns
a proxy object
- property proxy
The proxy of DBus.
- publish_object(object_path, obj, server_factory=<class 'dasbus.server.handler.ServerObjectHandler'>, **server_arguments)[source]
Publish an object on DBus.
- Parameters
object_path – a DBus path of an object
obj – an instance of @dbus_interface or @dbus_class
server_factory – a factory of a DBus server object handler
server_arguments – additional arguments for the server factory
- class SessionMessageBus(error_mapper=None, provider=<class 'dasbus.connection.GLibConnection'>)[source]
Bases:
MessageBus
Representation of a session bus connection.
- class SystemMessageBus(error_mapper=None, provider=<class 'dasbus.connection.GLibConnection'>)[source]
Bases:
MessageBus
Representation of a system bus connection.