Skip to content

Commit

Permalink
remote engine levels
Browse files Browse the repository at this point in the history
  • Loading branch information
LocutusOfPenguin committed Jan 16, 2018
1 parent 669a446 commit 5b1fb4e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions uci/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,20 @@ def startup(self, options: dict, show=True):
"""Startup engine."""
parser = configparser.ConfigParser()
parser.optionxform = str
if not options and parser.read(self.get_file() + '.uci'):
options = dict(parser[parser.sections().pop()])

if not options:
if self.shell is None:
success = parser.read(self.get_file() + '.uci')
else:
try:
with self.shell.open(self.get_file() + '.uci', 'r') as file:
parser.read_file(file)
success = True
except FileNotFoundError:
success = False
if success:
options = dict(parser[parser.sections().pop()])

self.level_support = bool(options)

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

0 comments on commit 5b1fb4e

Please sign in to comment.