platypush.plugins.dbus

class platypush.plugins.dbus.BusType(value)[source]

An enumeration.

class platypush.plugins.dbus.DbusPlugin(**kwargs)[source]

Plugin to interact with DBus.

Requires:

  • dbus-python (pip install dbus-python)

__init__(**kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

execute(service: str, path: str, method_name: str, args: Optional[list] = None, interface: Optional[str] = None, bus_type: str = 'session')[source]

Execute a method exposed on DBus.

Parameters
  • service – Service/bus name (e.g. org.platypush.Bus).

  • path – Object path (e.g. /MessageService).

  • method_name – Method name (e.g. Post).

  • args – Arguments to be passed to the method, depending on the method signature.

  • interface – Interface name (e.g. org.platypush.MessageBusInterface).

  • bus_type – Bus type (supported: system and session - default: session).

Returns

Return value of the executed method.

query(service: Optional[str] = None, system_bus: bool = True, session_bus: bool = True)Dict[str, dict][source]

Query DBus for a specific service or for the full list of services.

Parameters
  • service – Service name (default: None, query all services).

  • system_bus – Query the system bus (default: True).

  • session_bus – Query the session bus (default: True).

Returns

A {service_name -> {properties}} mapping.