Skip to content

Commit 669a446

Browse files
remote engine levels
1 parent 89609ea commit 669a446

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

uci/read.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,23 @@ def read_engine_ini(engine_shell=None, engine_path=None):
4141
for section in config.sections():
4242
parser = configparser.ConfigParser()
4343
parser.optionxform = str
44+
4445
level_dict = {}
45-
if parser.read(engine_path + os.sep + section + '.uci'):
46+
if engine_shell is None:
47+
success = parser.read(engine_path + os.sep + section + '.uci')
48+
else:
49+
try:
50+
with engine_shell.open(engine_path + os.sep + section + '.uci', 'r') as file:
51+
parser.read_file(file)
52+
success = True
53+
except FileNotFoundError:
54+
success = False
55+
if success:
4656
for p_section in parser.sections():
4757
level_dict[p_section] = {}
4858
for option in parser.options(p_section):
4959
level_dict[p_section][option] = parser[p_section][option]
60+
5061
confsect = config[section]
5162
text = Dgt.DISPLAY_TEXT(l=confsect['large'], m=confsect['medium'], s=confsect['small'], wait=True, beep=False,
5263
maxtime=0, devs={'ser', 'i2c', 'web'})

0 commit comments

Comments
 (0)