[Om2009] D-bus errors
David Fokkema
dfokkema at ileos.nl
Thu Jun 18 15:24:04 CEST 2009
Hi list,
The following python script:
import dbus
bus = dbus.SystemBus()
gps = bus.get_object('org.freedesktop.Gypsy', '/org/freedesktop/Gypsy')
gps_device = dbus.Interface(gps, 'org.freedesktop.Gypsy.Device')
print gps_device.GetConnectionStatus()
gives:
Traceback (most recent call last):
File "./myapp.py", line 9, in <module>
print gps_device.GetConnectionStatus()
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 622,
in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Python.NameError:
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/dbus/service.py", line 702, in
_message_cb
retval = candidate_method(self, *args, **keywords)
File "<string>", line 1, in <lambda>
File "/usr/lib/python2.6/site-packages/framework/resource.py", line
57, in checkedsyncmethod
dbus_error( ResourceNotEnabled( "Resource %s is not enabled, current
status is '%s'" % ( self.__class__.__name__, self._resourceStatus ) ) )
NameError: global name 'dbus_error' is not defined
Now, I understand that the resource is not enabled, but that's not the
'real' problem, of course: I'm talking about the NameError. Should I
import something, make use of a higher-level interface? Or is this a
plain bug?
Thanks,
David
More information about the support
mailing list