Get the cache directory it is created if it does not exist.
()
| 71 | |
| 72 | |
| 73 | def get_ipython_cache_dir() -> str: |
| 74 | """Get the cache directory it is created if it does not exist.""" |
| 75 | xdgdir = get_xdg_cache_dir() |
| 76 | if xdgdir is None: |
| 77 | return get_ipython_dir() |
| 78 | ipdir = os.path.join(xdgdir, "ipython") |
| 79 | if not os.path.exists(ipdir) and _writable_dir(xdgdir): |
| 80 | ensure_dir_exists(ipdir) |
| 81 | elif not _writable_dir(xdgdir): |
| 82 | return get_ipython_dir() |
| 83 | |
| 84 | return ipdir |
| 85 | |
| 86 | |
| 87 | def get_ipython_package_dir() -> str: |
no test coverage detected