launch.substitutions.for_loop_var module

Module for the ForLoopIndex substitution.

class launch.substitutions.for_loop_var.ForEachVar[source]

Bases: Substitution

Substitution for a launch.actions.ForEach iteration 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.ForEach iteration variable

  • default_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.

classmethod get_local_arg_name(name: str) str[source]
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: ForEachVar

Substitution for a launch.actions.ForLoop iteration 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.ForLoop index which this substitution is part of