[PyKDE] kdevelop: c++,pyqt...sip?

Jim Bublitz jbublitz at nwinternet.com
Thu Oct 16 18:54:01 BST 2003


On Wednesday October 15 2003 16:01, Patrick Stinson wrote:
> At this point, just generate bindings. You know, when you jump
> into a new tool like sip, you always think "All I want to do
> is...". It took me a very long time to expose my C++ lib to
> python with sip, and It seems like there is a general lack for
> user-friendly interfaces for a great tool.

> So, I don't know very much about kdevelop archintecture, but
> if you could make a simple project that could import a chunk
> of c++ headers and generate a python module, that would be
> significant.

I took a similar approach originally - doing something "IDE-like" 
to generate sip files from h files. It's a pretty good approach 
and saves a lot of time, and actually isn't that hard to write.

What I've switched to instead is a command-line based tool 
('presip'), if for no other reason than it's not tied to a 
particular IDE (eg kdevelop, eric, idle, whatever), and in fact 
it's also not tied to PyKDE or PyQt. For the last few releases, 
PyKDE has been generated automatically except for handwritten 
code (%MemberCode, %MappedType, %C++Code, 
%ConvertToSubClassCode). It also takes care of versioning (%If 
statements).

For the PyKDE upgrade for KDE-3.1.4 I actually could do:

python presip.py pykde314.prj &&  python build.py && make

and come back 30 minutes later and run 'make install', but that's 
only because there was no handwritten code for that version 
change, and because build.py was already written. It still 
would've worked if handwritten code was needed, but those 
methods that need %MemberCode or %MappedType would have been 
commented out (they're flagged and disabled until you write the 
code).

It needs upgrading to accomodate changes Phil is making for 
sip-3.9/4.0, and needs some work for documentation generation 
and build system generation. I'd like to release it generally 
late this year/early next year. That'll still be an 'alpha' 
release, but should be reasonably complete.

The other thing I have in the works (really part of the same 
project) is a sip tutorial. That's about half done but also 
needs updating for Phil's change from %MemberCode to %MethodCode 
in the new sip version.

If I recall correctly, KDevelop has a "tools" interface that lets 
you call external tools, and presip would probably work there. 
You'd just need to create a project file (about 10 lines/module) 
for it.

Jim





More information about the PyQt mailing list