summaryrefslogtreecommitdiffstats
path: root/gamechestcli/gamechest/paths.py
blob: 5e009a66f3110d5648820a05aeb803cf95f7d568 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import os
from pathlib import Path

from xdg import xdg_data_home

from . import consts


def get_remote_basedir():
    # TODO: unhardcode this
    return 'jibril:/storage/games'


def get_games_saves_path():
    # TODO: unhardcode this
    return Path(os.path.expanduser('~/games/.saves'))
    #return Path(os.path.expanduser('~/game-saves'))


def get_games_saves_tools_bin_path():
    return get_games_saves_path() / 'tools' / 'bin'


def get_profile_dir(profile_id):
    return get_games_saves_path() / 'profiles' / profile_id


def get_games_database_path():
    return get_games_saves_path() / 'gamedata.yaml'


def get_games_install_basedir():
    games_install_path = xdg_data_home() / consts.XDG_RESOURCE_NAME / 'games'
    games_install_path.mkdir(parents=True, exist_ok=True)
    return games_install_path