1
0

Refactored user_dir to utils and replaced it in wallet and config

This commit is contained in:
Maran
2012-08-30 18:00:08 +02:00
parent fbf854bcb8
commit 6da25727f8
4 changed files with 15 additions and 18 deletions

View File

@@ -8,6 +8,16 @@ def print_error(*args):
sys.stderr.write(" ".join(args) + "\n")
sys.stderr.flush()
def user_dir():
if "HOME" in os.environ:
return os.path.join(os.environ["HOME"], ".electrum")
elif "LOCALAPPDATA" in os.environ:
return os.path.join(os.environ["LOCALAPPDATA"], "Electrum")
elif "APPDATA" in os.environ:
return os.path.join(os.environ["APPDATA"], "Electrum")
else:
raise BaseException("No home directory found in environment variables.")
def appdata_dir():
"""Find the path to the application data directory; add an electrum folder and return path."""
if platform.system() == "Windows":