Skip to content

Commit b8cb123

Browse files
committed
nicer dump of json in cache file, unindent section which searches for repos defined in teams
1 parent fd7f9ee commit b8cb123

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

githubcollective/config.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def dumps(self, filename=None):
6666
json.dump({
6767
'teams': [self._teams[name].dumps() for name in self.teams],
6868
'repos': [self._repos[name].dumps() for name in self.repos],
69-
}, f)
69+
}, f, indent=4)
7070
f.close()
7171

7272
def is_url(self, url):
@@ -139,13 +139,14 @@ def parse(self, data):
139139
self._teams[name] = Team(name, permission,
140140
members=members, repos=repos)
141141

142-
# add repos to teams (defined with repo: section
143-
for section in config.sections():
144-
if section.startswith('repo:'):
145-
repos = [section[len('repo:'):]]
146-
if config.has_option(section, 'team'):
147-
for team in config.get(section, 'team').split():
148-
self._teams[TEAM_PREFIX + team].repos.update(repos)
142+
# add repos to teams (defined with repo: section
143+
for section in config.sections():
144+
if section.startswith('repo:'):
145+
if config.has_option(section, 'teams'):
146+
for team in config.get(section, 'teams').split():
147+
self._teams[TEAM_PREFIX + team].repos.add(
148+
section[len('repo:'):],
149+
)
149150

150151
class ConfigGithub(Config):
151152

0 commit comments

Comments
 (0)