diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-09-27 18:54:51 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpg@redhat.com> | 2007-09-27 18:54:25 (GMT) |
commit | ef7e4fc70eb5cf2b9240b0fc6ad68a7d3298b441 (patch) | |
tree | 549aa13419fb24066aa285f1c7b23d7525b8b787 /downloadmanager.py | |
parent | 2aa7486c21b71329016e6cec4f9c2322812e8a26 (diff) |
Cope with dbus-python 0.82.2 fixing async call timeouts
Diffstat (limited to 'downloadmanager.py')
-rw-r--r-- | downloadmanager.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/downloadmanager.py b/downloadmanager.py index 20f0d62..dfc8a10 100644 --- a/downloadmanager.py +++ b/downloadmanager.py @@ -30,6 +30,14 @@ from sugar.clipboard import clipboardservice from sugar import profile from sugar import objects +# #3903 - this constant can be removed and assumed to be 1 when dbus-python +# 0.82.3 is the only version used +import dbus +if dbus.version >= (0, 82, 3): + DBUS_PYTHON_TIMEOUT_UNITS_PER_SECOND = 1 +else: + DBUS_PYTHON_TIMEOUT_UNITS_PER_SECOND = 1000 + _browser = None _temp_path = '/tmp' def init(browser, temp_path): @@ -126,7 +134,7 @@ class Download: datastore.write(self._dl_jobject, reply_handler=self._internal_save_cb, error_handler=self._internal_save_error_cb, - timeout=360000) + timeout=360 * DBUS_PYTHON_TIMEOUT_UNITS_PER_SECOND) def _cleanup_datastore_write(self): global _active_ds_writes |