diff options
author | Michał Klichowicz <emkael@tlen.pl> | 2023-10-04 23:37:41 +0200 |
---|---|---|
committer | Michał Klichowicz <emkael@tlen.pl> | 2023-10-04 23:37:41 +0200 |
commit | 540dcfb0300ec31919b14d31bed84a7bfaeab78f (patch) | |
tree | 0bb72ac9d9d978e29403ed22186b7529952d2d6b /src | |
parent | c1e0672ccd4a4ae140db7a9f88b9dbd34e230813 (diff) |
Detecting tables in PBN that are not in Teamy event (probably a very bad situation)
Diffstat (limited to 'src')
-rw-r--r-- | src/main.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main.py b/src/main.py index 05d6b02..111cc39 100644 --- a/src/main.py +++ b/src/main.py @@ -89,6 +89,9 @@ def fetch_lineups(pbn, db, settings): for t, rooms in tables.items(): table = get_digits(t) + if table not in round_lineup: + logging.error('[Table "%s"] not in tournament for round %s-%s', table, settings['teamy_round'], settings['teamy_segment']) + continue home_team = round_lineup[table][0] away_team = round_lineup[table][1] home_roster = rosters[home_team] @@ -266,6 +269,7 @@ def update_auction(db, pbn_board, round_no, segment_no, table, room, board_no, r def fetch_scores(pbn, db, settings): + round_lineup = get_round_lineup(db, settings['teamy_round'], settings['teamy_segment']) board_mapping = get_board_mapping(db, settings['teamy_round'], settings['teamy_segment']) for b in pbn.boards: if b.has_field('Round'): @@ -277,10 +281,16 @@ def fetch_scores(pbn, db, settings): board, settings['teamy_round'], settings['teamy_segment']) continue + board_no = board_mapping[board] + table = get_digits(b.get_field('Table')) room = 1 if b.get_field('Room') == 'Open' else 2 + if table not in round_lineup: + logging.error('[Table "%s"] not in tournament for round %s-%s', table, settings['teamy_round'], settings['teamy_segment']) + continue + update_score(db, b, settings['teamy_round'], settings['teamy_segment'], table, room, board_no, real_board_no=board, overwrite=settings['overwrite_scores']) |