Initial commit
This commit is contained in:
17
flashcards/config.py
Normal file
17
flashcards/config.py
Normal file
@@ -0,0 +1,17 @@
|
||||
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.maps_dir = root_path / c['storage']['maps']
|
||||
config.decks_dir = root_path / c['storage']['decks']
|
||||
Reference in New Issue
Block a user