Improved comments of mailing

This commit is contained in:
Sven Heidemann 2021-03-14 16:18:11 +01:00
parent c3e9803cd6
commit a604fca5cc
2 changed files with 16 additions and 11 deletions

View File

@ -8,10 +8,24 @@ class EMailClientABC(ServiceABC):
@abstractmethod
def __init__(self):
"""
ABC to send emails
"""
ServiceABC.__init__(self)
@abstractmethod
def connect(self): pass
def connect(self):
"""
Connects to server
:return:
"""
pass
@abstractmethod
def send_mail(self, email: EMail): pass
def send_mail(self, email: EMail):
"""
Sends email
:param email:
:return:
"""
pass

View File

@ -39,10 +39,6 @@ class EMailClient(EMailClientABC):
self._logger.trace(__name__, f'Stopped {__name__}.create')
def connect(self):
"""
Connects to server
:return:
"""
self._logger.trace(__name__, f'Started {__name__}.connect')
try:
self._logger.debug(__name__, f'Try to connect to {self._mail_settings.host}:{self._mail_settings.port}')
@ -73,11 +69,6 @@ class EMailClient(EMailClientABC):
self._logger.trace(__name__, f'Stopped {__name__}.login')
def send_mail(self, email: EMail):
"""
Sends email
:param email:
:return:
"""
self._logger.trace(__name__, f'Started {__name__}.send_mail')
try:
self.login()