Class attributes with dbus-python
DBus is great, and so is Python—each for their own reasons. One mismatch is that everything passing over the bus must be a message or signal. You wind up with Python code that looks like
proxyobject.SetThis('foo')
bar = proxyobject.GetThat()
proxyobject.DoSomeOtherStuff()
But then you realize the dbus-python binding is very Pythonic, so you can extend it in a Pythonic way. Here's something I banged together in about half an hour:
import dbus
class FancyInterface(dbus.Interface):
"""A fancier DBus Interface.
Derived classes should define a list of strings __dbus_properties__ and a
_dbus_interface. For every listed property ('foo' …
more ...
