def open_pulls(): """Displays currently open pull requests""" pulls = open_pull_requests(config.ORGANISATION_NAME) data = aggregate_data(config.ORGANISATION_NAME) return render_template('open_pull_requests.html', open_pulls = pulls, avatars = data['user_avatars'])
def user(username): """Show project stats for this user""" data = aggregate_data(config.ORGANISATION_NAME) return render_template('user.html', avatar = data['user_avatars'][username], organisation = data['organisation'], username = username, user = data['raw']['user_data'][username], project_stats = data['users'][username])
def index(): """Shows a leaderboard of users, in two categories: pull request creators and commenters""" data = aggregate_data(config.ORGANISATION_NAME) return render_template('index.html', avatars = data['user_avatars'], pulls = data['totals']['pulls'], comments = data['totals']['comments'], projects = data['raw']['projects'], organisation = data['organisation'])
def project(projectname): """Show user stats for this project""" data = aggregate_data(config.ORGANISATION_NAME) project_stats = data['projects'][projectname] if project_stats: project_stats.pop('pulls') project_stats.pop('comments') return render_template('project.html', organisation = data['organisation'], projectname = projectname, project_stats = project_stats, project = data['raw']['project_data'].get(projectname))
def test_aggregate_data(self): data = aggregate_data(self.organisation) assert_equals(sorted(data.keys()), sorted(['raw', 'user_avatars', 'projects', 'users', 'totals']))
def test_aggregate_data(self): data = aggregate_data(self.organisation) assert_equals( sorted(data.keys()), sorted(['raw', 'user_avatars', 'projects', 'users', 'totals']))