Traceback (most recent call last):
File "./service.py", line 29, in <module>
run_service ()
File "./service.py", line 22, in run_service
example_object = example_object.ExampleObject (name, "/org/example/ExampleObject")
UnboundLocalError: local variable 'example_object' referenced before assignment
Environment: Fedora 23, Python 2.7.11, python-slip 0.6.4, dbus-python 1.2.0, dbus 1.10.8
The example provided on https://fedorahosted.org/python-slip/wiki/SlipDBusService is not working.
The Python interpreter throws an error if the scripts are used as it:
Renaming that variable leads to a service that just times out.
Walking through with the debugger, it looks like when slip adds the ASYNC_CALLBACKS tuple, those values confuse dbus.service into thinking the method is an async method. It looks like slip is attempting to remove those dummy ASYNC_CALLBACKS values if the method is not async, but it's not working. When the code returns to
in dbus.service,
parent_methodstill has values in the_dbus_async_callbackstuple.