From bb0c0ff4c69529525f7a25667c169ae7a303fa5a Mon Sep 17 00:00:00 2001 From: Amir Taaki Date: Thu, 5 Jul 2012 01:36:32 +0200 Subject: [PATCH] add multiargs support to get_resource_path --- lib/util.py | 17 +++++++++++++++++ util.py | 17 ----------------- 2 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 lib/util.py delete mode 100644 util.py diff --git a/lib/util.py b/lib/util.py new file mode 100644 index 0000000..1a8cd4c --- /dev/null +++ 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 deleted file mode 100644 index 53cc650..0000000 --- a/util.py +++ /dev/null @@ -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) - -- 1.7.1