From 77cd4abe3e4124b2c1368dcf49f3cab269b7993b Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Tue, 15 Nov 2022 17:22:43 +0100 Subject: [PATCH] somersaultecu: load the odx-cs files correctly thanks to [at]kayoub5 for the catch. Signed-off-by: Andreas Lauser Signed-off-by: Gerrit Ecke Signed-off-by: Alexander Walz --- examples/somersaultecu.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/somersaultecu.py b/examples/somersaultecu.py index c3100727..67e20c82 100755 --- a/examples/somersaultecu.py +++ b/examples/somersaultecu.py @@ -7,6 +7,8 @@ from itertools import chain from typing import Any from xml.etree import ElementTree +import pathlib +import odxtools from odxtools.utils import short_name_as_id from odxtools import PhysicalConstantParameter @@ -1271,11 +1273,12 @@ def extract_constant_bytes(params): # read the communication parameters comparam_subsets = [] +odx_cs_dir = pathlib.Path(odxtools.__file__).parent / "pdx_stub" for odx_cs_filename in ("ISO_11898_2_DWCAN.odx-cs", "ISO_11898_3_DWFTCAN.odx-cs", "ISO_15765_2.odx-cs", "ISO_15765_3_CPSS.odx-cs"): - odx_cs_root = ElementTree.parse(odx_cs_filename).getroot() + odx_cs_root = ElementTree.parse(odx_cs_dir/odx_cs_filename).getroot() subset = odx_cs_root.find("COMPARAM-SUBSET") if subset is not None: comparam_subsets.append(read_comparam_subset_from_odx(subset))