#!/usr/bin/env python3 import cgitb; cgitb.enable() import points s = points.Storage('scores.dat') teams = s.teams() categories = [(cat, s.cat_points(cat)) for cat in s.categories()] teamcolors = points.colors(teams) print('Content-type: text/html') print() print('''
%s (%d) | ' % (cat, points)) print('
---|
') scores = sorted([(s.team_points_in_cat(cat, team), team) for team in teams]) for points, team in scores: color = teamcolors[team] print(' | ') print(' ') print('