From e51e9e7539b3f79101e01ca1ec6e3419daa95f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Thu, 16 Sep 2021 12:34:32 +0200 Subject: [PATCH] add config parameter for name of courseignore file --- scripts/config.py | 1 + scripts/courses.py | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/config.py b/scripts/config.py index b8ec5d1..155e4af 100644 --- a/scripts/config.py +++ b/scripts/config.py @@ -17,3 +17,4 @@ CURRENT_COURSE_WATCH_FILE = Path('/tmp/current_course').resolve() ROOT = Path('~/Uni/semester-5').expanduser() DATE_FORMAT = '%a %d %b %Y %H:%M' LOCALE = "de_DE.utf8" +COURSE_IGNORE_FILE = '.courseignore' diff --git a/scripts/courses.py b/scripts/courses.py index 46a87f5..4f5ddfc 100755 --- a/scripts/courses.py +++ b/scripts/courses.py @@ -3,8 +3,7 @@ from pathlib import Path import yaml from lectures import Lectures -from config import ROOT, CURRENT_COURSE_ROOT, CURRENT_COURSE_SYMLINK, CURRENT_COURSE_WATCH_FILE - +from config import ROOT, CURRENT_COURSE_ROOT, CURRENT_COURSE_SYMLINK, CURRENT_COURSE_WATCH_FILE, COURSE_IGNORE_FILE class Course(): def __init__(self, path): self.path = path @@ -34,7 +33,7 @@ class Courses(list): return sorted(_courses, key=lambda c: c.name) def ignored_courses(self): - with open(ROOT / '.courseignore') as ignore: + with open(ROOT / COURSE_IGNORE_FILE) as ignore: lines = ignore.readlines() paths = [] for line in lines: