Gio.DBusObjectManagerClient¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | GObject.Object (37), Gio.AsyncInitable (4), Gio.DBusObjectManager (4), Gio.Initable (2) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | new(connection, flags, name, object_path, get_proxy_type_func, get_proxy_type_user_data, cancellable, callback, *user_data) | 
| class | new_finish(res) | 
| class | new_for_bus(bus_type, flags, name, object_path, get_proxy_type_func, get_proxy_type_user_data, cancellable, callback, *user_data) | 
| class | new_for_bus_finish(res) | 
| class | new_for_bus_sync(bus_type, flags, name, object_path, get_proxy_type_func, get_proxy_type_user_data, cancellable) | 
| class | new_sync(connection, flags, name, object_path, get_proxy_type_func, get_proxy_type_user_data, cancellable) | 
| get_connection() | |
| get_flags() | |
| get_name() | |
| get_name_owner() | 
Virtual Methods¶
| Inherited: | GObject.Object (7), Gio.AsyncInitable (2), Gio.DBusObjectManager (8), Gio.Initable (1) | 
|---|
| do_interface_proxy_properties_changed(object_proxy, interface_proxy, changed_properties, invalidated_properties) | |
| do_interface_proxy_signal(object_proxy, interface_proxy, sender_name, signal_name, parameters) | 
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| bus-type | Gio.BusType | w/co | The bus to connect to, if any | 
| connection | Gio.DBusConnection | r/w/co | The connection to use | 
| flags | Gio.DBusObjectManagerClientFlags | r/w/co | Flags for the proxy manager | 
| get-proxy-type-destroy-notify | int | r/w/co | The Gio.DBusProxyTypeFuncuser data free function | 
| get-proxy-type-func | int | r/w/co | The Gio.DBusProxyTypeFuncpointer to use | 
| get-proxy-type-user-data | int | r/w/co | The Gio.DBusProxyTypeFuncuser_data | 
| name | str | r/w/co | Name that the manager is for | 
| name-owner | str | r | The owner of the name we are watching | 
| object-path | str | r/w/co | The object path of the control object | 
Signals¶
| Inherited: | GObject.Object (1), Gio.DBusObjectManager (4) | 
|---|
| Name | Short Description | 
|---|---|
| interface-proxy-properties-changed | Emitted when one or more D-Bus properties on proxy changes. | 
| interface-proxy-signal | Emitted when a D-Bus signal is received on interface_proxy. | 
Fields¶
| Inherited: | GObject.Object (1), Gio.DBusObjectManager (4) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| parent_instance | GObject.Object | r | 
Class Details¶
- 
class Gio.DBusObjectManagerClient(**kwargs)¶
- Bases: - GObject.Object,- Gio.AsyncInitable,- Gio.DBusObjectManager,- Gio.Initable- Abstract: - No - Structure: - Gio.DBusObjectManagerClientClass- Gio.DBusObjectManagerClientis used to create, monitor and delete object proxies for remote objects exported by a- Gio.DBusObjectManagerServer(or any code implementing the org.freedesktop.DBus.ObjectManager interface).- Once an instance of this type has been created, you can connect to the - Gio.DBusObjectManager- ::object-addedand- Gio.DBusObjectManager- ::object-removedsignals and inspect the- Gio.DBusObjectProxyobjects returned by- Gio.DBusObjectManager.get_objects().- If the name for a - Gio.DBusObjectManagerClientis not owned by anyone at object construction time, the default behavior is to request the message bus to launch an owner for the name. This behavior can be disabled using the- Gio.DBusObjectManagerClientFlags.DO_NOT_AUTO_STARTflag. It’s also worth noting that this only works if the name of interest is activatable in the first place. E.g. in some cases it is not possible to launch an owner for the requested name. In this case,- Gio.DBusObjectManagerClientobject construction still succeeds but there will be no object proxies (e.g.- Gio.DBusObjectManager.get_objects() returns the empty list) and the- Gio.DBusObjectManagerClient- :name-ownerproperty is- None.- The owner of the requested name can come and go (for example consider a system service being restarted) – - Gio.DBusObjectManagerClienthandles this case too; simply connect to the- GObject.Object- ::notifysignal to watch for changes on the- Gio.DBusObjectManagerClient- :name-ownerproperty. When the name owner vanishes, the behavior is that- Gio.DBusObjectManagerClient- :name-owneris set to- None(this includes emission of the- GObject.Object- ::notifysignal) and then- Gio.DBusObjectManager- ::object-removedsignals are synthesized for all currently existing object proxies. Since- Gio.DBusObjectManagerClient- :name-owneris- Nonewhen this happens, you can use this information to disambiguate a synthesized signal from a genuine signal caused by object removal on the remote- Gio.DBusObjectManager. Similarly, when a new name owner appears,- Gio.DBusObjectManager- ::object-addedsignals are synthesized while- Gio.DBusObjectManagerClient- :name-owneris still- None. Only when all object proxies have been added, the- Gio.DBusObjectManagerClient- :name-owneris set to the new name owner (this includes emission of the- GObject.Object- ::notifysignal). Furthermore, you are guaranteed that- Gio.DBusObjectManagerClient- :name-ownerwill alternate between a name owner (e.g.- :1.42) and- Noneeven in the case where the name of interest is atomically replaced- Ultimately, - Gio.DBusObjectManagerClientis used to obtain- Gio.DBusProxyinstances. All signals (including the org.freedesktop.DBus.Properties::PropertiesChanged signal) delivered to- Gio.DBusProxyinstances are guaranteed to originate from the name owner. This guarantee along with the behavior described above, means that certain race conditions including the “half the proxy is from the old owner and the other half is from the new owner” problem cannot happen.- To avoid having the application connect to signals on the returned - Gio.DBusObjectProxyand- Gio.DBusProxyobjects, the- Gio.DBusObject- ::interface-added,- Gio.DBusObject- ::interface-removed,- Gio.DBusProxy- ::g-properties-changedand- Gio.DBusProxy- ::g-signalsignals are also emitted on the- Gio.DBusObjectManagerClientinstance managing these objects. The signals emitted are- Gio.DBusObjectManager- ::interface-added,- Gio.DBusObjectManager- ::interface-removed,- Gio.DBusObjectManagerClient- ::interface-proxy-properties-changedand- Gio.DBusObjectManagerClient- ::interface-proxy-signal.- Note that all callbacks and signals are emitted in the - thread-default main contextthat the- Gio.DBusObjectManagerClientobject was constructed in. Additionally, the- Gio.DBusObjectProxyand- Gio.DBusProxyobjects originating from the- Gio.DBusObjectManagerClientobject will be created in the same context and, consequently, will deliver signals in the same main loop.- New in version 2.30. - 
classmethod new(connection, flags, name, object_path, get_proxy_type_func, get_proxy_type_user_data, cancellable, callback, *user_data)[source]¶
- Parameters: - connection (Gio.DBusConnection) – AGio.DBusConnection.
- flags (Gio.DBusObjectManagerClientFlags) – Zero or more flags from theGio.DBusObjectManagerClientFlagsenumeration.
- name (str) – The owner of the control object (unique or well-known name).
- object_path (str) – The object path of the control object.
- get_proxy_type_func (Gio.DBusProxyTypeFuncorNone) – AGio.DBusProxyTypeFuncfunction orNoneto always constructGio.DBusProxyproxies.
- get_proxy_type_user_data (objectorNone) – User data to pass to get_proxy_type_func.
- cancellable (Gio.CancellableorNone) – AGio.CancellableorNone
- callback (Gio.AsyncReadyCallbackorNone) – AGio.AsyncReadyCallbackto call when the request is satisfied.
- user_data (objectorNone) – The data to pass to callback.
 - Asynchronously creates a new - Gio.DBusObjectManagerClientobject.- This is an asynchronous failable constructor. When the result is ready, callback will be invoked in the - thread-default main contextof the thread you are calling this method from. You can then call- Gio.DBusObjectManagerClient.new_finish() to get the result. See- Gio.DBusObjectManagerClient.new_sync() for the synchronous version.- New in version 2.30. 
