Files
PyVtT/src/pyvtt/configuration.py
Max P. 5b343b68cf
All checks were successful
Build and Publish / build-and-publish (push) Successful in 21s
feat(pyvtt): add CI pipeline and restructure project
- Add GitHub Actions workflow for building and publishing packages.
- Introduce `pyproject.toml` for project metadata and dependency management.
- Remove `requirements.txt` in favor of Poetry for dependency handling.
- Restructure source files under `src/pyvtt` for better organization.
- Enhance `notify.py` with sound playback and improve error handling.
- Update `voice_to_text_tray.py` to support dynamic configuration reload.
- Add `.vscode/settings.json` for improved IDE configuration.
- Update `.gitignore` to exclude build artifacts.

Signed-off-by: Max P. <Mail@MPassarello.de>
2025-04-30 15:01:58 +02:00

23 lines
782 B
Python

import json
import os
def read_configurations():
"""
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.
"""
script_dir = os.path.dirname(os.path.abspath(__file__))
settings_path = os.path.join(script_dir, "pyvtt.settings.json")
try:
with open(settings_path) as f:
return json.load(f)
except Exception as e:
print(f"Error reading configurations: {e}")
raise Exception(f"Error reading configurations: {e}")