fix: use resources.files...

read_text is deprecated

Co-authored-by: chayleaf <chayleaf@pavluk.org>
This commit is contained in:
Hendrik Wiese 2024-06-09 10:58:34 +02:00 committed by GitHub
parent 61f528d9b3
commit 6e5e40e7e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -33,9 +33,9 @@ def load_templates():
global mod_template, meta_template, base_config, loaded global mod_template, meta_template, base_config, loaded
if loaded: if loaded:
return return
meta_template = Template(resources.read_text("maubot.cli", "res/maubot.yaml.j2")) meta_template = Template(resources.files("maubot.cli").joinpath("res/maubot.yaml.j2").read_text(encoding="utf-8"))
mod_template = Template(resources.read_text("maubot.cli", "res/plugin.py.j2")) mod_template = Template(resources.files("maubot.cli").joinpath("res/plugin.py.j2").read_text(encoding="utf-8"))
base_config = resources.read_text("maubot.cli", "res/config.yaml") base_config = resources.files("maubot.cli").joinpath("res/config.yaml").read_text(encoding="utf-8")
loaded = True loaded = True