From 3407f0309155e75230cd6c10f17f5733ad421e46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Fri, 17 Sep 2021 14:11:46 +0200 Subject: [PATCH] add config entry for latex aux file extension --- scripts/config.py | 1 + scripts/notes.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/config.py b/scripts/config.py index 6680500..af214a7 100644 --- a/scripts/config.py +++ b/scripts/config.py @@ -25,3 +25,4 @@ DEFAULT_IMPORT_INDENTATION = 4 FALLBACK_COURSE_INFO_FILE = Path('fallback.yaml').resolve() TIMEZONE = pytz.timezone('CET') SCHEDULER_DELAY = 60 +DEFAULT_LATEX_COUNTER_AUX_FILE_EXTENSION = '.cnt' \ No newline at end of file diff --git a/scripts/notes.py b/scripts/notes.py index 533ae35..dbb9d1c 100644 --- a/scripts/notes.py +++ b/scripts/notes.py @@ -3,7 +3,8 @@ import subprocess from pathlib import Path from typing import Dict -from config import LECTURE_START_MARKER, LECTURE_END_MARKER, DEFAULT_IMPORT_INDENTATION +from config import LECTURE_START_MARKER, LECTURE_END_MARKER, DEFAULT_IMPORT_INDENTATION, \ + DEFAULT_LATEX_COUNTER_AUX_FILE_EXTENSION from edit import edit from lectures import Lectures, number2filename from parse_counters import parse_counters, dict2setcounters @@ -59,7 +60,10 @@ class Notes: if not setcounters: return '' if lec - 1 not in lecture_list and self.full_file: - return dict2setcounters(parse_counters(self.full_file.with_suffix('.counters'), {'lecture': lec})) + return dict2setcounters(parse_counters( + self.full_file.with_suffix(DEFAULT_LATEX_COUNTER_AUX_FILE_EXTENSION), + {'lecture': lec} + )) return '' def update_lectures_in_file(self, filename, lecture_list, setcounters=False):