diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/gen_map/gen_map.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/scripts/gen_map/gen_map.py b/scripts/gen_map/gen_map.py index 8765336b..b3a01e34 100755 --- a/scripts/gen_map/gen_map.py +++ b/scripts/gen_map/gen_map.py @@ -285,7 +285,7 @@ def gen_latex_table( def print_map(rows: list[str], template_path: Path, outfile, - map_info: dict[t.Union[str, datetime]]): + map_info: dict[str, t.Union[str, datetime]]): """Print the template including the generated table""" with open(template_path, 'r', encoding='utf-8') as template_file: template = template_file.readlines() @@ -293,11 +293,13 @@ def print_map(rows: list[str], template_path: Path, outfile, template_prefix = template[:-8] for i, line in enumerate(template_prefix): if r'Start' in line: - template_prefix[ - i] = f'\\Start{{{map_info["start"].strftime("%d.%m.%y")}}}\n' + start = map_info["start"] + assert isinstance(start, datetime) + template_prefix[i] = f'\\Start{{{start.strftime("%d.%m.%y")}}}\n' elif 'End' in line: - template_prefix[ - i] = f'\\End{{{map_info["end"].strftime("%d.%m.%y")}}}\n' + end = map_info["end"] + assert isinstance(end, datetime) + template_prefix[i] = f'\\End{{{end.strftime("%d.%m.%y")}}}\n' elif 'Klasse' in line: template_prefix[i] = f'\\Klasse{{{map_info["form"]}?}}\n' |
