Files

24 lines
710 B
Python
Raw Permalink Normal View History

2026-05-15 16:39:08 -05:00
import json
from pathlib import Path
from config_model import Config, HanaConfig, OutlookConfig, MailConfig, SmbConfig
# ========================================================================
2026-05-15 16:39:08 -05:00
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', {}))
smb = SmbConfig(**data.get('smb', {}))
mails = [MailConfig(**c) for c in data.get('mails', [])]
CONFIG = Config(
hana=hana,
outlook=outlook,
smb=smb,
mails=mails
)
# ========================================================================