qgis_deployment_toolbelt.jobs.job_profiles_synchronizer module

Synchronize profiles between downloaded (in QDT working folder) and installed

profiles (in QGIS profiles’folder).

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

class qgis_deployment_toolbelt.jobs.job_profiles_synchronizer.JobProfilesSynchronizer(options: dict)

Bases: GenericJob

Job to synchronize profiles between downloaded (in QDT working folder) and installed

profiles (in QGIS profiles’folder).

ID: str = 'qprofiles-synchronizer'
OPTIONS_SCHEMA: dict = {'sync_mode': {'condition': 'in', 'default': 'only_missing', 'possible_values': ('only_missing', 'only_different_version', 'only_new_version', 'overwrite'), 'required': False, 'type': <class 'str'>}}
PROFILES_NAMES_DOWNLOADED: list = []
PROFILES_NAMES_INSTALLED: list = []
__init__(options: dict) None

Instantiate the class.

Parameters:
  • options (List[dict]) – list of dictionary with environment variables to set

  • remove. (or)

compare_downloaded_with_installed_profiles(li_downloaded_profiles: Iterable[QdtProfile]) tuple[list[QdtProfile], list[QdtProfile], list[QdtProfile]]
Compare versions between downloaded (in QDT working folder) and installed

(in QGIS) profiles.

Parameters:

li_downloaded_profiles (Iterable[QdtProfile]) – downloaded profiles.

Returns:

a tuple with the following structure (

list of installed profiles which are outdated (lesser version number), list of installed profiles with a different version (lesser or greater), list of profiles with the same version number in downloaded/installed )

Return type:

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

run() None

Execute job logic.

sync_installed_profiles_from_downloaded_profiles(downloaded_profiles: Iterable[QdtProfile]) None
Copy downloaded profiles to QGIS profiles folder. If the QGIS profiles folder

doesn’t exist, it will be created and every downloaded profile will be copied. If a profile is already installed, it won’t be overwritten.

Parameters:

downloaded_profiles (tuple[QdtProfile]) – list of downloaded profiles objects

sync_overwrite_local_profiles(profiles_to_copy: tuple[QdtProfile]) None

Overwrite local profiles with downloaded ones.

Parameters:

profiles_to_copy (tuple[QdtProfile]) – tuple of profiles to copy