- connection (
 - 
classmethod new_finish(res)[source]¶
- Parameters: - res ( - Gio.AsyncResult) – A- Gio.AsyncResultobtained from the- Gio.AsyncReadyCallbackpassed to- Gio.DBusObjectManagerClient.new().- Raises: - GLib.Error- Returns: - A - Gio.DBusObjectManagerClientobject or- Noneif error is set. Free with- GObject.Object.unref().- Return type: - Gio.DBusObjectManagerClient- Finishes an operation started with - Gio.DBusObjectManagerClient.new().- New in version 2.30. 
 - 
classmethod new_for_bus(bus_type, flags, name, object_path, get_proxy_type_func, get_proxy_type_user_data, cancellable, callback, *user_data)[source]¶
- Parameters: - bus_type (Gio.BusType) – AGio.BusType.
- flags (Gio.DBusObjectManagerClientFlags) – Zero or more flags from theGio.DBusObjectManagerClientFlagsenumeration.
- name (str) – The owner of the control object (unique or well-known name).
- object_path (str) – The object path of the control object.
- get_proxy_type_func (Gio.DBusProxyTypeFuncorNone) – AGio.DBusProxyTypeFuncfunction orNoneto always constructGio.DBusProxyproxies.
- get_proxy_type_user_data (objectorNone) – User data to pass to get_proxy_type_func.
- cancellable (Gio.CancellableorNone) – AGio.CancellableorNone
- callback (Gio.AsyncReadyCallbackorNone) – AGio.AsyncReadyCallbackto call when the request is satisfied.
- user_data (objectorNone) – The data to pass to callback.
 - Like - Gio.DBusObjectManagerClient.new() but takes a- Gio.BusTypeinstead of a- Gio.DBusConnection.- This is an asynchronous failable constructor. When the result is ready, callback will be invoked in the - thread-default main loopof the thread you are calling this method from. You can then call- Gio.DBusObjectManagerClient.new_for_bus_finish() to get the result. See- Gio.DBusObjectManagerClient.new_for_bus_sync() for the synchronous version.- New in version 2.30. 
- bus_type (
 - 
classmethod new_for_bus_finish(res)[source]¶
- Parameters: - res ( - Gio.AsyncResult) – A- Gio.AsyncResultobtained from the- Gio.AsyncReadyCallbackpassed to- Gio.DBusObjectManagerClient.new_for_bus().- Raises: - GLib.Error- Returns: - A - Gio.DBusObjectManagerClientobject or- Noneif error is set. Free with- GObject.Object.unref().- Return type: - Gio.DBusObjectManagerClient- Finishes an operation started with - Gio.DBusObjectManagerClient.new_for_bus().- New in version 2.30. 
 - 
classmethod new_for_bus_sync(bus_type, flags, name, object_path, get_proxy_type_func, get_proxy_type_user_data, cancellable)[source]¶
- Parameters: - bus_type (Gio.BusType) – AGio.BusType.
- flags (Gio.DBusObjectManagerClientFlags) – Zero or more flags from theGio.DBusObjectManagerClientFlagsenumeration.
- name (str) – The owner of the control object (unique or well-known name).
- object_path (str) – The object path of the control object.
- get_proxy_type_func (Gio.DBusProxyTypeFuncorNone) – AGio.DBusProxyTypeFuncfunction orNoneto always constructGio.DBusProxyproxies.
- get_proxy_type_user_data (objectorNone) – User data to pass to get_proxy_type_func.
- cancellable (Gio.CancellableorNone) – AGio.CancellableorNone
 - Raises: - Returns: - A - Gio.DBusObjectManagerClientobject or- Noneif error is set. Free with- GObject.Object.unref().- Return type: - Like - Gio.DBusObjectManagerClient.new_sync() but takes a- Gio.BusTypeinstead of a- Gio.DBusConnection.- This is a synchronous failable constructor - the calling thread is blocked until a reply is received. See - Gio.DBusObjectManagerClient.new_for_bus() for the asynchronous version.- New in version 2.30. 
- bus_type (
 - 
classmethod new_sync(connection, flags, name, object_path, get_proxy_type_func, get_proxy_type_user_data, cancellable)[source]¶
- Parameters: - connection (Gio.DBusConnection) – AGio.DBusConnection.
- flags (Gio.DBusObjectManagerClientFlags) – Zero or more flags from theGio.DBusObjectManagerClientFlagsenumeration.
- name (strorNone) – The owner of the control object (unique or well-known name), orNonewhen not using a message bus connection.
- object_path (str) – The object path of the control object.
- get_proxy_type_func (Gio.DBusProxyTypeFuncorNone) – AGio.DBusProxyTypeFuncfunction orNoneto always constructGio.DBusProxyproxies.
- get_proxy_type_user_data (objectorNone) – User data to pass to get_proxy_type_func.
- cancellable (Gio.CancellableorNone) – AGio.CancellableorNone
 - Raises: - Returns: - A - Gio.DBusObjectManagerClientobject or- Noneif error is set. Free with- GObject.Object.unref().- Return type: - Creates a new - Gio.DBusObjectManagerClientobject.- This is a synchronous failable constructor - the calling thread is blocked until a reply is received. See - Gio.DBusObjectManagerClient.new() for the asynchronous version.- New in version 2.30. 
- connection (
 - 
get_connection()[source]¶
- Returns: - A - Gio.DBusConnectionobject. Do not free, the object belongs to self.- Return type: - Gio.DBusConnection- Gets the - Gio.DBusConnectionused by self.- New in version 2.30. 
 - 
get_flags()[source]¶
- Returns: - Zero of more flags from the - Gio.DBusObjectManagerClientFlagsenumeration.- Return type: - Gio.DBusObjectManagerClientFlags- Gets the flags that self was constructed with. - New in version 2.30. 
 - 
get_name()[source]¶
- Returns: - A unique or well-known name. Do not free, the string belongs to self. - Return type: - str- Gets the name that self is for, or - Noneif not a message bus connection.- New in version 2.30. 
 - 
get_name_owner()[source]¶
- Returns: - The name owner or - Noneif no name owner exists. Free with- GLib.free().- Return type: - stror- None- The unique name that owns the name that self is for or - Noneif no-one currently owns that name. You can connect to the- GObject.Object- ::notifysignal to track changes to the- Gio.DBusObjectManagerClient- :name-ownerproperty.- New in version 2.30. 
 - 
do_interface_proxy_properties_changed(object_proxy, interface_proxy, changed_properties, invalidated_properties) virtual¶
- Parameters: - object_proxy (Gio.DBusObjectProxy) –
- interface_proxy (Gio.DBusProxy) –
- changed_properties (GLib.Variant) –
- invalidated_properties (str) –
 
- object_proxy (
 - 
do_interface_proxy_signal(object_proxy, interface_proxy, sender_name, signal_name, parameters) virtual¶
- Parameters: - object_proxy (Gio.DBusObjectProxy) –
- interface_proxy (Gio.DBusProxy) –
- sender_name (str) –
- signal_name (str) –
- parameters (GLib.Variant) –
 
- object_proxy (
 
- 
classmethod 
Signal Details¶
- 
Gio.DBusObjectManagerClient.signals.interface_proxy_properties_changed(d_bus_object_manager_client, object_proxy, interface_proxy, changed_properties, invalidated_properties)¶
- Signal Name: - interface-proxy-properties-changed- Flags: - Parameters: - d_bus_object_manager_client (Gio.DBusObjectManagerClient) – The object which received the signal
- object_proxy (Gio.DBusObjectProxy) – TheGio.DBusObjectProxyon which an interface has properties that are changing.
- interface_proxy (Gio.DBusProxy) – TheGio.DBusProxythat has properties that are changing.
- changed_properties (GLib.Variant) – AGLib.Variantcontaining the properties that changed (type:a{sv}).
- invalidated_properties ([str]) – ANoneterminated array of properties that were invalidated.
 - Emitted when one or more D-Bus properties on proxy changes. The local cache has already been updated when this signal fires. Note that both changed_properties and invalidated_properties are guaranteed to never be - None(either may be empty though).- This signal exists purely as a convenience to avoid having to connect signals to all interface proxies managed by manager. - This signal is emitted in the - thread-default main contextthat manager was constructed in.- New in version 2.30. 
- d_bus_object_manager_client (
- 
Gio.DBusObjectManagerClient.signals.interface_proxy_signal(d_bus_object_manager_client, object_proxy, interface_proxy, sender_name, signal_name, parameters)¶
- Signal Name: - interface-proxy-signal- Flags: - Parameters: - d_bus_object_manager_client (Gio.DBusObjectManagerClient) – The object which received the signal
- object_proxy (Gio.DBusObjectProxy) – TheGio.DBusObjectProxyon which an interface is emitting a D-Bus signal.
- interface_proxy (Gio.DBusProxy) – TheGio.DBusProxythat is emitting a D-Bus signal.
- sender_name (str) – The sender of the signal orNoneif the connection is not a bus connection.
- signal_name (str) – The signal name.
- parameters (GLib.Variant) – AGLib.Varianttuple with parameters for the signal.
 - Emitted when a D-Bus signal is received on interface_proxy. - This signal exists purely as a convenience to avoid having to connect signals to all interface proxies managed by manager. - This signal is emitted in the - thread-default main contextthat manager was constructed in.- New in version 2.30. 
- d_bus_object_manager_client (
Property Details¶
- 
Gio.DBusObjectManagerClient.props.bus_type¶
- Name: - bus-type- Type: - Gio.BusType- Default Value: - Gio.BusType.NONE- Flags: - WRITABLE,- CONSTRUCT_ONLY- If this property is not - Gio.BusType.NONE, then- Gio.DBusObjectManagerClient- :connectionmust be- Noneand will be set to the- Gio.DBusConnectionobtained by calling- Gio.bus_get() with the value of this property.- New in version 2.30. 
- 
Gio.DBusObjectManagerClient.props.connection¶
- Name: - connection- Type: - Gio.DBusConnection- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- The - Gio.DBusConnectionto use.- New in version 2.30. 
- 
Gio.DBusObjectManagerClient.props.flags¶
- Name: - flags- Type: - Gio.DBusObjectManagerClientFlags- Default Value: - Gio.DBusObjectManagerClientFlags.NONE- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- Flags from the - Gio.DBusObjectManagerClientFlagsenumeration.- New in version 2.30. 
- 
Gio.DBusObjectManagerClient.props.get_proxy_type_destroy_notify¶
- Name: - get-proxy-type-destroy-notify- Type: - int- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- A - GLib.DestroyNotifyfor the- objectuser_data in- Gio.DBusObjectManagerClient- :get-proxy-type-user-data.- New in version 2.30. 
- 
Gio.DBusObjectManagerClient.props.get_proxy_type_func¶
- Name: - get-proxy-type-func- Type: - int- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- The - Gio.DBusProxyTypeFuncto use when determining what- GObject.GTypeto use for interface proxies or- None.- New in version 2.30. 
- 
Gio.DBusObjectManagerClient.props.get_proxy_type_user_data¶
- Name: - get-proxy-type-user-data- Type: - int- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- The - objectuser_data to pass to- Gio.DBusObjectManagerClient- :get-proxy-type-func.- New in version 2.30. 
- 
Gio.DBusObjectManagerClient.props.name¶
- Name: - name- Type: - str- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- The well-known name or unique name that the manager is for. - New in version 2.30. 
- 
Gio.DBusObjectManagerClient.props.name_owner¶
- Name: - name-owner- Type: - str- Default Value: - None- Flags: - READABLE- The unique name that owns - Gio.DBusObjectManagerClient- :nameor- Noneif no-one is currently owning the name. Connect to the- GObject.Object- ::notifysignal to track changes to this property.- New in version 2.30.