Show More
@@ -273,7 +273,6 b' def get_ipython_dir():' | |||
|
273 | 273 | |
|
274 | 274 | |
|
275 | 275 | ipdir_def = '.ipython' |
|
276 | xdg_def = 'ipython' | |
|
277 | 276 | |
|
278 | 277 | home_dir = get_home_dir() |
|
279 | 278 | xdg_dir = get_xdg_dir() |
@@ -284,20 +283,21 b' def get_ipython_dir():' | |||
|
284 | 283 | 'Please use IPYTHONDIR instead.') |
|
285 | 284 | ipdir = env.get('IPYTHONDIR', env.get('IPYTHON_DIR', None)) |
|
286 | 285 | if ipdir is None: |
|
287 |
# not set explicitly, use |
|
|
288 |
|
|
|
286 | # not set explicitly, use ~/.ipython | |
|
287 | ipdir = pjoin(home_dir, ipdir_def) | |
|
289 | 288 | if xdg_dir: |
|
290 | # use XDG, as long as the user isn't already | |
|
291 | # using $HOME/.ipython and *not* XDG/ipython | |
|
292 | ||
|
293 | xdg_ipdir = pjoin(xdg_dir, xdg_def) | |
|
294 | ||
|
295 | if _writable_dir(xdg_ipdir) or not _writable_dir(home_ipdir): | |
|
296 |
ipdir |
|
|
297 | ||
|
298 | if ipdir is None: | |
|
299 |
|
|
|
300 | ipdir = home_ipdir | |
|
289 | # Several IPython versions (up to 1.x) defaulted to .config/ipython | |
|
290 | # on Linux. We have decided to go back to using .ipython everywhere | |
|
291 | xdg_ipdir = pjoin(xdg_dir, 'ipython') | |
|
292 | ||
|
293 | if _writable_dir(xdg_ipdir): | |
|
294 | cu = compress_user | |
|
295 | if os.path.exists(ipdir): | |
|
296 | warnings.warn(('Ignoring {0} in favour of {1}. Remove {0} ' | |
|
297 | 'to get rid of this message').format(cu(xdg_ipdir), cu(ipdir))) | |
|
298 | else: | |
|
299 | warnings.warn('Moving {0} to {1}'.format(cu(xdg_ipdir), cu(ipdir))) | |
|
300 | os.rename(xdg_ipdir, ipdir) | |
|
301 | 301 | |
|
302 | 302 | ipdir = os.path.normpath(os.path.expanduser(ipdir)) |
|
303 | 303 |
General Comments 0
You need to be logged in to leave comments.
Login now