style: restrict line-length

This commit is contained in:
Junyan Qin
2025-05-10 18:04:58 +08:00
parent b30016ed08
commit 055b389353
134 changed files with 1096 additions and 2595 deletions

View File

@@ -70,15 +70,12 @@ class HTTPController:
@self.quart_app.route('/')
async def index():
return await quart.send_from_directory(
frontend_path, 'index.html', mimetype='text/html'
)
return await quart.send_from_directory(frontend_path, 'index.html', mimetype='text/html')
@self.quart_app.route('/<path:path>')
async def static_file(path: str):
if not (
os.path.exists(os.path.join(frontend_path, path))
and os.path.isfile(os.path.join(frontend_path, path))
os.path.exists(os.path.join(frontend_path, path)) and os.path.isfile(os.path.join(frontend_path, path))
):
if os.path.exists(os.path.join(frontend_path, path + '.html')):
path += '.html'
@@ -110,6 +107,4 @@ class HTTPController:
elif path.endswith('.txt'):
mimetype = 'text/plain'
return await quart.send_from_directory(
frontend_path, path, mimetype=mimetype
)
return await quart.send_from_directory(frontend_path, path, mimetype=mimetype)