Refine option v2

This commit is contained in:
WQY\qiong
2023-03-03 19:50:49 +08:00
parent ece98ae07c
commit 9ad47d27cc

View File

@@ -143,7 +143,9 @@ def set_option(name: str, cs: ChangeSet) -> ChangeSet:
# MAP filename # MAP filename
#-------------------------------------------------------------- #--------------------------------------------------------------
def inp_in_option(section: list[str]) -> ChangeSet: def inp_in_option(section: list[str]) -> ChangeSet:
if len(section) > 0: if len(section) <= 0:
return ChangeSet()
cs = g_update_prefix | { 'type' : 'option' } cs = g_update_prefix | { 'type' : 'option' }
for s in section: for s in section:
if s.startswith(';'): if s.startswith(';'):
@@ -164,7 +166,6 @@ def inp_in_option(section: list[str]) -> ChangeSet:
value = line.removeprefix(key).strip() value = line.removeprefix(key).strip()
cs |= { key : value } cs |= { key : value }
return ChangeSet(cs) return ChangeSet(cs)
return ChangeSet()
def inp_out_option(name: str) -> list[str]: def inp_out_option(name: str) -> list[str]: