tget_resource_path("foo.png") -> "/usr/share/electrum/foo.png" - electrum - Electrum Bitcoin wallet
HTML git clone https://git.parazyd.org/electrum
DIR Log
DIR Files
DIR Refs
DIR Submodules
---
DIR commit 15a8e1167bbfcdd9f989138cda05622c463115ed
DIR parent e954bdef3efbf9f0dc5709d9403b2d341cb8b9e8
HTML Author: Amir Taaki <genjix@riseup.net>
Date: Thu, 5 Jul 2012 01:25:05 +0200
get_resource_path("foo.png") -> "/usr/share/electrum/foo.png"
Diffstat:
A util.py | 17 +++++++++++++++++
1 file changed, 17 insertions(+), 0 deletions(-)
---
DIR diff --git a/util.py b/util.py
t@@ -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)
+