launch.conditions.evaluate_condition_expression_impl module

Module for utility functions related to evaluating condition expressions.

launch.conditions.evaluate_condition_expression_impl.evaluate_condition_expression(context: LaunchContext, expression: List[Substitution]) bool[source]

Expand an expression and then evaluate it as a condition, returning true or false.

The expanded expression is stripped and has lower() called on it before being logically evaluated as either true or false. A string will be considered True if it matches ‘true’ or ‘1’. A string will be considered False if it matches ‘false’ or ‘0’. Any other string content (including empty string) will result in an error.

Raises:

InvalidConditionExpressionError