index : matrix-js-sdk

My fork of matrix-js-sdk

path: root/scripts/changelog_head.py
blob: c7c1c0aeaa5f03ba018110c1834c214f29e19d10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env python

"""
Outputs the body of the first entry of changelog file on stdin
"""

import re
import sys

found_first_header = False
for line in sys.stdin:
    line = line.strip()
    if re.match(r"^Changes in \[.*\]", line):
        if found_first_header:
            break
        found_first_header = True
    elif not re.match(r"^=+$", line) and len(line) > 0:
        print line