aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'layman/api.py')
-rw-r--r--layman/api.py15
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