Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

nicer dump of json in cache file, unindent section which searches for…

… repos defined in teams
  • Loading branch information...
commit b8cb123b58774967b32b7e2abe2d0b1a283d633a 1 parent fd7f9ee
@garbas authored
Showing with 9 additions and 8 deletions.
  1. +9 −8 githubcollective/config.py
View
17 githubcollective/config.py
@@ -66,7 +66,7 @@ def dumps(self, filename=None):
json.dump({
'teams': [self._teams[name].dumps() for name in self.teams],
'repos': [self._repos[name].dumps() for name in self.repos],
- }, f)
+ }, f, indent=4)
f.close()
def is_url(self, url):
@@ -139,13 +139,14 @@ def parse(self, data):
self._teams[name] = Team(name, permission,
members=members, repos=repos)
- # add repos to teams (defined with repo: section
- for section in config.sections():
- if section.startswith('repo:'):
- repos = [section[len('repo:'):]]
- if config.has_option(section, 'team'):
- for team in config.get(section, 'team').split():
- self._teams[TEAM_PREFIX + team].repos.update(repos)
+ # add repos to teams (defined with repo: section
+ for section in config.sections():
+ if section.startswith('repo:'):
+ if config.has_option(section, 'teams'):
+ for team in config.get(section, 'teams').split():
+ self._teams[TEAM_PREFIX + team].repos.add(
+ section[len('repo:'):],
+ )
class ConfigGithub(Config):
Please sign in to comment.
Something went wrong with that request. Please try again.