GUPnP.ServiceProxy¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Whether we are subscribed to this service |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted whenever the subscription to this service has been lost due to an error condition. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class GUPnP.ServiceProxy(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Proxy class for remote services.
GUPnP.ServiceProxy
sends commands to a remote UPnP service and handles incoming event notifications.- add_notify(variable, type, callback, *user_data)¶
- Parameters:
variable (
str
) – The variable to add notification fortype (
GObject.GType
) – The type of the variablecallback (
GUPnP.ServiceProxyNotifyCallback
) – The callback to call when variable changes
- Returns:
True
on success.- Return type:
Sets up callback to be called whenever a change notification for variable is recieved.
New in version 0.20.12.
- add_raw_notify(callback, *user_data)¶
- Parameters:
callback (
GUPnP.ServiceProxyNotifyCallback
) – The callback to call when the peer issues any variable notification.
- Returns:
True
on success.- Return type:
Get a notification for anything that happens on the peer.
value in callback will be of type
GObject.TYPE_POINTER
and contain the pre-parsed [type`libxml2`.Doc]. Do NOT free or modify this document.New in version 0.20.12.
- call_action(action, cancellable)¶
- Parameters:
action (
GUPnP.ServiceProxyAction
) – An actioncancellable (
Gio.Cancellable
orNone
) – AGio.Cancellable
which can be used to cancel the current action call
- Raises:
- Returns:
None
on error, action if successful.- Return type:
Synchronously call the action on the remote UPnP service.
New in version 1.2.0.
- call_action_async(action, cancellable, callback, *user_data)¶
- Parameters:
action (
GUPnP.ServiceProxyAction
) – AGUPnP.ServiceProxyAction
to callcancellable (
Gio.Cancellable
orNone
) – AGio.Cancellable
which can be used to cancel the current action callcallback (
Gio.AsyncReadyCallback
orNone
) – AGio.AsyncReadyCallback
to call when the action is finished.
Start a call on the remote UPnP service using the pre-configured action. Use
GUPnP.ServiceProxy.call_action_finish
() in the callback to finalize the call and gupnp_service_proxy_action_get_result(),GUPnP.ServiceProxyAction.get_result_hash
() orGUPnP.ServiceProxyAction.get_result_list
() to extract the result of the remote call.New in version 1.2.0.
- call_action_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – aGio.AsyncResult
- Raises:
- Returns:
None
, if the call had an error, the action otherwise.- Return type:
Finish an asynchronous call initiated with
GUPnP.ServiceProxy.call_action_async
().New in version 1.2.0.
- get_subscribed()¶
-
Returns if we are subscribed to this service.
- remove_notify(variable, callback, *user_data)¶
- Parameters:
variable (
str
) – The variable to add notification forcallback (
GUPnP.ServiceProxyNotifyCallback
) – The callback to call when variable changes
- Returns:
True
on success.- Return type:
Cancels the variable change notification for callback and user_data.
Up to version 0.20.9 this function must not be called directlya or indirectly from a
GUPnP.ServiceProxyNotifyCallback
associated with this service proxy, even if it is for another variable. In later versions such calls are allowed.
- remove_raw_notify(callback, *user_data)¶
- Parameters:
callback (
GUPnP.ServiceProxyNotifyCallback
) – The callback to call when variable changes
- Returns:
True
on success.- Return type:
Cancels the variable change notification for callback and user_data.
This function must not be called directly or indirectly from a
GUPnP.ServiceProxyNotifyCallback
associated with this service proxy, even if it is for another variable.
- set_credentials(user, password)¶
- Parameters:
Sets user and password for authentication
New in version 1.6.4.
- set_subscribed(subscribed)¶
-
(Un)subscribes to this service.
The relevant messages are not immediately sent but queued. If you want to unsubcribe from this service because the application is quitting, rely on automatic synchronised unsubscription on object destruction instead.
- do_subscription_lost(reason) virtual¶
- Parameters:
reason (
GLib.Error
) –
Signal Details¶
- GUPnP.ServiceProxy.signals.subscription_lost(service_proxy, error)¶
- Signal Name:
subscription-lost
- Flags:
- Parameters:
service_proxy (
GUPnP.ServiceProxy
) – The object which received the signalerror (
GLib.Error
) – A pointer to aGLib.Error
describing why the subscription has been lost
Emitted whenever the subscription to this service has been lost due to an error condition.