1
0

Do not use XDG_DATA_HOME. Tell user to use virtualenv if they are not root

This commit is contained in:
ThomasV
2014-10-23 21:25:14 +02:00
parent ffbabc63e9
commit b8a5d4146d
2 changed files with 7 additions and 8 deletions

View File

@@ -62,13 +62,15 @@ def data_dir():
else:
return appdata_dir()
def usr_share_dir():
return os.path.join(sys.prefix, "share")
def appdata_dir():
"""Find the path to the application data directory; add an electrum folder and return path."""
if platform.system() == "Windows":
return os.path.join(os.environ["APPDATA"], "Electrum")
elif platform.system() == "Linux":
return os.path.join(sys.prefix, "share", "electrum")
return os.path.join(usr_share_dir(), "electrum")
elif (platform.system() == "Darwin" or
platform.system() == "DragonFly" or
platform.system() == "OpenBSD" or