summaryrefslogtreecommitdiffstats
path: root/layman/api.py
diff options
context:
space:
mode:
authordol-sen <brian.dolbec@gmail.com>2011-07-30 09:52:54 -0700
committerdol-sen <brian.dolbec@gmail.com>2011-07-30 09:52:54 -0700
commit6bfa7e9204b4af2ee0fc816c87ea2bffcce61ccb (patch)
treee6fdd56d092c21c45ef18277e28a74533e135f39 /layman/api.py
parentba4481d37cbedc5700b5ea21c5a1897389ecc1cb (diff)
downloadlayman-6bfa7e9204b4af2ee0fc816c87ea2bffcce61ccb.tar.gz
layman-6bfa7e9204b4af2ee0fc816c87ea2bffcce61ccb.tar.bz2
layman-6bfa7e9204b4af2ee0fc816c87ea2bffcce61ccb.zip
add supported_types() to the api
Diffstat (limited to 'layman/api.py')
-rwxr-xr-xlayman/api.py12
1 files changed, 12 insertions, 0 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