Code style optimizations

This commit is contained in:
retoor 2024-12-01 10:21:20 +01:00
parent 600edca8cd
commit 8b925f852d
2 changed files with 8 additions and 7 deletions

View File

@ -1,8 +1,7 @@
import aiohttp
from aiohttp import web
import asyncio
import pathlib
from aiohttp import web
class Rupload(web.Application):
def __init__(
@ -247,9 +246,7 @@ async def handle_upload(request: web.Request):
print(f"File {filename} deleted.")
return web.Response(
status=413,
text="File is too large. Maximum file size is {} bytes.".format(
app.max_file_size
),
text=f"File is too large. Maximum file size is {app.max_file_size} bytes.",
)
f.write(chunk)
print(f"File {filename} uploaded successfully.")
@ -281,7 +278,9 @@ async def handle_index(request: web.Request):
message += f'<a href="{url}">'
message += f"{url}</a>"
if not message:
message = "Any file type is allowed thus also binary/executable or source files."
message = (
"Any file type is allowed thus also binary/executable or source files."
)
if message:
message += "<br /><br />"
html_content = html_content.replace("[message]", message)

View File

@ -1,5 +1,7 @@
import argparse
from aiohttp import web
from rupload.app import create_app