DBUS/HAL Manager Interface Help
Casey McGinty
casey.mcginty at gmail.com
Tue Jul 29 14:24:16 PDT 2008
Can someone explain to me why this sample code does not work? I am trying to
test if a device exists.
---------------- dbus_test.py --------------------------
import dbus
bus = dbus.SystemBus()
proxy = bus.get_object( 'org.freedesktop.Hal',
'/org/freedesktop/Hal/Manager' )
manager = dbus.Interface( proxy, 'org.freedesktop.Hal.Manager' )
some_dev = manager.GetAllDevices()[0]
print "Calling DeviceExists on '%s'" % some_dev
print manager.DeviceExists( some_dev )
------------------- output ------------------------------
$ python dbus_test.py
Calling DeviceExists on '/org/freedesktop/Hal/devices/platform_bluetooth'
Traceback (most recent call last):
File "dbus_test.py", line 9, in <module>
print manager.DeviceExists( some_dev )
File "/var/lib/python-support/python2.5/dbus/proxies.py", line 140, in
__call__
**keywords)
File "/var/lib/python-support/python2.5/dbus/connection.py", line 607, in
call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.Hal.SyntaxError: There is a
syntax error in the invocation of the method Manager.DeviceExists
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/hal/attachments/20080729/add1cf5f/attachment.htm
More information about the hal
mailing list