launch.frontend.parse_substitution module

Module for parsing substitutions.

class launch.frontend.parse_substitution.ExtractSubstitution[source]

Bases: Transformer

Extract a substitution.

arguments(values)[source]
double_quoted_arguments(values)
double_quoted_fragment(content)
double_quoted_part(content)
double_quoted_substitution(args)
double_quoted_template(fragments)
double_quoted_value(parts)
fragment(content)[source]
part(content)[source]
single_quoted_arguments(values)
single_quoted_fragment(content)
single_quoted_part(content)
single_quoted_substitution(args)
single_quoted_template(fragments)
single_quoted_value(parts)
substitution(args)[source]
template(fragments)[source]
value(parts)[source]
launch.frontend.parse_substitution.get_grammar_path()[source]
launch.frontend.parse_substitution.parse_if_substitutions(value: str | Substitution | Iterable[str | Substitution] | int | float | bool | Sequence[int | str] | Sequence[float | str] | Sequence[bool | str] | Sequence[str]) List[Substitution] | int | float | bool | str | List[int | List[Substitution]] | List[float | List[Substitution]] | List[bool | List[Substitution]] | List[str | List[Substitution]][source]

Parse substitutions in value, if there are any, and return a normalized value type.

If value is a str, substitutions will be interpolated in it. If value is any other scalar type, it will be returned as-is. If value is a list, the two rules above will be applied to each item. When interpolating substitutions in a string, TextSubstitution instances are resolved and the original str is left.

Raise:

ValueError if the result cannot be parsed into a valid type.

launch.frontend.parse_substitution.parse_substitution(string_value)[source]
launch.frontend.parse_substitution.replace_escaped_characters(data: str) str[source]

Search escaped characters and replace them.