BaseProxyObject

class dbus_next.proxy_object.BaseProxyObject(bus_name: str, path: str, introspection: Union[dbus_next.introspection.Node, str, xml.etree.ElementTree.Element], bus: dbus_next.message_bus.BaseMessageBus, ProxyInterface: Type[dbus_next.proxy_object.BaseProxyInterface])

An abstract class representing a proxy to an object exported on the bus by another client.

Implementations of this class are not meant to be constructed directly. Use BaseMessageBus.get_proxy_object() to get a proxy object. Each message bus implementation provides its own proxy object implementation that will be returned by that method.

The primary use of the proxy object is to select a proxy interface to act on. Information on what interfaces are available is provided by introspection data provided to this class. This introspection data can either be included in your project as an XML file (recommended) or retrieved from the org.freedesktop.DBus.Introspectable interface at runtime.

Variables
  • bus_name (str) – The name of the bus this object is exported on.

  • path (str) – The object path exported on the client that owns the bus name.

  • introspection (Node) – Parsed introspection data for the proxy object.

  • bus (BaseMessageBus) – The message bus this proxy object is connected to.

  • ProxyInterface (Type[BaseProxyInterface]) – The proxy interface class this proxy object uses.

  • child_paths (list(str)) – A list of absolute object paths of the children of this object.

Raises
get_children()List[dbus_next.proxy_object.BaseProxyObject]

Get the child nodes of this proxy object according to the introspection data.

get_interface(name: str)dbus_next.proxy_object.BaseProxyInterface

Get an interface exported on this proxy object and connect it to the bus.

Parameters

name (str) – The name of the interface to retrieve.

Raises