qgis_deployment_toolbelt.jobs.job_plugins_downloader module

Download plugins listed into profiles.

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

class qgis_deployment_toolbelt.jobs.job_plugins_downloader.JobPluginsDownloader(options: dict)

Bases: GenericJob

Job to download plugins.

ID: str = 'qplugins-downloader'
OPTIONS_SCHEMA: dict = {'force': {'condition': None, 'default': False, 'possible_values': None, 'required': False, 'type': <class 'bool'>}, 'threads': {'condition': 'in', 'default': 5, 'possible_values': (1, 2, 3, 4, 5), 'required': False, 'type': <class 'int'>}}
__init__(options: dict) None

Instantiate the class.

Parameters:

options (dict) – job options.

copy_plugins(plugins_to_copy: list[QgisPlugin], destination_parent_folder: Path) tuple[list[QgisPlugin], list[QgisPlugin]]

Copy listed plugins into the specified folder.

Parameters:
  • plugins_to_copy (List[QgisPlugin]) – list of plugins to copy

  • destination_parent_folder (Path) – where to store copied plugins

Returns:

tuple of (copied plugins, failed copies)

Return type:

Tuple[List[QgisPlugin],List[QgisPlugin]]

download_remote_plugins(plugins_to_download: list[QgisPlugin], destination_parent_folder: Path, threads: int = 5) tuple[list[QgisPlugin], list[QgisPlugin]]

Download listed plugins into the specified folder, using multithreads or not.

Parameters:
  • plugins_to_download (List[QgisPlugin]) – list of plugins to download

  • destination_parent_folder (Path) – where to store downloaded plugins

  • threads (int, optional) – number of threads to use. If 0, downloads will be performed synchronously. Defaults to 5.

Returns:

tuple of (downloaded plugins, failed downloads)

Return type:

Tuple[List[QgisPlugin],List[QgisPlugin]]

filter_list_copiable_plugins(input_list: list[QgisPlugin]) list[QgisPlugin]
Filter input list of plugins keeping only those which are stored locally and

which are not present within the local QDT plugins folder.

Parameters:

input_list (List[QgisPlugin]) – list of plugins to filter

Returns:

list of plugins to copy from local disk or network

Return type:

List[QgisPlugin]

filter_list_downloadable_plugins(input_list: list[QgisPlugin]) list[QgisPlugin]
Filter input list of plugins keeping only those are remotly stored and which

are not present within the local QDT plugins folder.

Parameters:

input_list (List[QgisPlugin]) – list of plugins to filter

Returns:

list of plugins to download

Return type:

List[QgisPlugin]

list_referenced_plugins(parent_folder: Path) list[QgisPlugin]

Return a list of plugins referenced in profile.json files found within a parent folder and sorted by unique id with version.

Parameters:

parent_folder (Path) – folder to start searching for profile.json files

Returns:

list of plugins referenced within profile.json files

Return type:

List[QgisPlugin]

run() None

Execute job logic.