qgis_deployment_toolbelt.jobs.job_qgis_installation_finder module¶
Tools to find installed QGIS version
Author: Jean-Marie KERLOCH (https://github.com/jmkerloch)
- class qgis_deployment_toolbelt.jobs.job_qgis_installation_finder.JobQgisInstallationFinder(options: dict)¶
Bases:
GenericJobClass to find installed QGIS version
- OPTIONS_SCHEMA: dict = {'if_not_found': {'condition': 'in', 'default': 'warning', 'possible_values': ('warning', 'error'), 'required': False, 'type': <class 'str'>}, 'search_paths': {'condition': None, 'default': ('%PROGRAMFILES%', 'C:\\OSGeo4W'), 'possible_values': None, 'required': False, 'type': (<class 'list'>, <class 'str'>)}, 'version_priority': {'condition': None, 'default': None, 'possible_values': None, 'required': False, 'type': (<class 'list'>, <class 'str'>)}}¶
- _export_qgis_version(version_str: str) None¶
Export the detected QGIS version as an environment variable.
- Parameters:
version_str (str) – QGIS version, typically a SemVer string like 3.40.1.
- static _get_latest_matching_version_path(found_versions: dict[str, str], version: str) str | None¶
Get latest version path matching a wanted version.
- static _get_latest_version_from_list(versions: list[str]) str | None¶
Get latest version from a list.
- _get_linux_installed_qgis_path() dict[str, str]¶
Get install qgis path for linux operating system with which
- static _get_qgis_bin_version(qgis_bin: str) str | None¶
Get QGIS bin version with –version.
See:
- static _get_qgis_found_version_dict_from_search_paths(search_paths: list[str], search_patterns: list[str]) dict[str, str]¶
Define qgis found version dict from a list of search path.
If identical version are found in multiple path, the first version found in search_path is used.
- static _get_qgis_versions_in_dir(search_dir: str, search_patterns: list[str], found_version: dict[str, str]) None¶
Get QGIS binary path from an install directory.
- _get_search_paths_with_environment_variable() list[str]¶
Get search_paths option with environment variable update.
- static _get_windows_hide_console_startupinfo() dict¶
Build extra kwargs to hide a console window newly created on Windows.
- Returns:
- empty on non-Windows platforms, otherwise a single
startupinfoentry ready to unpack intosubprocess.run.
- Return type:
- _get_windows_installed_qgis_path() dict[str, str]¶
Get dict of installed QGIS version in common install directory.
- static _search_qgis_version_and_add_to_dict(qgis_bin: str, found_version: dict[str, str]) None¶
Search qgis version from qgis binary and add to found_version dict if found
- static _version_sort_key(version_str: str) Version¶
Transforn a version string into a sortable and comparable Version object.
- Parameters:
version_str (str) – version string to parse, typically X.Y.Z.
- Returns:
parsed version, or Version(“0”) if parsing failed.
- Return type:
Version
- get_installed_qgis_path() str | None¶
Get the path to the installed QGIS executable best matching job options.
- Returns:
installed qgis path
- Return type:
str | None
- get_installed_qgis_version_and_path() tuple[str, str] | None¶
Get the installed QGIS version and executable path best matching job options.