deemix-py/deemix/utils/localpaths.py

25 lines
547 B
Python
Raw Normal View History

2020-02-20 14:42:12 +00:00
#!/usr/bin/env python3
import os.path as path
import sys
2020-02-20 14:42:12 +00:00
from os import getenv
userdata = ""
homedata = path.expanduser("~")
if getenv("APPDATA"):
userdata = getenv("APPDATA") + path.sep + "deemix" + path.sep
2020-02-20 14:42:12 +00:00
elif sys.platform.startswith('darwin'):
userdata = homedata + '/Library/Application Support/deemix/'
2020-02-20 14:42:12 +00:00
elif getenv("XDG_CONFIG_HOME"):
userdata = getenv("XDG_CONFIG_HOME") + '/deemix/';
2020-02-20 14:42:12 +00:00
else:
userdata = homedata + '/.config/deemix/';
2020-02-20 14:42:12 +00:00
def getHomeFolder():
return homedata
2020-02-20 14:42:12 +00:00
def getConfigFolder():
return userdata