[PyQt] Auto-generate sip specification file?

Jim Bublitz jbublitz at nwinternet.com
Fri Aug 15 02:03:34 BST 2008

On Thursday 14 August 2008 17:02, Mark A. Schmucker wrote:
> Hi, I used SIP today to generate a wrapper for one class in my library. My
> library has about 50 classes, and I want to wrap most of them. Now that I
> have things set up, it won't be too hard to copy each header file and
> manually edit them to create SIP specification files. But as the classes
> change, I'll need to maintain the SIP files too. Are there any tools that
> would help automate this process?

Phil has a gcc-xml based tool he uses to generate PyQt, but I'm not sure if he 
wants to make it generally available (there are lots of good reasons not to).

Simon Edwards is using a tool for PyKDE4 called "twine" whose lexer./parser 
are based on PLY and which will generate a versioned set of sip files (one 
that, at least in theory, will build for any version of your lib). It also 
handles multiple modules, and will produce a set of HTML class docs from 
doxygen markup.  It's GPL'd.

There isn't much in the way of docs. It requires a project file (PyKDE4's 
project file can be used as an example) and has a few quirks.

It's entirely written in Python and takes under 2 minutes to generate all of 
PyKDE4's sip files and HTML docs from KDE h files. It probably has some PyKDE 
specific stuff that needs to be worked out to make it a general purpose tool 
(for example it automatically builds a PyKDE4 directory structure, but the 
code that does that is a plugin that's easily replaced).

If Simon doesn't chime in with a location where it's available, email him -
simon AT simonzone.com :)


More information about the PyQt mailing list