DBusInterfaceSkeleton#
Added in version 2.30.
Superclasses: Object
Implemented Interfaces: DBusInterface
Abstract base class for D-Bus interfaces on the service side.
Methods#
- class DBusInterfaceSkeleton
-
- do_g_authorize_method(self, invocation: DBusMethodInvocation) bool#
- Parameters:
invocation
- do_get_info(self) DBusInterfaceInfo#
- do_get_vtable(self) DBusInterfaceVTable#
- export(connection: DBusConnection, object_path: str) bool#
Exports
interface_atobject_pathonconnection.This can be called multiple times to export the same
interface_onto multiple connections however theobject_pathprovided must be the same for all connections.Use
unexport()to unexport the object.Added in version 2.30.
- Parameters:
connection – A
DBusConnectionto exportinterface_on.object_path – The path to export the interface at.
- flush() None#
If
interface_has outstanding changes, request for these changes to be emitted immediately.For example, an exported D-Bus interface may queue up property changes and emit the
org.freedesktop.DBus.Properties.PropertiesChangedsignal later (e.g. in an idle handler). This technique is useful for collapsing multiple property changes into one.Added in version 2.30.
- get_connection() DBusConnection | None#
Gets the first connection that
interface_is exported on, if any.Added in version 2.30.
- get_connections() list[DBusConnection]#
Gets a list of the connections that
interface_is exported on.Added in version 2.32.
- get_flags() DBusInterfaceSkeletonFlags#
Gets the
DBusInterfaceSkeletonFlagsthat describes what the behavior ofinterface_Added in version 2.30.
- get_info() DBusInterfaceInfo#
Gets D-Bus introspection information for the D-Bus interface implemented by
interface_.Added in version 2.30.
- get_object_path() str | None#
Gets the object path that
interface_is exported on, if any.Added in version 2.30.
- get_vtable() DBusInterfaceVTable#
Gets the interface vtable for the D-Bus interface implemented by
interface_. The returned function pointers should expectinterface_itself to be passed asuser_data.Added in version 2.30.
- has_connection(connection: DBusConnection) bool#
Checks if
interface_is exported onconnection.Added in version 2.32.
- Parameters:
connection – A
DBusConnection.
- set_flags(flags: DBusInterfaceSkeletonFlags) None#
Sets flags describing what the behavior of
skeletonshould be.Added in version 2.30.
- Parameters:
flags – Flags from the
DBusInterfaceSkeletonFlagsenumeration.
- unexport() None#
Stops exporting
interface_on all connections it is exported on.To unexport
interface_from only a single connection, useunexport_from_connection()Added in version 2.30.
- unexport_from_connection(connection: DBusConnection) None#
Stops exporting
interface_onconnection.To stop exporting on all connections the interface is exported on, use
unexport().Added in version 2.32.
- Parameters:
connection – A
DBusConnection.
Properties#
- class DBusInterfaceSkeleton
- props.g_flags: DBusInterfaceSkeletonFlags#
Flags from the
DBusInterfaceSkeletonFlagsenumeration.Added in version 2.30.
Signals#
- class DBusInterfaceSkeleton.signals
- g_authorize_method(invocation: DBusMethodInvocation) bool#
Emitted when a method is invoked by a remote caller and used to determine if the method call is authorized.
Note that this signal is emitted in a thread dedicated to handling the method call so handlers are allowed to perform blocking IO. This means that it is appropriate to call e.g. polkit_authority_check_authorization_sync() with the POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION flag set.
If
Falseis returned then no further handlers are run and the signal handler must take a reference toinvocationand finish handling the call (e.g. return an error viareturn_error()).Otherwise, if
Trueis returned, signal emission continues. If no handlers returnFalse, then the method is dispatched. Ifinterfacehas an enclosingDBusObjectSkeleton, then theDBusObjectSkeleton::authorize-method signal handlers run before the handlers for this signal.The default class handler just returns
True.Please note that the common case is optimized: if no signals handlers are connected and the default class handler isn’t overridden (for both
interfaceand the enclosingDBusObjectSkeleton, if any) andDBusInterfaceSkeleton:g-flags does not have theHANDLE_METHOD_INVOCATIONS_IN_THREADflags set, no dedicated thread is ever used and the call will be handled in the same thread as the object thatinterfacebelongs to was exported in.Added in version 2.30.
- Parameters:
invocation – A
DBusMethodInvocation.
Virtual Methods#
- class DBusInterfaceSkeleton
- do_flush() None#
If
interface_has outstanding changes, request for these changes to be emitted immediately.For example, an exported D-Bus interface may queue up property changes and emit the
org.freedesktop.DBus.Properties.PropertiesChangedsignal later (e.g. in an idle handler). This technique is useful for collapsing multiple property changes into one.Added in version 2.30.
- do_g_authorize_method(invocation: DBusMethodInvocation) bool#
Signal class handler for the
DBusInterfaceSkeleton::g-authorize-method signal.- Parameters:
invocation
- do_get_info() DBusInterfaceInfo#
Gets D-Bus introspection information for the D-Bus interface implemented by
interface_.Added in version 2.30.
- do_get_vtable() DBusInterfaceVTable#
Gets the interface vtable for the D-Bus interface implemented by
interface_. The returned function pointers should expectinterface_itself to be passed asuser_data.Added in version 2.30.