202 """ |
201 """ |
203 if configDir is not None and os.path.exists(configDir): |
202 if configDir is not None and os.path.exists(configDir): |
204 hp = configDir |
203 hp = configDir |
205 else: |
204 else: |
206 cdn = ".eric7" |
205 cdn = ".eric7" |
207 if isWindowsPlatform(): |
|
208 # migrate the old config directory (< v18.06) |
|
209 cdnOld = "_eric7" |
|
210 hpOld = os.path.join(os.path.expanduser("~"), cdnOld) |
|
211 if os.path.exists(hpOld): |
|
212 hpNew = os.path.join(os.path.expanduser("~"), cdn) |
|
213 if os.path.exists(hpNew): |
|
214 # simply delete the old config directory |
|
215 shutil.rmtree(hpOld, True) |
|
216 else: |
|
217 os.rename(hpOld, hpNew) |
|
218 |
|
219 hp = os.path.join(os.path.expanduser("~"), cdn) |
206 hp = os.path.join(os.path.expanduser("~"), cdn) |
220 if not os.path.exists(hp): |
207 if not os.path.exists(hp): |
221 os.mkdir(hp) |
208 os.mkdir(hp) |
222 return hp |
209 return hp |
223 |
210 |