diff --git a/pyproject.toml b/pyproject.toml index e35be63..fced494 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "sanescansrv" -version = "2.1.3" +version = "2.1.4" authors = [ { name="CoolCat467" }, ] @@ -23,11 +23,11 @@ classifiers = [ ] keywords = ["scanner", "sane", "server", "frontend"] dependencies = [ - "hypercorn[trio]~=0.14.3", - "Pillow~=10.0.0", + "hypercorn[trio]~=0.14.4", + "Pillow~=10.0.1", "python-sane~=2.9.1", - "quart~=0.19.2", - "quart-trio~=0.10.0", + "quart~=0.19.3", + "quart-trio~=0.11.0", "trio~=0.22.0", "Werkzeug~=3.0.0" ] diff --git a/src/sanescansrv/server.py b/src/sanescansrv/server.py index b0b2dc0..60c649e 100644 --- a/src/sanescansrv/server.py +++ b/src/sanescansrv/server.py @@ -20,7 +20,7 @@ __title__ = "Sane Scanner Web Server" __author__ = "CoolCat467" -__version__ = "2.1.3" +__version__ = "2.1.4" __license__ = "GPLv3" @@ -41,8 +41,7 @@ import trio from hypercorn.config import Config from hypercorn.trio import serve -from quart import Response, request, request_started -from quart.ctx import RequestContext +from quart import Response, request from quart.templating import stream_template from quart_trio import QuartTrio from werkzeug import Response as WerkzeugResponse @@ -130,35 +129,7 @@ def as_argument(self) -> str: return f"--{self.name}={self.set if self.set is not None else self.default}" -class HopefullyTemporarySubclass(QuartTrio): - """Hopefully Temporary Subclass of QuartTrio with patched code because QuartTrio is out of date.""" - - __slots__ = () - - async def full_dispatch_request( - self, - request_context: RequestContext | None = None, - ) -> Response | WerkzeugResponse: - """Adds pre and post processing to the request dispatching. - - Arguments: - --------- - request_context: The request context, optional as Flask - omits this argument. - """ - # await self.try_trigger_before_first_request_functions() - # await request_started.send(self) - await request_started.send_async(self, _sync_wrapper=self.ensure_async) - try: - result = await self.preprocess_request(request_context) - if result is None: - result = await self.dispatch_request(request_context) - except (Exception, trio.MultiError) as error: - result = await self.handle_user_exception(error) # type: ignore[assignment] - return await self.finalize_request(result, request_context) # type: ignore[arg-type] - - -app: Final = HopefullyTemporarySubclass( # pylint: disable=invalid-name +app: Final = QuartTrio( # pylint: disable=invalid-name __name__, static_folder="static", template_folder="templates",