:right-sidebar: True DBusObjectManagerServer =================================================================== .. currentmodule:: gi.repository.Gio .. versionadded:: 2.30 .. class:: DBusObjectManagerServer(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gio.DBusObjectManager` ``GDBusObjectManagerServer`` is used to export :obj:`~gi.repository.Gio.DBusObject` instances using the standardized ```org.freedesktop.DBus.ObjectManager`` `__ interface. For example, remote D-Bus clients can get all objects and properties in a single call. Additionally, any change in the object hierarchy is broadcast using signals. This means that D-Bus clients can keep caches up to date by only listening to D-Bus signals. The recommended path to export an object manager at is the path form of the well-known name of a D-Bus service, or below. For example, if a D-Bus service is available at the well-known name ``net.example.ExampleService1``\, the object manager should typically be exported at ``/net/example/ExampleService1``\, or below (to allow for multiple object managers in a service). It is supported, but not recommended, to export an object manager at the root path, ``/``\. See :obj:`~gi.repository.Gio.DBusObjectManagerClient` for the client-side code that is intended to be used with ``GDBusObjectManagerServer`` or any D-Bus object implementing the ``org.freedesktop.DBus.ObjectManager`` interface. Constructors ------------ .. rst-class:: interim-class .. class:: DBusObjectManagerServer :no-index: .. classmethod:: new(object_path: str) -> ~gi.repository.Gio.DBusObjectManagerServer Creates a new :obj:`~gi.repository.Gio.DBusObjectManagerServer` object. The returned server isn't yet exported on any connection. To do so, use :func:`~gi.repository.Gio.DBusObjectManagerServer.set_connection`. Normally you want to export all of your objects before doing so to avoid `InterfacesAdded `__ signals being emitted. .. versionadded:: 2.30 :param object_path: The object path to export the manager object at. Methods ------- .. rst-class:: interim-class .. class:: DBusObjectManagerServer :no-index: .. method:: export(object: ~gi.repository.Gio.DBusObjectSkeleton) -> None Exports ``object`` on ``manager``\. If there is already a :obj:`~gi.repository.Gio.DBusObject` exported at the object path, then the old object is removed. The object path for ``object`` must be in the hierarchy rooted by the object path for ``manager``\. Note that ``manager`` will take a reference on ``object`` for as long as it is exported. .. versionadded:: 2.30 :param object: A :obj:`~gi.repository.Gio.DBusObjectSkeleton`\. .. method:: export_uniquely(object: ~gi.repository.Gio.DBusObjectSkeleton) -> None Like :func:`~gi.repository.Gio.DBusObjectManagerServer.export` but appends a string of the form _N (with N being a natural number) to ``object``\'s object path if an object with the given path already exists. As such, the :obj:`~gi.repository.Gio.DBusObjectProxy`\:g-object-path property of ``object`` may be modified. .. versionadded:: 2.30 :param object: An object. .. method:: get_connection() -> ~gi.repository.Gio.DBusConnection | None Gets the :obj:`~gi.repository.Gio.DBusConnection` used by ``manager``\. .. versionadded:: 2.30 .. method:: is_exported(object: ~gi.repository.Gio.DBusObjectSkeleton) -> bool Returns whether ``object`` is currently exported on ``manager``\. .. versionadded:: 2.34 :param object: An object. .. method:: set_connection(connection: ~gi.repository.Gio.DBusConnection | None = None) -> None Exports all objects managed by ``manager`` on ``connection``\. If ``connection`` is :const:`None`, stops exporting objects. :param connection: A :obj:`~gi.repository.Gio.DBusConnection` or :const:`None`. .. method:: unexport(object_path: str) -> bool If ``manager`` has an object at ``path``\, removes the object. Otherwise does nothing. Note that ``object_path`` must be in the hierarchy rooted by the object path for ``manager``\. .. versionadded:: 2.30 :param object_path: An object path. Properties ---------- .. rst-class:: interim-class .. class:: DBusObjectManagerServer :no-index: .. attribute:: props.connection :type: ~gi.repository.Gio.DBusConnection The type of the None singleton. .. versionadded:: 2.30 .. attribute:: props.object_path :type: str The type of the None singleton. .. versionadded:: 2.30 Fields ------ .. rst-class:: interim-class .. class:: DBusObjectManagerServer :no-index: .. attribute:: parent_instance .. attribute:: priv