import json import os from pathlib import Path from pyvtt.models.config import AppConfig DEFAULT_CONFIG_PATH = Path.home() / ".pyvtt.json" def read_configurations() -> AppConfig: """ Reads the configuration settings from a JSON file named 'pyvtt.settings.json' located in the same directory as the script. Returns: dict: The configuration settings loaded from the JSON file. Raises: Exception: If there is an error reading or parsing the JSON file, an exception is raised with the error details. """ try: with open(DEFAULT_CONFIG_PATH) as f: raw_config = json.load(f) return AppConfig(**raw_config) except Exception as e: print(f"Error reading configurations: {e}") raise Exception(f"Error reading configurations: {e}")