Fix option exception

This commit is contained in:
WQY\qiong
2022-11-19 00:05:16 +08:00
parent d73b90c20a
commit 32ade1ed5f

View File

@@ -110,12 +110,19 @@ def inp_in_option(section: list[str]) -> ChangeSet:
for s in section: for s in section:
if s.startswith(';'): if s.startswith(';'):
continue continue
line = s.upper().strip() tokens = s.strip().split()
for key in get_option_schema('').keys(): if tokens[0].upper() == 'QUALITY':
if line.startswith(key): value = tokens[1]
value = line.removeprefix(key).strip() if len(tokens) > 2:
cs |= { key : value } value += f' {tokens[2]}'
cs |= { 'QUALITY' : value }
else:
line = s.upper().strip()
for key in get_option_schema('').keys():
if line.startswith(key):
value = line.removeprefix(key).strip()
cs |= { key : value }
return ChangeSet(cs) return ChangeSet(cs)