blob: 1e3967cb4d72bee9e8d0056e48a1e1228bb4c9e1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
import yaml
from . import paths
def load_games_database():
database_path = paths.get_games_database_path()
with open(database_path, 'rb') as fdin:
return yaml.safe_load(fdin)
def get_game_info(game_id):
db = load_games_database()
return next(game_info
for game_info in db['games']
if game_info['id'] == game_id)
|