Files
aoe2-flashcard-creator/flashcards/config.py
Nate Bowman 6e1b876a14 Add more data
Also renamed some of the files and had to change some code to account
for the new names.
2026-10-14 19:03:59 -04:00

19 lines
603 B
Python

from pathlib import Path
from types import SimpleNamespace
import yaml
config_file = '/home/nate/aoe/flashcards/settings.yaml'
with open(config_file, 'r') as f:
c = yaml.safe_load(f)
root_path = Path(c['storage']['root'])
config = SimpleNamespace()
config.data_file = root_path / c['storage']['data'] / c['data_file']
config.name_data_file = root_path / c['storage']['data'] / c['name_data_file']
config.string_data_file = root_path / c['storage']['data'] / c['string_data_file']
config.namelists_dir = root_path / c['storage']['namelists']
config.decks_dir = root_path / c['storage']['decks']