qgis_deployment_toolbelt.exceptions module

Custom exceptions.

exception qgis_deployment_toolbelt.exceptions.DomainControllerUnreachableError(data_label: str)

Bases: QdtError

When the domain controller can’t be reached to retrieve user data.

__init__(data_label: str)

Initialization method.

Parameters:

data_label (str) – label of the user data which can’t be retrieved

exception qgis_deployment_toolbelt.exceptions.InvalidScenarioError(scenario_path: Path | str, reason: str)

Bases: QdtError, ValueError

When a scenario file can’t be parsed: YAML syntax or text encoding.

Structure checks (required keys, steps…) are handled by ScenarioReader.validate_scenario().

__init__(scenario_path: Path | str, reason: str)

Initialization method.

Parameters:
  • scenario_path (Path | str) – path or name of the scenario

  • reason (str) – why the scenario can’t be parsed

exception qgis_deployment_toolbelt.exceptions.JobOptionBadNameError(job_id: str, bad_option_name: str, expected_options_names: Iterable[str])

Bases: QdtError, KeyError

When a job reveives an option which is not part of accepted ones.

__init__(job_id: str, bad_option_name: str, expected_options_names: Iterable[str])

Initialization method.

Parameters:
  • job_id (str) – job ID

  • bad_option_name (str) – name of bad option passed

  • expected_options_names (Iterable[str]) – list of accepted options

exception qgis_deployment_toolbelt.exceptions.JobOptionBadValueError(job_id: str, bad_option_name: str, bad_option_value: str, condition: str, accepted_values: Iterable[str] | None = None)

Bases: QdtError, ValueError

When a job’s option reveives a value which does not complies with condition.

__init__(job_id: str, bad_option_name: str, bad_option_value: str, condition: str, accepted_values: Iterable[str] | None = None)

Initialization method.

Parameters:
  • job_id (str) – job ID

  • bad_option_name (str) – name of bad option passed

  • bad_option_type (str) – type of bad option passed

  • condition (str) – condition

  • accepted_values (Iterable[str] | None, optional) – accepted types of values. Defaults to None.

exception qgis_deployment_toolbelt.exceptions.JobOptionBadValueTypeError(job_id: str, bad_option_name: str, bad_option_value: str, expected_option_type: Iterable[str])

Bases: QdtError, TypeError

When a job reveives an option which is not of the expected type.

__init__(job_id: str, bad_option_name: str, bad_option_value: str, expected_option_type: Iterable[str])

Initialization method.

Parameters:
  • job_id (str) – job ID

  • bad_option_name (str) – name of bad option passed

  • bad_option_value (str) – value of bad option passed

  • expected_option_type (Iterable[str]) – accepted types of values

exception qgis_deployment_toolbelt.exceptions.JobOptionMissingError(job_id: str, missing_option_name: str)

Bases: QdtError, KeyError

When a required option of a job is not set.

__init__(job_id: str, missing_option_name: str)

Initialization method.

Parameters:
  • job_id (str) – job ID

  • missing_option_name (str) – name of the required option not set

exception qgis_deployment_toolbelt.exceptions.QdtError

Bases: Exception

Base class for QDT errors.

exception qgis_deployment_toolbelt.exceptions.QgisCustomizationXmlError(xml_filepath: Path, reason: str)

Bases: QdtError, ValueError

When an existing QGIS customization XML file can’t be edited.

__init__(xml_filepath: Path, reason: str)

Initialization method.

Parameters:
  • xml_filepath (Path) – path to the QGISCUSTOMIZATION.xml file

  • reason (str) – why the file can’t be edited

exception qgis_deployment_toolbelt.exceptions.QgisInstallNotFoundError

Bases: QdtError

When no QGIS installation are found.

__init__()

Initialization method.

exception qgis_deployment_toolbelt.exceptions.SplashScreenBadDimensionsError(image_filepath: Path, profile_name: str | None = None)

Bases: QdtError

When splash screen image does not comply with recomended dimensions.

__init__(image_filepath: Path, profile_name: str | None = None)

Initialization method.

Parameters:
  • image_filepath (Path) – path to the selected image to be set as splash screen

  • profile_name (str, optional) – name of profile. Defaults to None.