stratified_packager.processing.provider

The plugin’s Processing provider and its GUI-only default-refresh hookups (SPEC §5).

Classes

StratifiedPackagerProvider()

Registers the plugin's single algorithm and keeps its dynamic defaults fresh.

class stratified_packager.processing.provider.StratifiedPackagerProvider[source]

Registers the plugin’s single algorithm and keeps its dynamic defaults fresh.

The default values shown in the Processing dialog are computed in algorithm.StratifiedPackagerAlgorithm.initAlgorithm() from the active project’s variables and the plugin settings (SPEC §5; LAYERS alone carries no default — see params.declare_parameters()). To keep those defaults in step with edits to the project, connect_project_signals() wires the relevant QgsProject signals to refreshAlgorithms() (which rebuilds every algorithm instance). Those hookups are made only from a GUI session: connecting them headless and refreshing from them mid-run segfaults qgis_process (SPEC §5), so connect_project_signals() is called from initGui() and never from initProcessing().

__init__()[source]

Initialize the provider with no signal hookups (those are GUI-only).

_refresh_algorithms()[source]

Rebuild the provider’s algorithms so dialog defaults pick up project edits.

Return type:

None

_schedule_refresh()[source]

Restart the single-shot timer, coalescing a burst of signals into one refresh.

Connected to argument-bearing signals too (e.g. readProject); PyQt drops the extra payloads when the slot takes none.

Return type:

None

connect_project_signals()[source]

Wire project edits to a coalesced algorithm refresh (SPEC §5).

Idempotent. Call from initGui only — never headless (SPEC §5). Connects the project’s readProject / cleared / customVariablesChanged signals, each routed through a single-shot 0 ms timer so the burst of signals QGIS emits while loading a project collapses into one refresh (SPEC §5).

Return type:

None

disconnect_project_signals()[source]

Reverse connect_project_signals() (called from unload).

Disconnects the project-level connections, then stops and disposes the coalescing timer, leaving the provider safe to re-register.

Return type:

None

icon()[source]

Icon used for the provider inside the Processing toolbox.

Return type:

QIcon

Returns:

provider icon

id()[source]

Return the unique provider id string.

Return type:

str

Returns:

provider ID

loadAlgorithms()[source]

Load algorithms belonging to this provider.

Return type:

None

name()[source]

Human-friendly provider name, used to describe the provider within the GUI.

Return type:

str

Returns:

provider name

versionInfo()[source]

Version information for the provider.

Return type:

str

Returns:

version

_project_connections: list[QMetaObject.Connection]

Tokens of the project-level signal connections, for tidy disconnection.

_refresh_timer: QTimer | None

Single-shot coalescing timer; created lazily by connect_project_signals().