Parse a configuration value that can be either comma-separated or multi-line. Args: value: Raw configuration value Returns: List of parsed values
(value: str)
| 505 | |
| 506 | |
| 507 | def _parse_list_value(value: str) -> list[str]: |
| 508 | """ |
| 509 | Parse a configuration value that can be either comma-separated or multi-line. |
| 510 | |
| 511 | Args: |
| 512 | value: Raw configuration value |
| 513 | |
| 514 | Returns: |
| 515 | List of parsed values |
| 516 | """ |
| 517 | if not value or not value.strip(): |
| 518 | return [] |
| 519 | |
| 520 | # Handle multi-line format (values on separate lines) |
| 521 | if "\n" in value: |
| 522 | lines = [line.strip() for line in value.split("\n") if line.strip()] |
| 523 | return lines |
| 524 | |
| 525 | # Handle comma-separated format |
| 526 | if "," in value: |
| 527 | return [item.strip() for item in value.split(",") if item.strip()] |
| 528 | |
| 529 | # Single value |
| 530 | return [value.strip()] if value.strip() else [] |
| 531 | |
| 532 | |
| 533 | def _parse_platformio_section( |
no outgoing calls
no test coverage detected