| Team |  |  |  |  |
%( buttons = { 0: """

# Player names

""", 1: """

"""} for id, img, bgcolor in [ (0, 'bub.png', '#c0ffc0'), (1, 'bob.png', '#c0c0ff'), (2,'boob.png', '#ffc0c0'), (3, 'beb.png', '#ffc000'), (4,'biob.png', '#ffff00'), (5, 'bab.png', '#c04040'), (6, 'bib.png', '#c0c0c0'), (7,'baub.png', '#fc60ff'), (8,'beab.png', '#4fa4ff'), (9,'biab.png', '#0ab237'), ]: keyid = "player%d" % id playername = options.get(keyid) or '' playername = playername.strip() for team in [1,2]: if playername.endswith('(%d)' % team): playername = playername[:-3].strip() break else: team = 'off' def nameval(value, team=team, teamid="team%d" % id): if team == value: s = 'checked ' else: s = '' return s + 'name="%s" value="%s"' % (teamid, value) print """

|  |  |  | 1 no 2

%s
""" % (bgcolor, img, keyid, playername, nameval(1), nameval('off'), nameval(2), buttons.get(id, '')) )s