From 86493ff0c90862ac2b985db7f0f566e3d68ad400 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Tue, 25 Aug 2009 17:50:49 -0600 Subject: [PATCH] Standard team colors --- points.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/points.py b/points.py index 273e623..55a74fa 100755 --- a/points.py +++ b/points.py @@ -112,7 +112,10 @@ class Storage: except IOError: pass - self.f = open(fn, 'ab') + try: + self.f = open(fn, 'ab') + except IOError: + self.f = None def __contains__(self, req): return req in self.events @@ -150,6 +153,19 @@ class Storage: return self.points_by_cat_team.get((cat, team), 0) +## +## Colors +## +def colors(teams): + colors = ['F0888A', '88BDF0', '00782B', '999900', 'EF9C00', + 'F4B5B7', 'E2EFFB', '89CA9D', 'FAF519', 'FFE7BB', + 'BA88F0', '8DCFF4', 'BEDFC4', 'FFFAB2', 'D7D7D7', + 'C5B9D7', '006189', '8DCB41', 'FFCC00', '898989'] + return dict(zip(teams, colors)) + + + + ## ## Testing ##