get variable from variables_mapping. Args: variable_name (str): variable name variables_mapping (dict): variables mapping Returns: mapping variable value. Raises: exceptions.VariableNotFound: variable is not found.
(
variable_name: Text, variables_mapping: VariablesMapping
)
| 219 | |
| 220 | |
| 221 | def get_mapping_variable( |
| 222 | variable_name: Text, variables_mapping: VariablesMapping |
| 223 | ) -> Any: |
| 224 | """get variable from variables_mapping. |
| 225 | |
| 226 | Args: |
| 227 | variable_name (str): variable name |
| 228 | variables_mapping (dict): variables mapping |
| 229 | |
| 230 | Returns: |
| 231 | mapping variable value. |
| 232 | |
| 233 | Raises: |
| 234 | exceptions.VariableNotFound: variable is not found. |
| 235 | |
| 236 | """ |
| 237 | # TODO: get variable from debugtalk module and environ |
| 238 | try: |
| 239 | return variables_mapping[variable_name] |
| 240 | except KeyError: |
| 241 | raise exceptions.VariableNotFound( |
| 242 | f"{variable_name} not found in {variables_mapping}" |
| 243 | ) |
| 244 | |
| 245 | |
| 246 | def get_mapping_function( |