2021.4 #19

Merged
edraft merged 237 commits from 2021.4 into master 2021-04-01 10:13:33 +02:00
2 changed files with 16 additions and 11 deletions
Showing only changes of commit a604fca5cc - Show all commits

View File

@ -8,10 +8,24 @@ class EMailClientABC(ServiceABC):
@abstractmethod @abstractmethod
def __init__(self): def __init__(self):
"""
ABC to send emails
"""
ServiceABC.__init__(self) ServiceABC.__init__(self)
@abstractmethod @abstractmethod
def connect(self): pass def connect(self):
"""
Connects to server
:return:
"""
pass
@abstractmethod @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') self._logger.trace(__name__, f'Stopped {__name__}.create')
def connect(self): def connect(self):
"""
Connects to server
:return:
"""
self._logger.trace(__name__, f'Started {__name__}.connect') self._logger.trace(__name__, f'Started {__name__}.connect')
try: try:
self._logger.debug(__name__, f'Try to connect to {self._mail_settings.host}:{self._mail_settings.port}') 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') self._logger.trace(__name__, f'Stopped {__name__}.login')
def send_mail(self, email: EMail): def send_mail(self, email: EMail):
"""
Sends email
:param email:
:return:
"""
self._logger.trace(__name__, f'Started {__name__}.send_mail') self._logger.trace(__name__, f'Started {__name__}.send_mail')
try: try:
self.login() self.login()