Parse [OPTIONS]

This commit is contained in:
WQY\qiong
2022-11-12 17:29:42 +08:00
parent 27c112d1fb
commit 1dae56939f
2 changed files with 22 additions and 2 deletions

View File

@@ -69,10 +69,9 @@ def set_time(name: str, cs: ChangeSet) -> ChangeSet:
def inp_in_time(section: list[str]) -> ChangeSet:
cs = g_update_prefix | { 'type' : 'time' }
keys = ['DURATION', 'HYDRAULIC TIMESTEP', 'QUALITY TIMESTEP', 'RULE TIMESTEP', 'PATTERN TIMESTEP', 'PATTERN START', 'REPORT TIMESTEP', 'REPORT START', 'START CLOCKTIME', 'STATISTIC']
for s in section:
line = s.upper().strip()
for key in keys:
for key in get_time_schema('').keys():
if line.startswith(key):
value = line.removeprefix(key).strip()
cs |= { key : value }