diff options
author | Michał Klichowicz <emkael@tlen.pl> | 2023-10-04 23:38:29 +0200 |
---|---|---|
committer | Michał Klichowicz <emkael@tlen.pl> | 2023-10-04 23:38:29 +0200 |
commit | 314123c854bd808fc51e2d72694ef13becf581da (patch) | |
tree | 9561e20efc752929626d694200f141cd534fe8ea /src/main.py | |
parent | 540dcfb0300ec31919b14d31bed84a7bfaeab78f (diff) |
Warning when no boards for specified pbn_round are found in the file
Diffstat (limited to 'src/main.py')
-rw-r--r-- | src/main.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main.py b/src/main.py index 111cc39..d4bd3f0 100644 --- a/src/main.py +++ b/src/main.py @@ -271,9 +271,11 @@ 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']) + boards_found = False for b in pbn.boards: if b.has_field('Round'): if b.get_field('Round') == str(settings['pbn_round']): + boards_found = True board = int(b.get_field('Board')) if board not in board_mapping: @@ -296,6 +298,8 @@ def fetch_scores(pbn, db, settings): update_auction(db, b, settings['teamy_round'], settings['teamy_segment'], table, room, board_no, real_board_no=board) + if not boards_found: + logging.warning('No [Round "%s"] boards found in PBN file', str(settings['pbn_round'])) def main_loop(): |