Resolve variable substitution in a list of values.
(
values: list[str], config: configparser.ConfigParser
)
| 486 | |
| 487 | |
| 488 | def _resolve_list_variables( |
| 489 | values: list[str], config: configparser.ConfigParser |
| 490 | ) -> list[str]: |
| 491 | """ |
| 492 | Resolve variable substitution in a list of values. |
| 493 | """ |
| 494 | resolved: list[str] = [] |
| 495 | for value in values: |
| 496 | resolved_value = _resolve_variable_substitution(value, config) |
| 497 | # If the resolved value contains newlines or commas, parse it as a list |
| 498 | if resolved_value != value and ( |
| 499 | "\n" in resolved_value or "," in resolved_value |
| 500 | ): |
| 501 | resolved.extend(_parse_list_value(resolved_value)) |
| 502 | else: |
| 503 | resolved.append(resolved_value) |
| 504 | return resolved |
| 505 | |
| 506 | |
| 507 | def _parse_list_value(value: str) -> list[str]: |
no test coverage detected