From 8759e2548fda59eedc58bf0ff0e53050dab7c5da Mon Sep 17 00:00:00 2001 From: HUG0-D Date: Fri, 15 Nov 2024 15:54:58 +0100 Subject: [PATCH] Fixing template formating Signed-off-by: HUG0-D --- cimgen/languages/modernpython/lang_pack.py | 3 ++- .../modernpython/templates/cimpy_class_template.mustache | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cimgen/languages/modernpython/lang_pack.py b/cimgen/languages/modernpython/lang_pack.py index c51b6f1e..dcf1fcfc 100644 --- a/cimgen/languages/modernpython/lang_pack.py +++ b/cimgen/languages/modernpython/lang_pack.py @@ -152,7 +152,8 @@ def _set_cim_data_type(text, render) -> str: attribute = eval(render(text)) cim_data_type = "" if attribute["is_cim_datatype"] or attribute["is_primitive_attribute"]: - cim_data_type = """"cim_data_type": """ + attribute["attribute_class"] + ",\n\t\t" + cim_data_type += "\n " + cim_data_type += """"cim_data_type": """ + attribute["attribute_class"] + "," return cim_data_type diff --git a/cimgen/languages/modernpython/templates/cimpy_class_template.mustache b/cimgen/languages/modernpython/templates/cimpy_class_template.mustache index 14da3b41..ae5163a6 100644 --- a/cimgen/languages/modernpython/templates/cimpy_class_template.mustache +++ b/cimgen/languages/modernpython/templates/cimpy_class_template.mustache @@ -35,8 +35,8 @@ class {{class_name}}({{sub_class_of}}): "is_enum_attribute": {{#is_enum_attribute}}True{{/is_enum_attribute}}{{^is_enum_attribute}}False{{/is_enum_attribute}}, "is_list_attribute": {{#is_list_attribute}}True{{/is_list_attribute}}{{^is_list_attribute}}False{{/is_list_attribute}}, "is_primitive_attribute": {{#is_primitive_attribute}}True{{/is_primitive_attribute}}{{^is_primitive_attribute}}False{{/is_primitive_attribute}}, - "is_cim_datatype": {{#is_cim_datatype}}True{{/is_cim_datatype}}{{^is_cim_datatype}}False{{/is_cim_datatype}}, - {{#setCimDataType}}{{.}}{{/setCimDataType}}}, + "is_cim_datatype": {{#is_cim_datatype}}True{{/is_cim_datatype}}{{^is_cim_datatype}}False{{/is_cim_datatype}},{{#setCimDataType}}{{.}}{{/setCimDataType}} + }, ) {{/attributes}}