Return the XDG cache directory. See https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
()
| 47 | |
| 48 | |
| 49 | def _get_xdg_cache_dir(): |
| 50 | """ |
| 51 | Return the XDG cache directory. |
| 52 | |
| 53 | See |
| 54 | https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html |
| 55 | """ |
| 56 | cache_dir = os.environ.get("XDG_CACHE_HOME") |
| 57 | if not cache_dir: |
| 58 | cache_dir = os.path.expanduser("~/.cache") |
| 59 | if cache_dir.startswith("~/"): # Expansion failed. |
| 60 | return None |
| 61 | return Path(cache_dir, "matplotlib") |
| 62 | |
| 63 | |
| 64 | if __name__ == "__main__": |
no test coverage detected
searching dependent graphs…