Expand @file references to their contents. A path starting with '@' is treated as a file containing one path per line. Blank lines and lines starting with '#' are skipped.
(paths: list[str])
| 91 | |
| 92 | |
| 93 | def _expand_file_lists(paths: list[str]) -> list[str]: |
| 94 | """Expand @file references to their contents. |
| 95 | |
| 96 | A path starting with '@' is treated as a file containing one path per line. |
| 97 | Blank lines and lines starting with '#' are skipped. |
| 98 | """ |
| 99 | result: list[str] = [] |
| 100 | for path in paths: |
| 101 | if path.startswith("@"): |
| 102 | list_file = path[1:] |
| 103 | with open(list_file) as f: |
| 104 | for line in f: |
| 105 | line = line.strip() |
| 106 | if line and not line.startswith("#"): |
| 107 | result.append(line) |
| 108 | else: |
| 109 | result.append(path) |
| 110 | return result |
| 111 | |
| 112 | |
| 113 | def collect_gz_files(paths: list[str]) -> list[str]: |