Gio.DBusObjectManagerServer¶
| Subclasses: | None |
|---|
Methods¶
| Inherited: | GObject.Object (37), Gio.DBusObjectManager (4) |
|---|---|
| Structs: | GObject.ObjectClass (5) |
| class | new (object_path) |
export (object) |
|
export_uniquely (object) |
|
get_connection () |
|
is_exported (object) |
|
set_connection (connection) |
|
unexport (object_path) |
Virtual Methods¶
| Inherited: | GObject.Object (7), Gio.DBusObjectManager (8) |
|---|
Properties¶
| Name | Type | Flags | Short Description |
|---|---|---|---|
connection |
Gio.DBusConnection |
r/w | The connection to export objects on |
object-path |
str |
r/w/co | The object path to register the manager object at |
Signals¶
| Inherited: | GObject.Object (1), Gio.DBusObjectManager (4) |
|---|
Fields¶
| Inherited: | GObject.Object (1), Gio.DBusObjectManager (4) |
|---|
| Name | Type | Access | Description |
|---|---|---|---|
| parent_instance | GObject.Object |
r |
Class Details¶
-
class
Gio.DBusObjectManagerServer(**kwargs)¶ Bases: GObject.Object,Gio.DBusObjectManagerAbstract: No Structure: Gio.DBusObjectManagerServerClassGio.DBusObjectManagerServeris used to exportGio.DBusObjectinstances 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
Gio.DBusObjectManagerClientfor the client-side code that is intended to be used withGio.DBusObjectManagerServeror any D-Bus object implementing the org.freedesktop.DBus.ObjectManager interface.New in version 2.30.
-
classmethod
new(object_path)[source]¶ Parameters: object_path ( str) – The object path to export the manager object at.Returns: A Gio.DBusObjectManagerServerobject. Free withGObject.Object.unref().Return type: Gio.DBusObjectManagerServerCreates a new
Gio.DBusObjectManagerServerobject.The returned server isn’t yet exported on any connection. To do so, use
Gio.DBusObjectManagerServer.set_connection(). Normally you want to export all of your objects before doing so to avoid InterfacesAdded signals being emitted.New in version 2.30.
-
export(object)[source]¶ Parameters: object ( Gio.DBusObjectSkeleton) – AGio.DBusObjectSkeleton.Exports object on self.
If there is already a
Gio.DBusObjectexported 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 self.
Note that self will take a reference on object for as long as it is exported.
New in version 2.30.
-
export_uniquely(object)[source]¶ Parameters: object ( Gio.DBusObjectSkeleton) – An object.Like
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, theGio.DBusObjectProxy:g-object-pathproperty of object may be modified.New in version 2.30.
-
get_connection()[source]¶ Returns: A Gio.DBusConnectionobject orNoneif self isn’t exported on a connection. The returned object should be freed withGObject.Object.unref().Return type: Gio.DBusConnectionGets the
Gio.DBusConnectionused by self.New in version 2.30.
-
is_exported(object)[source]¶ Parameters: object ( Gio.DBusObjectSkeleton) – An object.Returns: Trueif object is exportedReturn type: boolReturns whether object is currently exported on self.
New in version 2.34.
-
set_connection(connection)[source]¶ Parameters: connection ( Gio.DBusConnectionorNone) – AGio.DBusConnectionorNone.Exports all objects managed by self on connection. If connection is
None, stops exporting objects.
-
unexport(object_path)[source]¶ Parameters: object_path ( str) – An object path.Returns: Trueif object at object_path was removed,Falseotherwise.Return type: boolIf self 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 self.
New in version 2.30.
-
classmethod
Property Details¶
-
Gio.DBusObjectManagerServer.props.connection¶ Name: connectionType: Gio.DBusConnectionDefault Value: NoneFlags: READABLE,WRITABLEThe
Gio.DBusConnectionto export objects on.New in version 2.30.