Skip to content

Commit 508cefc

Browse files
Copilotfsmosca
andcommitted
Skip managed UCI options during analysis startup
Agent-Logs-Url: https://github.com/fsmosca/Python-Easy-Chess-GUI/sessions/8cacb687-7f24-4e3d-a2bb-0c4416bdb89d Co-authored-by: fsmosca <22366935+fsmosca@users.noreply.github.com>
1 parent c160a5b commit 508cefc

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

python_easy_chess_gui.py

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -486,19 +486,24 @@ def configure_engine(self):
486486
487487
However if default_value and user_value are the same, we will not send
488488
commands to set the option value because the value is default already.
489-
"""
490-
with open(self.engine_config_file, 'r') as json_file:
491-
data = json.load(json_file)
492-
for p in data:
493-
if p['name'] == self.engine_id_name:
494-
for n in p['options']:
495-
496-
if n['name'].lower() == 'ownbook':
497-
self.is_ownbook = True
498-
499-
# Ignore button type for a moment.
500-
if n['type'] == 'button':
501-
continue
489+
"""
490+
with open(self.engine_config_file, 'r') as json_file:
491+
data = json.load(json_file)
492+
managed_uci_options = {name.lower() for name in MANAGED_UCI_OPTIONS}
493+
for p in data:
494+
if p['name'] == self.engine_id_name:
495+
for n in p['options']:
496+
option_name = n['name'].lower()
497+
498+
if option_name == 'ownbook':
499+
self.is_ownbook = True
500+
501+
if self.analysis and option_name in managed_uci_options:
502+
continue
503+
504+
# Ignore button type for a moment.
505+
if n['type'] == 'button':
506+
continue
502507

503508
if n['type'] == 'spin':
504509
user_value = int(n['value'])

0 commit comments

Comments
 (0)