Support to convert between option v2 & v3
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from .database import *
|
||||
from .s23_options_util import generate_v3
|
||||
|
||||
|
||||
OPTION_UNITS_CFS = 'CFS'
|
||||
@@ -144,10 +145,6 @@ def set_option(name: str, cs: ChangeSet) -> ChangeSet:
|
||||
#--------------------------------------------------------------
|
||||
|
||||
|
||||
def _sync_to_v3() -> ChangeSet:
|
||||
return ChangeSet()
|
||||
|
||||
|
||||
def inp_in_option(section: list[str]) -> ChangeSet:
|
||||
if len(section) <= 0:
|
||||
return ChangeSet()
|
||||
@@ -173,7 +170,7 @@ def inp_in_option(section: list[str]) -> ChangeSet:
|
||||
cs |= { key : value }
|
||||
|
||||
result = ChangeSet(cs)
|
||||
result.merge(_sync_to_v3())
|
||||
result.merge(generate_v3(result))
|
||||
return result
|
||||
|
||||
|
||||
@@ -183,5 +180,6 @@ def inp_out_option(name: str) -> list[str]:
|
||||
for obj in objs:
|
||||
key = obj['key']
|
||||
value = obj['value']
|
||||
lines.append(f'{key} {value}')
|
||||
if value != '':
|
||||
lines.append(f'{key} {value}')
|
||||
return lines
|
||||
|
||||
Reference in New Issue
Block a user