First pass scan

This commit is contained in:
WQY\qiong
2023-03-09 22:44:13 +08:00
parent 369e636e13
commit 96cb99b87a
11 changed files with 156 additions and 7 deletions

View File

@@ -44,7 +44,11 @@ def inp_in_option_v3(section: list[str]) -> ChangeSet:
tokens = s.strip().split()
key = tokens[0]
if key in get_option_v3_schema('').keys():
value = tokens[1] if len(tokens) >= 2 else ''
value = ''
if len(tokens) == 2:
value = tokens[1]
elif len(tokens) > 2:
value = ' '.join(tokens[1:])
cs_v3 |= { key : value }
else:
v2_lines.append(s.strip())
@@ -58,6 +62,18 @@ def inp_in_option_v3(section: list[str]) -> ChangeSet:
return result
def inp_in_option_v3_new(name: str, section: list[str]) -> None:
result = inp_in_option_v3(section)
for op in result.operations:
for key in op.keys():
if key == 'operation' or key == 'type':
continue
if op['type'] == 'option_v3':
write(name, f"update options_v3 set value = '{op[key]}' where key = '{key}';")
else:
write(name, f"update options set value = '{op[key]}' where key = '{key}';")
def inp_out_option_v3(name: str) -> list[str]:
lines = []
objs = read_all(name, f"select * from options_v3")