Add docstrings

This commit is contained in:
trueold89 2024-07-08 00:09:08 +03:00
parent 62e8aad3a8
commit 2ae08b8f7e
Signed by: trueold89
GPG Key ID: C122E85DD49E6B30
1 changed files with 34 additions and 0 deletions

View File

@ -37,37 +37,71 @@ class AIOConnection(object):
class IMCServer(ABC): class IMCServer(ABC):
def __init__(self, host: str, port: int) -> None: def __init__(self, host: str, port: int) -> None:
"""
:param host: Minecraft server ip or hostname
:param port: Minecraft server port
"""
self.host = host self.host = host
self.port = port self.port = port
@property @property
@abstractmethod @abstractmethod
async def players_count(self) -> int: async def players_count(self) -> int:
"""
Returns current number of players on server
:return: Number of players on server
"""
raise NotImplementedError raise NotImplementedError
@property @property
@abstractmethod @abstractmethod
async def name(self) -> str: async def name(self) -> str:
"""
Returns server core name
:return: Server name
"""
raise NotImplementedError raise NotImplementedError
@property @property
@abstractmethod @abstractmethod
async def maxplayers(self) -> int: async def maxplayers(self) -> int:
"""
Returns max number of players available on server
:return: Max number of players
"""
raise NotImplementedError raise NotImplementedError
@property @property
@abstractmethod @abstractmethod
async def motd(self) -> str: async def motd(self) -> str:
"""
Returns Message of the day
:return: Server motd
"""
raise NotImplementedError raise NotImplementedError
@property @property
@abstractmethod @abstractmethod
async def players_list(self) -> Iterable: async def players_list(self) -> Iterable:
"""
Returns iterable object with online players nicknames
:return: Players nicknames iterable object
"""
raise NotImplementedError raise NotImplementedError
@property @property
@abstractmethod @abstractmethod
async def all_info(self) -> dict: async def all_info(self) -> dict:
"""
Returns dict with all information about server
:return: All information about server
"""
raise NotImplementedError raise NotImplementedError