From 94a63c8d29d8bbc47ef4a58e33cdaa7d23708485 Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Mon, 17 Jan 2011 23:56:04 -0800 Subject: fix some screwups :( --- layman/api.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/layman/api.py b/layman/api.py index 360356f..fe754c8 100644 --- a/layman/api.py +++ b/layman/api.py @@ -240,19 +240,20 @@ class LaymanAPI(object): result = {} if local: - db = self._installed_db + db = self._get_installed_db() else: - db = self._available_db + db = self._get_remote_db() for ovl in repos: if not self.is_repo(ovl): - self._error(1, UNKNOWN_REPO_ID %ovl) + self._error(1, UNKNOWN_REPO_ID % ovl) result[ovl] = ('', False, False) try: overlay = db.select(ovl) #print "overlay = ", ovl #print overlay except UnknownOverlayException, error: + #print "ERRORS", str(error) self._error(2, "Error: %s" %str(error)) result[ovl] = ('', False, False) else: @@ -383,14 +384,14 @@ class LaymanAPI(object): def get_available(self, reload=False): """returns the list of available overlays""" - if not self._available_db or reload: + if self._available_ids is None or reload: self._available_ids = sorted(self._get_remote_db(reload).overlays) - return self._available_ids[:] + return self._available_ids[:] or ['None'] def get_installed(self, reload=False): """returns the list of installed overlays""" - if not self._installed_db or reload: + if self._installed_ids is None or reload: self._installed_ids = sorted(self._get_installed_db(reload).overlays) return self._installed_ids[:] @@ -404,7 +405,7 @@ class LaymanAPI(object): def _get_remote_db(self, reload=False): """returns the list of installed overlays""" - if not self._available_db or reload: + if self._available_db is None or reload: self._available_db = RemoteDB(self.config) return self._available_db -- cgit v1.2.3-65-gdbad