From 9a81f1a2c2555333eb7a8642a3f6104a0af156fe Mon Sep 17 00:00:00 2001 From: "andreu.castillo" Date: Thu, 5 Dec 2024 13:24:20 +0100 Subject: [PATCH] Description field is injected in missing codecs Signed-off-by: andreu.castillo --- src/cbexigen/datatype_classes.py | 2 +- src/cbexigen/decoder_classes.py | 6 ++++-- src/cbexigen/encoder_classes.py | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/cbexigen/datatype_classes.py b/src/cbexigen/datatype_classes.py index 67e846f..ba978a4 100644 --- a/src/cbexigen/datatype_classes.py +++ b/src/cbexigen/datatype_classes.py @@ -889,7 +889,7 @@ def generate_file(self): try: temp = self.generator.get_template("BaseDatatypes.c.jinja") code = temp.render(filename=self.c_params["filename"], filekey=self.c_params["identifier"], - includes_code=includes, code=content) + description=self.c_params.get('description'), includes_code=includes, code=content) tools.save_code_to_file(self.c_params["filename"], code, self.parameters['folder']) except KeyError as err: tools_logging.log_write_error(f'Exception in {self.__class__.__name__}.{self.generate_file.__name__} ' diff --git a/src/cbexigen/decoder_classes.py b/src/cbexigen/decoder_classes.py index 1637d29..4c5cee8 100644 --- a/src/cbexigen/decoder_classes.py +++ b/src/cbexigen/decoder_classes.py @@ -60,7 +60,8 @@ def __render_file(self): try: temp = self.generator.get_template('DatatypesDecoder.h.jinja') code = temp.render(filename=self.h_params["filename"], filekey=self.h_params['identifier'], - include_content=self.__include_content, code_content=self.__code_content) + description=self.h_params.get('description'), include_content=self.__include_content, + code_content=self.__code_content) tools.save_code_to_file(self.h_params['filename'], code, self.parameters['folder']) except KeyError as err: log_write_error(f'Exception in {self.__class__.__name__}.{self.__render_file.__name__} ' @@ -918,7 +919,8 @@ def __render_file(self): try: temp = self.generator.get_template("DatatypesDecoder.c.jinja") code = temp.render(filename=self.c_params["filename"], filekey=self.c_params["identifier"], - includes_code=self.__include_content, code=self.__code_content) + description=self.c_params.get('description'), includes_code=self.__include_content, + code=self.__code_content) tools.save_code_to_file(self.c_params["filename"], code, self.parameters['folder']) except KeyError as err: log_write_error(f'Exception in {self.__class__.__name__}.{self.__render_file.__name__} ' diff --git a/src/cbexigen/encoder_classes.py b/src/cbexigen/encoder_classes.py index b65a122..89f7d20 100644 --- a/src/cbexigen/encoder_classes.py +++ b/src/cbexigen/encoder_classes.py @@ -60,7 +60,8 @@ def __render_file(self): try: temp = self.generator.get_template('DataTypesEncoder.h.jinja') code = temp.render(filename=self.h_params["filename"], filekey=self.h_params['identifier'], - include_content=self.__include_content, code_content=self.__code_content) + description=self.h_params.get('description'), include_content=self.__include_content, + code_content=self.__code_content) tools.save_code_to_file(self.h_params['filename'], code, self.parameters['folder']) except KeyError as err: log_write_error(f'Exception in {self.__class__.__name__}.{self.__render_file.__name__} ' @@ -924,7 +925,8 @@ def __render_file(self): try: temp = self.generator.get_template("DataTypesEncoder.c.jinja") code = temp.render(filename=self.c_params["filename"], filekey=self.c_params["identifier"], - includes_code=self.__include_content, code=self.__code_content) + description=self.c_params.get('description'), includes_code=self.__include_content, + code=self.__code_content) tools.save_code_to_file(self.c_params["filename"], code, self.parameters['folder']) except KeyError as err: log_write_error(f'Exception in {self.__class__.__name__}.{self.__render_file.__name__} '