mirror of
https://github.com/Benexl/FastAnime.git
synced 2026-04-28 11:53:08 -07:00
feat(config-loader): allow env vars
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import configparser
|
import configparser
|
||||||
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
@@ -28,10 +29,9 @@ class ConfigLoader:
|
|||||||
"""
|
"""
|
||||||
self.config_path = config_path
|
self.config_path = config_path
|
||||||
self.parser = configparser.ConfigParser(
|
self.parser = configparser.ConfigParser(
|
||||||
interpolation=None,
|
interpolation=configparser.ExtendedInterpolation(),
|
||||||
# Allow boolean values without a corresponding value (e.g., `enabled` vs `enabled = true`)
|
defaults=os.environ,
|
||||||
allow_no_value=True,
|
allow_no_value=True,
|
||||||
# Behave like a dictionary, preserving case sensitivity of keys
|
|
||||||
dict_type=dict,
|
dict_type=dict,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user