Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 49167e18ce5e242ec2a5d45fe0a1aa76 > files > 90

PyKDE4-devel-4.6.5-1.fc14.i686.rpm

This is a slightly incomplete example of using the PolkitQt support in
PyKDE4 (KDE 4.3 and higher) The PolkitQt has a good example which
demonstrates what you can do with it. pyexample.py and pyexamplehelper.py
are Python replacements for the C++ versions used in the example.

If you want to run this code, first build and install the example in
PolkitQt. pkexample.py is the easiest one to run. It should work fine with
C++ backend. If you manually run the pkexamplehelper.py as root you can also
test out the Python example back end. (You'll have to 'kill' afterwards as
it won't shut down by itself).

The two Python replacements are very similar to their C++ counterparts. The
biggest difference is in pyexamplehelper.py. PyQt4 doesn't support QDBus.
But it does support using the standard DBus Python bindings with PyQt4.
pyexamplehelper.py uses PolkitQt for the authorization check in combination
with the standard DBus Python bindings, with no loss of functionality. 

--Simon Edwards <simon@simonzone.com>
21 June, 2009