(fp)
| 129 | |
| 130 | |
| 131 | def get_header_bash(fp): |
| 132 | with open(fp, "r") as f: |
| 133 | lines = iter(l for l in f.readlines()) |
| 134 | |
| 135 | header = [] |
| 136 | rest = [] |
| 137 | |
| 138 | while (l := next(lines, None)) is not None: |
| 139 | l = l.strip() |
| 140 | if not l.startswith(BASH_SL_COMMENT) or l.isspace(): |
| 141 | # Not in a comment |
| 142 | rest += [l + "\n"] |
| 143 | break |
| 144 | header.append(l) |
| 145 | |
| 146 | rest += list(lines) |
| 147 | |
| 148 | return header, rest |
| 149 | |
| 150 | |
| 151 | def remove_comments(line, comment_strs): |