diff --git a/pyproject.toml b/pyproject.toml index 177aa59..e6a4910 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "sati-ac" -version = "0.1.1" +version = "0.1.2" authors = [ { name="sati.ac", email="sati.ac@proton.me" } ] diff --git a/sati/sati.py b/sati/sati.py index d61ee66..a8f5c93 100644 --- a/sati/sati.py +++ b/sati/sati.py @@ -5,7 +5,6 @@ from .util import SatiDict from .socket import SatiSocket class UnableToSolveTask(Exception): - task: SatiDict def __init__(self, task: SatiDict): super().__init__(f"sati: unable to solve {task.type} task #{task.id}") self.task = task @@ -23,10 +22,6 @@ class Sati: >>> print(task.result.token) ''' - _socket: SatiSocket - _project_id: int - _awaited_tasks: dict - def __init__( self, token: str, diff --git a/sati/socket.py b/sati/socket.py index 0257481..611d9e9 100644 --- a/sati/socket.py +++ b/sati/socket.py @@ -16,8 +16,6 @@ class SatiUnrecoverableException(Exception): class SatiException(Exception): ''' api error ''' - code: int - def __init__(self, message: str, code: int = 0): super().__init__(f"sati: #{code}: {message}") self.code = code @@ -30,18 +28,6 @@ class QueueEntry: class SatiSocket: ''' low-level api wrapper ''' - __token: str - __state: int = STATE_RECONNECTING - __socket: typing.Any - __reconnection_interval: float - __connector_ref: asyncio.Task - __id_counter: int = 0 - __awaited_replies: dict - __error = None - __queue: list - __url: str - __event_handlers: dict - __debug: bool def __init__( self, @@ -58,6 +44,9 @@ class SatiSocket: self.__url = url self.__connector_ref = asyncio.create_task(self.__connector()) self.__debug = debug + self.__error = None + self.__id_counter = 0 + self.__state = STATE_RECONNECTING async def __connector(self): while self.__state != STATE_UNRECOVERABLE: