stratified_packager.processing.provider
The plugin’s Processing provider and its GUI-only default-refresh hookups (SPEC §5).
Classes
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;LAYERSalone carries no default — seeparams.declare_parameters()). To keep those defaults in step with edits to the project,connect_project_signals()wires the relevantQgsProjectsignals torefreshAlgorithms()(which rebuilds every algorithm instance). Those hookups are made only from a GUI session: connecting them headless and refreshing from them mid-run segfaultsqgis_process(SPEC §5), soconnect_project_signals()is called frominitGui()and never frominitProcessing().- _refresh_algorithms()[source]
Rebuild the provider’s algorithms so dialog defaults pick up project edits.
- Return type:
- _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:
- connect_project_signals()[source]
Wire project edits to a coalesced algorithm refresh (SPEC §5).
Idempotent. Call from
initGuionly — never headless (SPEC §5). Connects the project’sreadProject/cleared/customVariablesChangedsignals, 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:
- disconnect_project_signals()[source]
Reverse
connect_project_signals()(called fromunload).Disconnects the project-level connections, then stops and disposes the coalescing timer, leaving the provider safe to re-register.
- Return type:
- icon()[source]
Icon used for the provider inside the Processing toolbox.
- Return type:
- Returns:
provider icon
- name()[source]
Human-friendly provider name, used to describe the provider within the GUI.
- Return type:
- Returns:
provider name
- _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().