1#!/usr/bin/env python
2
3import os
4import re
5import sys
6import time
7
8version = sys.argv[1]
9
10template = \
11"""Hi,
12
13Thank you for contributing to VTK!
14
15If you would like your recent work (listed below) to be mentioned in the vtk
16{version} release notes, please summarize your changes and we will try to work the
17description in.
18
19{changes}
20Thanks,
21
22VTK Maintenance Team
23"""
24
25with open('changes.txt', 'r') as changes:
26    committer = ''
27    contribs = []
28
29    for change in changes:
30        email = re.search('.*<(.*@.*)>.*', change)
31        if email:
32            if committer:
33                print committer
34                with open('%s.txt' % committer, 'w+') as output:
35                    output.write(template.format(
36                        version=version,
37                        changes=''.join(contribs)))
38            committer = email.group(1)
39            contribs = []
40        if change != '\n':
41            contribs.append(change)
42