Clean code
This commit is contained in:
@@ -106,7 +106,7 @@ def get_option(name: str) -> dict[str, Any]:
|
||||
return d
|
||||
|
||||
|
||||
def set_option_cmd(name: str, cs: ChangeSet) -> DbChangeSet:
|
||||
def _set_option(name: str, cs: ChangeSet) -> DbChangeSet:
|
||||
raw_old = get_option(name)
|
||||
|
||||
old = {}
|
||||
@@ -140,9 +140,8 @@ def set_option_cmd(name: str, cs: ChangeSet) -> DbChangeSet:
|
||||
return DbChangeSet(redo_sql, undo_sql, [redo_cs], [undo_cs])
|
||||
|
||||
|
||||
def set_option_only(name: str, cs: ChangeSet) -> ChangeSet:
|
||||
v2_cmd = set_option_cmd(name, cs)
|
||||
return execute_command(name, v2_cmd)
|
||||
def set_option(name: str, cs: ChangeSet) -> ChangeSet:
|
||||
return execute_command(name, _set_option(name, cs))
|
||||
|
||||
|
||||
OPTION_V3_FLOW_UNITS_CFS = OPTION_UNITS_CFS
|
||||
@@ -231,7 +230,7 @@ def get_option_v3(name: str) -> dict[str, Any]:
|
||||
return d
|
||||
|
||||
|
||||
def set_option_v3_cmd(name: str, cs: ChangeSet) -> DbChangeSet:
|
||||
def _set_option_v3(name: str, cs: ChangeSet) -> DbChangeSet:
|
||||
raw_old = get_option_v3(name)
|
||||
|
||||
old = {}
|
||||
@@ -265,9 +264,8 @@ def set_option_v3_cmd(name: str, cs: ChangeSet) -> DbChangeSet:
|
||||
return DbChangeSet(redo_sql, undo_sql, [redo_cs], [undo_cs])
|
||||
|
||||
|
||||
def set_option_v3_only(name: str, cs: ChangeSet) -> ChangeSet:
|
||||
v3_cmd = set_option_v3_cmd(name, cs)
|
||||
return execute_command(name, v3_cmd)
|
||||
def set_option_v3(name: str, cs: ChangeSet) -> ChangeSet:
|
||||
return execute_command(name, _set_option_v3(name, cs))
|
||||
|
||||
|
||||
_key_map_23 = {
|
||||
|
||||
Reference in New Issue
Block a user