Lint: unused arguments
This commit is contained in:
@@ -22,11 +22,13 @@ fileserver = FileServer()
|
||||
|
||||
@bp.before_server_start
|
||||
async def start_fileserver(app):
|
||||
_ = app
|
||||
await fileserver.start()
|
||||
|
||||
|
||||
@bp.after_server_stop
|
||||
async def stop_fileserver(app):
|
||||
_ = app
|
||||
await fileserver.stop()
|
||||
|
||||
|
||||
@@ -100,6 +102,7 @@ async def watch(req, ws):
|
||||
|
||||
|
||||
def subscribe(uuid, ws):
|
||||
_ = ws
|
||||
with watching.state.lock:
|
||||
q = watching.pubsub[uuid] = asyncio.Queue()
|
||||
# Init with disk usage and full tree
|
||||
|
||||
@@ -141,6 +141,7 @@ async def main_start(app):
|
||||
|
||||
@app.after_server_start
|
||||
async def main_after_start(app):
|
||||
_ = app
|
||||
onlyoffice.log_reachable_info()
|
||||
|
||||
|
||||
@@ -255,6 +256,7 @@ async def wwwroot(req, path=""):
|
||||
|
||||
@app.route("/favicon.ico", methods=["GET", "HEAD"])
|
||||
async def favicon(req):
|
||||
_ = req
|
||||
# Browsers keep asking for it when viewing files (not HTML with icon link)
|
||||
return redirect("/assets/logo-ctv8tVwU.svg", status=308)
|
||||
|
||||
|
||||
@@ -268,6 +268,7 @@ def _log_webdav_user_agent_once(request, user_agent: str):
|
||||
|
||||
|
||||
def _build_ua_auth_headers(request, *, include_hint=False) -> dict[str, str]:
|
||||
_ = include_hint
|
||||
user_agent = request.headers.get("user-agent", "")
|
||||
_log_webdav_user_agent_once(request, user_agent)
|
||||
if _is_windows_auth_client(user_agent):
|
||||
@@ -1081,6 +1082,7 @@ async def login_page(request):
|
||||
|
||||
def _login_success_page(username: str) -> str:
|
||||
"""Minimal page that signals auth-success to parent iframe."""
|
||||
_ = username
|
||||
return str(
|
||||
Document().script_("window.parent.postMessage({type:'auth-success'},'*')")
|
||||
)
|
||||
|
||||
@@ -281,6 +281,8 @@ async def head_file(request, name=""):
|
||||
@bp.route("/", methods=["OPTIONS"], name="options_root", strict_slashes=False)
|
||||
@bp.route("/<name:path>", methods=["OPTIONS"], name="options_path")
|
||||
async def dav_options(request, name=""):
|
||||
_ = request
|
||||
_ = name
|
||||
return HTTPResponse(
|
||||
status=200,
|
||||
headers={
|
||||
|
||||
@@ -266,6 +266,7 @@ def process_image_pyvips(path, *, maxsize, quality):
|
||||
|
||||
|
||||
def process_image_buffer(data: bytes, *, quality, maxsize, maxzoom):
|
||||
_ = maxzoom
|
||||
t_start = perf_counter()
|
||||
img = pyvips.Image.new_from_buffer(data, "")
|
||||
img = img.autorot()
|
||||
|
||||
@@ -35,6 +35,7 @@ def run(*, dev=False):
|
||||
|
||||
|
||||
def check_cert(certdir, domain):
|
||||
_ = domain
|
||||
if (certdir / "privkey.pem").exist() and (certdir / "fullchain.pem").exists():
|
||||
return
|
||||
# Certificate provisioning is external; files must exist before startup.
|
||||
|
||||
@@ -6,6 +6,7 @@ app = Sanic("server80")
|
||||
# Send all HTTP users to HTTPS
|
||||
@app.exception(exceptions.NotFound, exceptions.MethodNotSupported)
|
||||
def redirect_everything_else(request, exception):
|
||||
_ = exception
|
||||
server, path = request.server_name, request.path
|
||||
if server and path.startswith("/"):
|
||||
return response.redirect(f"https://{server}{path}", status=308)
|
||||
@@ -15,6 +16,7 @@ def redirect_everything_else(request, exception):
|
||||
# ACME challenge for LetsEncrypt
|
||||
@app.get("/.well-known/acme-challenge/<challenge>")
|
||||
async def letsencrypt(request, challenge):
|
||||
_ = request
|
||||
try:
|
||||
return response.text(acme_challenges[challenge])
|
||||
except KeyError:
|
||||
|
||||
@@ -349,6 +349,7 @@ bp = Blueprint("sso", url_prefix="/auth")
|
||||
@bp.websocket("/ws/<path:path>")
|
||||
async def auth_websocket_proxy(request, ws, path=""):
|
||||
"""Proxy WebSocket connections to the auth backend."""
|
||||
_ = path
|
||||
await proxy_auth_websocket(request, ws)
|
||||
|
||||
|
||||
@@ -363,6 +364,7 @@ async def auth_websocket_proxy_root(request, ws):
|
||||
)
|
||||
async def auth_proxy(request, path=""):
|
||||
"""Proxy all auth requests to the auth backend."""
|
||||
_ = path
|
||||
return await proxy_auth_request(request)
|
||||
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ if sys.platform == "win32":
|
||||
|
||||
def get_allocated_size(path: Path, st: stat_result) -> int:
|
||||
"""Get actual disk allocation on Windows using GetCompressedFileSizeW."""
|
||||
_ = st
|
||||
high = wintypes.DWORD()
|
||||
low = GetCompressedFileSizeW(str(path), ctypes.byref(high))
|
||||
if low == INVALID_FILE_SIZE and ctypes.get_last_error() != 0:
|
||||
@@ -41,6 +42,7 @@ else:
|
||||
|
||||
def get_allocated_size(path: Path, st: stat_result) -> int:
|
||||
"""Get actual disk allocation on Unix using st_blocks."""
|
||||
_ = path
|
||||
# st_blocks is in 512-byte units
|
||||
return st.st_blocks * 512
|
||||
|
||||
@@ -249,6 +251,7 @@ def update_root(loop):
|
||||
def update_path(rootmod: list[FileEntry], relpath: PurePosixPath, loop):
|
||||
"""Called on FS updates, check the filesystem and broadcast any changes."""
|
||||
new = walk(relpath)
|
||||
_ = loop
|
||||
obegin, old = treeget(rootmod, relpath)
|
||||
|
||||
if old == new:
|
||||
|
||||
Reference in New Issue
Block a user