Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /MTSWebServices_syncmaster /syncmaster /settings /base.py
| # SPDX-FileCopyrightText: 2023-present MTS PJSC | |
| # SPDX-License-Identifier: Apache-2.0 | |
| import os | |
| from pydantic_settings import BaseSettings as PydanticBaseSettings | |
| from pydantic_settings import ( | |
| PydanticBaseSettingsSource, | |
| SettingsConfigDict, | |
| YamlConfigSettingsSource, | |
| ) | |
| class BaseSettings(PydanticBaseSettings): | |
| model_config = SettingsConfigDict( | |
| env_prefix="SYNCMASTER__", | |
| env_nested_delimiter="__", | |
| extra="ignore", | |
| ) | |
| def settings_customise_sources( | |
| cls, | |
| settings_cls: type[PydanticBaseSettings], | |
| init_settings: PydanticBaseSettingsSource, | |
| env_settings: PydanticBaseSettingsSource, | |
| dotenv_settings: PydanticBaseSettingsSource, | |
| file_secret_settings: PydanticBaseSettingsSource, | |
| ) -> tuple[PydanticBaseSettingsSource, ...]: | |
| yaml_file_path = os.getenv("SYNCMASTER_CONFIG_FILE", "config.yml") | |
| yaml_settings = YamlConfigSettingsSource(settings_cls, yaml_file=yaml_file_path) | |
| return ( | |
| init_settings, | |
| yaml_settings, | |
| env_settings, | |
| dotenv_settings, | |
| file_secret_settings, | |
| ) | |
Xet Storage Details
- Size:
- 1.18 kB
- Xet hash:
- 05f58784467e4a5e59df8991d700f0665f9dbad10150a7035715779c31626427
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.