Skip to content

Commit 5b1fb4e

Browse files
remote engine levels
1 parent 669a446 commit 5b1fb4e

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

uci/engine.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,20 @@ def startup(self, options: dict, show=True):
254254
"""Startup engine."""
255255
parser = configparser.ConfigParser()
256256
parser.optionxform = str
257-
if not options and parser.read(self.get_file() + '.uci'):
258-
options = dict(parser[parser.sections().pop()])
257+
258+
if not options:
259+
if self.shell is None:
260+
success = parser.read(self.get_file() + '.uci')
261+
else:
262+
try:
263+
with self.shell.open(self.get_file() + '.uci', 'r') as file:
264+
parser.read_file(file)
265+
success = True
266+
except FileNotFoundError:
267+
success = False
268+
if success:
269+
options = dict(parser[parser.sections().pop()])
270+
259271
self.level_support = bool(options)
260272

261273
logging.debug('setting engine with options %s', options)

0 commit comments

Comments
 (0)