From 6788e6a4f10df5e17537d9e7cd9706dc180efbe7 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Mon, 21 Feb 2022 11:01:27 +0100 Subject: [PATCH] fix: allow template loading without the web server See https://git.vvvvvvaria.org/decentral1se/xbotlib/issues/12 --- README.md | 1 + xbotlib.py | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index eff8afa..80f6f98 100644 --- a/README.md +++ b/README.md @@ -258,6 +258,7 @@ easily template and generate HTML. The web server is provided by The default template search path is `index.html.j2` in the current working directory. This can be configured through the usual configuration entrypoints. +It is possible to use the template without the built-in server too! Here's a small example that renders a random ASCII letter and uses a stylesheet. diff --git a/xbotlib.py b/xbotlib.py index 329151b..32fa91b 100644 --- a/xbotlib.py +++ b/xbotlib.py @@ -490,11 +490,7 @@ class Bot(ClientXMPP): self.no_auto_join = no_auto_join self.port = port self.serve_web = serve_web - - self.template = None - if self.serve_web: - self.template = self.load_template(template) - + self.template = self.load_template(template) self.storage = storage self.output = Path(output).absolute()