From 51b5c5dd00647fe88ada723a4393bf600a508cf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Thu, 16 Sep 2021 18:02:36 +0200 Subject: [PATCH] rename script into notes --- scripts/compile-all-masters.py | 2 +- scripts/courses.py | 12 ++++++------ scripts/new-lecture.py | 2 +- scripts/{script.py => notes.py} | 8 ++++---- scripts/rofi-lectures-view.py | 2 +- scripts/rofi-lectures.py | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) rename scripts/{script.py => notes.py} (95%) diff --git a/scripts/compile-all-masters.py b/scripts/compile-all-masters.py index f8b6a2e..96df6a9 100755 --- a/scripts/compile-all-masters.py +++ b/scripts/compile-all-masters.py @@ -2,7 +2,7 @@ from courses import Courses for course in Courses(): - script = course.script + script = course.notes lectures = script.lectures r = lectures.parse_range_string('all') diff --git a/scripts/courses.py b/scripts/courses.py index ca8f26a..95c9ee9 100755 --- a/scripts/courses.py +++ b/scripts/courses.py @@ -3,7 +3,7 @@ from pathlib import Path import yaml from lectures import Lectures -from script import Script +from notes import Notes from config import ROOT, CURRENT_COURSE_ROOT, CURRENT_COURSE_SYMLINK, CURRENT_COURSE_WATCH_FILE, COURSE_IGNORE_FILE, \ COURSE_INFO_FILE @@ -14,13 +14,13 @@ class Course: self.name = path.stem self.info = yaml.safe_load((path / COURSE_INFO_FILE).open()) - self._script = None + self._notes = None @property - def script(self): - if not self._script: - self._script = Script(self) - return self._script + def notes(self): + if not self._notes: + self._notes = Notes(self) + return self._notes def __eq__(self, other): if other is None: diff --git a/scripts/new-lecture.py b/scripts/new-lecture.py index d696364..2a880bb 100755 --- a/scripts/new-lecture.py +++ b/scripts/new-lecture.py @@ -1,5 +1,5 @@ from courses import Courses -script = Courses().current.script +script = Courses().current.notes new_lecture = script.new_lecture() new_lecture.edit() diff --git a/scripts/script.py b/scripts/notes.py similarity index 95% rename from scripts/script.py rename to scripts/notes.py index e08d13d..96d2c15 100644 --- a/scripts/script.py +++ b/scripts/notes.py @@ -5,11 +5,12 @@ import subprocess from lectures import Lectures, number2filename from config import * -class Script: + +class Notes: def __init__(self, course): self.course = course - if 'script' in course.info: - self.info = course.info['script'] + if 'notes' in course.info: + self.info = course.info['notes'] else: self.info = [] if 'path' in self.info: @@ -70,4 +71,3 @@ class Script: if not self._lectures: self._lectures = Lectures(self) return self._lectures - diff --git a/scripts/rofi-lectures-view.py b/scripts/rofi-lectures-view.py index 7fe0e95..06a145a 100755 --- a/scripts/rofi-lectures-view.py +++ b/scripts/rofi-lectures-view.py @@ -2,7 +2,7 @@ from courses import Courses from rofi import rofi -script = Courses().current.script +script = Courses().current.notes lectures = script.lectures commands = ['last', 'prev-last', 'all', 'prev'] diff --git a/scripts/rofi-lectures.py b/scripts/rofi-lectures.py index d7eba6e..8e0e567 100755 --- a/scripts/rofi-lectures.py +++ b/scripts/rofi-lectures.py @@ -4,7 +4,7 @@ from rofi import rofi from utils import generate_short_title from config import MAX_LEN -script = Courses().current.script +script = Courses().current.notes lectures = script.lectures sorted_lectures = sorted(lectures, key=lambda l: -l.number)