[PyKDE] KControl Modules II (Simon Edwards)

Jim Bublitz jbublitz at nwinternet.com
Sat Jan 3 20:38:01 GMT 2004


On Saturday January 3 2004 10:20, Simon Edwards wrote:
> On Sat, 3 Jan 2004 04:57 pm, David Boddie wrote:
> > On Sat, 3 Jan 2004 11:45:34, Simon Edwards 
<simon at simonzone.com> wrote:
> > > Hello all,
> >
> > Happy New Year!
>
> yes indeed, happy new year.
>
> > > The last we touched this issue we were kind of stuck with
> > > python kcontrol modules kind of working except when you
> > > have more than one python module. Trying to run a second
> > > python module in the same process (kcontrol) runs into
> > > disaster. (just doesn't work). Is this correct summary of
> > > the current situation?
> >
> > Fortunately not! Thanks to some clever hacking by Jim,
> > Python KControl modules should now coexist peacefully.
>
> way cool! What was the general solution BTW?

Basically maintaining a thread state variable along with the 
global interpreter lock in the interface to the interpreter. It 
appears to work when the Python interpreter is loaded from a 
plugin (as panel applets or control modules would do), but has 
problems from a Python program: for example, if you wrote a 
PyKDE program that loaded a KPart, and the KPart later tries to 
load the Python interpreter (which is already running) say to 
load another plugin, thread state issues arise again. I haven't 
been able to get back to that - the guys working on QtDesigner 
plugins tried some of the obvious "fixes" but that didn't fix 
anything.

> > a bit later today. The pykde-components archive will have
> > today's date; don't grab the one from December by accident!
>
> cool, I'll grab it then.
>
> > Note that I'm using an older version of libpythonize than
> > that supplied with PyKDE-3.8.0. Although I believe that the
> > newer libpythonize only has issues when used to create
> > KParts, I can't be sure that this isn't also the case
>
> for
>
> > KControl modules as well.
>
> I've got 3.7 installed here. Is that good? or should I
> (finally) get around to packaging the current PyQt/PyKDE
> versions?

The change is only in the later versions of PyKDE-3.8 (like the 
one available at riverbankcomputing). The change only affects 
libpythonize (PyKDE-3.8/pythonize. directory), so you could just 
replace the version of libpythonize you're running now. That's a 
very short compile (copy the source files from the newer 
distribution, but use the older Makefile in the pythonize/ 
directory, and don't re-run build.py).

> > > I've been helping out with the "KDE on Debian" project
> > > lately and being able to write modules in python is highly
> > > desired capability to say the least. :)
> >
> > I can imagine. Haven't you got some sort of configuration
> > system which would benefit from the KControl treatment, or
> > am I thinking of someone else?
>
> Guilty as charged. :) Thanks a lot. Not having to hack
> kcontrol does simplify things.
>
> cheers,




More information about the PyQt mailing list