[PyKDE] logging

Jim Bublitz jbublitz at nwinternet.com
Fri Jul 30 00:26:00 BST 2004


On Thursday 29 July 2004 14:33, Lionel Roubeyrie wrote:

> How with PyQt/PyKDE can I use the root authentification dialogbox? I wrote
> an application where root must be the only one who can have access.

If you just want to verify that the user running the app is root, you can do 
that in Python more easily - os.getuid and friends.

If you want the user to provide the root password before starting the app, you 
can do it graphically. Instead of "python foo.py", run (or bind to a menu or 
panel button) "kdesu -c"python foo.py". That's how, for example, the 
konqueror "super user" menu entry is done in KDE.

If you want to do your own validation within your program, you can do your own 
password checking from Python, or you can look at the kdesu PyKDE module. 
It's been in PyKDE for quite a while, but I've never written code using it, 
and KDE doesn't appear to document it. I'd love to have an example program if 
you get it working (or hear about what's missing if you can't).

It's fairly easy to write bindings without a clue about what the code does, 
and kdesu (and probably kdeprint) are in that category. I've never even had a 
question about it, so I'm not sure anyone is using it - speak up if you are.

Jim




More information about the PyQt mailing list