sh_cpl/tools/set_pip_urls/startup.py

22 lines
826 B
Python
Raw Permalink Normal View History

2022-05-25 19:30:11 +02:00
from cpl_core.application import StartupABC
from cpl_core.configuration import ConfigurationABC
from cpl_core.dependency_injection import ServiceProviderABC, ServiceCollectionABC
from cpl_core.environment import ApplicationEnvironment
class Startup(StartupABC):
def __init__(self):
StartupABC.__init__(self)
2023-02-20 15:55:20 +01:00
def configure_configuration(
self, configuration: ConfigurationABC, environment: ApplicationEnvironment
) -> ConfigurationABC:
configuration.add_environment_variables("CPL_")
configuration.add_json_file("appsettings.json", optional=False, output=False)
2022-05-25 19:30:11 +02:00
return configuration
2023-02-20 15:55:20 +01:00
def configure_services(
self, services: ServiceCollectionABC, environment: ApplicationEnvironment
) -> ServiceProviderABC:
2022-05-25 19:30:11 +02:00
return services.build_service_provider()