qgis_deployment_toolbelt.jobs.job_environment_variables module

Tools to manage the environment setup (variables, etc.)

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

class qgis_deployment_toolbelt.jobs.job_environment_variables.JobEnvironmentVariables(options: list[dict])

Bases: GenericJob

Class to manage the environment variables of QGIS installation.

ID: str = 'manage-env-vars'
OPTIONS_SCHEMA: dict = {'action': {'condition': 'in', 'default': 'add', 'possible_values': ('add', 'remove'), 'required': False, 'type': <class 'str'>}, 'name': {'condition': None, 'default': None, 'possible_values': None, 'required': True, 'type': <class 'str'>}, 'scope': {'condition': 'in', 'default': 'user', 'possible_values': ('system', 'user'), 'required': False, 'type': <class 'str'>}, 'value': {'condition': None, 'default': None, 'possible_values': None, 'required': False, 'type': (<class 'bool'>, <class 'int'>, <class 'str'>, <class 'list'>)}, 'value_type': {'condition': 'in', 'default': 'str', 'possible_values': ('bool', 'path', 'str', 'url'), 'required': False, 'type': <class 'str'>}}
__init__(options: list[dict]) None

Instantiate the class. :param options: list of dictionary with environment variables to set :type options: List[dict] :param or remove.:

prepare_value(value: str, value_type: str | None = None) str

Prepare value to be used in the environment variable.

It performs some checks or operations depending on value type: user and

variable expansion, check if URL is valid, etc.

Parameters:
  • value (str) – value to prepare.

  • value_type (str, optional) – type of input value. Defaults to “str”.

Returns:

prepared value.

Return type:

str

run() None

Apply environment variables from dictionary to the system.