Removed service abc

This commit is contained in:
2021-03-29 13:29:26 +02:00
parent d0e3e1792f
commit f3be927440
10 changed files with 25 additions and 44 deletions

View File

@@ -20,7 +20,6 @@ __version__ = '2021.4.2.dev1'
from collections import namedtuple
# imports:
from .service_abc import ServiceABC
from .service_collection import ServiceCollection
from .service_collection_abc import ServiceCollectionABC
from .service_descriptor import ServiceDescriptor

View File

@@ -1,11 +0,0 @@
from abc import ABC, abstractmethod
class ServiceABC(ABC):
@abstractmethod
def __init__(self):
"""
ABC to represent a service
"""
pass

View File

@@ -1,8 +1,6 @@
from abc import abstractmethod, ABC
from collections import Callable
from typing import Type
from cpl.dependency_injection.service_abc import ServiceABC
from typing import Type, Optional
class ServiceProviderABC(ABC):
@@ -24,7 +22,7 @@ class ServiceProviderABC(ABC):
pass
@abstractmethod
def get_service(self, instance_type: Type) -> Callable[ServiceABC]:
def get_service(self, instance_type: Type) -> Optional[Callable[object]]:
"""
Returns instance of given type
:param instance_type:

View File

@@ -1,16 +1,14 @@
from abc import abstractmethod
from cpl.dependency_injection.service_abc import ServiceABC
from abc import abstractmethod, ABC
class LoggerABC(ServiceABC):
class LoggerABC(ABC):
@abstractmethod
def __init__(self):
"""
ABC for logging
"""
ServiceABC.__init__(self)
ABC.__init__(self)
@abstractmethod
def header(self, string: str):

View File

@@ -1,17 +1,16 @@
from abc import abstractmethod
from abc import abstractmethod, ABC
from cpl.dependency_injection.service_abc import ServiceABC
from cpl.mailing.email import EMail
class EMailClientABC(ServiceABC):
class EMailClientABC(ABC):
@abstractmethod
def __init__(self):
"""
ABC to send emails
"""
ServiceABC.__init__(self)
ABC.__init__(self)
@abstractmethod
def connect(self):