From 1c63ee0d49974e81ef990864bc371b0337730189 Mon Sep 17 00:00:00 2001 From: "WQY\\qiong" Date: Fri, 18 Nov 2022 20:29:20 +0800 Subject: [PATCH] Guard coding for ";" line --- api/s15_energy.py | 3 +++ api/s19_reactions.py | 3 +++ api/s21_times.py | 3 +++ api/s23_options.py | 3 +++ api/s25_vertices.py | 3 +++ 5 files changed, 15 insertions(+) diff --git a/api/s15_energy.py b/api/s15_energy.py index 70d50df..aad2fd6 100644 --- a/api/s15_energy.py +++ b/api/s15_energy.py @@ -135,6 +135,9 @@ def inp_in_energy(section: list[str]) -> ChangeSet: cs = ChangeSet() for s in section: + if s.startswith(';'): + continue + tokens = s.strip().split() if tokens[0].upper() == 'PUMP': diff --git a/api/s19_reactions.py b/api/s19_reactions.py index 7ef4b1c..5f2be70 100644 --- a/api/s19_reactions.py +++ b/api/s19_reactions.py @@ -185,6 +185,9 @@ def inp_in_reaction(section: list[str]) -> ChangeSet: cs = ChangeSet() for s in section: + if s.startswith(';'): + continue + tokens = s.strip().split() token0 = tokens[0].upper() if token0 == 'BULK' or token0 == 'WALL': diff --git a/api/s21_times.py b/api/s21_times.py index 848ba9c..11cc6fc 100644 --- a/api/s21_times.py +++ b/api/s21_times.py @@ -70,6 +70,9 @@ 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): diff --git a/api/s23_options.py b/api/s23_options.py index 5d77569..329e419 100644 --- a/api/s23_options.py +++ b/api/s23_options.py @@ -108,6 +108,9 @@ def set_option(name: str, cs: ChangeSet) -> ChangeSet: def inp_in_option(section: list[str]) -> ChangeSet: cs = g_update_prefix | { 'type' : 'option' } for s in section: + if s.startswith(';'): + continue + line = s.upper().strip() for key in get_option_schema('').keys(): if line.startswith(key): diff --git a/api/s25_vertices.py b/api/s25_vertices.py index d6a73e8..dac67e5 100644 --- a/api/s25_vertices.py +++ b/api/s25_vertices.py @@ -84,6 +84,9 @@ def inp_in_vertex(section: list[str]) -> ChangeSet: vertices: dict[str, list[dict[str, float]]] = {} for s in section: + if s.startswith(';'): + continue + tokens = s.split() if tokens[0] not in vertices: vertices[tokens[0]] = []