qgis_deployment_toolbelt.constants module#

Define toolbelt constant types and values.

Author: Julien Moura (https://github.com/guts)

class qgis_deployment_toolbelt.constants.OSConfiguration(name_python: str, names_alter: list[str], qgis_bin_exe_path: Path | None = None, qgis_profiles_path: Path | None = None, shortcut_extension: str | None = None, shortcut_forbidden_chars: tuple[str, ...] | None = None, shortcut_icon_extensions: tuple[str, ...] | None = None, shortcut_icon_default_path: str | None = None)#

Bases: object

Settings related to QGIS and depending on operating system

classmethod from_opersys(operating_system_codename: str | None = None) OSConfiguration#
Create configuration object with defaults values from a operating system

code name.

Parameters:

operating_system_codename – operating system code name as specified in sys.platform. If None, fallback to current operating system. Defaults to None.

Returns:

OSConfiguration object with defaults settings

Return type:

Self

property get_qgis_bin_path: Path#

Returns the QGIS path determined from QDT_QGIS_EXE_PATH environment variable, or result of which command or fallback to default value passed to the object.

Returns:

path to the QGIS bin/exe

Return type:

Path

name_python: str#
names_alter: list[str]#
qgis_bin_exe_path: Path | None = None#
qgis_profiles_path: Path | None = None#
shortcut_extension: str | None = None#
shortcut_forbidden_chars: tuple[str, ...] | None = None#
shortcut_icon_default_path: str | None = None#
shortcut_icon_extensions: tuple[str, ...] | None = None#
valid_shortcut_name(shortcut_name: str) bool#

Check if a given string is a valid shortcut name for the current operating system.

Parameters:

shortcut_name (str) – given shortcut name to check

Returns:

True if the givn string can be used as shortcut name

Return type:

bool

qgis_deployment_toolbelt.constants.get_qdt_logs_folder() Path#
Get QDT logs folder. It uses the default path (a logs subfolder under the QDT

working folder) or the path defined in environment variable QDT_LOGS_DIR.

Returns:

path to the QDT logs folder.

Return type:

Path

qgis_deployment_toolbelt.constants.get_qdt_working_directory(specific_value: PathLike | None = None, identifier: str | None = None) Path#

Get QDT working directory.

Parameters:
  • specific_value (PathLike, optional) – a specific path to use. If set it’s expanded and returned. Defaults to None.

  • identifier (str, optional) – used to make the folder unique. Defaults to None.

Returns:

path to the QDT working directory

Return type:

Path