Files
aoe2-flashcard-creator/flashcards/config.py
2026-10-16 16:33:49 -04:00

21 lines
573 B
Python

from pathlib import Path
from types import SimpleNamespace
import yaml
config_file = 'settings.yaml'
with open(config_file, 'r') as f:
c = yaml.safe_load(f)
data_path = Path(c['storage']['data'])
output_path = Path(c['storage']['output'])
config = SimpleNamespace()
config.data_file = data_path / 'data.json'
config.bonus_data_file = data_path / 'bonuses.json'
config.name_data_file = data_path / 'name_data.json'
config.string_data_file = data_path / 'strings.json'
config.namelists_dir = output_path / 'namelists'
config.decks_dir = output_path / 'decks-output'