Python HAL CPU governor
Пытаюсь получить выбранные governor для процессора с помощью Python и HAL.
#!/usr/bin/env python
import dbus
bus = dbus.SystemBus();
hal_obj = bus.get_object('org.freedesktop.Hal', '/org/freedesktop/Hal/Manager')
hal = dbus.Interface (hal_obj, 'org.freedesktop.Hal.Manager')
udis = hal.FindDeviceByCapability ('processor')
for udi in udis:
dev_obj = bus.get_object ('org.freedesktop.Hal', udi)
dev = dbus.Interface(dev_obj, 'org.freedesktop.Hal.Device.CPUFreq')
print "Currently selected CPU Frequency governor:", dev.GetCPUFreqGovernor()
Выбрасывает исключение
Traceback (most recent call last):
File "/home/alexey/work/power/hal/src/cpufreq.py", line 15, in <module>
print "Currently selected CPU Frequency governor:", dev.GetCPUFreqGovernor()
File "/usr/lib/python2.6/site-packages/dbus/proxies.py", line 68, in __call__
return self._proxy_method(*args, **keywords)
File "/usr/lib/python2.6/site-packages/dbus/proxies.py", line 140, in __call__
**keywords)
File "/usr/lib/python2.6/site-packages/dbus/connection.py", line 630, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "GetCPUFreqGovernor" with signature "" on interface "org.freedesktop.Hal.Device.CPUFreq" doesn't exist
Версия HAL у меня 0.5.13 (0.5.13-9.fc12 Fedora Core 12), согласно спецификации такой метод должен быть. Будучи запущенным от суперпользователя код выбрасывает такое же исключение.