From d4f0db129da13da621b679fcd037249e066980eb Mon Sep 17 00:00:00 2001 From: Matthias Jung Date: Sat, 7 Feb 2026 00:17:16 +0100 Subject: [PATCH] refactor: remove cache to speedup building --- src/build.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/build.py b/src/build.py index 044be39..1e70dee 100644 --- a/src/build.py +++ b/src/build.py @@ -4,7 +4,6 @@ import shutil from pathlib import Path from jinja2 import Environment, FileSystemLoader -from joblib import Memory from mistletoe import Document from tqdm import tqdm @@ -18,18 +17,10 @@ class Build: def __init__(self, config: Config): self.config = config - memory = Memory("./cache", verbose=0) self.env = Environment(loader=FileSystemLoader("templates/")) self.env.filters["shuffle_answers"] = self.__filter_shuffle_answers self.questions = self.__parse_katalog() - # Decorate the method with memory.cache - self.__build_question = memory.cache(self.__build_question) - self.__build_question_slide = memory.cache(self.__build_question_slide) - self.__build_chapter = memory.cache(self.__build_chapter) - self.__build_section = memory.cache(self.__build_section) - self.__build_chapter_slidedeck = memory.cache(self.__build_chapter_slidedeck) - def __parse_katalog(self): with self.config.p_data_fragenkatalog.open() as file: fragenkatalog = json.load(file) @@ -48,7 +39,6 @@ class Build: return questions - # cached def __build_question(self, number, template_file="html/question.html"): """Combines the original question dataset from BNetzA with our internal metadata""" @@ -127,7 +117,6 @@ class Build: def __build_question_slide(self, input): return self.__build_question(input, template_file="slide/question.html") - # cached def __build_page(self, content, course_wrapper=False, sidebar=None): page_template = self.env.get_template("html/page.html") return page_template.render(content=content, course_wrapper=course_wrapper, sidebar=sidebar) @@ -156,7 +145,6 @@ class Build: except FileNotFoundError: tqdm.write(f"\033[31mPhoto #{id} not found\033[0m") - # cached def __build_chapter(self, edition, edition_name, number, chapter, next_chapter=None): chapter_template = self.env.get_template("html/chapter.html") next_chapter_template = self.env.get_template("html/next_chapter.html") @@ -181,7 +169,6 @@ class Build: with (self.config.p_data_html / f"{include}.html").open() as file: return file.read() - # cached def __build_section( self, edition,