From dabbcf182e15908f66b8c14a27e793718c48aa02 Mon Sep 17 00:00:00 2001 From: HUG0-D Date: Wed, 20 Nov 2024 13:50:34 +0100 Subject: [PATCH] Fix comments Signed-off-by: HUG0-D --- cimgen/languages/modernpython/utils/base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cimgen/languages/modernpython/utils/base.py b/cimgen/languages/modernpython/utils/base.py index 9fbfce5..272f85c 100644 --- a/cimgen/languages/modernpython/utils/base.py +++ b/cimgen/languages/modernpython/utils/base.py @@ -315,13 +315,14 @@ def _extract_attr_value_from_etree(self, class_attribute: dict, xml_attribute: e attr_value = attr_value.rsplit("#")[-1] elif class_attribute["is_list_attribute"]: - # other attributes types are defined in .text attr_value = xml_attribute attr_value = self.key.append(attr_value) else: + # other attributes types are defined in .text attr_value = xml_attribute.text - # primitive classes are described in "cim_data_type" allowing to retrieve the data type + if class_attribute["is_primitive_attribute"] or class_attribute["is_datatype_attribute"]: + # primitive classes are described in "attribute_class" allowing to retrieve the data type if class_attribute["attribute_class"].type == bool: attr_value = {"true": True, "false": False}.get(attr_value, None) else: