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