17 lines
441 B
Python
17 lines
441 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.namelists_dir = root_path / c['storage']['namelists']
|
|
config.decks_dir = root_path / c['storage']['decks']
|