From: Michael Tremer Date: Sat, 3 Dec 2016 14:01:59 +0000 (+0100) Subject: config: Add get_repos() to get all repository definitions X-Git-Tag: 0.9.28~1285^2~1421 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c2432fd42e909d7407542df05ba599f4b732b30;p=pakfire.git config: Add get_repos() to get all repository definitions Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/config.py b/src/pakfire/config.py index 530397f09..01227f660 100644 --- a/src/pakfire/config.py +++ b/src/pakfire/config.py @@ -91,6 +91,19 @@ class Config(object): log.debug(" %-20s: %s" % (option, value)) + def get_repos(self): + repos = [] + for section in self._config.sections(): + if not section.startswith("repo:"): + continue + + name = section[5:] + + repo = self._config.items(section) + repos.append((name, dict(repo))) + + return repos + # Read initial configuration config = Config("general.conf")