Parse a target list from *source*. If *source* is the path of an existing file, read one target per line. Otherwise treat *source* as comma-separated inline targets.
(source: str)
| 29 | |
| 30 | |
| 31 | def parse_targets(source: str) -> list[str]: |
| 32 | """ |
| 33 | Parse a target list from *source*. |
| 34 | |
| 35 | If *source* is the path of an existing file, read one target per line. |
| 36 | Otherwise treat *source* as comma-separated inline targets. |
| 37 | """ |
| 38 | p = Path(source) |
| 39 | if p.exists() and p.is_file(): |
| 40 | lines = p.read_text(encoding="utf-8").splitlines() |
| 41 | return [ln.strip() for ln in lines if ln.strip()] |
| 42 | return [t.strip() for t in source.split(",") if t.strip()] |
| 43 | |
| 44 | |
| 45 | async def _investigate_one( |
no outgoing calls