launch.substitutions.for_loop_var module
Module for the ForLoopIndex substitution.
- class launch.substitutions.for_loop_var.ForEachVar[source]
Bases:
SubstitutionSubstitution for a
launch.actions.ForEachiteration variable value.- __init__(name: str | Path | Substitution | Iterable[str | Path | Substitution], *, default_value: str | Path | Substitution | Iterable[str | Path | Substitution] | None = None) None[source]
Create a ForEachVar.
- Parameters:
name – the name of the
launch.actions.ForEachiteration variabledefault_value – a default value for the variable if a value is not available for a given iteration
- property default_value: List[Substitution] | None
- describe() str[source]
Return a description of this substitution as a string.
When inherited from, calling this base class’s default method is not required.
- property name: List[Substitution]
- classmethod parse(data: Sequence[str | Path | Substitution | Iterable[str | Path | Substitution]])[source]
- perform(context: LaunchContext) str[source]
Perform the substitution, given the launch context, and return it as a string.
This should be overridden by the derived classes, and the default raises NotImplementedError.
- Raises:
NotImplementedError
- class launch.substitutions.for_loop_var.ForLoopIndex[source]
Bases:
ForEachVarSubstitution for a
launch.actions.ForLoopiteration index value.- __init__(name: str | Path | Substitution | Iterable[str | Path | Substitution], **kwargs) None[source]
Create a ForLoopIndex.
- Parameters:
name – the name of the
launch.actions.ForLoopindex which this substitution is part of