[PyKDE] KControl Modules II (Simon Edwards)

David Boddie david at boddie.org.uk
Sat Jan 3 17:58:00 GMT 2004


On Sat, 3 Jan 2004 11:45:34, Simon Edwards <simon at simonzone.com> wrote:

> Hello all,

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. I've got three installed at the moment
which appear to live together nicely within the Control Centre, allowing me
to switch between them without apparent problems. I'll upload the latest
build system to 

    http://www.boddie.org.uk/david/Projects/Python/KDE/

a bit later today. The pykde-components archive will have today's date;
don't grab the one from December by accident!

> Now, what is interesting in kcontrol is that when you run a root-only
> module by clicking on the "Administrator Mode" button the module is then
> started up outside kcontrol (using kcmshell I think) in a separate process
> and the contents of the module are then embedded in the kcontrol window. To
> the user it looks all normal, but under the surface the module is running
> in its own process.

Yes, although it should try to embed the window within KControl, sometimes
it doesn't manage it, and this results in a separate window.

> Could this same approach be used to run python modules in kcontrol?
> (Instead of having an "Administrator Mode" button, python modules would
> have to be always started out-of-process and then embedded. Yes, kcontrol
> would have to modified a little bit.) I'm fairly sure that it can, but I
> want to ask you guys too just to be safe.

It's a good idea, but it might not be necessary unless you find some problems
with the current arrangement.

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.

Maybe I'll throw the sources for the libpythonize variant into the components
package, too.

> 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?

All the best,

David




More information about the PyQt mailing list