Cleanup for mysql
All checks were successful
All checks were successful
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
from cpl.dependency import ServiceCollection as _ServiceCollection
|
||||
from .translate_pipe import TranslatePipe
|
||||
from .translation_service import TranslationService
|
||||
from .translation_service_abc import TranslationServiceABC
|
||||
from .translation_settings import TranslationSettings
|
||||
|
||||
|
||||
def add_translation(self):
|
||||
def add_translation(collection: _ServiceCollection):
|
||||
from cpl.core.console import Console
|
||||
from cpl.core.pipes import PipeABC
|
||||
from cpl.translation.translate_pipe import TranslatePipe
|
||||
@@ -12,16 +13,10 @@ def add_translation(self):
|
||||
from cpl.translation.translation_service_abc import TranslationServiceABC
|
||||
|
||||
try:
|
||||
self.add_singleton(TranslationServiceABC, TranslationService)
|
||||
self.add_transient(PipeABC, TranslatePipe)
|
||||
collection.add_singleton(TranslationServiceABC, TranslationService)
|
||||
collection.add_transient(PipeABC, TranslatePipe)
|
||||
except ImportError as e:
|
||||
Console.error("cpl-translation is not installed", str(e))
|
||||
|
||||
|
||||
def init():
|
||||
from cpl.dependency import ServiceCollection
|
||||
|
||||
ServiceCollection.add_translation = add_translation
|
||||
|
||||
|
||||
init()
|
||||
_ServiceCollection.with_module(add_translation, __name__)
|
||||
|
||||
Reference in New Issue
Block a user