Skip to content

Commit

Permalink
Move websockets from legacy to asyncio
Browse files Browse the repository at this point in the history
  • Loading branch information
Tschuppi81 committed Nov 5, 2024
1 parent 911c8ec commit e7ec7bf
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/onegov/websockets/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import click
from sentry_sdk import init as init_sentry
from websockets.legacy.client import connect
from websockets.asyncio.client import connect

from onegov.core.cli import command_group, pass_group_context
from onegov.websockets.client import authenticate
Expand Down
2 changes: 1 addition & 1 deletion src/onegov/websockets/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from onegov.core.types import JSON_ro
from websockets.legacy.client import WebSocketClientProtocol
from websockets.client import WebSocketClientProtocol


async def acknowledged(websocket: 'WebSocketClientProtocol') -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/onegov/websockets/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from onegov.websockets.client import broadcast
from urllib.parse import ParseResult
from urllib.parse import urlparse
from websockets.legacy.client import connect
from websockets.asyncio.client import connect


from typing import Any
Expand Down
5 changes: 2 additions & 3 deletions src/onegov/websockets/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
from itsdangerous import BadSignature, Signer
from markupsafe import escape
from websockets.exceptions import ConnectionClosed, InvalidOrigin
from websockets.legacy.protocol import broadcast
from websockets.legacy.server import WebSocketServerProtocol, serve
from websockets.server import WebSocketServerProtocol, serve, broadcast

from onegov.chat.collections import ChatCollection
from onegov.chat.utils import param_from_path
Expand All @@ -30,7 +29,7 @@

from sqlalchemy.orm import Session
from websockets import Headers
from websockets.legacy.server import HTTPResponse
from websockets.asyncio.server import HTTPResponse

from onegov.chat.models import Chat
from onegov.core.types import JSONObject, JSONObject_ro
Expand Down
2 changes: 1 addition & 1 deletion tests/onegov/websockets/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from onegov.websockets.client import status
from pytest import mark
from tests.onegov.websockets.conftest import WebsocketsRoot
from websockets import connect
from websockets.asyncio.client import connect


@mark.asyncio
Expand Down
2 changes: 1 addition & 1 deletion tests/onegov/websockets/test_client_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from onegov.websockets.client import status
from pytest import mark
from pytest import raises
from websockets import connect
from websockets.asyncio.client import connect


@mark.asyncio
Expand Down

0 comments on commit e7ec7bf

Please sign in to comment.