A dbus.mainloop.NativeMainLoop instance is required [Was: Re: dbus-python: support for Windows and OS X]

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Feb 3 05:10:59 PST 2011


On Thu, 03 Feb 2011 at 16:00:21 +0300, Pavel Strashkin wrote:
> What about native main loop inside libdbus? Can we do it? Or write our
> own and put it inside python-dbus so glib will not be required
> anymore.

I'm not suggesting that GLib should be mandatory; I'm suggesting that trying
the GLib main loop integration would be useful for debugging, to indicate
whether the bug here is likely to be in dbus-python (if the GLib main loop
doesn't work on Windows either) or in PyQt (if the GLib main loop works on
Windows and the Qt one doesn't).

There's a simple main loop implementation in dbus-daemon, but it's
sufficiently confusing and inefficient that I'd oppose putting it in libdbus
(see fd.o #33337, #23194, #33342, #33336, among others).

If you're using dbus-python in a GUI application, you have to use the same
main loop as the GUI, so GLib and Qt main loop glue will remain necessary.
The fewer additional wheels we reinvent in libdbus, the better, as far as I'm
concerned; we already have too much code and not enough bugfixing.

(FWIW, I did try adding support for arbitrary pure-Python main loop glue once,
but it didn't work and was basically impossible to debug. You're welcome to
try, but I think it's a waste of time; we already have at least two perfectly
good main loops.)

    Simon


More information about the dbus mailing list