2021.4 #19
@ -4,6 +4,7 @@ from typing import Type, Optional
|
|||||||
from cpl.application.application_host_abc import ApplicationHostABC
|
from cpl.application.application_host_abc import ApplicationHostABC
|
||||||
from cpl.application.startup_abc import StartupABC
|
from cpl.application.startup_abc import StartupABC
|
||||||
from cpl.configuration.configuration_abc import ConfigurationABC
|
from cpl.configuration.configuration_abc import ConfigurationABC
|
||||||
|
from cpl.console.console import Console
|
||||||
from cpl.dependency_injection.service_provider_base import ServiceProviderABC
|
from cpl.dependency_injection.service_provider_base import ServiceProviderABC
|
||||||
|
|
||||||
|
|
||||||
@ -26,6 +27,18 @@ class ApplicationABC(ABC):
|
|||||||
self._services = self._startup.create_services()
|
self._services = self._startup.create_services()
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
if self._app_host is None:
|
||||||
|
Console.error('Application host is empty')
|
||||||
|
exit()
|
||||||
|
|
||||||
|
if self._configuration is None:
|
||||||
|
Console.error('Configuration is empty')
|
||||||
|
exit()
|
||||||
|
|
||||||
|
if self._services is None:
|
||||||
|
Console.error('Service provider is empty')
|
||||||
|
exit()
|
||||||
|
|
||||||
self.configure()
|
self.configure()
|
||||||
self.main()
|
self.main()
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from tests.Application import Application
|
from tests.application import Application
|
||||||
from tests.startup import Startup
|
from tests.startup import Startup
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
Reference in New Issue
Block a user