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 |
|||
d/r |
|
||
d/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.Client
object, orNone
on failure.- Return type:
Creates a new
UPowerGlib.Client
object. If connecting to upowerd on D-Bus fails, this returnsNone
and prints out a warning with the error message. Consider usingUPowerGlib.Client.new_full
() instead which allows you to handle errors and cancelling long operations yourself.New in version 0.9.0.
- classmethod new_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
orNone
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfied
Asynchronously creates a new
UPowerGlib.Client
object.This is an asynchronous failable function.
New in version 0.99.14.
- classmethod new_finish(res)¶
- Parameters:
res (
Gio.AsyncResult
) – aGio.AsyncResult
obtained from theGio.AsyncReadyCallback
passed toUPowerGlib.Client.new_async
()- Raises:
- Returns:
a
UPowerGlib.Client
orNone
if error is set. Free withGObject.Object.unref
().- Return type:
Finishes an operation started with
UPowerGlib.Client.new_async
().New in version 0.99.14.
- classmethod new_full(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – AGio.Cancellable
orNone
.- Raises:
- Returns:
a new
UPowerGlib.Client
object, orNone
on failure.- Return type:
Creates a new
UPowerGlib.Client
object. If connecting to upowerd on D-Bus fails, this returnsNone
and sets error.New in version 0.99.5.
- get_critical_action()¶
-
Gets a string representing the configured critical action, depending on availability.
New in version 1.0.
- get_daemon_version()¶
- Returns:
string containing the daemon version, e.g. 008
- Return type:
Get UPower daemon version.
New in version 0.9.0.
- get_devices()¶
- Returns:
an array of
UPowerGlib.Device
objects orNone
on 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.PtrArray
so you need useGObject.Object.unref
on all elements when you are finished with the array.New in version 0.9.0.
Deprecated since version 0.99.8.
- get_devices2()¶
- Returns:
an array of
UPowerGlib.Device
objects orNone
on error, free with g_ptr_array_unref()- Return type:
Get a copy of the device objects.
New in version 0.99.8.
- get_devices_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
orNone
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfied
Asynchronously fetches the list of
UPowerGlib.Device
objects.New in version 0.99.14.
- get_devices_finish(res)¶
- Parameters:
res (
Gio.AsyncResult
) – aGio.AsyncResult
obtained from theGio.AsyncReadyCallback
passed toUPowerGlib.Client.get_devices_async
()- Raises:
- Returns:
an array of
UPowerGlib.Device
objects orNone
on error.- Return type:
Finishes an operation started with
UPowerGlib.Client.get_devices_async
().
- get_display_device()¶
- Returns:
a
UPowerGlib.Device
object, orNone
on error.- Return type:
Get the composite display device.
New in version 1.0.
- get_lid_is_closed()¶
-
Get whether the laptop lid is closed.
New in version 0.9.0.
- get_lid_is_present()¶
-
Get whether a laptop lid is present on this machine.
New in version 0.9.2.
- get_on_battery()¶
-
Get whether the system is running on battery power.
New 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.Device
that was added.
The
::device-added
signal is emitted when a power device is added.New 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.Device
that was removed.
The
::device-removed
signal is emitted when a power device is removed.New in version 1.0.
Property Details¶
- UPowerGlib.Client.props.daemon_version¶
-
The daemon version.
New in version 0.9.0.
- UPowerGlib.Client.props.lid_is_closed¶
- Name:
lid-is-closed
- Type:
- Default Value:
- Flags:
If the laptop lid is closed.
New in version 0.9.0.
Deprecated since version ???.
- UPowerGlib.Client.props.lid_is_present¶
- Name:
lid-is-present
- Type:
- Default Value:
- Flags:
If a laptop lid is present.
New in version 0.9.0.
Deprecated since version ???.