Heray-Was-Here
Server : Apache
System : Linux vps37394.inmotionhosting.com 3.10.0-1160.119.1.vz7.224.4 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
User : jasonp18 ( 1000)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /lib/rads/venv/lib/python3.13/site-packages/exim_analytics/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/rads/venv/lib/python3.13/site-packages/exim_analytics/config.py
from typing import NamedTuple
import yaml


class ConfigData(NamedTuple):
    endpoint_url: str
    bearer_token: str
    tls_verify: bool = True
    timeout_connect: int = 5
    timeout_read: int = 15
    max_retries: int = 3
    retry_backoff_seconds: int = 2
    log_level: str = "INFO"
    log_path: str = "/var/log/mail_analytics.log"


data: ConfigData | None = None


def load_config(path: str):
    with open(path, "r", encoding="utf-8") as f:
        cfg = yaml.safe_load(f) or {}
    global data
    data = ConfigData(**cfg)
    return data

Hry