diff options
Diffstat (limited to 'portato/backend/catapult/system.py')
-rw-r--r-- | portato/backend/catapult/system.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/portato/backend/catapult/system.py b/portato/backend/catapult/system.py index cfa74ed..c5365c9 100644 --- a/portato/backend/catapult/system.py +++ b/portato/backend/catapult/system.py @@ -14,6 +14,7 @@ from __future__ import absolute_import import re, os from gettext import lgettext as _ +from threading import Event import dbus from .package import CatapultPackage @@ -124,7 +125,21 @@ class CatapultSystem (SystemInterface): return self.proxy.reload_settings() def update_world (self, newuse = False, deep = False): - return [(CatapultPackage(x), CatapultPackage(y)) for x,y in self.proxy.update_world(newuse, deep, {})] + + ret = [] + e = Event() + + def wait (list): + ret.extend([(CatapultPackage(x), CatapultPackage(y)) for x,y in list]) + e.set() + + def error (ex): + raise ex + + self.proxy.update_world(newuse, deep, {}, reply_handler = wait, error_handler = error) + e.wait() + return ret + # return [(CatapultPackage(x), CatapultPackage(y)) for x,y in self.proxy.update_world(newuse, deep, {})] def get_updated_packages (self): return self.geneticize_list(self.proxy.get_updated_packages()) |