Simplify configuration

This commit is contained in:
Nate Bowman
2026-10-16 16:33:49 -04:00
parent 5146dc2893
commit 93372fed4a
2 changed files with 10 additions and 16 deletions

View File

@@ -8,12 +8,13 @@ config_file = 'settings.yaml'
with open(config_file, 'r') as f: with open(config_file, 'r') as f:
c = yaml.safe_load(f) c = yaml.safe_load(f)
root_path = Path(c['storage']['root']) data_path = Path(c['storage']['data'])
output_path = Path(c['storage']['output'])
config = SimpleNamespace() config = SimpleNamespace()
config.data_file = root_path / c['storage']['data'] / c['data_file'] config.data_file = data_path / 'data.json'
config.bonus_data_file = root_path / c['storage']['data'] / c['bonus_data_file'] config.bonus_data_file = data_path / 'bonuses.json'
config.name_data_file = root_path / c['storage']['data'] / c['name_data_file'] config.name_data_file = data_path / 'name_data.json'
config.string_data_file = root_path / c['storage']['data'] / c['string_data_file'] config.string_data_file = data_path / 'strings.json'
config.namelists_dir = root_path / c['storage']['namelists'] config.namelists_dir = output_path / 'namelists'
config.decks_dir = root_path / c['storage']['decks'] config.decks_dir = output_path / 'decks-output'

View File

@@ -1,10 +1,3 @@
storage: storage:
root: '/home/nate/aoe/flashcards/' data: '/home/nate/projects/aoe/flashcards/data'
data: 'data' output: '/home/nate/projects/aoe/flashcards/output'
namelists: 'output/namelists'
maps: 'output/maps'
decks: 'output/decks-output'
data_file: 'data.json'
bonus_data_file: 'bonuses.json'
name_data_file: 'name_data.json'
string_data_file: 'strings.json'