Improved application

This commit is contained in:
2021-03-04 07:09:08 +01:00
parent 164c639d29
commit aa4931fd18
5 changed files with 55 additions and 28 deletions

View File

@@ -22,18 +22,20 @@ class Startup(StartupABC):
def create_application_host(self) -> ApplicationHostABC:
self._app_host = ApplicationHost()
self._app_host.application_runtime.set_runtime_directory(__file__)
self._app_host.console_argument_error_function(Error.error)
self._configuration = self._app_host.configuration
self._services = self._app_host.services
self._app_host.console_argument_error_function(Error.error)
return self._app_host
def create_configuration(self) -> ConfigurationABC:
self._configuration.add_environment_variables('PYTHON_')
self._configuration.add_environment_variables('CPL_')
self._configuration.add_console_argument('', 'help', ['h'], '')
self._configuration.add_console_argument('', 'version', ['v'], '')
self._configuration.add_console_argument('', 'help', ['-h', '-H'], '')
self._configuration.add_console_argument('', 'version', ['-v', '-V'], '')
self._configuration.add_console_arguments()
return self._configuration