qgis_deployment_toolbelt.jobs.generic_job module

Base of QDT jobs.

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

class qgis_deployment_toolbelt.jobs.generic_job.GenericJob

Bases: object

Generic base for QDT jobs.

ID: str = ''
OPTIONS_SCHEMA: dict[dict] = {}
__init__() None

Object instanciation.

filter_profiles_folder(start_parent_folder: Path) tuple[QdtProfile, ...] | None

Parse a folder structure to filter on QGIS profiles folders.

Returns:

tuple of profiles objects matching criteria or

None if no profile folder found

Return type:

tuple[QdtProfile] | None

filter_profiles_on_rules(tup_qdt_profiles: tuple[QdtProfile]) tuple[list[QdtProfile], list[QdtProfile]]

Evaluate profile regarding to its deployment rules.

Parameters:

tup_qdt_profiles (tuple[QdtProfile]) – input tuple of QDT profiles

Returns:

tuple of profiles that matched and those which did not match their deployment rules

Return type:

tuple[list[QdtProfile], list[QdtProfile]]

list_downloaded_profiles() tuple[QdtProfile] | None
List downloaded QGIS profiles, i.e. a profile’s folder located into the QDT

working folder. Typically: ~/.cache/qgis-deployment-toolbelt/repositories/geotribu or %USERPROFILE%/.cache/qgis-deployment-toolbelt/repositories/geotribu).

Returns:

tuple of profiles objects or None if no profile

folder listed

Return type:

tuple[QdtProfile] | None

list_installed_profiles() tuple[QdtProfile] | None
List installed QGIS profiles, i.e. a profile’s folder located into the QGIS

profiles path and so accessible to the end-user through the QGIS interface. Typically: ~/.local/share/QGIS/QGIS3/profiles/geotribu or %APPDATA%/QGIS/QGIS3/profiles/geotribu).

Returns:

tuple of profiles objects or Non if no profile is

installed in QGIS3/profiles

Return type:

tuple[QdtProfile] | None

validate_options(options: dict[dict]) dict[dict]

Validate options.

Parameters:

options (dict[dict]) – options to validate.

Raises:
  • ValueError – if option has an invalid name or doesn’t comply with condition

  • TypeError – if the option does’nt not comply with expected type

Returns:

options if valid

Return type:

dict[dict]