26 lines
740 B
Python
26 lines
740 B
Python
from pathlib import Path
|
|
from types import SimpleNamespace
|
|
import yaml
|
|
|
|
|
|
|
|
config_file = '/home/nate/projects/games-spreadsheet/config.yaml'
|
|
with open(config_file, 'r') as f:
|
|
c = yaml.safe_load(f)
|
|
|
|
root_path = Path(c['storage']['root'])
|
|
|
|
copied_keys = [
|
|
'users',
|
|
'key',
|
|
'share',
|
|
'user_games_refresh_delay_seconds',
|
|
'max_players_refresh_delay_seconds'
|
|
]
|
|
|
|
config = SimpleNamespace({k: c[k] for k in copied_keys})
|
|
config.max_player_spreadsheet_path = (root_path /
|
|
c['storage']['resources'] /
|
|
'max-players.ods')
|
|
config.resources = root_path / c['storage']['resources']
|