File: prep-emails.py

package info (click to toggle)
vtk7 7.1.1%2Bdfsg2-8
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 127,396 kB
  • sloc: cpp: 1,539,584; ansic: 124,382; python: 78,038; tcl: 47,013; xml: 8,142; yacc: 5,040; java: 4,439; perl: 3,132; lex: 1,926; sh: 1,500; makefile: 126; objc: 83
file content (41 lines) | stat: -rwxr-xr-x 939 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python

import os
import re
import sys
import time

version = sys.argv[1]

template = \
"""Hi,

Thank you for contributing to VTK!

If you would like your recent work (listed below) to be mentioned in the vtk
{version} release notes, please summarize your changes and we will try to work the
description in.

{changes}
Thanks,

VTK Maintenance Team
"""

with open('changes.txt', 'r') as changes:
    committer = ''
    contribs = []

    for change in changes:
        email = re.search('.*<(.*@.*)>.*', change)
        if email:
            if committer:
                print committer
                with open('%s.txt' % committer, 'w+') as output:
                    output.write(template.format(
                        version=version,
                        changes=''.join(contribs)))
            committer = email.group(1)
            contribs = []
        if change != '\n':
            contribs.append(change)