From d7deaba441a7192a7828cf7471ce1bc8e3cea5f4 Mon Sep 17 00:00:00 2001 From: Tobias Wolf Date: Fri, 31 May 2024 08:38:30 +0200 Subject: [PATCH] Fix path calculation for templates of modules Signed-off-by: Tobias Wolf --- src/rookify/modules/module.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/rookify/modules/module.py b/src/rookify/modules/module.py index 1de3997..a02e743 100644 --- a/src/rookify/modules/module.py +++ b/src/rookify/modules/module.py @@ -213,7 +213,12 @@ def execute(self) -> None: pass def load_template(self, filename: str, **variables: Any) -> __Template: - template_path = os.path.join(os.path.dirname(__file__), "templates", filename) + template_path = os.path.join( + os.path.dirname(__file__), + self.__class__.__module__.rsplit(".", 2)[1], + "templates", + filename, + ) template = ModuleHandler.__Template(template_path) template.render(**variables) return template