Don't use aiofiles. It's anoying to install in docker
This commit is contained in:
parent
acccacdff1
commit
84ff66becc
@ -4,5 +4,5 @@
|
|||||||
"documentation": "",
|
"documentation": "",
|
||||||
"dependencies": ["websocket_api", "http"],
|
"dependencies": ["websocket_api", "http"],
|
||||||
"codeowners": [],
|
"codeowners": [],
|
||||||
"requirements": ["aiofiles"]
|
"requirements": []
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
import aiofiles
|
|
||||||
from homeassistant.components.http import HomeAssistantView
|
from homeassistant.components.http import HomeAssistantView
|
||||||
|
|
||||||
from .const import FRONTEND_SCRIPT_URL, DATA_EXTRA_MODULE_URL
|
from .const import FRONTEND_SCRIPT_URL, DATA_EXTRA_MODULE_URL
|
||||||
@ -28,8 +27,8 @@ class ModView(HomeAssistantView):
|
|||||||
filecontent = ""
|
filecontent = ""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
async with aiofiles.open(path, mode="r", encoding="utf-8", errors="ignore") as localfile:
|
with open(path, mode="r", encoding="utf-8", errors="ignore") as localfile:
|
||||||
filecontent = await localfile.read()
|
filecontent = localfile.read()
|
||||||
localfile.close()
|
localfile.close()
|
||||||
except Exception as exception:
|
except Exception as exception:
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user