5 def print_error(*args):
7 args = [str(item) for item in args]
8 sys.stderr.write(" ".join(args) + "\n")
12 if "HOME" in os.environ:
13 return os.path.join(os.environ["HOME"], ".electrum")
14 elif "LOCALAPPDATA" in os.environ:
15 return os.path.join(os.environ["LOCALAPPDATA"], "Electrum")
16 elif "APPDATA" in os.environ:
17 return os.path.join(os.environ["APPDATA"], "Electrum")
19 raise BaseException("No home directory found in environment variables.")
22 """Find the path to the application data directory; add an electrum folder and return path."""
23 if platform.system() == "Windows":
24 return os.path.join(os.environ["APPDATA"], "Electrum")
25 elif platform.system() == "Linux":
26 return os.path.join(sys.prefix, "share", "electrum")
27 elif (platform.system() == "Darwin" or
28 platform.system() == "DragonFly"):
29 return "/Library/Application Support/Electrum"
31 raise Exception("Unknown system")
33 def get_resource_path(*args):
34 return os.path.join(".", *args)
37 """Return path to the data folder."""
39 prefix_path = os.path.dirname(sys.argv[0])
40 local_data = os.path.join(prefix_path, "data")