correct header when formatting dictionaries

This commit is contained in:
Maximilian Keßler 2022-01-09 14:21:50 +01:00
parent 99c984049c
commit 5e077e77d8

View file

@ -69,9 +69,17 @@ class TexFileToFormat:
def __format_header(self): def __format_header(self):
new_header = [] new_header = []
for line in self.current_build_info.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( new_header.append(line.format(
source_file=self.src_path.name, 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 self._header = new_header