Enhance grabbing of user data folder
This commit is contained in:
parent
e6d6b2d62b
commit
23ce47df41
@ -44,11 +44,14 @@ def runScript(sf, lcs = False):
|
||||
def getDataDir(appName):
|
||||
basePath = False
|
||||
if sys.platform.startswith("win"):
|
||||
basePath = os.environ["appdata"]
|
||||
if "appdata" in os.environ: basePath = os.environ["appdata"]
|
||||
elif sys.platform.startswith("linux"):
|
||||
basePath = os.environ["XDG_DATA_HOME"]
|
||||
if "XDG_DATA_HOME" in os.environ:
|
||||
basePath = os.environ["XDG_DATA_HOME"]
|
||||
else:
|
||||
if "HOME" in os.environ: basePath = p(os.environ["HOME"],".config")
|
||||
elif sys.platform.startswith("darwin"):
|
||||
basePath = os.path.join(os.environ["home"],"Library","Application Support")
|
||||
if "HOME" in os.environ: basePath = p(os.environ["HOME"],"Library","Application Support")
|
||||
|
||||
if not basePath: raise
|
||||
return p(basePath,appName)
|
||||
|
Loading…
Reference in New Issue
Block a user