How could I control a DBus timeout with PolicyKit?
Mario
maacub at gmail.com
Fri Oct 1 03:34:14 PDT 2010
Thanks very much Will! :)
I solved with a try-except in the call to the DBus service :D
Cheers!
On Fri, Oct 1, 2010 at 12:22 PM, Will Thompson
<will.thompson at collabora.co.uk> wrote:
> On 01/10/10 08:53, Mario wrote:
>>
>> My code:
>> ...........
>> try:
>> (is_auth, _, details) = self.polkit.CheckAuthorization(
>> ('unix-process', {'pid': dbus.UInt32(pid,
>> variant_level=1),
>> 'start-time': dbus.UInt64(0, variant_level=1)}),
>> privilege, {'': ''}, dbus.UInt32(1), '', timeout=600)
>> except:
>> raise #<----- This not get the timeout exception.
>> ............
>>
>>
>> The exception:
>> user at ubuntu:~/Desktop$ python 1.py
>> Traceback (most recent call last):
>> File "1.py", line 5, in<module>
>> print(iface.fw_unblock())
>> File "/usr/lib/pymodules/python2.6/dbus/proxies.py", line 68, in
>> __call__
>> return self._proxy_method(*args, **keywords)
>> File "/usr/lib/pymodules/python2.6/dbus/proxies.py", line 140, in
>> __call__
>> **keywords)
>> File "/usr/lib/pymodules/python2.6/dbus/connection.py", line 620, in
>> call_blocking
>> message, timeout)
>
> This backtrace isn't from the method call you show in your code, which would
> be why its try: ... except: ... wrapper isn't doing much. :)
>
> --
> Will
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus
>
More information about the dbus
mailing list