Python bindings

Seth Nickell seth@gnome.org
20 Sep 2003 13:20:37 -0700


I'm working on Python bindings right now based off the code Johan
originally wrote some months ago. They are at the "basically working"
stage right now (e.g. I've rewritten dbus-send and dbus-monitor in
Python). BUT... they are currently an uninspired wrappering of the C API
into simple objects like Connection, Server, Message, etc. I plan to
keep this API around for completeness, but I'd really like to build a
nicer API around it, perhaps in the spirit of dcoppython.

dcoppython overloads method and sub-object resolution to make runtime
DCOP objects that behave as if they were "normal":

object = dcop.DCOPObject("KWeatherService", "WeatherService")

At this point, if no exceptions have been thrown, you should have an
object upon which you can make method calls:

station_list = object.listStations()

Given introspection it should be possible to get rid of the object
resolution overloading and actually return Objects that had all their
methods already included as normal methods, so for example dir(object)
would return a list of all the methods. The downside is that we'd have
to fetch introspection information for each object, whereas in the
dcoppython world you can "call first and ask questions later".

Anyone have opinions on this?

-Seth