After fighting with Pyrex and getting modules to share class definitions I was able to rip dbus-glib into its own bindings. In order to integrate a new mainloop all a module writter has to do is:

import dbus

setattr(dbus, "_dbus_mainloop_setup_function", _setup_function)

where the setup function takes a dbus_bindings.Connection object. The setup function then takes that Connection object and in the binding backend, extracts the DBusConnection pointer and runs the method it uses to do the setup. In glib’s case it is dbus_connection_setup_with_g_main. I’ll need to think of a way to pass in extra parameters to the setup function. For instance a person may wish to setup the connection on something other than the main loop context.

Anyway I will check in the code tomorrow. Right now I need some sleep and have a forty minute drive home.

[read this post in: ar de es fr it ja ko pt ru zh-CN ]