How to call SetBrightness in Python?

Andrey Borzenkov arvidjaar at mail.ru
Fri Dec 30 09:43:25 PST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Is there any contemplative tutorial on HAL bindings? Using straightforward 
code gives an error:

{pts/1}% ~/tmp/setbr
Traceback (most recent call last):
  File "/home/bor/tmp/setbr", line 9, in ?
    dev.SetBrightness(4)
  File "/usr/lib/python2.4/site-packages/dbus/proxies.py", line 64, in 
__call__
    reply_message = self._connection.send_with_reply_and_block(message, 
timeout)
  File "dbus_bindings.pyx", line 395, in 
dbus_bindings.Connection.send_with_reply_and_block
dbus_bindings.DBusException: Method "SetBrightness" with signature "i" on 
interface "org.freedesktop.Hal.Device" doesn't exist

The code follows:

#!/usr/bin/python

import dbus

bus = dbus.Bus(dbus.Bus.TYPE_SYSTEM)
devobj = bus.get_object('org.freedesktop.Hal', 
'/org/freedesktop/Hal/devices/acpi_lcd')
dev = dbus.Interface (devobj, "org.freedesktop.Hal.Device")

dev.SetBrightness(4)

TIA and Happy New Year to everybody

- -andrey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFDtXHFR6LMutpd94wRAnRUAKDA1rkG5Hsnp9kMqK7auSdcR2AoegCgsFXN
4EiqfqgCfUATYgSNCDQANpU=
=XE5d
-----END PGP SIGNATURE-----


More information about the hal mailing list