Foundry.ProcessLauncher¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Foundry.ProcessLauncher(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Manages process execution and subprocess launching.
Foundry.ProcessLauncherprovides a unified interface for launching and managing subprocesses with proper environment setup, working directory configuration, and I/O handling. It supports both local and chained subprocesses that may either run remotely or in a remote context such as a container or virtual machine.- classmethod new()¶
- Return type:
- add_minimal_environment()¶
Adds a minimal set of environment variables.
This is useful to get access to things like the display or other expected variables.
- create_stdio_stream()¶
- Raises:
- Returns:
a
Gio.IOStreamif successful; otherwiseNoneand error is set.- Return type:
Creates a stream to communicate with the subprocess using stdin/stdout.
The stream is created using UNIX pipes which are attached to the stdin/stdout of the child process.
- environ_to_argv()¶
- merge_unix_fd_map(unix_fd_map)¶
- Parameters:
unix_fd_map (
Foundry.UnixFDMap) – aFoundry.UnixFDMap- Raises:
- Returns:
- Return type:
Merges the
Foundry.UnixFDMapinto the current layer.If there are collisions in destination FDs, then that may cause an error and
Falseis returned.unix_fd_map will have the FDs stolen using
Foundry.UnixFDMap.steal_from() which means that if successful, unix_fd_map will not have any open file-descriptors after calling this function.
- push(handler, *handler_data)¶
- Parameters:
handler (
Foundry.ProcessLauncherHandler) –
- push_at_base(handler, *handler_data)¶
- Parameters:
handler (
Foundry.ProcessLauncherHandler) –
- push_error(error)¶
- Parameters:
error (
GLib.Error) – aGLib.Error
Pushes a new layer that will always fail with error.
This is useful if you have an error when attempting to build a run command, but need it to deliver the error when attempting to create a subprocess launcher.
- push_expansion(environ)¶
- Parameters:
environ (
str) –
Pushes a layer to expand known environment variables.
The command argv and cwd will have
$FOOstyle environment variables expanded that are known. This can be useful to allow things like$BUILDDIRbe expanded at this layer.
- push_host()¶
Pushes handler to transform command to run on host.
If necessary, a layer is pushed to ensure the command is run on the host instead of the application container.
If Builder is running on the host already, this function does nothing.
- push_shell(shell)¶
- Parameters:
shell (
Foundry.ProcessLauncherShell) – the kind of shell to be used
Pushes a shell which can run the upper layer command with -c.
- push_user_shell(shell)¶
- Parameters:
shell (
Foundry.ProcessLauncherShell) –
- set_pty_fd(consumer_fd)¶
- Parameters:
consumer_fd (
int) – the FD of the PTY consumer
Sets up a PTY for the run context that will communicate with the consumer. The consumer is the generally the widget that is rendering the PTY contents and the producer is the FD that is connected to the subprocess.
- spawn()¶
- Raises:
- Returns:
an
Gio.Subprocessif successful; otherwiseNoneand error is set.- Return type:
Spawns the run command.
If there is a failure to build the command into a subprocess launcher, then
Noneis returned and error is set.If the subprocess fails to launch, then
Noneis returned and error is set.
- spawn_with_flags(flags)¶
- Parameters:
flags (
Gio.SubprocessFlags) –- Raises:
- Returns:
a
Gio.SubprocessorNoneupon error.- Return type:
Like
Foundry.ProcessLauncher.spawn() but allows specifying the flags for theGio.Subprocesswhich may override other settings.