launch.events.process package
Submodules
- launch.events.process.process_exited module
- launch.events.process.process_io module
- launch.events.process.process_matchers module
- launch.events.process.process_started module
- launch.events.process.process_stderr module
- launch.events.process.process_stdin module
- launch.events.process.process_stdout module
- launch.events.process.process_targeted_event module
- launch.events.process.running_process_event module
- launch.events.process.shutdown_process module
- launch.events.process.signal_process module
Module contents
Package for launch.events.process.
- class launch.events.process.ProcessExited[source]
Bases:
RunningProcessEvent
Event emitted when a process exits.
- __init__(*, returncode: int, **kwargs) None [source]
Create a ProcessExited event.
Unmatched keyword arguments are passed to RunningProcessEvent, see it for details on those arguments.
- Param:
returncode is the returncode of the process
- name = 'launch.events.process.ProcessExited'
- class launch.events.process.ProcessIO[source]
Bases:
RunningProcessEvent
Event emitted when a process generates output on stdout or stderr, or if stdin is used.
- __init__(*, text: bytes, fd: int, **kwargs) None [source]
Create a ProcessIO event.
Unmatched keyword arguments are passed to RunningProcessEvent, see it for details on those arguments.
- Param:
text is the unicode data associated with the event
- Param:
fd is an integer that indicates which file descriptor the text is from
- name = 'launch.events.process.ProcessIO'
- class launch.events.process.ProcessStarted[source]
Bases:
RunningProcessEvent
Event emitted when a process starts.
- __init__(**kwargs)[source]
Create a ProcessStarted event.
Unmatched keyword arguments are passed to RunningProcessEvent, see it for details on those arguments.
- name = 'launch.events.process.ProcessStarted'
- class launch.events.process.ProcessStderr[source]
Bases:
ProcessIO
Event emitted when a process generates output on stderr.
- __init__(*, text: bytes, **kwargs) None [source]
Create a ProcessStderr event.
Unmatched keyword arguments are passed to ProcessEvent, see it for details on those arguments.
- Param:
text is the unicode data associated with the event
- name = 'launch.events.process.ProcessStderr'
- class launch.events.process.ProcessStdin[source]
Bases:
ProcessIO
Event emitted when a process needs to handle stdin.
- __init__(*, text: bytes, **kwargs) None [source]
Create a ProcessStdin event.
Unmatched keyword arguments are passed to ProcessEvent, see it for details on those arguments.
- Param:
text is the unicode data associated with the event
- name = 'launch.events.process.ProcessStdin'
- class launch.events.process.ProcessStdout[source]
Bases:
ProcessIO
Event emitted when a process generates output on stdout.
- __init__(*, text: bytes, **kwargs) None [source]
Create a ProcessStdout event.
Unmatched keyword arguments are passed to ProcessEvent, see it for details on those arguments.
- Param:
text is the unicode data associated with the event
- name = 'launch.events.process.ProcessStdout'
- class launch.events.process.ProcessTargetedEvent[source]
Bases:
Event
Event base class that is targeted at some running process.
- __init__(*, process_matcher: Callable[[ExecuteLocal], bool]) None [source]
Create a ProcessTargetedEvent.
Some standard matchers are also available, like:
- Param:
process_matcher is a predicate which can determine if an ExecuteLocal action matches this event or not
- name = 'launch.events.process.ProcessTargetedEvent'
- property process_matcher: Callable[[ExecuteLocal], bool]
Getter for process_matcher.
- class launch.events.process.RunningProcessEvent[source]
Bases:
Event
Event base class that is related to some running process.
- __init__(*, action: ExecuteProcess, name: str, cmd: List[str], cwd: str | None, env: Dict[str, str] | None, pid: int) None [source]
Create a RunningProcessEvent.
- Param:
action is the ExecuteProcess action associated with the event
- Param:
name is the final name of the process instance, which is unique
- Param:
cmd is the final command after substitution expansion
- Param:
cwd is the final working directory after substitution expansion
- Param:
env is the final environment variables after substitution expansion
- property action: ExecuteProcess
Getter for action.
- property execute_process_action: ExecuteProcess
Getter for execute_process_action.
- name = 'launch.events.process.RunningProcessEvent'
- class launch.events.process.ShutdownProcess[source]
Bases:
ProcessTargetedEvent
Event emitted when a process should begin shutting down.
This event is handled by the launch.actions.ExecuteLocal action, see it for details on what happens when this is emitted.
Also see ProcessTargetedEvent for details on how to target a specific process.
- __init__(*, process_matcher: Callable[[ExecuteLocal], bool]) None [source]
Create a ShutdownProcess event.
- name = 'launch.events.process.ShutdownProcess'
- class launch.events.process.SignalProcess[source]
Bases:
ProcessTargetedEvent
Event emitted when a signal should be sent to a process.
- __init__(*, signal_number: str | Signals, process_matcher: Callable[[ExecuteLocal], bool]) None [source]
Create a SignalProcess event.
Takes an optional process matcher, which can be used to match the signal to a process.
Since Windows does not support SIGKILL, the string ‘SIGKILL’ can be given instead of signal.SIGKILL. Handlers of this event can then check for the ‘SIGKILL’ string and do the appropriate thing on Windows instead of sending a signal.
- Signal_number:
either the string ‘SIGKILL’ or a signal.Signals
- name = 'launch.events.process.SignalProcess'
- launch.events.process.matches_executable(executable: str) Callable[[ExecuteProcess], bool] [source]
Return a matcher which matches based on the name of the executable for the process.
The given executable is compared with the first element of the ‘cmd’ using str.endswith(). So, for example, ‘ls’ would match either ‘ls .’ or ‘/usr/bin/ls .’.