qcc_kplugin.jobs¶
Background qcc subprocesses for the GUI: run one command or a chain, show progress in the status bar, never
block KLayout’s UI thread and never open a modal dialog from the timer (errors go to the status bar and the log).
run(steps, label, done) starts steps (a list of argument lists for qcc) one after the other; done(ok,
output) is called from the polling timer when the last step ended or one failed. QuCat on a large netlist can take
minutes: the UI stays usable meanwhile, and the status bar shows the elapsed time.
A job stops by itself: when a step fails (the rest are skipped, done(False, output)), or after timeout seconds
(the process is killed, timed_out is set and done(False, output) gets a “stopped” line). progress(job), when
given, is called on every poll while the job runs (live_text() is the output so far, also of the running step).
Attributes¶
Classes¶
Functions¶
Module Contents¶
- class qcc_kplugin.jobs.Job(steps, label, done, cwd=None, timeout=None, progress=None)¶
- cancel() None¶
Stop the job: kill the
qccprocess (tree) of the running step, skip the rest, drop its log.doneis called with(False, "cancelled")andjob.cancelledset, so the caller can restore what it showed.
- elapsed() float¶
- live_text() str¶
The output so far: the finished steps and what the running step has written.
- poll() None¶
- wait(timeout: float = 600.0) bool¶
Block until finished (tests only; the GUI never calls this).
- cancelled = False¶
- cwd = None¶
- done¶
- finished = False¶
- index = -1¶
- label¶
- log_path: pathlib.Path | None = None¶
- ok = False¶
- output = ''¶
- proc: subprocess.Popen | None = None¶
- progress = None¶
- started¶
- steps¶
- timed_out = False¶
- timeout = None¶
- timer¶
- qcc_kplugin.jobs.busy(label_prefix: str) bool¶
- qcc_kplugin.jobs.kill_tree(proc: subprocess.Popen) None¶
Stop a
qccprocess and its children (qcc.exeis a launcher that starts python.exe).