Fix reading inp bug

This commit is contained in:
WQY\qiong
2023-02-09 00:08:36 +08:00
parent 7f9c9a8e8c
commit 8979885eac
6 changed files with 45 additions and 38 deletions

View File

@@ -68,17 +68,19 @@ def set_time(name: str, cs: ChangeSet) -> ChangeSet:
def inp_in_time(section: list[str]) -> ChangeSet:
cs = g_update_prefix | { 'type' : 'time' }
for s in section:
if s.startswith(';'):
continue
line = s.upper().strip()
for key in get_time_schema('').keys():
if line.startswith(key):
value = line.removeprefix(key).strip()
cs |= { key : value }
return ChangeSet(cs)
if len(section) > 0:
cs = g_update_prefix | { 'type' : 'time' }
for s in section:
if s.startswith(';'):
continue
line = s.upper().strip()
for key in get_time_schema('').keys():
if line.startswith(key):
value = line.removeprefix(key).strip()
cs |= { key : value }
return ChangeSet(cs)
return ChangeSet()
def inp_out_time(name: str) -> list[str]: