Skip to content

Commit

Permalink
Iterate over it our own way, because we want the keys, not the values.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmulich committed Dec 5, 2011
1 parent 42ca625 commit 5a34b88
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkgmeta/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
)


class RepositoryConfig:
class RepositoryConfig(Mapping):
"""A repository configuration"""

def __init__(self, name, type=None, sources=None,
Expand Down Expand Up @@ -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)

0 comments on commit 5a34b88

Please sign in to comment.