From cd28d026fe8176ac071a706dae0cf1e3cabdaa56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Thu, 16 Sep 2021 13:08:05 +0200 Subject: [PATCH] introduce yaml config parameter for master file name Specify a line master_file: 'name.tex' in your yaml.info in some course directory to change the name of the master file that is used --- scripts/config.py | 1 + scripts/lectures.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/config.py b/scripts/config.py index 5b69cc8..f980d93 100644 --- a/scripts/config.py +++ b/scripts/config.py @@ -19,3 +19,4 @@ DATE_FORMAT = '%a %d %b %Y %H:%M' LOCALE = "de_DE.utf8" COURSE_IGNORE_FILE = '.courseignore' COURSE_INFO_FILE = 'info.yaml' +DEFAULT_MASTER_FILE_NAME = 'master.tex' diff --git a/scripts/lectures.py b/scripts/lectures.py index b1ea912..4efeb0f 100755 --- a/scripts/lectures.py +++ b/scripts/lectures.py @@ -8,7 +8,7 @@ import re import subprocess -from config import get_week, DATE_FORMAT, CURRENT_COURSE_ROOT, LOCALE +from config import get_week, DATE_FORMAT, CURRENT_COURSE_ROOT, LOCALE, DEFAULT_MASTER_FILE_NAME # TODO locale.setlocale(locale.LC_TIME, LOCALE) @@ -58,7 +58,10 @@ class Lectures(list): def __init__(self, course): self.course = course self.root = course.path - self.master_file = self.root / 'master.tex' + if 'master_file' in course.info: + self.master_file = self.root / course.info['master_file'] + else: + self.master_file = self.root / DEFAULT_MASTER_FILE_NAME list.__init__(self, self.read_files()) def read_files(self):