[PyKDE] sip module prototyping

Jim Bublitz jbublitz at nwinternet.com
Fri Dec 12 07:22:01 GMT 2003


On Thursday December 11 2003 14:49, Patrick Stinson wrote:
> It seems as though it would be useful for sip (or similar
> utility) to create skeleton (protoype?) python modules from
> your sip files. This idea came to me in wanting a prtotype
> module to develop my GUI with, while I am still developing the
> C++ code for my real python module.
> If you could start with a skeleton, you could fill in the
> blanks however you wanted to get the null module to behave
> like the real C++ module.

> ideas? been done? overlooking an option? Otherwise it
> shouldn't be hard to use the sip parsing code to write python
> files.

If I understand correctly (which often I don't), you want to 
create a skeleton Python file with "class" and "def" stmts from 
a set of C++ .h file or .sip files?

sip's symbol tables should contain all of the relevant 
information (as you assume). It would be necessary to hook in 
different a code generation module, but it seems it should be 
possible. (I'm not familiar enough with sip to do it or be sure 
it can be done).

Actually, the way class docs are generated for PyKDE does 
essentially what you're asking - PyKDE/wabbit/data/classref.txt 
is a complete description of all PyKDE namespaces, classes (with 
bases), methods (with typed/named args) and variables (with 
types and names). It's generated via presip, which isn't 
released yet. presip can parse both h and sip files and 
generates sip files and docs. It wouldn't be difficult to 
generate a Python skeletion, either directly or from 
classref.txt. 

Jim





More information about the PyQt mailing list