[pygtk] PolicyKit from Python

David Zeuthen david at fubar.dk
Fri Feb 8 00:28:31 WST 2008


On Wed, 2008-02-06 at 13:32 +0100, Murray Cumming wrote:
> 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.

The names of interfaces and objects changed a bit since 0.6 to 0.7 to
make it desktop agnostic (so in some future if the user is running
non-GNOME he will get a native authentication agent etc.); this is what
you should use

http://hal.freedesktop.org/docs/PolicyKit/model-authentication-agent.html
http://hal.freedesktop.org/docs/PolicyKit-gnome/ref-auth-daemon.html

There is no ShowDialog() any more. Does that clear it up?

      David




More information about the pygtk mailing list