Get the config directory for Jupyter data files for this platform and user. These are non-transient, non-configuration files. Returns JUPYTER_DATA_DIR if defined, else a platform-appropriate path.
()
| 70 | return pjoin(home_dir, ".jupyter") |
| 71 | |
| 72 | def jupyter_data_dir(): |
| 73 | """Get the config directory for Jupyter data files for this platform and user. |
| 74 | |
| 75 | These are non-transient, non-configuration files. |
| 76 | |
| 77 | Returns JUPYTER_DATA_DIR if defined, else a platform-appropriate path. |
| 78 | """ |
| 79 | env = __vscode_os.environ |
| 80 | |
| 81 | if env.get("JUPYTER_DATA_DIR"): |
| 82 | return env["JUPYTER_DATA_DIR"] |
| 83 | |
| 84 | home = get_home_dir() |
| 85 | |
| 86 | if __vscode_sys.platform == "darwin": |
| 87 | return __vscode_os.path.join(home, "Library", "Jupyter") |
| 88 | elif __vscode_os.name == "nt": |
| 89 | appdata = __vscode_os.environ.get("APPDATA", None) |
| 90 | if appdata: |
| 91 | return str(__vscode_Path(appdata, "jupyter").resolve()) |
| 92 | else: |
| 93 | return pjoin(jupyter_config_dir(), "data") |
| 94 | else: |
| 95 | # Linux, non-OS X Unix, AIX, etc. |
| 96 | xdg = env.get("XDG_DATA_HOME", None) |
| 97 | if not xdg: |
| 98 | xdg = pjoin(home, ".local", "share") |
| 99 | return pjoin(xdg, "jupyter") |
| 100 | |
| 101 | if __vscode_os.name == "nt": |
| 102 | programdata = __vscode_os.environ.get("PROGRAMDATA", None) |
no test coverage detected