commit bb0c0ff4c69529525f7a25667c169ae7a303fa5a
parent 15a8e1167bbfcdd9f989138cda05622c463115ed
Author: Amir Taaki <genjix@riseup.net>
Date: Thu, 5 Jul 2012 01:36:32 +0200
add multiargs support to get_resource_path
Diffstat:
2 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/lib/util.py b/lib/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(*args):
+ return os.path.join(appdata_dir(), *args)
+
diff --git a/util.py b/util.py
@@ -1,17 +0,0 @@
-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)
-