from __future__ import annotations

from typing import Any

from .SHRLogCore_readConfigFileBase import CaseSensitiveConfigParser


def read_config_file(file_path: str) -> dict[str, dict[str, Any]]:
    temp_result_dict: dict[str, dict[str, Any]] = {}

    object_conf = CaseSensitiveConfigParser()
    object_conf.read(file_path, encoding="utf-8")

    for section in object_conf.sections():
        section_dict: dict[str, Any] = {}
        for key in object_conf[section]:
            section_dict[key] = object_conf.get(section, key)
        temp_result_dict[section] = section_dict

    return temp_result_dict