acpi.py 0.3.1 review
Downloadacpi.py provides an platform-independent and uniform interface to ACPI. Installation: Linux 2.4 / 2.6 The Linux implementati
|
|
acpi.py provides an platform-independent and uniform interface to ACPI.
Installation:
Linux 2.4 / 2.6
The Linux implementation reads informations from /proc/acpi/. Therefore a low level modul is not needed. Copy the file acpi.py from the acpi.py directory into your Python directory/site-packages (in most cases you must be root for that).
Be sure that the needed ACPI drivers are loaded (on laptops usually battery). You will have subdirectories in /proc/acpi/. That's all.
Note: We have not tested acpi.py elaborately on Linux 2.6.
Requirements:
Python >= 2.0
Linux Kernel 2.4.x (not elaborately tested with kernel 2.6)
Usage:
Usage is simple. Do something like the following:
import acpi
battery = acpi.Acpi()
...
battery.update()
print battery.percent()
print battery.capacity()
print battery.nb_of_batteries()
print battery.charging_state()
Note that you have to call update() if you want get the current state of battery. Note furthermore that acpi raises exceptions in some cases. Please take a look into the short and well readable source file acpi.py.
What's New in This Release:
A bug in the AcpiLinux.estimated_lifetime() function has been fixed.
acpi.py 0.3.1 keywords