Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions solvedac_community/HTTPClients/abstract_http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@


class AbstractHTTPClient(metaclass=ABCMeta):
def __new__(cls, *args, **kwargs):
if not hasattr(cls, "_instance"):
cls._instance = super().__new__(cls)
return cls._instance

@abstractmethod
def __init__(self):
Expand Down
5 changes: 0 additions & 5 deletions solvedac_community/HTTPClients/aiohttp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@
class AiohttpHTTPClient(AbstractHTTPClient):
USER_AGENT: ClassVar[str] = "Mozilla/5.0"

def __new__(cls, *args, **kwargs):
if not hasattr(cls, "_instance"):
cls._instance = super().__new__(cls)
return cls._instance

def __init__(self, loop: asyncio.AbstractEventLoop, solvedac_token: Optional[str] = None) -> None:
self.loop: asyncio.AbstractEventLoop = loop
self.session: aiohttp.ClientSession = MISSING
Expand Down
8 changes: 4 additions & 4 deletions solvedac_community/HTTPClients/httpclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ def __make_url(url: str, params: dict) -> str:
def __init__(self, method: RequestMethod, url: str, params: Optional[Dict[str, Any]] = None) -> None:
if params:
url = self.__make_url(url, params)
(self.url): str = self.BASE_URL + url
(self.method): RequestMethod = method
self.url: str = self.BASE_URL + url
self.method: RequestMethod = method


class ResponseData:
def __init__(self, text: str, status: int) -> None:
(self.response_data): str = text
(self.status): int = status
self.response_data: str = text
self.status: int = status

def __str__(self) -> str:
return f"status_code : {self.status}\nresponse_data : {self.response_data}"
5 changes: 0 additions & 5 deletions solvedac_community/HTTPClients/httpx_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@
class HttpxHTTPClient(AbstractHTTPClient):
USER_AGENT: ClassVar[str] = "Mozilla/5.0"

def __new__(cls, *args, **kwargs):
if not hasattr(cls, "_instance"):
cls._instance = super().__new__(cls)
return cls._instance

def __init__(self, loop: asyncio.AbstractEventLoop, solvedac_token: Optional[str] = None) -> None:
self.loop: asyncio.AbstractEventLoop = loop
self.lock: asyncio.Lock = asyncio.Lock()
Expand Down