File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -124,7 +124,18 @@ def lookupAppdataFolder():
124124 elif 'win32' in sys .platform or 'win64' in sys .platform :
125125 dataFolder = path .join (environ ['APPDATA' ], APPNAME ) + '\\ '
126126 else :
127- dataFolder = path .expanduser (path .join ("~" , "." + APPNAME + "/" ))
127+ from shutil import move
128+ try :
129+ dataFolder = path .join (environ ["XDG_CONFIG_HOME" ], APPNAME )
130+ except KeyError :
131+ dataFolder = path .join (environ ["HOME" ], ".config" , APPNAME )
132+ # Migrate existing data to the proper location if this is an existing install
133+ try :
134+ print "Moving data folder to ~/.config/%s" % APPNAME
135+ move (path .join (environ ["HOME" ], ".%s" % APPNAME ), dataFolder )
136+ dataFolder = dataFolder + '/'
137+ except IOError :
138+ dataFolder = dataFolder + '/'
128139 return dataFolder
129140
130141def isAddressInMyAddressBook (address ):
You can’t perform that action at this time.
0 commit comments