##// END OF EJS Templates
add optional support for xdg_config|cache_dir
Julien Rabinow -
Show More
@@ -54,8 +54,7 b' def get_ipython_dir() -> str:'
54 warn(('{0} is deprecated. Move link to {1} to '
54 warn(('{0} is deprecated. Move link to {1} to '
55 'get rid of this message').format(cu(xdg_ipdir), cu(ipdir)))
55 'get rid of this message').format(cu(xdg_ipdir), cu(ipdir)))
56 else:
56 else:
57 warn('Moving {0} to {1}'.format(cu(xdg_ipdir), cu(ipdir)))
57 ipdir = xdg_ipdir
58 shutil.move(xdg_ipdir, ipdir)
59
58
60 ipdir = os.path.normpath(os.path.expanduser(ipdir))
59 ipdir = os.path.normpath(os.path.expanduser(ipdir))
61
60
@@ -223,7 +223,7 b' def get_xdg_dir():'
223
223
224 env = os.environ
224 env = os.environ
225
225
226 if os.name == 'posix' and sys.platform != 'darwin':
226 if os.name == "posix":
227 # Linux, Unix, AIX, etc.
227 # Linux, Unix, AIX, etc.
228 # use ~/.config if empty OR not set
228 # use ~/.config if empty OR not set
229 xdg = env.get("XDG_CONFIG_HOME", None) or os.path.join(get_home_dir(), '.config')
229 xdg = env.get("XDG_CONFIG_HOME", None) or os.path.join(get_home_dir(), '.config')
@@ -242,7 +242,7 b' def get_xdg_cache_dir():'
242
242
243 env = os.environ
243 env = os.environ
244
244
245 if os.name == 'posix' and sys.platform != 'darwin':
245 if os.name == "posix":
246 # Linux, Unix, AIX, etc.
246 # Linux, Unix, AIX, etc.
247 # use ~/.cache if empty OR not set
247 # use ~/.cache if empty OR not set
248 xdg = env.get("XDG_CACHE_HOME", None) or os.path.join(get_home_dir(), '.cache')
248 xdg = env.get("XDG_CACHE_HOME", None) or os.path.join(get_home_dir(), '.cache')
General Comments 0
You need to be logged in to leave comments. Login now