diff options
author | Brian Dolbec <brian.dolbec@gmail.com> | 2011-01-16 22:41:32 -0800 |
---|---|---|
committer | Brian Dolbec <brian.dolbec@gmail.com> | 2011-01-16 22:41:32 -0800 |
commit | e4e58bfa0a1537b26e09481ad8f87d3b42c9ca89 (patch) | |
tree | 407f9b5faf9d768514609f8d679da4b3ab0ef925 | |
parent | slight code change to my modified base. (diff) | |
download | overlord-e4e58bfa0a1537b26e09481ad8f87d3b42c9ca89.tar.gz overlord-e4e58bfa0a1537b26e09481ad8f87d3b42c9ca89.tar.bz2 overlord-e4e58bfa0a1537b26e09481ad8f87d3b42c9ca89.zip |
add optional repo list limiter to the list function
-rw-r--r-- | layman/dbbase.py | 7 |
1 files 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())) |