Add docstrings
This commit is contained in:
parent
62e8aad3a8
commit
2ae08b8f7e
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue