PluginWorker¶
- class forkbit_sdk.PluginWorker[source]¶
Bases:
QThreadBase class for plugin background tasks.
Handles busy-state tracking, logging, and error handling automatically. Subclass and override
execute()with your work.Example:
class BuildWorker(PluginWorker): def execute(self) -> str: self.log_message.emit("Building...") # do work return "Build complete" # In your plugin: worker = BuildWorker(self) worker.log_message.connect(self._append_log) worker.done.connect(self._on_done) worker.start()
The plugin’s busy indicator is set automatically when the worker starts and cleared when it finishes — no need to call
set_busy()yourself.- log_message¶
Emitted to log a message to the plugin console.
- step_changed¶
Emitted to advance the pipeline step indicator.
- progress¶
Emitted with (current, total) for progress tracking.
- done¶
(success, message).
- Type:
Emitted when the worker finishes
- __init__(plugin)[source]¶
- Parameters:
plugin (BasePlugin)
- staticMetaObject = PySide6.QtCore.QMetaObject("PluginWorker" inherits "QThread": Methods: #12 type=Signal, signature=log_message(QString), parameters=QString #13 type=Signal, signature=step_changed(int), parameters=int #14 type=Signal, signature=progress(int,int), parameters=int, int #15 type=Signal, signature=done(bool,QString), parameters=bool, QString #16 type=Signal, signature=_busy_signal(bool), parameters=bool )¶
- start(priority=Priority.InheritPriority)[source]¶
Start the worker thread and mark the plugin as busy.
- Return type:
None
- execute()[source]¶
Override this to do the actual work.
Use
log_message,step_changed, andprogresssignals to report status. Return a success message string.