Initial commit
This commit is contained in:
25
website/config.py
Normal file
25
website/config.py
Normal file
@@ -0,0 +1,25 @@
|
||||
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']
|
||||
Reference in New Issue
Block a user