Kaydet (Commit) 4f2fd6b0 authored tarafından Bahadır Kandemir's avatar Bahadır Kandemir

Do nothing if PolicyKit is unavailable

üst 4973b458
2009-05-07 Bahadır Kandemir <bahadir@pardus.org.tr>
* api: Do nothing if PolicyKit is unavailable
2009-02-06 Bahadır Kandemir <bahadir@pardus.org.tr>
* api: socket parameter for Link class to connect any other DBus servers
......@@ -131,7 +131,10 @@ class Call:
if "DISPLAY" not in os.environ:
raise Exception, "X session required to query PolKit"
bus = dbus.SessionBus()
obj = bus.get_object("org.freedesktop.PolicyKit.AuthenticationAgent", "/")
obj = bus.get_object("org.freedesktop.PolicyKit.AuthenticationAgent", "/")
except dbus.DBusException, exception:
return False
iface = dbus.Interface(obj, "org.freedesktop.PolicyKit.AuthenticationAgent")
return iface.ObtainAuthorization(action, 0, os.getpid(), timeout=2**16-1) == 1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment