Fix option exception
This commit is contained in:
@@ -110,12 +110,19 @@ def inp_in_option(section: list[str]) -> ChangeSet:
|
||||
for s in section:
|
||||
if s.startswith(';'):
|
||||
continue
|
||||
|
||||
line = s.upper().strip()
|
||||
for key in get_option_schema('').keys():
|
||||
if line.startswith(key):
|
||||
value = line.removeprefix(key).strip()
|
||||
cs |= { key : value }
|
||||
|
||||
tokens = s.strip().split()
|
||||
if tokens[0].upper() == 'QUALITY':
|
||||
value = tokens[1]
|
||||
if len(tokens) > 2:
|
||||
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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user