| @@ 50-63 (lines=14) @@ | ||
| 47 | end_num = len(file_contents) |
|
| 48 | line_num = 0 |
|
| 49 | ||
| 50 | while line_num < end_num: |
|
| 51 | if len(file_contents[line_num]) >= sec_len: |
|
| 52 | if file_contents[line_num][0:sec_len] == sec_id: |
|
| 53 | begin = line_num |
|
| 54 | line_num += 1 |
|
| 55 | while line_num < end_num: |
|
| 56 | nonempty_line = file_contents[line_num] |
|
| 57 | if nonempty_line and file_contents[line_num][0] != ' ': |
|
| 58 | break |
|
| 59 | line_num += 1 |
|
| 60 | ||
| 61 | end = line_num - 1 |
|
| 62 | sec_ranges.append(section(begin, end)) |
|
| 63 | line_num += 1 |
|
| 64 | ||
| 65 | return sec_ranges |
|
| 66 | ||
| @@ 206-218 (lines=13) @@ | ||
| 203 | end_num = len(file_contents) |
|
| 204 | line_num = 0 |
|
| 205 | ||
| 206 | while line_num < end_num: |
|
| 207 | if len(file_contents[line_num]) >= sec_len: |
|
| 208 | if file_contents[line_num][0:sec_len] == sec_id: |
|
| 209 | begin = line_num |
|
| 210 | line_num += 1 |
|
| 211 | while line_num < end_num: |
|
| 212 | if len(file_contents[line_num]) > 0 and file_contents[line_num][0] != ' ': |
|
| 213 | break |
|
| 214 | line_num += 1 |
|
| 215 | ||
| 216 | end = line_num - 1 |
|
| 217 | sec_ranges.append((begin, end)) |
|
| 218 | line_num += 1 |
|
| 219 | return sec_ranges |
|
| 220 | ||
| 221 | ||