implement name property in abstract class

This commit is contained in:
gcarq 2018-06-23 12:28:32 +02:00
parent 112998c205
commit 96a405feb7
2 changed files with 5 additions and 9 deletions

View File

@ -51,15 +51,15 @@ class RPC(object):
""" """
self._freqtrade = freqtrade self._freqtrade = freqtrade
@property
def name(self) -> str:
""" Returns the lowercase name of the implementation """
return self.__class__.__name__.lower()
@abstractmethod @abstractmethod
def cleanup(self) -> None: def cleanup(self) -> None:
""" Cleanup pending module resources """ """ Cleanup pending module resources """
@property
@abstractmethod
def name(self) -> str:
""" Returns the lowercase name of this module """
@abstractmethod @abstractmethod
def send_msg(self, msg: str) -> None: def send_msg(self, msg: str) -> None:
""" Sends a message to all registered rpc modules """ """ Sends a message to all registered rpc modules """

View File

@ -55,10 +55,6 @@ def authorized_only(command_handler: Callable[[Any, Bot, Update], None]) -> Call
class Telegram(RPC): class Telegram(RPC):
""" This class handles all telegram communication """ """ This class handles all telegram communication """
@property
def name(self) -> str:
return "telegram"
def __init__(self, freqtrade) -> None: def __init__(self, freqtrade) -> None:
""" """
Init the Telegram call, and init the super class RPC Init the Telegram call, and init the super class RPC