From b2b15f812e289e1696d1b7948575d3e2c0c40d1d Mon Sep 17 00:00:00 2001 From: Martin Lehmann Date: Mon, 4 Nov 2024 13:39:39 +0100 Subject: [PATCH] feat(importer): Don't delete descriptions If the ROS messages don't have a description for an object, keep the current description in the Capella model unchanged. This allows adding descriptions in the Capella model manually if they're not present in the imported ROS messages package. Fixes #11 --- capella_ros_tools/importer.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/capella_ros_tools/importer.py b/capella_ros_tools/importer.py index 24b27f8..4516772 100644 --- a/capella_ros_tools/importer.py +++ b/capella_ros_tools/importer.py @@ -158,9 +158,11 @@ def _convert_class( "find": { "name": msg_def.name, }, - "set": { - "description": msg_def.description, - }, + "set": ( + {"description": msg_def.description} + if msg_def.description + else {} + ), "sync": { "properties": props, },