maestral.utils.appdirs
¶
This module contains functions to retrieve platform dependent locations to store app data. It supports macOS and Linux.
Module Contents¶
- maestral.utils.appdirs.get_home_dir()[source]¶
Returns user home directory. This will be determined from the first valid result out of (osp.expanduser(“~”), $HOME, $USERPROFILE, $TMP).
- Return type:
- maestral.utils.appdirs.get_conf_path(subfolder=None, filename=None, create=True)[source]¶
Returns the default config path for the platform. This will be:
macOS: “~/Library/Application Support/<subfolder>/<filename>.”
Linux: “XDG_CONFIG_HOME/<subfolder>/<filename>”
other: “~/.config/<subfolder>/<filename>”
- maestral.utils.appdirs.get_data_path(subfolder=None, filename=None, create=True)[source]¶
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.
- maestral.utils.appdirs.get_cache_path(subfolder=None, filename=None, create=True)[source]¶
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”
- maestral.utils.appdirs.get_log_path(subfolder=None, filename=None, create=True)[source]¶
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”
- maestral.utils.appdirs.get_autostart_path(filename=None, create=True)[source]¶
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”
- maestral.utils.appdirs.get_runtime_path(subfolder=None, filename=None, create=True)[source]¶
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”