[pygtk] PolicyKit from Python

Murray Cumming murrayc at murrayc.com
Wed Feb 6 21:32:57 WST 2008


On Tue, 2008-02-05 at 15:58 +0100, Murray Cumming wrote:
> Does anyone know if there are already PolicyKit (and
> policykit-gnome) python bindings?

I discovered that I can probably do this with just the D-Bus API. I made
the attached test case after some googling, but the call to PolicyKit's
ObtainAuthorization() doesn't seem to have any effect. I'd welcome any
advice.

I'm on Ubuntu Hardy Heron, where PolicyKit is definitely working, as
seen when I try to use the Services control panel, for instance, which
has an Unlock button.

I believe that I need to call ShowDialog() if ObtainAuthorization()
denies authorization, but I want to understand this first part.


-- 
murrayc at murrayc.com
www.murrayc.com
www.openismus.com
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_policykit.py
Type: text/x-python
Size: 1995 bytes
Desc: not available
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20080206/d79a4b91/test_policykit.py


More information about the pygtk mailing list