22 lines
606 B
Python
22 lines
606 B
Python
import json
|
|
from pathlib import Path
|
|
from config_model import Config, HanaConfig, OutlookConfig, ClientConfig
|
|
|
|
########################################################
|
|
CONFIG_PATH = Path(__file__).resolve().parent / "config.json"
|
|
|
|
with open(CONFIG_PATH, 'r', encoding='utf-8') as f:
|
|
data = json.load(f)
|
|
|
|
# Instantiate dataclasses
|
|
hana = HanaConfig(**data.get('hana', {}))
|
|
outlook = OutlookConfig(**data.get('outlook', {}))
|
|
client = ClientConfig(**data.get('client', {}))
|
|
|
|
CONFIG = Config(
|
|
hana=hana,
|
|
outlook=outlook,
|
|
client=client
|
|
)
|
|
|
|
######################################################## |