[PyKDE] Konqueror plugins in Python

Jim Bublitz jbublitz at nwinternet.com
Fri May 20 22:22:09 BST 2005


On Friday 20 May 2005 13:58, Giacomo Lacava wrote:
> On 5/20/05, Roberto Alsina <ralsina at kde.org> wrote:
> > Now, doing that is somewhat involved. Ok, it's quite hard. Hmmm...
> > well, I don't think anyone has done it yet :-(
> >
> > The good news are, if someone ever does it, then there is no need to do
> > it ever again, since the plugin itself would be python code :-)
>
> that's what I feared :/
>
> and what about the other way around? For example, embed *the entire
> Konqueror* (not just KHTML) in a python application, and then interact
> through the usual interfaces? then you might add other features in
> python...

I'm missing the rest of this thread for some reason, but I've never been been 
afraid to jump in even when I'm totally uninformed.

I believe David Boddie has done some konqueror plugins - maybe he'll jump in 
here. The most likely case is that each plugin would need a small loader 
compiled as an .so file (C/C++) so that konqueror can find the plugin and 
load it. The loader simply instantiates a Python interpreter, calls the 
Python-coded plugin, and returns the plugin's handle to konqueror.

They're not particularly hard to write, but the big apps (konqueror, koffice 
stuff, even control center modules) sometimes require some additional stuff 
to be workable. Panel applets or panel extensions, on the other hand are 
pretty simple examples of what's involved, and in fact you can use a single 
loader for all Python-based applets (because kicker provides enough info so 
the loader can tell what applet or extension to load).

On the other side, PyKDE supports both qxembed and has a KParts module, so you 
could embed konqueror (the application) or import konqueror as a part. I 
haven't done any coding with KParts in a while, and there were some issues 
going from KDE2 to KDE3 - they should have been resolved, but I don't have an 
example that works at the moment.

PyKDE has a couple global functions in KParts (see the PyKDE docs --  
create[ReadWrite,ReadOnly]Part) to make loading KParts easier.

Jim




More information about the PyQt mailing list