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
-- http://mail.python.org/mailman/listinfo/python-list