From e4e58bfa0a1537b26e09481ad8f87d3b42c9ca89 Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Sun, 16 Jan 2011 22:41:32 -0800 Subject: add optional repo list limiter to the list function --- layman/dbbase.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/layman/dbbase.py b/layman/dbbase.py index 0421e10..3ba8bb3 100644 --- a/layman/dbbase.py +++ b/layman/dbbase.py @@ -199,7 +199,7 @@ class DbBase: raise UnknownOverlayException(overlay) return self.overlays[overlay] - def list(self, verbose = False, width = 0): + def list(self, repos=None, verbose = False, width = 0): ''' List all overlays. @@ -236,8 +236,11 @@ class DbBase: ''' result = [] - for _, overlay in self.overlays.items(): + selection = [overlay for (a, overlay) in self.overlays.items()] + if repos: + selection = [overlay for overlay in selection if overlay.name in repos] + for overlay in selection: if verbose: result.append((str(overlay), overlay.is_supported(), overlay.is_official())) -- cgit v1.2.3-65-gdbad