From 32ade1ed5f35f07779a50add0e81a98a11b0250c Mon Sep 17 00:00:00 2001 From: "WQY\\qiong" Date: Sat, 19 Nov 2022 00:05:16 +0800 Subject: [PATCH] Fix option exception --- api/s23_options.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/api/s23_options.py b/api/s23_options.py index 329e419..77034e2 100644 --- a/api/s23_options.py +++ b/api/s23_options.py @@ -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)