From 08c2fae66204f9653a12bb369061731dcf4a2449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Thu, 16 Sep 2021 12:35:25 +0200 Subject: [PATCH] add config parameter for course info file --- scripts/config.py | 1 + scripts/courses.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/config.py b/scripts/config.py index 155e4af..5b69cc8 100644 --- a/scripts/config.py +++ b/scripts/config.py @@ -18,3 +18,4 @@ ROOT = Path('~/Uni/semester-5').expanduser() DATE_FORMAT = '%a %d %b %Y %H:%M' LOCALE = "de_DE.utf8" COURSE_IGNORE_FILE = '.courseignore' +COURSE_INFO_FILE = 'info.yaml' diff --git a/scripts/courses.py b/scripts/courses.py index 4f5ddfc..cc22c56 100755 --- a/scripts/courses.py +++ b/scripts/courses.py @@ -3,13 +3,13 @@ from pathlib import Path import yaml from lectures import Lectures -from config import ROOT, CURRENT_COURSE_ROOT, CURRENT_COURSE_SYMLINK, CURRENT_COURSE_WATCH_FILE, COURSE_IGNORE_FILE +from config import ROOT, CURRENT_COURSE_ROOT, CURRENT_COURSE_SYMLINK, CURRENT_COURSE_WATCH_FILE, COURSE_IGNORE_FILE, COURSE_INFO_FILE class Course(): def __init__(self, path): self.path = path self.name = path.stem - self.info = yaml.load((path / 'info.yaml').open()) + self.info = yaml.load((path / COURSE_INFO_FILE).open()) self._lectures = None @property