qgis_deployment_toolbelt.jobs.job_cleanup_manager module

QDT autocleaner to remove stale resources generated by previous deployments.

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

class qgis_deployment_toolbelt.jobs.job_cleanup_manager.CleanupReport(removed: list[Path] = <factory>, failed: list[Path] = <factory>)

Bases: object

Structure to summarize a cleanup.

__init__(removed: list[Path] = <factory>, failed: list[Path] = <factory>) None
failed: list[Path]
removed: list[Path]
class qgis_deployment_toolbelt.jobs.job_cleanup_manager.JobCleanupManager(options: dict)

Bases: GenericJob

Job to remove stale resources left over by previous QDT deployments.

ID: str = 'cleanup-manager'
OPTIONS_SCHEMA: dict = {'deletion_mode': {'condition': 'in', 'default': None, 'possible_values': ('force_delete', 'trash_only', 'trash_or_delete'), 'required': False, 'type': <class 'str'>}, 'dry_run': {'condition': None, 'default': False, 'possible_values': None, 'required': False, 'type': <class 'bool'>}, 'scopes': {'condition': 'all_in', 'default': ['plugins_cache'], 'possible_values': ('plugins_cache', 'plugins_installed'), 'required': False, 'type': <class 'list'>}}
__init__(options: dict) None

Instantiate the class.

Parameters:

options (dict) – job options.

cleanup_plugins_cache() None

Remove plugin archives from the QDT plugins cache folder which are not referenced by any installed or downloaded profile anymore.

cleanup_plugins_installed() None

Remove stale plugin folders from installed QGIS profiles.

Only plugins listed in QDT managed plugins manifests are considered for cleanup. Third-party plugins manually installed by users are ignored.

options: dict
run() CleanupReport

Execute job logic.

Returns:

summary of removed/failed resources

Return type:

CleanupReport