From 4fc8b3ef6f6dec4d28bc6716b92f5fe8641e6c2e Mon Sep 17 00:00:00 2001 From: Shoichi Seto <61938408+flap1@users.noreply.github.com> Date: Fri, 24 May 2024 05:36:38 +0900 Subject: [PATCH 1/2] fix: Resolve issue of duplicate definitions in header file when multiple EH IDs are used (#88) --- c2a_generator/eh_rules_h.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/c2a_generator/eh_rules_h.py b/c2a_generator/eh_rules_h.py index f6470ca..c398a9c 100644 --- a/c2a_generator/eh_rules_h.py +++ b/c2a_generator/eh_rules_h.py @@ -29,11 +29,15 @@ def generate(src_path: str, dest_path: Path, base_id: int) -> None: reader = csv.reader(csv_file) headers = next(reader) dict_reader = csv.DictReader(csv_file, fieldnames=headers) + name_list = [] for row in dict_reader: if not any(row): continue try: + if row["name"] in name_list: + continue header_file.write(f' {row["name"]} = {base_id},\n') + name_list.append(row["name"]) base_id += 1 except ValueError: continue From 9e525e1529d0e8502c457c36ece7e2716fd8275b Mon Sep 17 00:00:00 2001 From: Shoichi Seto <61938408+flap1@users.noreply.github.com> Date: Fri, 24 May 2024 05:37:24 +0900 Subject: [PATCH 2/2] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 78c1053..b16f711 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "c2a_generator" -version = "0.1.0" +version = "0.1.1" description = "Add your description here" authors = [ { name = "flap1", email = "sho1seto@gmail.com" }