File: header-list.py

package info (click to toggle)
gemmi 0.5.7%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 5,344 kB
  • sloc: cpp: 48,972; python: 4,352; ansic: 3,428; sh: 302; makefile: 69; f90: 42; javascript: 12
file content (18 lines) | stat: -rwxr-xr-x 574 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env python3

import glob

SEPARATOR_LINES = ('//\n', '\n')
for header in sorted(glob.glob('include/gemmi/*.hpp')):
    without_include = header.partition('/')[2]
    print('\n' + without_include)
    with open(header) as f:
        line = f.readline()
        if line.startswith('// Copyright'):
            line = f.readline()
            assert line in SEPARATOR_LINES, line
            line = f.readline()
        while line not in SEPARATOR_LINES:
            assert line[2] == ' ', line
            print('    ' + line[3:-1])
            line = f.readline()