@@ -2089,33 +2089,31 @@ def play_game(self, window: sg.Window, board: chess.Board):
20892089 if button is None :
20902090 search .stop ()
20912091 is_search_stop_for_exit = True
2092- try :
2093- msg = self .queue .get_nowait ()
2094- if 'pv' in msg :
2095- # Reformat msg, remove the word pv at the end
2096- adviser_line = ' ' .join (msg .split ()[0 :- 1 ])
2097- window .Element ('advise_info_k' ).Update (adviser_line )
2098- except queue .Empty :
2099- continue
2100- except Exception :
2101- logging .exception (
2102- 'Unexpected error reading adviser queue' )
2103- continue
2104-
2105- if 'bestmove' in msg :
2106- if adviser_line :
2107- # Shorten the displayed line to 3 ply moves.
2108- adviser_line = ' ' .join (
2109- adviser_line .split ()[0 :3 ])
2110- else :
2111- bestmove_parts = msg .split (maxsplit = 1 )
2112- if len (bestmove_parts ) > 1 :
2113- bestmove = bestmove_parts [1 ]
2114- else :
2115- bestmove = '(none)'
2116- adviser_line = f'bestmove { bestmove } '
2117- adviser_line += ' - ' + self .adviser_id_name
2118- window .Element ('advise_info_k' ).Update (adviser_line )
2092+ try :
2093+ msg = self .queue .get_nowait ()
2094+ if 'info_all' in msg :
2095+ # Remove the trailing info_all tag
2096+ adviser_line = ' ' .join (msg .split ()[0 :- 1 ])
2097+ window .Element ('advise_info_k' ).Update (adviser_line )
2098+ except queue .Empty :
2099+ continue
2100+ except Exception :
2101+ logging .exception (
2102+ 'Unexpected error reading adviser queue' )
2103+ continue
2104+
2105+ if 'bestmove' in msg :
2106+ if adviser_line :
2107+ adviser_line += ' - ' + self .adviser_id_name
2108+ else :
2109+ bestmove_parts = msg .split (maxsplit = 1 )
2110+ if len (bestmove_parts ) > 1 :
2111+ bestmove = bestmove_parts [1 ]
2112+ else :
2113+ bestmove = '(none)'
2114+ adviser_line = \
2115+ f'bestmove { bestmove } - { self .adviser_id_name } '
2116+ window .Element ('advise_info_k' ).Update (adviser_line )
21192117 break
21202118
21212119 search .join ()
0 commit comments