fix: don't use static properties
This commit is contained in:
parent
4ec4bb9aac
commit
bfa6d717c2
@ -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" }
|
||||
]
|
||||
|
@ -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,
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user