[PyKDE] KParts

Jim Bublitz jbublitz at nwinternet.com
Mon Sep 29 18:53:01 BST 2003


On Sunday September 28 2003 10:17, Ted Shab wrote:
> Has anyone written a KPart from PyKDE? 

I doubt it.

>  Is it straightforward?

Not yet.

>  What are the major issues?

There are two issues - you need to embed Python, and you need to 
create a .so lib that includes the factory function (don't know 
the name offhand) that's called by the app that imports the 
part. Those are of course in addition to the KDE requirements 
for creating a KPart - locating the rc or desktop file in the 
right place, creating it, etc. - all of the KDE stuff you have 
to do.

PyKDE3.8rc2 (on sourceforge at 
http://www.sourceforge.net/projects/pykde) already includes 
'libpythonize' which takes care of the the first issue, although 
there are some revisions coming for that.

The second issue (.so lib) probably has a general solution like 
creating a single .so lib that will import any Python-based 
KPart (the Python script will still need to provide a Python 
version of the factory function, but that's pretty trivial).

I plan to do this eventually - if you're in a rush, I can give it 
a higher priority and (hopefully) have something in a week or 
two. Otherwise, if you want to try it yourself, you can take a 
look at how PyKPanelApplet/libpykpanelapplet is implemented in 
PyKDE3.8rc2 - the method should be essentially the same. There's 
also a lot of documentation (compared to the rest of sip/PyKDE 
anyway) for both libpythonize and panel applets in the doc/ 
directory.

Let me know if you want me to proceed with it soon - it would be 
a lot of help to me to have a "willing test subject" :) If you 
do it yourself, I'd appreciate it if you'd share the code (if 
your employment situation allows). In either case I can provide 
more details - let me know.

Jim





More information about the PyQt mailing list