diff options
-rwxr-xr-x | layman/api.py | 12 | ||||
-rw-r--r-- | layman/overlays/source.py | 3 |
2 files changed, 14 insertions, 1 deletions
diff --git a/layman/api.py b/layman/api.py index fefb6a0..869d882 100755 --- a/layman/api.py +++ b/layman/api.py @@ -22,6 +22,7 @@ from layman.config import BareConfig from layman.dbbase import UnknownOverlayException, UnknownOverlayMessage from layman.db import DB, RemoteDB +from layman.overlays.source import require_supported #from layman.utils import path, delete_empty_directory # give them some values for now, these are from the packagekit backend @@ -499,6 +500,17 @@ class LaymanAPI(object): return messages return [] + def supported_types(self): + """returns a dictionary of all repository types, + with boolean values""" + cmds = [x for x in self.config.keys() if '_command' in x] + supported = {} + for cmd in cmds: + type_key = cmd.split('_')[0] + supported[type_key] = require_supported( + [(self.config[cmd],type_key, '')], self.output.warn) + return supported + def create_fd(): """creates file descriptor pairs an opens them ready for diff --git a/layman/overlays/source.py b/layman/overlays/source.py index 083beb6..a62cd15 100644 --- a/layman/overlays/source.py +++ b/layman/overlays/source.py @@ -53,7 +53,8 @@ def require_supported(binaries, _output): for command, mtype, package in binaries: kind, path = _resolve_command(command, _output) if not path: - _output(kind + ' ' + command + ' seems to be missing!' + if _output: + _output(kind + ' ' + command + ' seems to be missing!' ' Overlay type "' + mtype + '" not support' 'ed. Did you emerge ' + package + '?', 6) return False |