Skip to content

Commit

Permalink
nicer dump of json in cache file, unindent section which searches for…
Browse files Browse the repository at this point in the history
… repos defined in teams
  • Loading branch information
garbas committed Jul 3, 2011
1 parent fd7f9ee commit b8cb123
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions githubcollective/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):

Expand Down

0 comments on commit b8cb123

Please sign in to comment.