From a77eeb821b234c01d791c02ca37d4a66d6075f0c Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Tue, 13 Aug 2024 15:05:28 +0200 Subject: [PATCH] checkpoint --- py4web/server_adapters/__init__.py | 15 ++++++++++----- py4web/server_adapters/adapter_gevent.py | 3 +-- .../server_adapters/adapter_gevent_websockets.py | 3 +-- py4web/server_adapters/adapter_gunicorn_gevent.py | 3 +-- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/py4web/server_adapters/__init__.py b/py4web/server_adapters/__init__.py index e2aea618..bc3d0fb6 100644 --- a/py4web/server_adapters/__init__.py +++ b/py4web/server_adapters/__init__.py @@ -3,30 +3,35 @@ try: from .adapter_wsgiref import WSGIRefAdapter + available["wsgiref+threaded"] = WSGIRefAdapter except ModuleNotFoundError: - missing.append("wsgiref+threaded") + missing.append("wsgiref+threaded") try: from .adapter_rocket3 import Rocket3Adapter + available["rocket"] = Rocket3Adapter except ModuleNotFoundError: - missing.append("rocket") + missing.append("rocket") try: from .adapter_gevent import GeventAdapter + available["gevent"] = GeventAdapter except ModuleNotFoundError: - missing.append("gevent") + missing.append("gevent") try: from .adapter_gunicorn_gevent import GunicornGeventAdapter + available["gunicorn+gevent"] = GunicornGeventAdapter except ModuleNotFoundError: - missing.append("gunicorn+gevent") + missing.append("gunicorn+gevent") try: from .adapter_gevent_websockets import GeventWebsocketsAdapter + available["gevent+websockets"] = GeventWebsocketsAdapter except ModuleNotFoundError: - missing.append("gevent+websockets") + missing.append("gevent+websockets") diff --git a/py4web/server_adapters/adapter_gevent.py b/py4web/server_adapters/adapter_gevent.py index 178e61b3..afc113a2 100644 --- a/py4web/server_adapters/adapter_gevent.py +++ b/py4web/server_adapters/adapter_gevent.py @@ -1,9 +1,8 @@ import ssl import threading -from ombott.server_adapters import ServerAdapter - from gevent import local, pywsgi # pip install gevent +from ombott.server_adapters import ServerAdapter from .logging_utils import logging_conf diff --git a/py4web/server_adapters/adapter_gevent_websockets.py b/py4web/server_adapters/adapter_gevent_websockets.py index fd8dd507..a06f03ed 100644 --- a/py4web/server_adapters/adapter_gevent_websockets.py +++ b/py4web/server_adapters/adapter_gevent_websockets.py @@ -1,9 +1,8 @@ # from geventwebsocket.handler import WebSocketHandler # pip install gevent-websocket +from gevent import pywsgi from gevent_ws import WebSocketHandler # pip install gevent gevent-ws from ombott.server_adapters import ServerAdapter -from gevent import pywsgi - from .logging_utils import logging_conf # https://stackoverflow.com/questions/5312311/secure-websockets-with-self-signed-certificate diff --git a/py4web/server_adapters/adapter_gunicorn_gevent.py b/py4web/server_adapters/adapter_gunicorn_gevent.py index 07c94ac7..ddbd4016 100644 --- a/py4web/server_adapters/adapter_gunicorn_gevent.py +++ b/py4web/server_adapters/adapter_gunicorn_gevent.py @@ -7,9 +7,8 @@ import sys import threading -from ombott.server_adapters import ServerAdapter - from gevent import local # pip install gevent gunicorn setproctitle +from ombott.server_adapters import ServerAdapter from .logging_utils import check_level, get_log_file, logging_conf