Browse Source

get_resource_path("foo.png") -> "/usr/share/electrum/foo.png"

283
Amir Taaki 13 years ago
parent
commit
15a8e1167b
  1. 17
      util.py

17
util.py

@ -0,0 +1,17 @@
import os
import platform
import sys
def appdata_dir():
if platform.system() == "Windows":
return os.path.join(os.environ["APPDATA"], "Electrum")
elif platform.system() == "Linux":
return os.path.join(sys.prefix, "share", "electrum")
elif platform.system() == "Darwin":
return "/Library/Application Support/Electrum"
else:
raise Exception("Unknown system")
def get_resource_path(filename):
return os.path.join(appdata_dir(), filename)
Loading…
Cancel
Save