Esempio n. 1
0
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'])
Esempio n. 2
0
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])
Esempio n. 3
0
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'])
Esempio n. 4
0
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))
Esempio n. 5
0
 def test_aggregate_data(self):
     data = aggregate_data(self.organisation)
     assert_equals(sorted(data.keys()), sorted(['raw', 'user_avatars', 'projects', 'users', 'totals']))
Esempio n. 6
0
 def test_aggregate_data(self):
     data = aggregate_data(self.organisation)
     assert_equals(
         sorted(data.keys()),
         sorted(['raw', 'user_avatars', 'projects', 'users', 'totals']))