atlas.core.gui.process package

Background process runner for the ATLAS GUI.

Submodules

atlas.core.gui.process.runner module

Background process runner for the ATLAS GUI.

ProcessRunner executes an external command in a QThread, streams its combined stdout/stderr line-by-line to a Qt signal, optionally tees each line into a log file, and reports the exit code when finished. It is the single point through which the GUI shells out to atl_* CLI tools.

When detached=True the child process is launched in a new session (setsid) so it survives GUI shutdown. A PID file is written next to the log file, enabling the GUI to reconnect on next launch via DetachedProcessMonitor.

class atlas.core.gui.process.runner.DetachedProcessMonitor(*args: Any, **kwargs: Any)

Bases: QThread

Reconnect to a detached process by tailing its log and watching its PID.

Used when the GUI restarts and finds a PID file from a previous session. Emits the same signals as ProcessRunner so callers can treat it identically.

log_message

alias of str

process_finished

alias of int

run()
stop()

Stop monitoring (does NOT kill the detached process).

terminate_process()

Actually kill the detached process.

class atlas.core.gui.process.runner.ProcessRunner(*args: Any, **kwargs: Any)

Bases: QThread

Run a command in a separate thread to keep the GUI responsive.

Parameters:

detached (bool) – If True, the child is started in a new session via setsid so it survives GUI shutdown. Output goes directly to log_file (required when detached); the thread tails the log to emit log_message signals.

log_message

alias of str

property pid_file: Path | None
process_finished

alias of int

run()
stop()
atlas.core.gui.process.runner.find_detached_process(log_dir: Path, command_prefix: str) dict | None

Find a running detached process by scanning PID files.

Returns {'pid': int, 'log_file': Path, 'pid_file': Path, 'command': list[str]} if a live process is found, else None.

Module contents

Background process management for the ATLAS GUI.