"""Unix."""
=
"""
On Unix/Linux, we follow the
`XDG Basedir Spec <https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html>`_. The spec allows
overriding directories with environment variables. The examples show are the default values, alongside the name of
the environment variable that overrides them. Makes use of the
`appname <platformdirs.api.PlatformDirsABC.appname>`,
`version <platformdirs.api.PlatformDirsABC.version>`,
`multipath <platformdirs.api.PlatformDirsABC.multipath>`,
`opinion <platformdirs.api.PlatformDirsABC.opinion>`,
`ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`.
"""
"""
:return: data directory tied to the user, e.g. ``~/.local/share/$appname/$version`` or
``$XDG_DATA_HOME/$appname/$version``
"""
=
= # noqa: PTH111
return
"""
:return: data directories shared by users (if `multipath <platformdirs.api.PlatformDirsABC.multipath>` is
enabled and ``XDG_DATA_DIR`` is set and a multi path the response is also a multi path separated by the OS
path separator), e.g. ``/usr/local/share/$appname/$version`` or ``/usr/share/$appname/$version``
"""
# XDG default for $XDG_DATA_DIRS; only first, if multipath is False
=
= f
return
=
=
= # noqa: PTH111
return
"""
:return: config directory tied to the user, e.g. ``~/.config/$appname/$version`` or
``$XDG_CONFIG_HOME/$appname/$version``
"""
=
= # noqa: PTH111
return
"""
:return: config directories shared by users (if `multipath <platformdirs.api.PlatformDirsABC.multipath>`
is enabled and ``XDG_DATA_DIR`` is set and a multi path the response is also a multi path separated by the OS
path separator), e.g. ``/etc/xdg/$appname/$version``
"""
# XDG default for $XDG_CONFIG_DIRS only first, if multipath is False
=
=
return
"""
:return: cache directory tied to the user, e.g. ``~/.cache/$appname/$version`` or
``~/$XDG_CACHE_HOME/$appname/$version``
"""
=
= # noqa: PTH111
return
""":return: cache directory shared by users, e.g. ``/var/tmp/$appname/$version``"""
return # noqa: S108
"""
:return: state directory tied to the user, e.g. ``~/.local/state/$appname/$version`` or
``$XDG_STATE_HOME/$appname/$version``
"""
=
= # noqa: PTH111
return
""":return: log directory tied to the user, same as `user_state_dir` if not opinionated else ``log`` in it"""
=
= # noqa: PTH118
return
""":return: documents directory tied to the user, e.g. ``~/Documents``"""
return
""":return: downloads directory tied to the user, e.g. ``~/Downloads``"""
return
""":return: pictures directory tied to the user, e.g. ``~/Pictures``"""
return
""":return: videos directory tied to the user, e.g. ``~/Videos``"""
return
""":return: music directory tied to the user, e.g. ``~/Music``"""
return
"""
:return: runtime directory tied to the user, e.g. ``/run/user/$(id -u)/$appname/$version`` or
``$XDG_RUNTIME_DIR/$appname/$version``.
For FreeBSD/OpenBSD/NetBSD, it would return ``/var/run/user/$(id -u)/$appname/$version`` if
exists, otherwise ``/tmp/runtime-$(id -u)/$appname/$version``, if``$XDG_RUNTIME_DIR``
is not set.
"""
=
= f
= f # noqa: S108
= f
return
""":return: data path shared by users. Only return first item, even if ``multipath`` is set to ``True``"""
return
""":return: config path shared by the users. Only return first item, even if ``multipath`` is set to ``True``"""
return
""":return: cache path shared by users. Only return first item, even if ``multipath`` is set to ``True``"""
return
# If multipath is True, the first path is returned.
=
return
=
=
= # noqa: PTH111
return
"""Return directory from user-dirs.dirs config file. See https://freedesktop.org/wiki/Software/xdg-user-dirs/."""
= /
=
# Add fake section header, so ConfigParser doesn't complain
return None
=
# Handle relative home paths
return # noqa: PTH111
return None
=