summaryrefslogtreecommitdiff
path: root/portato/backend/catapult/system.py
diff options
context:
space:
mode:
authorNecoro <>2007-11-01 23:55:10 +0000
committerNecoro <>2007-11-01 23:55:10 +0000
commitc1fff1ed4879dcc035cbf77e648074e952c0f925 (patch)
treebb1cc8c0a8075d9010ef03305a042bf312f45be5 /portato/backend/catapult/system.py
parentb7c30a8494c0cc7f74fcd3810a2c146ae3b1a6e4 (diff)
downloadportato-c1fff1ed4879dcc035cbf77e648074e952c0f925.tar.gz
portato-c1fff1ed4879dcc035cbf77e648074e952c0f925.tar.bz2
portato-c1fff1ed4879dcc035cbf77e648074e952c0f925.zip
r521@Devoty: necoro | 2007-10-31 17:19:09 +0100
r522@Devoty: necoro | 2007-11-02 00:51:00 +0100 No more instanceof calls r523@Devoty: necoro | 2007-11-02 00:51:51 +0100 Fixed bugs; removed unnecessairy dbus calls; make update world being async r524@Devoty: necoro | 2007-11-02 00:52:09 +0100 always use catapult
Diffstat (limited to '')
-rw-r--r--portato/backend/catapult/system.py17
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())