UPowerGlib.Client¶
- Subclasses:
None
Methods¶
- Inherited:
GObject.Object (37), Gio.AsyncInitable (4), Gio.Initable (2)
- Structs:
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r |
|||
r |
|||
r |
|||
r |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
The |
|
The |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent |
r |
||
priv |
r |
Class Details¶
- class UPowerGlib.Client(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Returns:
a new
UPowerGlib.Clientobject, orNoneon failure.- Return type:
Creates a new
UPowerGlib.Clientobject. If connecting to upowerd on D-Bus fails, this returnsNoneand prints out a warning with the error message. Consider usingUPowerGlib.Client.new_full() instead which allows you to handle errors and canceling long operations yourself.Added in version 0.9.0.
- classmethod new_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.CancellableorNone) – aGio.CancellableorNonecallback (
Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied
Asynchronously creates a new
UPowerGlib.Clientobject.This is an asynchronous failable function.
Added in version 0.99.14.
- classmethod new_finish(res)¶
- Parameters:
res (
Gio.AsyncResult) – aGio.AsyncResultobtained from theGio.AsyncReadyCallbackpassed toUPowerGlib.Client.new_async()- Raises:
- Returns:
a
UPowerGlib.ClientorNoneif error is set. Free withGObject.Object.unref().- Return type:
Finishes an operation started with
UPowerGlib.Client.new_async().Added in version 0.99.14.
- classmethod new_full(cancellable)¶
- Parameters:
cancellable (
Gio.CancellableorNone) – AGio.CancellableorNone.- Raises:
- Returns:
a new
UPowerGlib.Clientobject, orNoneon failure.- Return type:
Creates a new
UPowerGlib.Clientobject. If connecting to upowerd on D-Bus fails, this returnsNoneand sets error.Added in version 0.99.5.
- get_critical_action()¶
-
Gets a string representing the configured critical action, depending on availability.
Added in version 1.0.
- get_daemon_version()¶
- Returns:
string containing the daemon version, e.g. 008
- Return type:
Get UPower daemon version.
Added in version 0.9.0.
- get_devices()¶
- Returns:
an array of
UPowerGlib.Deviceobjects orNoneon error, free with g_ptr_array_unref()- Return type:
Get a copy of the device objects. This function does not set the free function for the
GLib.PtrArrayso you need useGObject.Object.unrefon all elements when you are finished with the array.Added in version 0.9.0.
Deprecated since version 0.99.8.
- get_devices2()¶
- Returns:
an array of
UPowerGlib.Deviceobjects orNoneon error, free with g_ptr_array_unref()- Return type:
Get a copy of the device objects.
Added in version 0.99.8.
- get_devices_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.CancellableorNone) – aGio.CancellableorNonecallback (
Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied
Asynchronously fetches the list of
UPowerGlib.Deviceobjects.Added in version 0.99.14.
- get_devices_finish(res)¶
- Parameters:
res (
Gio.AsyncResult) – aGio.AsyncResultobtained from theGio.AsyncReadyCallbackpassed toUPowerGlib.Client.get_devices_async()- Raises:
- Returns:
an array of
UPowerGlib.Deviceobjects orNoneon error.- Return type:
Finishes an operation started with
UPowerGlib.Client.get_devices_async().
- get_display_device()¶
- Returns:
a
UPowerGlib.Deviceobject, orNoneon error.- Return type:
Get the composite display device.
Added in version 1.0.
- get_lid_is_closed()¶
-
Get whether the laptop lid is closed.
Added in version 0.9.0.
- get_lid_is_present()¶
-
Get whether a laptop lid is present on this machine.
Added in version 0.9.2.
- get_on_battery()¶
-
Get whether the system is running on battery power.
Added in version 0.9.0.
- do_device_added(device) virtual¶
- Parameters:
device (
UPowerGlib.Device)
Signal Details¶
- UPowerGlib.Client.signals.device_added(client, device)¶
- Signal Name:
device-added- Flags:
- Parameters:
client (
UPowerGlib.Client) – The object which received the signaldevice (
UPowerGlib.Device) – theUPowerGlib.Devicethat was added.
The
::device-addedsignal is emitted when a power device is added.Added in version 0.9.0.
- UPowerGlib.Client.signals.device_removed(client, object_path)¶
- Signal Name:
device-removed- Flags:
- Parameters:
client (
UPowerGlib.Client) – The object which received the signalobject_path (
str) – the object path of theUPowerGlib.Devicethat was removed.
The
::device-removedsignal is emitted when a power device is removed.Added in version 1.0.
Property Details¶
- UPowerGlib.Client.props.daemon_version¶
-
The daemon version.
Added in version 0.9.0.
- UPowerGlib.Client.props.lid_is_closed¶
-
If the laptop lid is closed.
Added in version 0.9.0.
- UPowerGlib.Client.props.lid_is_present¶
-
If a laptop lid is present.
Added in version 0.9.0.