diff --git a/test.py b/test.py index 37f7053..98228f1 100644 --- a/test.py +++ b/test.py @@ -20,7 +20,8 @@ logger.setLevel(logging.DEBUG) logger.addHandler(handler) async def main(): - conn = Connection("wss://echo.websocket.org") + conn = Connection("wss://euphoria.io/room/test/ws") + #conn = Connection("wss://euphoria.io/room/cabal/ws") # password protected print() print(" DISCONNECTING TWICE AT THE SAME TIME") diff --git a/yaboli/client.py b/yaboli/client.py index ee868cf..be3e364 100644 --- a/yaboli/client.py +++ b/yaboli/client.py @@ -1,9 +1,9 @@ +from typing import List, Optional + from .message import Message from .room import Room from .user import User -from typing import List, Optional - __all__ = ["Client"] class Client: @@ -12,8 +12,8 @@ class Client: async def join(self, room_name: str, - password: str = None, - nick: str = None) -> Room: + password: Optional[str] = None, + nick: str = "") -> Room: pass async def get(self, room_name: str) -> Optional[Room]: diff --git a/yaboli/exceptions.py b/yaboli/exceptions.py index 28f2cfb..8601641 100644 --- a/yaboli/exceptions.py +++ b/yaboli/exceptions.py @@ -1,6 +1,6 @@ __all__ = [ "EuphException", - # Connection stuff + # Connection exceptions "IncorrectStateException", "ConnectionClosedException", # Joining a room @@ -9,16 +9,12 @@ __all__ = [ "CouldNotAuthenticateException", # Doing stuff in a room "RoomClosedException", - # Other stuff - "RateLimitException", - "NotLoggedInException", - "UnauthorizedException", ] class EuphException(Exception): pass -# Connection stuff +# Connection exceptions class IncorrectStateException(EuphException): """ @@ -64,16 +60,3 @@ class RoomClosedException(EuphException): completed. """ pass - -# exception for having no username? - -# Maybe these will become real exceptions one day? - -class RateLimitException(EuphException): - pass - -class NotLoggedInException(EuphException): - pass - -class UnauthorizedException(EuphException): - pass diff --git a/yaboli/message.py b/yaboli/message.py index 088cbe7..e985c05 100644 --- a/yaboli/message.py +++ b/yaboli/message.py @@ -1,7 +1,7 @@ -from .user import User, LiveUser - -from typing import TYPE_CHECKING, Optional import datetime +from typing import TYPE_CHECKING, Optional + +from .user import LiveUser, User if TYPE_CHECKING: from .client import Client diff --git a/yaboli/room.py b/yaboli/room.py index 5d36c54..092c7b4 100644 --- a/yaboli/room.py +++ b/yaboli/room.py @@ -1,9 +1,9 @@ +from typing import List, Optional + from .exceptions import * from .message import LiveMessage from .user import LiveUser -from typing import List, Optional - __all__ = ["Room"] class Room: @@ -65,8 +65,8 @@ class Room: def __init__(self, room_name: str, - nick: str = None, - password: str = None): + nick: str = "", + password: Optional[str] = None) -> None: pass self.closed = False diff --git a/yaboli/user.py b/yaboli/user.py index 053315c..f97d7d7 100644 --- a/yaboli/user.py +++ b/yaboli/user.py @@ -1,7 +1,7 @@ -from .util import mention, atmention - from typing import TYPE_CHECKING +from .util import atmention, mention + if TYPE_CHECKING: from .client import Client from .room import Room