API Documentation¶
Base¶
-
class
dbus_objects.
DBusObject
(name=None, default_interface_root=None)¶ Bases:
object
This class represents a DBus object. It should be subclassed and to export DBus methods, you must define typed functions with the
dbus_objects.dbus_object()
decorator.-
get_dbus_methods
()¶ Generator that provides the DBus methods
-
get_dbus_properties
()¶ Generator that provides the DBus properties
-
get_dbus_signals
()¶ Generator that provides the DBus signals
-
register_server
(server, path)¶
-
-
dbus_objects.
custom_dbus_signal
(*types, interface=None, name=None)¶ This method returns a custom DBus signal constructor
- Return type
Callable
[…,_DBusSignal
]
-
dbus_objects.
dbus_method
(interface=None, name=None, return_names=None, multiple_returns=False)¶ This decorator exports a function as a DBus method
The function must have type annotations, they will be used to resolve the method signature.
The function name will be used as the DBus method name unless otherwise specified in the arguments.
-
dbus_objects.
dbus_property
(interface=None, name=None, return_names=None, multiple_returns=False)¶ This decorator exports a method as a DBus property
Works just like
dbus_method()
andproperty()
-
dbus_objects.
dbus_signal
(*types, **named_types)¶ This method returns a DBus signal
- Return type
_DBusSignal
Signature¶
Types¶
Custom Python types
-
dbus_objects.types.
Byte
¶ DBus byte
alias of int[int]
-
dbus_objects.types.
Int16
¶ DBus int16
alias of int[int]
-
dbus_objects.types.
Int32
¶ DBus int32
alias of int[int]
-
dbus_objects.types.
Int64
¶ DBus int64
alias of int[int]
-
dbus_objects.types.
MultipleReturn
¶ Multiple return type. Used when you want to return multiple variables in a DBus method
alias of Tuple
-
dbus_objects.types.
Signature
¶ DBus signature
alias of str[str]
-
dbus_objects.types.
UInt16
¶ DBus uint16
alias of int[int]
-
dbus_objects.types.
UInt32
¶ DBus uint32
alias of int[int]
-
dbus_objects.types.
UInt64
¶ DBus uint64
alias of int[int]
-
dbus_objects.types.
Variant
¶ DBus variant
alias of Tuple[str, Any][Tuple[str, Any]]
Integration¶
-
class
dbus_objects.integration.
DBusServerBase
(bus, name)¶ Bases:
object
-
get_method
(path, interface, method)¶ Fetches the method for given path, interface and method name
-
get_property
(path, interface, method)¶ Fetches the property for given path, interface and property name
-
register_object
(path, obj)¶ Registers the object into the server
- Parameters
path (
str
) – object pathobj (
DBusObject
) – object
- Return type
-
Jeepney¶
-
class
dbus_objects.integration.jeepney.
BlockingDBusServer
(bus, name)¶ Bases:
dbus_objects.integration.jeepney._JeepneyServerBase
This class represents a DBus server. It should be instanciated.
-
class
dbus_objects.integration.jeepney.
TrioDBusServer
(bus, name)¶ Bases:
dbus_objects.integration.jeepney._JeepneyServerBase
This class represents a DBus server. It should be instanciated.
-
async
listen
()¶ Start listening and handling messages
- Parameters
delay – loop delay
- Return type
-
async classmethod
new
(bus, name)¶ - Return type
-
async