summaryrefslogtreecommitdiff
path: root/portato/backend/catapult
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
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/__init__.py3
-rw-r--r--portato/backend/catapult/package.py15
-rw-r--r--portato/backend/catapult/system.py17
3 files changed, 26 insertions, 9 deletions
diff --git a/portato/backend/catapult/__init__.py b/portato/backend/catapult/__init__.py
index 47fc042..348b941 100644
--- a/portato/backend/catapult/__init__.py
+++ b/portato/backend/catapult/__init__.py
@@ -12,5 +12,8 @@
from __future__ import absolute_import
+from dbus.mainloop.glib import DBusGMainLoop
+DBusGMainLoop(set_as_default=True)
+
from .system import CatapultSystem
from .package import CatapultPackage
diff --git a/portato/backend/catapult/package.py b/portato/backend/catapult/package.py
index b5f3539..b1dbcfb 100644
--- a/portato/backend/catapult/package.py
+++ b/portato/backend/catapult/package.py
@@ -34,12 +34,6 @@ class CatapultPackage(Package):
suggest = ""
return str(self.proxy.use_expanded(self.get_cpv(), flag, suggest))
- def get_cp (self):
- return str(self.proxy.get_cp(self.get_cpv()))
-
- def get_slot_cp (self):
- return str(self.proxy.get_slot_cp(self.get_cpv()))
-
def get_package_path(self):
return str(self.proxy.get_package_path(self.get_cpv()))
@@ -107,7 +101,12 @@ class CatapultPackage(Package):
return [str(x) for x in self.proxy.get_matched_dep_packages(self.get_cpv(), self.get_new_use_flags())]
def get_dep_packages (self, depvar = ["RDEPEND", "PDEPEND", "DEPEND"], with_criterions = False):
- return [str(x) for x in self.proxy.get_dep_packages(self.get_cpv(), depvar, self.get_new_use_flags(), with_criterions)]
+ pkgs = self.proxy.get_dep_packages(self.get_cpv(), depvar, self.get_new_use_flags())
+
+ if not with_criterions:
+ return [str(x) for x,y in pkgs]
+ else:
+ return [(str(x),str(y)) for x,y in pkgs]
def get_global_settings(self, key):
return str(self.proxy.get_global_settings(self.get_cpv(), key))
@@ -122,7 +121,7 @@ class CatapultPackage(Package):
return " ".join(self.proxy.get_use_flags(self.get_cpv()))
def compare_version(self, other):
- return self.proxy.compare_version(self.get_cpv(), other)
+ return self.proxy.compare_version(self.get_cpv(), other.get_cpv())
def matches (self, criterion):
return self.proxy.matches(self.get_cpv(), criterion)
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())