deemix-py/deemix/utils/localpaths.py

22 lines
509 B
Python
Raw Normal View History

from pathlib import Path
import sys
2020-02-20 14:42:12 +00:00
from os import getenv
userdata = ""
homedata = Path.home()
2020-02-20 14:42:12 +00:00
if getenv("APPDATA"):
userdata = Path(getenv("APPDATA")) / "deemix"
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 = Path(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