pypeit.dashboard.launcher module
Launch PypeIt’s external inspection tools as subprocesses (design C8/C14/C15).
Uses Qt’s QProcess (S3-Q2) so launches are non-blocking and integrate
with the event loop: stdout/stderr/return code are captured and the
ActivityBar is updated on start and
finish (observable launches, per the Debugging plan).
Generated by JXP and Claude.
- class pypeit.dashboard.launcher.Launcher(activity=None, run_lock=None)[source]
Bases:
objectLaunches external tools as non-blocking subprocesses and reports progress/outcome to the activity bar.
Generated by JXP and Claude.
- Parameters:
activity (
ActivityBar) – The status/activity bar to report to (may beNone).run_lock (
RunLock, optional) – The single-run lock (design X1); a run launched viarun()holds it while active. May beNone.
- _drop(proc)[source]
Release a finished process reference.
Generated by JXP and Claude.
- Parameters:
proc (
QProcess) – The process to release.- Returns:
None.
- _on_error(proc, cmd)[source]
Handle an inspection process that failed to start (e.g. command not found).
Generated by JXP and Claude.
- Parameters:
proc (
QProcess) – The failed process.cmd (
str) – The quoted command line.
- Returns:
None.
- _on_finished(proc, cmd, code, hint='viewer window')[source]
Handle process completion: report the outcome and capture output. The exact command stays shown after finishing (Stage 3b #2).
Generated by JXP and Claude.
- _on_run_error(proc, cmd, on_finished)[source]
Handle a run that failed to start: release the lock and report.
Generated by JXP and Claude.
- Parameters:
proc (
QProcess) – The failed process.cmd (
str) – The quoted command line.on_finished (callable) – Called as
on_finished(-1)(orNone).
- Returns:
None.
- _on_run_finished(proc, cmd, code, on_finished)[source]
Handle a finished run: release the lock, report, refresh.
Generated by JXP and Claude.
- _report(message, busy=False, build=True)[source]
Report a message to the activity bar (and the log), on the Build channel ((re)build runs) or the Inspection channel (viewer launches) per
build(Stage 5 S5-Q9).Generated by JXP and Claude.
- launch(argv, description=None, hint='viewer window')[source]
Launch
argvas a detached-from-the-UI subprocess.Generated by JXP and Claude.
- Parameters:
- Returns:
True if the process was started, False if it could not be launched (e.g. the target file is missing).
- Return type:
- run(argv, description='Rebuilding', on_finished=None)[source]
Launch a PypeIt run (e.g.
pypeit_run_to_calibstep): hold the single-run lock while it is active and refresh on completion (design C10/C15/X1).Unlike
launch()(inspection viewers), a run engages therun_lockso launch controls disable while it executes, and callson_finishedwhen it ends so the views can re-read the state.Generated by JXP and Claude.
- Parameters:
- Returns:
True if the process was started, False otherwise.
- Return type: