From 84035772f2a1280d923a09bc61510785893368dc Mon Sep 17 00:00:00 2001 From: Gregor Robinson Date: Tue, 25 Jun 2013 21:28:06 +0000 Subject: [PATCH 1/2] Rename files with spaces in names. These filenames are technically allowed, but aren't that fun. --- src/{api client.py => api_client.py} | 0 src/{messages.dat reader.py => message_data_reader.py} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename src/{api client.py => api_client.py} (100%) rename src/{messages.dat reader.py => message_data_reader.py} (100%) diff --git a/src/api client.py b/src/api_client.py similarity index 100% rename from src/api client.py rename to src/api_client.py diff --git a/src/messages.dat reader.py b/src/message_data_reader.py similarity index 100% rename from src/messages.dat reader.py rename to src/message_data_reader.py From ad5517b41b4b21b7127e8a41e94efa587c7c50e6 Mon Sep 17 00:00:00 2001 From: Carlos Killpack Date: Wed, 26 Jun 2013 03:11:32 -0600 Subject: [PATCH 2/2] Fixed issue #157: Use $XDG_CONFIG_HOME --- src/shared.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/shared.py b/src/shared.py index 5dc6964b..22c3b9f6 100644 --- a/src/shared.py +++ b/src/shared.py @@ -124,7 +124,18 @@ def lookupAppdataFolder(): elif 'win32' in sys.platform or 'win64' in sys.platform: dataFolder = path.join(environ['APPDATA'], APPNAME) + '\\' else: - dataFolder = path.expanduser(path.join("~", "." + APPNAME + "/")) + from shutil import move + try: + dataFolder = path.join(environ["XDG_CONFIG_HOME"], APPNAME) + except KeyError: + dataFolder = path.join(environ["HOME"], ".config", APPNAME) + # Migrate existing data to the proper location if this is an existing install + try: + print "Moving data folder to ~/.config/%s" % APPNAME + move(path.join(environ["HOME"], ".%s" % APPNAME), dataFolder) + dataFolder = dataFolder + '/' + except IOError: + dataFolder = dataFolder + '/' return dataFolder def isAddressInMyAddressBook(address):