Skip to content

Commit

Permalink
Revert removing type ignores
Browse files Browse the repository at this point in the history
  • Loading branch information
CoolCat467 committed Dec 23, 2024
1 parent 901d330 commit aa6d5ac
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/sanescansrv/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def progress(current: int, total: int) -> None:
return filename


@app.get("/scan/<scan_filename>")
@app.get("/scan/<scan_filename>") # type: ignore[type-var]
@pretty_exception
async def handle_scan_get(
scan_filename: str,
Expand All @@ -529,7 +529,7 @@ async def handle_scan_get(
return await send_file(temp_file, attachment_filename=scan_filename)


@app.get("/scan-status")
@app.get("/scan-status") # type: ignore[type-var]
@pretty_exception
async def scan_status_get() -> (
AsyncIterator[str] | tuple[AsyncIterator[str], int] | WerkzeugResponse
Expand Down Expand Up @@ -593,7 +593,7 @@ async def scan_status_get() -> (
)


@app.get("/")
@app.get("/") # type: ignore[type-var]
async def root_get() -> AsyncIterator[str]:
"""Handle main page GET request."""
scanners = {}
Expand All @@ -617,7 +617,7 @@ async def root_get() -> AsyncIterator[str]:
)


@app.post("/")
@app.post("/") # type: ignore[type-var]
@pretty_exception
async def root_post() -> (
WerkzeugResponse | AsyncIterator[str] | tuple[AsyncIterator[str], int]
Expand Down Expand Up @@ -675,7 +675,7 @@ async def update_scanners_async() -> bool:
return True


@app.get("/update_scanners")
@app.get("/update_scanners") # type: ignore[type-var]
@pretty_exception
async def update_scanners_get() -> (
WerkzeugResponse | AsyncIterator[str] | tuple[AsyncIterator[str], int]
Expand All @@ -692,7 +692,7 @@ async def update_scanners_get() -> (
return app.redirect("scanners")


@app.get("/scanners")
@app.get("/scanners") # type: ignore[type-var]
async def scanners_get() -> AsyncIterator[str]:
"""Scanners page get handling."""
scanners = {}
Expand Down Expand Up @@ -803,7 +803,7 @@ def get_setting_radio(setting: DeviceSetting) -> str | None:
)


@app.get("/settings")
@app.get("/settings") # type: ignore[type-var]
async def settings_get() -> AsyncIterator[str] | WerkzeugResponse:
"""Handle settings page GET."""
scanner = request.args.get("scanner", "none")
Expand All @@ -827,7 +827,7 @@ async def settings_get() -> AsyncIterator[str] | WerkzeugResponse:
)


@app.post("/settings")
@app.post("/settings") # type: ignore[type-var]
async def settings_post() -> tuple[AsyncIterator[str], int] | WerkzeugResponse:
"""Handle settings page POST."""
scanner = request.args.get("scanner", "none")
Expand Down

0 comments on commit aa6d5ac

Please sign in to comment.