diff options
author | Brian Dolbec <brian.dolbec@gmail.com> | 2011-01-17 23:56:04 -0800 |
---|---|---|
committer | Brian Dolbec <brian.dolbec@gmail.com> | 2011-01-17 23:56:04 -0800 |
commit | 94a63c8d29d8bbc47ef4a58e33cdaa7d23708485 (patch) | |
tree | 3d5ddd2b7a048664b7e395fd2f266e07db2640b5 | |
parent | fix the missing '+' and line continuation (diff) | |
download | overlord-94a63c8d29d8bbc47ef4a58e33cdaa7d23708485.tar.gz overlord-94a63c8d29d8bbc47ef4a58e33cdaa7d23708485.tar.bz2 overlord-94a63c8d29d8bbc47ef4a58e33cdaa7d23708485.zip |
fix some screwups :(
-rw-r--r-- | layman/api.py | 15 |
1 files 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 |