deemix-py/deemix/utils/localpaths.py

23 lines
543 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"):
2020-08-14 18:31:37 +00:00
userdata = getenv("XDG_CONFIG_HOME") + '/deemix/'
2020-02-20 14:42:12 +00:00
else:
2020-08-14 18:31:37 +00:00
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