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 | None)¶
Bases:
GenericJobJob to download plugins.
- OPTIONS¶
alias of
PluginsDownloaderOptions
- __init__(options: dict | None) None¶
Instantiate the class.
- Parameters:
options (dict | None) – options set in the
withkey of the scenario step, see PluginsDownloaderOptions. None (nowithkey) means default values.
- _abc_impl = <_abc._abc_data object>¶
- static _download_plugin(plugin: QgisPlugin, destination_parent_folder: Path) Path¶
Download a plugin archive into the specified folder.
- Parameters:
plugin (QgisPlugin) – plugin to download
destination_parent_folder (Path) – where to store the downloaded archive
- Raises:
Exception – any error raised while downloading
- Returns:
path to the downloaded archive
- Return type:
Path
- 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 1, 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] | None¶
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]
- class qgis_deployment_toolbelt.jobs.job_plugins_downloader.PluginsDownloaderOptions(*, force: bool = False, threads: Annotated[int, Ge(ge=1), Le(le=5)] = 5)¶
Bases:
JobOptionsOptions of the qplugins-downloader job.
- _abc_impl = <_abc._abc_data object>¶
- model_config = {'extra': 'forbid', 'frozen': True, 'strict': True, 'validate_default': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].