This commit is contained in:
Daniil Fajnberg 2021-07-25 14:46:27 +02:00
parent 529c1a452c
commit ab1468788e

View File

@ -19,7 +19,7 @@ class OutputFormat(str, Enum):
class Settings(BaseSettings): class Settings(BaseSettings):
CONFIG_FILE: Optional[Path] = os.getenv(CONFIG_FILE_ENV_VAR, CONFIG_FILE_PLACEHOLDER) _CONFIG_FILE: Optional[Path] = os.getenv(CONFIG_FILE_ENV_VAR, CONFIG_FILE_PLACEHOLDER)
entry_urls: Union[str, List[str]] = [] entry_urls: Union[str, List[str]] = []
regex_mode: bool = False regex_mode: bool = False
@ -61,7 +61,7 @@ class Settings(BaseSettings):
def yaml_settings(settings_obj: Settings) -> Dict[str, Any]: def yaml_settings(settings_obj: Settings) -> Dict[str, Any]:
try: try:
with open(settings_obj.CONFIG_FILE, 'r') as f: with open(getattr(settings_obj, '_CONFIG_FILE'), 'r') as f:
config = yaml.safe_load(f) config = yaml.safe_load(f)
except FileNotFoundError: except FileNotFoundError:
return {} return {}