MCPcopy Index your code
hub / github.com/ipython/ipython / get_xdg_cache_dir

Function get_xdg_cache_dir

IPython/utils/path.py:218–234  ·  view source on GitHub ↗

Return the XDG_CACHE_HOME, if it is defined and exists, else None. This is only for non-OS X posix (Linux,Unix,etc.) systems.

()

Source from the content-addressed store, hash-verified

216
217
218def get_xdg_cache_dir():
219 """Return the XDG_CACHE_HOME, if it is defined and exists, else None.
220
221 This is only for non-OS X posix (Linux,Unix,etc.) systems.
222 """
223
224 env = os.environ
225
226 if os.name == "posix":
227 # Linux, Unix, AIX, etc.
228 # use ~/.cache if empty OR not set
229 xdg = env.get("XDG_CACHE_HOME", None) or os.path.join(get_home_dir(), '.cache')
230 if xdg and _writable_dir(xdg):
231 assert isinstance(xdg, str)
232 return xdg
233
234 return None
235
236
237def expand_path(s: str) -> str:

Callers 1

get_ipython_cache_dirFunction · 0.90

Calls 3

get_home_dirFunction · 0.85
_writable_dirFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…