qgis_deployment_toolbelt.profiles.remote_http_handler module

Handle remote HTTP repository.

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

class qgis_deployment_toolbelt.profiles.remote_http_handler.HttpHandler(source_repository_path_or_uri: str, source_repository_type: str = 'http')

Bases: RemoteProfilesHandlerBase

Handle remote HTTP repositories without git protocol.

It’s designed to handle thoses cases:

  • the distant repository (source) is on a webserver accessible through HTTP protocol

  • the local repository (destination) is on a local network or drive

HTTP_HEADERS = {'User-Agent': 'QGISDeploymentToolbelt/0.34.5'}
__init__(source_repository_path_or_uri: str, source_repository_type: str = 'http') None

Constructor.

Parameters:

source_repository_path_or_uri (str | Path) – path to the source repository

download(destination_local_path: Path)

Generic wrapper around the specific logic of this handler.

Parameters:

destination_local_path (Path) – path to the local folder where to download

download_files_to_local(li_files_to_download: list[str], target_folder: Path) tuple[list[tuple[str, Path]], list[tuple[str, str]]]

Download list of files relative to remote base URL to local target folder.

Parameters:
  • li_files_to_download (list[str]) – list of files to download.

  • target_folder (Path) – local folder where to download

Returns:

(list of success download, list of failed download)