fix: allow template loading without the web server
See https://git.vvvvvvaria.org/decentral1se/xbotlib/issues/12
This commit is contained in:
		| @ -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 | The default template search path is `index.html.j2` in the current working | ||||||
| directory. This can be configured through the usual configuration entrypoints. | 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. | Here's a small example that renders a random ASCII letter and uses a stylesheet. | ||||||
|  |  | ||||||
|  | |||||||
| @ -490,11 +490,7 @@ class Bot(ClientXMPP): | |||||||
|         self.no_auto_join = no_auto_join |         self.no_auto_join = no_auto_join | ||||||
|         self.port = port |         self.port = port | ||||||
|         self.serve_web = serve_web |         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.storage = storage | ||||||
|         self.output = Path(output).absolute() |         self.output = Path(output).absolute() | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user