[Kde-bindings] Python bindings and other stuff

Jim Bublitz jbublitz at nwinternet.com
Sun Jan 12 05:44:32 UTC 2003


I just read through the archives for the list (I'm having a problem
receiving list mail, but working on it), and I thought it might be
helpful to post something about what's going on on the Python side
of the bindings scene.

I imagine most of you are aware that there is a complete set of Qt
bindings for Python (PyQt) written by Phil Thompson. Not quite two
years ago I picked up maintenance of PyKDE (which covers most of
kdelibs) from Phil. Both sets of bindings are based on Phil's sip
bindings generator and libsip runtime. PyKDE is current through KDE
3.0.4 and supports everything from 2.1.1 forward. 3.0.5 and 3.1
will be picked up, hopefully within the next month. PyKDE is in
desperate need of some thorough testing and example code.

There are a couple of other things going on that might be of
interest. All of these are "some time in the future", which could
be soon, or could be next year depending on lots of things.

First, Phil is planning a rewrite of sip (sip 4). Sip already
supports Linux (and other *nix) and Windows - this will make Mac
support easier, plus a number of other enhancements. Sip will
generate the C code for bindings from a set of ".sip" description
files, which are basically simple modifications of the h files for
a lib. I'm currently working on a second version of a program which
will generate .sip files automatically from h files. Actually, that
part works pretty well already, but the more important part still
to do is to handle new version generation - take the previous
version's .sip files, add the new version's h files and spit out a
new set of .sip files without having to do much manual fixup, and
still be able to use a single set of files to compile bindings from
all versions supported. PyKDE has been built this way for over a
year, but the software is pretty hackish and still requires too
much manual work. I'm hoping to have a general tool for generating
sip/Python bindings for any C/C++ libs, but we'll see if that really
materializes.

The other thing I've done some work on (but haven't done much in
the last 9 months or so) is a set of "bindings" for KOffice's
KSpread. I had a working set of bindings for KSpread 1.1 (could run
a Python script on a spreadsheet or use Python to write "built-in"
functions), but 1.2 breaks some of the interface and I haven't had
time to get back to it; Python 2.3 may break some things too. Like
the generalized h file -> bindings generator, this may never
materialize either. The KSpread "bindings" were actually bindings
for a lightweight C++ wrapper on top of KSpread - complete bindings
would be enormous and not that useful. The wrapper also allowed
some things like "A1:B3" type cell addressing and allowed KSpread
to load/work with additional spreadsheets in the background, and
was a more rational approach to scripting spreadsheets than the raw
C++ methods or dcop allow.

In general, those things represent what I'd like to see happen in
the bindings area: tools for quickly generating bindings and
keeping up with version changes and lightweight bindings to allow
plugins/addons/scripting for things like
KOffice/KMail/noatun/Konqueror/panel applets/plugins/etc.

Anyway, I'm working on a lot of stuff but am probably a long way
from releasing anything. I'd be interested in discussing any of the
above either on-list or off.

Jim




More information about the Kde-bindings mailing list