mirror of
https://github.com/daimyomizukagebay61/SteamPanel.git
synced 2026-08-26 17:27:43 +00:00
v 3.0.3
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
from .request import RequestStrategyAbstract
|
||||
from .storage import CookieStorageAbstract
|
||||
|
||||
|
||||
__all__ = [
|
||||
'RequestStrategyAbstract',
|
||||
'CookieStorageAbstract',
|
||||
]
|
||||
@@ -0,0 +1,29 @@
|
||||
from abc import (
|
||||
ABC,
|
||||
abstractmethod,
|
||||
)
|
||||
from typing import (
|
||||
Any,
|
||||
Mapping,
|
||||
)
|
||||
|
||||
from aiohttp import ClientResponse
|
||||
|
||||
|
||||
class RequestStrategyAbstract(ABC):
|
||||
|
||||
@abstractmethod
|
||||
async def request(self, url: str, method: str, **kwargs: Any) -> ClientResponse: # noqa:U100
|
||||
...
|
||||
|
||||
@abstractmethod
|
||||
async def text(self, url: str, method: str, **kwargs: Any) -> str: # noqa:U100
|
||||
...
|
||||
|
||||
@abstractmethod
|
||||
async def bytes(self, url: str, method: str, **kwargs: Any) -> bytes: # noqa:U100
|
||||
...
|
||||
|
||||
@abstractmethod
|
||||
def cookies(self, domain: str = 'steamcommunity.com') -> Mapping[str, str]: # noqa:U100
|
||||
...
|
||||
@@ -0,0 +1,16 @@
|
||||
from abc import (
|
||||
ABC,
|
||||
abstractmethod,
|
||||
)
|
||||
from typing import Mapping
|
||||
|
||||
|
||||
class CookieStorageAbstract(ABC):
|
||||
|
||||
@abstractmethod
|
||||
async def set(self, login: str, cookies: Mapping[str, Mapping[str, str]]) -> None: # noqa:U100
|
||||
...
|
||||
|
||||
@abstractmethod
|
||||
async def get(self, login: str, domain: str) -> Mapping[str, str]: # noqa:U100
|
||||
...
|
||||
Reference in New Issue
Block a user