From 5e077e77d88ec6b71ac0d39e21572fad5938b0c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Sun, 9 Jan 2022 14:21:50 +0100 Subject: [PATCH] correct header when formatting dictionaries --- build/utils/pytex_file.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build/utils/pytex_file.py b/build/utils/pytex_file.py index e1a7221..adf76f4 100644 --- a/build/utils/pytex_file.py +++ b/build/utils/pytex_file.py @@ -69,9 +69,17 @@ class TexFileToFormat: def __format_header(self): new_header = [] for line in self.current_build_info.header: + if '.pysty' in self.src_path.name: + latex_file_type = 'package' + elif '.pycls' in self.src_path.name: + latex_file_type = 'class' + elif '.pydict' in self.src_path.name: + latex_file_type = 'dictionary' + else: + raise Exception('Programming error. Please contact the developer.') new_header.append(line.format( source_file=self.src_path.name, - latex_file_type='package' if '.pysty' in self.src_path.name else 'class' + latex_file_type=latex_file_type )) self._header = new_header