maestral.utils.appdirs ====================== .. py:module:: maestral.utils.appdirs .. autoapi-nested-parse:: This module contains functions to retrieve platform dependent locations to store app data. It supports macOS and Linux. Module Contents --------------- .. py:function:: get_home_dir() Returns user home directory. This will be determined from the first valid result out of (osp.expanduser("~"), $HOME, $USERPROFILE, $TMP). .. py:function:: get_conf_path(subfolder = None, filename = None, create = True) Returns the default config path for the platform. This will be: - macOS: "~/Library/Application Support//." - Linux: "XDG_CONFIG_HOME//" - other: "~/.config//" :param subfolder: The subfolder for the app. :param filename: The filename to append for the app. :param create: If ``True``, the folder ``subfolder`` will be created on-demand. .. py:function:: get_data_path(subfolder = None, filename = None, create = True) Returns the default path to save application data for the platform. This will be: - macOS: "~/Library/Application Support/SUBFOLDER/FILENAME" - Linux: "$XDG_DATA_DIR/SUBFOLDER/FILENAME" - fallback: "$HOME/.local/share/SUBFOLDER/FILENAME" Note: We do not use "~/Library/Saved Application State" on macOS since this folder is reserved for user interface state and can be cleared by the user / system. :param subfolder: The subfolder for the app. :param filename: The filename to append for the app. :param create: If ``True``, the folder ``subfolder`` will be created on-demand. .. py:function:: get_cache_path(subfolder = None, filename = None, create = True) Returns the default cache path for the platform. This will be: - macOS: "~/Library/Caches/SUBFOLDER/FILENAME" - Linux: "$XDG_CACHE_HOME/SUBFOLDER/FILENAME" - fallback: "$HOME/.cache/SUBFOLDER/FILENAME" :param subfolder: The subfolder for the app. :param filename: The filename to append for the app. :param create: If ``True``, the folder ``subfolder`` will be created on-demand. .. py:function:: get_log_path(subfolder = None, filename = None, create = True) Returns the default log path for the platform. This will be: - macOS: "~/Library/Logs/SUBFOLDER/FILENAME" - Linux: "$XDG_CACHE_HOME/SUBFOLDER/FILENAME" - fallback: "$HOME/.cache/SUBFOLDER/FILENAME" :param subfolder: The subfolder for the app. :param filename: The filename to append for the app. :param create: If ``True``, the folder ``subfolder`` will be created on-demand. .. py:function:: get_autostart_path(filename = None, create = True) Returns the default path for login items for the platform. This will be: - macOS: "~/Library/LaunchAgents/FILENAME" - Linux: "$XDG_CONFIG_HOME/autostart/FILENAME" - fallback: "$HOME/.config/autostart/FILENAME" :param filename: The filename to append for the app. :param create: If ``True``, the folder ``subfolder`` will be created on-demand. .. py:function:: get_runtime_path(subfolder = None, filename = None, create = True) Returns the default runtime path for the platform. This will be: - macOS: "~/Library/Application Support/SUBFOLDER/FILENAME" - Linux: "$XDG_RUNTIME_DIR/SUBFOLDER/FILENAME" - fallback: "$HOME/.cache/SUBFOLDER/FILENAME" :param subfolder: The subfolder for the app. :param filename: The filename to append for the app. :param create: If ``True``, the folder ``subfolder`` will be created on-demand.