Cleanup for mysql
All checks were successful
All checks were successful
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from cpl.dependency import ServiceCollection as _ServiceCollection
|
||||
from .abc.email_client_abc import EMailClientABC
|
||||
from .email_client import EMailClient
|
||||
from .email_client_settings import EMailClientSettings
|
||||
@@ -6,21 +7,15 @@ from .email_model import EMail
|
||||
from .mail_logger import MailLogger
|
||||
|
||||
|
||||
def add_mail(self):
|
||||
def add_mail(collection: _ServiceCollection):
|
||||
from cpl.core.console import Console
|
||||
from cpl.core.log import LoggerABC
|
||||
|
||||
try:
|
||||
self.add_singleton(EMailClientABC, EMailClient)
|
||||
self.add_transient(LoggerABC, MailLogger)
|
||||
collection.add_singleton(EMailClientABC, EMailClient)
|
||||
collection.add_transient(LoggerABC, MailLogger)
|
||||
except ImportError as e:
|
||||
Console.error("cpl-translation is not installed", str(e))
|
||||
|
||||
|
||||
def init():
|
||||
from cpl.dependency import ServiceCollection
|
||||
|
||||
ServiceCollection.add_mail = add_mail
|
||||
|
||||
|
||||
init()
|
||||
_ServiceCollection.with_module(add_mail, __name__)
|
||||
|
||||
Reference in New Issue
Block a user