From 5a34b88aa4d9ec43f34ff71be18a7ca8ce367da6 Mon Sep 17 00:00:00 2001 From: Michael Mulich Date: Mon, 5 Dec 2011 10:03:22 -0500 Subject: [PATCH] Iterate over it our own way, because we want the keys, not the values. --- pkgmeta/config.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgmeta/config.py b/pkgmeta/config.py index 54b80c9..ed81aa7 100644 --- a/pkgmeta/config.py +++ b/pkgmeta/config.py @@ -8,7 +8,7 @@ ) -class RepositoryConfig: +class RepositoryConfig(Mapping): """A repository configuration""" def __init__(self, name, type=None, sources=None, @@ -86,7 +86,9 @@ def __len__(self): return len(self.repositories) def __iter__(self): - return iter(self.repositories) + for r in self.repositories: + yield r.name + raise StopIteration def __getitem__(self, key): return self.get_repository_config(key)