dbus-python: Binding names lazily without using follow_name_owner_changes

Simon McVittie simon.mcvittie at collabora.co.uk
Mon Nov 28 02:45:22 PST 2011


On Sat, 26 Nov 2011 at 22:48:21 +0100, Neal H. Walfield wrote:
> I know about 'follow_name_owner_changes', but I want my module to work
> even if the program does not use a main loop.

If so, then what you can do is considerably restricted. There's a reason
why most GUI frameworks, and several of the more successful D-Bus bindings
(e.g. QtDBus and GDBus), mandate the use of a particular main loop, either
in your main thread or in a worker thread.

> The attached code appears to do what I require.
> class DBusIndirectObject(object):

This isn't particularly efficient (run dbus-monitor and see how many method
calls it'll make!), but is about as good as you're going to get without some
sort of main loop.

    S


More information about the dbus mailing list