Files
games-spreadsheet/website/config.py
Nate Bowman 901c4812fe Add password
2026-10-07 17:32:22 -04:00

27 lines
768 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',
'password',
'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']