aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevan Franchini <twitch153@gentoo.org>2015-07-13 09:25:36 -0400
committerDevan Franchini <twitch153@gentoo.org>2015-07-13 09:25:39 -0400
commita3ef79ecdc93c82a599cab3eef1be49d7ca40a9d (patch)
tree8633cdb64877262f9fe4f57964e0d4da1f334394
parentoverlay.py: Quick code cleanup (diff)
downloadlayman-a3ef79ecdc93c82a599cab3eef1be49d7ca40a9d.tar.gz
layman-a3ef79ecdc93c82a599cab3eef1be49d7ca40a9d.tar.bz2
layman-a3ef79ecdc93c82a599cab3eef1be49d7ca40a9d.zip
Adds switch on read_db if text is provided
Logically speaking, if the database "document" text is provided then it will likely not be universal to every database provided. Therefore adding another parameter that specifies the type of text that is being provided will help distinguish which database type it is.
-rw-r--r--layman/dbbase.py11
-rw-r--r--layman/remotedb.py2
2 files changed, 9 insertions, 4 deletions
diff --git a/layman/dbbase.py b/layman/dbbase.py
index 56ef158..09133c2 100644
--- a/layman/dbbase.py
+++ b/layman/dbbase.py
@@ -167,12 +167,17 @@ class DbBase(object):
return
- def read_db(self, path, text=None):
+ def read_db(self, path, text=None, text_type=None):
'''
Read the overlay database for installed overlay definitions.
'''
- for types in self.db_types:
- db_ctl = self.mod_ctl.get_class(types)(self.config,
+ if text and text_type:
+ types = [text_type]
+ else:
+ types = self.db_types
+
+ for t in types:
+ db_ctl = self.mod_ctl.get_class(t)(self.config,
self.overlays,
self.paths,
self.ignore,
diff --git a/layman/remotedb.py b/layman/remotedb.py
index cd6ece3..89caf7a 100644
--- a/layman/remotedb.py
+++ b/layman/remotedb.py
@@ -280,7 +280,7 @@ class RemoteDB(DbBase):
def _check_download(self, olist, url):
try:
- self.read_db(url, text=olist)
+ self.read_db(url, text=olist, text_type="xml_db")
except Exception as error:
self.output.debug("RemoteDB._check_download(), url=%s \nolist:\n"
% url,2)