Refine option to support batch command
This commit is contained in:
@@ -1,16 +1,12 @@
|
||||
from .database import *
|
||||
from .s23_options_util import get_option_schema, get_option_v3_schema, set_option_v3_cmd, set_option_cmd, generate_v2, generate_v3
|
||||
from .s23_options_util import get_option_schema, get_option_v3_schema, generate_v2, generate_v3
|
||||
from .batch_cmd import execute_batch_command
|
||||
|
||||
|
||||
def set_option_v3(name: str, cs: ChangeSet) -> ChangeSet:
|
||||
v3_cmd = set_option_v3_cmd(name, cs)
|
||||
result = execute_command(name, v3_cmd)
|
||||
|
||||
v2 = generate_v2(ChangeSet(v3_cmd.redo_cs[0]))
|
||||
v2_cmd = set_option_cmd(name, v2)
|
||||
result.merge(execute_command(name, v2_cmd))
|
||||
|
||||
return result
|
||||
new_cs = cs
|
||||
new_cs.merge(generate_v2(cs))
|
||||
return execute_batch_command(name, new_cs)
|
||||
|
||||
|
||||
def _parse_v2(v2_lines: list[str]) -> dict[str, str]:
|
||||
|
||||
Reference in New Issue
Block a user