mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-23 10:37:13 +00:00
chore: update
This commit is contained in:
@@ -25,8 +25,10 @@ class JSONConfigFile(file_model.ConfigFile):
|
|||||||
if self.template_resource_name is None:
|
if self.template_resource_name is None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
with resources.path('langbot.templates', self.template_resource_name) as path:
|
with (
|
||||||
return path.open('r', encoding='utf-8').read()
|
resources.files('langbot.templates').joinpath(self.template_resource_name).open('r', encoding='utf-8') as f
|
||||||
|
):
|
||||||
|
return f.read()
|
||||||
|
|
||||||
async def create(self):
|
async def create(self):
|
||||||
if await self.get_template_file_str() is not None:
|
if await self.get_template_file_str() is not None:
|
||||||
|
|||||||
@@ -25,8 +25,10 @@ class YAMLConfigFile(file_model.ConfigFile):
|
|||||||
if self.template_resource_name is None:
|
if self.template_resource_name is None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
with resources.path('langbot.templates', self.template_resource_name) as path:
|
with (
|
||||||
return path.open('r', encoding='utf-8').read()
|
resources.files('langbot.templates').joinpath(self.template_resource_name).open('r', encoding='utf-8') as f
|
||||||
|
):
|
||||||
|
return f.read()
|
||||||
|
|
||||||
async def create(self):
|
async def create(self):
|
||||||
if await self.get_template_file_str() is not None:
|
if await self.get_template_file_str() is not None:
|
||||||
|
|||||||
Reference in New Issue
Block a user