maestral.utils.appdirs

This module contains functions to retrieve platform dependent locations to store app data. It supports macOS and Linux.

Module Contents

Functions

get_home_dir() → str

Returns user home directory. This will be determined from the first

get_conf_path(subfolder: Optional[str] = None, filename: Optional[str] = None, create: bool = True) → str

Returns the default config path for the platform. This will be:

get_data_path(subfolder: Optional[str] = None, filename: Optional[str] = None, create: bool = True) → str

Returns the default path to save application data for the platform. This will be:

get_cache_path(subfolder: Optional[str] = None, filename: Optional[str] = None, create: bool = True) → str

Returns the default cache path for the platform. This will be:

get_log_path(subfolder: Optional[str] = None, filename: Optional[str] = None, create: bool = True) → str

Returns the default log path for the platform. This will be:

get_autostart_path(filename: Optional[str] = None, create: bool = True) → str

Returns the default path for login items for the platform. This will be:

get_runtime_path(subfolder: Optional[str] = None, filename: Optional[str] = None, create: bool = True) → str

Returns the default runtime path for the platform. This will be:

maestral.utils.appdirs.get_cache_path(subfolder: Optional[str] = None, filename: Optional[str] = None, create: bool = True)str[source]

Returns the default cache path for the platform. This will be:

  • macOS: “~/Library/Application Support/SUBFOLDER/FILENAME”

  • Linux: “$XDG_CACHE_HOME/SUBFOLDER/FILENAME”

  • fallback: “$HOME/.cache/SUBFOLDER/FILENAME”

Parameters
  • subfolder – The subfolder for the app.

  • filename – The filename to append for the app.

  • create – If True, the folder subfolder will be created on-demand.

maestral.utils.appdirs.get_log_path(subfolder: Optional[str] = None, filename: Optional[str] = None, create: bool = True)str[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”

Parameters
  • subfolder – The subfolder for the app.

  • filename – The filename to append for the app.

  • create – If True, the folder subfolder will be created on-demand.

maestral.utils.appdirs.get_autostart_path(filename: Optional[str] = None, create: bool = True)str[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”

Parameters
  • filename – The filename to append for the app.

  • create – If True, the folder subfolder will be created on-demand.

maestral.utils.appdirs.get_runtime_path(subfolder: Optional[str] = None, filename: Optional[str] = None, create: bool = True)str[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”

Parameters
  • subfolder – The subfolder for the app.

  • filename – The filename to append for the app.

  • create – If True, the folder subfolder will be created on-demand.