summaryrefslogtreecommitdiff
path: root/ausbutler/interface.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2018-10-14 09:11:18 +0200
committeremkael <emkael@tlen.pl>2018-10-14 09:11:18 +0200
commitd0b64e8366ce9146805e2277258e18e936d985bf (patch)
treeb937a5d8aa6cc216620fe545aaaee2f3e2ee3743 /ausbutler/interface.py
parent4d6c92958d5ae5e21bc13eee6cc4526ccff5d4f7 (diff)
Warning when player in butler is missing from players list
Diffstat (limited to 'ausbutler/interface.py')
-rw-r--r--ausbutler/interface.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/ausbutler/interface.py b/ausbutler/interface.py
index d19ba7e..2b597a5 100644
--- a/ausbutler/interface.py
+++ b/ausbutler/interface.py
@@ -174,6 +174,8 @@ class Interface(object):
butler.table.tabl,
self.translation.get_translation(line)
)
+ if butler.player is None:
+ print 'WARNING: player ID=%d (round %d, segment %d) not in players database' % (butler.id, round_no, segment_no)
if position not in results:
results[position] = {'players': []}
results[position]['place'] = ''
@@ -181,7 +183,7 @@ class Interface(object):
str(butler.player).decode('utf8'))
results[position]['position'] = position
results[position]['team'] = str(
- butler.player.team_).decode('utf8')
+ butler.player.team_).decode('utf8') if butler.player else ''
results[position]['score'] = butler.score
results[position]['opp_score'] = butler.opp_score
results[position]['norm_score'] = butler.corrected_score
@@ -240,7 +242,7 @@ class Interface(object):
if butler.id not in players:
players[butler.id] = {
'name': str(butler.player).decode('utf8'),
- 'team': str(butler.player.team_).decode('utf8'),
+ 'team': str(butler.player.team_).decode('utf8') if butler.player else None,
'sum': 0,
'count': 0,
'results': copy(result_template)