Simplify configuration
This commit is contained in:
@@ -8,12 +8,13 @@ config_file = 'settings.yaml'
|
||||
with open(config_file, 'r') as 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.data_file = root_path / c['storage']['data'] / c['data_file']
|
||||
config.bonus_data_file = root_path / c['storage']['data'] / c['bonus_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']
|
||||
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'
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
storage:
|
||||
root: '/home/nate/aoe/flashcards/'
|
||||
data: 'data'
|
||||
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'
|
||||
data: '/home/nate/projects/aoe/flashcards/data'
|
||||
output: '/home/nate/projects/aoe/flashcards/output'
|
||||
|
||||
Reference in New Issue
Block a user