diff --git a/custom.py b/custom.py new file mode 100644 index 0000000..0d70f0c --- /dev/null +++ b/custom.py @@ -0,0 +1,26 @@ +from structure import Structure, Lecture +import json + +if __name__ == "__main__": + struct = Structure() + week = struct.get_week_number() + + with open("custom.txt", "r", encoding="utf-8") as f: + lines = f.readlines() + + lines = list(map(lambda s: s.strip(), lines)) + lectures = [] + + for i in range(0, len(lines), 5): + q = ["Custom"] + q.extend(lines[i:(i+4)]) + q.append(False) + q[2] = int(q[2]) + print(q) + + lectures.append(Lecture(*q)) + + lectures = list(filter(lambda l: l.complete, lectures)) + + with open("lecture.json", "w", encoding="utf-8") as f: + json.dump(list(map(lambda l: l.json(), lectures)), f, ensure_ascii=False, indent=4) \ No newline at end of file diff --git a/custom.txt b/custom.txt new file mode 100644 index 0000000..b97637f --- /dev/null +++ b/custom.txt @@ -0,0 +1,9 @@ +ПН +1 +Обеспечение антитеррористической защищенности объектов (территорий) образовательных организаций РФ +Окутина Наталья Николаевна + +ПН +2 +Обеспечение антитеррористической защищенности объектов (территорий) образовательных организаций РФ +Окутина Наталья Николаевна \ No newline at end of file