From 3c003c468c91cab4ebd42db68f52dff76c7822e7 Mon Sep 17 00:00:00 2001 From: nggit Date: Fri, 8 Nov 2024 23:33:24 +0700 Subject: [PATCH] release 0.0.50 (#45) * update dependency --------- Co-authored-by: nggit <12218311+nggit@users.noreply.github.com> --- examples/import.py | 2 +- httpout/__init__.py | 2 +- httpout/httpout.py | 4 ++-- httpout/lib/http_response.py | 2 +- pyproject.toml | 2 +- requirements.txt | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/import.py b/examples/import.py index 2a08db3..01628da 100644 --- a/examples/import.py +++ b/examples/import.py @@ -1,3 +1,3 @@ -from httpout import worker, context # noqa: F401 +from httpout import globals, context # noqa: F401 from httpout import app # noqa: F401 diff --git a/httpout/__init__.py b/httpout/__init__.py index 95c57a5..f1f5b97 100644 --- a/httpout/__init__.py +++ b/httpout/__init__.py @@ -1,6 +1,6 @@ # Copyright (c) 2024 nggit -__version__ = '0.0.47' +__version__ = '0.0.50' __all__ = ('HTTPOut',) from .httpout import HTTPOut # noqa: E402 diff --git a/httpout/httpout.py b/httpout/httpout.py index 4808a93..ec0fc05 100644 --- a/httpout/httpout.py +++ b/httpout/httpout.py @@ -167,7 +167,7 @@ async def _on_request(self, **server): request = server['request'] response = server['response'] logger = server['logger'] - worker_ctx = server['worker'] + worker_ctx = server['globals'] document_root = worker_ctx.options['document_root'] if not request.is_valid: @@ -326,7 +326,7 @@ async def _on_request(self, **server): async def _on_close(self, **server): request_ctx = server['context'] - worker_ctx = server['worker'] + worker_ctx = server['globals'] logger = server['logger'] if 'module_path' in request_ctx: diff --git a/httpout/lib/http_response.py b/httpout/lib/http_response.py index 9b7bb9a..78718bd 100644 --- a/httpout/lib/http_response.py +++ b/httpout/lib/http_response.py @@ -86,7 +86,7 @@ def set_content_type(self, content_type='text/html; charset=utf-8'): self.call_soon(self.response.set_content_type, content_type) async def _run_middleware(self): - worker_ctx = self.response.request.protocol.worker + worker_ctx = self.response.request.protocol.globals middlewares = worker_ctx.options['_middlewares']['response'] i = len(middlewares) diff --git a/pyproject.toml b/pyproject.toml index 67d07d7..0779594 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ description = """\ requires-python = '>=3.7' dependencies = [ 'awaiter', - 'tremolo>=0.0.761', + 'tremolo>=0.0.770', ] license = { text = 'MIT License' } classifiers = [ diff --git a/requirements.txt b/requirements.txt index 19ea906..8fc5cd8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ awaiter -tremolo>=0.0.761 +tremolo>=0.0.770