[PyKDE] Kcontrol modules.

Simon Edwards simon at simonzone.com
Tue Jul 8 20:25:00 BST 2003


Hello all,

Anyone here tried doing kcontrol modules in Python+PyKDE?

After seeing the success of IOSlaves in Python, I would like to be able to 
kcontrol modules (kcm). I've been playing a bit with coding some admin progs 
that really should be integrated with the control center.

I had a look at the IOSlave code and saw that it works quite differently than 
kcms. Kcms are basically shared libraries that have a factory method that 
returns a instances of a subclass of KCModule.

What I would like is some opinions on the three ways of doing in kcms in 
Python. (the 3 ways that I can think of ;-) ):

1) Implement in C/C++ a kcm that takes a python script from somewhere, creates 
a KCModule instance using the script and returns it back to KDE Control for 
running/embedding. This would be a case of C++ calling a library which 
returns a PyKDE/Python object. I don't know if this is possible.

2) Implement in C/C++ a kcm and a subclass of KCModule (Pykcm). Pykcm embeds 
the Python interpretter, and takes a python script from somewhere. It then 
delegates its methods out to the corresponding methods in the script. This 
sounds possible, and it probably a good solution (if it works. ;-) )

3) Implement in C/C++ a kcm that runs an external python script that then uses  
QXEmbed (see the KDE API docs) to embed itself in the KDE Control center. 
This is quite do-able I think, but there may be some draw backs.

Any thoughts?

-- 
Simon Edwards             | Guarddog Firewall
simon at simonzone.com       | http://www.simonzone.com/software/
Nijmegen, The Netherlands | "ZooTV? You made the right choice."




More information about the PyQt mailing list