add config parameter for name of courseignore file
This commit is contained in:
parent
06f34ba5fe
commit
e51e9e7539
2 changed files with 3 additions and 3 deletions
|
@ -17,3 +17,4 @@ CURRENT_COURSE_WATCH_FILE = Path('/tmp/current_course').resolve()
|
||||||
ROOT = Path('~/Uni/semester-5').expanduser()
|
ROOT = Path('~/Uni/semester-5').expanduser()
|
||||||
DATE_FORMAT = '%a %d %b %Y %H:%M'
|
DATE_FORMAT = '%a %d %b %Y %H:%M'
|
||||||
LOCALE = "de_DE.utf8"
|
LOCALE = "de_DE.utf8"
|
||||||
|
COURSE_IGNORE_FILE = '.courseignore'
|
||||||
|
|
|
@ -3,8 +3,7 @@ from pathlib import Path
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
from lectures import Lectures
|
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():
|
class Course():
|
||||||
def __init__(self, path):
|
def __init__(self, path):
|
||||||
self.path = path
|
self.path = path
|
||||||
|
@ -34,7 +33,7 @@ class Courses(list):
|
||||||
return sorted(_courses, key=lambda c: c.name)
|
return sorted(_courses, key=lambda c: c.name)
|
||||||
|
|
||||||
def ignored_courses(self):
|
def ignored_courses(self):
|
||||||
with open(ROOT / '.courseignore') as ignore:
|
with open(ROOT / COURSE_IGNORE_FILE) as ignore:
|
||||||
lines = ignore.readlines()
|
lines = ignore.readlines()
|
||||||
paths = []
|
paths = []
|
||||||
for line in lines:
|
for line in lines:
|
||||||
|
|
Loading…
Reference in a new issue