Gussy up the scoreboard

This commit is contained in:
Neale Pickett 2009-08-27 16:33:47 -06:00
parent e1a43cb9a7
commit 0a07f40ff4
2 changed files with 11 additions and 11 deletions

View File

@ -18,10 +18,9 @@ fn = 'scores.hist'
scoresfile = open(fn, 'w')
i = 2
for team in teams:
plotparts.append('"%s" using 1:%d with lines linetype rgb "#%s"' % (fn, i, teamcolors[team]))
plotparts.append('"%s" using 1:%d with lines linewidth 2 linetype rgb "#%s"' % (fn, i, teamcolors[team]))
scores[team] = 0
i += 1
print(plotparts)
def write_scores(t):
scoresfile.write('%d' % t)
@ -51,7 +50,7 @@ gp.write('set border 3\n')
gp.write('set xtics nomirror\n')
gp.write('set ytics nomirror\n')
gp.write('set nokey\n')
gp.write('set terminal png transparent x000000 xffffff\n')
gp.write('set terminal png transparent size 640,200 x000000 xffffff\n')
gp.write('set output "histogram.png"\n')
gp.write('plot %s\n' % ','.join(plotparts))
gp.flush()

View File

@ -3,19 +3,16 @@
import cgitb; cgitb.enable()
import points
print('Content-type: text/html')
print()
s = points.Storage('scores.dat')
rows = 20
teams = s.teams()
categories = [(cat, s.cat_points(cat)) for cat in s.categories()]
teamcolors = points.colors(teams)
print('''<?xml version="1.0" encoding="UTF-8"?>
print('Content-type: text/html')
print()
print('''<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
@ -44,6 +41,10 @@ for cat, total in categories:
print('</tr>')
print('''</table>
<img src="histogram.png" />
<img src="histogram.png" alt=""/>
</body>
</html>''')
# Local Variables:
# mode: python
# End: