set config location to the default XDG spec

This commit is contained in:
Sierra 2020-10-22 17:03:29 -04:00
parent 9af70e2ee4
commit d747579b62
2 changed files with 3 additions and 1 deletions

View File

@ -1 +1,2 @@
Mastodon.py >= 1.5.1
pyxdg >= 0.27

View File

@ -4,10 +4,11 @@ import json
import os
import tempfile
from subprocess import call
from xdg import BaseDirectory
# load JSON config file
def load_config() -> dict:
with open('config.json') as f:
with open(f"{BaseDirectory.xdg_config_home}/tootgopher/config.json") as f:
config_data = json.load(f)
return config_data