summaryrefslogtreecommitdiffstats
blob: 6e2d8241728b14a91b87d739ee1350b4aa3f9483 (plain)
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
#!/usr/bin/env python

import fnmatch
import os
import re
from sets import Set

projectSourceFiles = []
for directory in ['Documentation', 'Limber', 'Packages', 'QA', 'Slimber', 'Sluift', 'Swift', 'Swiften', 'SwifTools']:
    for root, dirnames, filenames in os.walk(directory):
        for filename in filenames:
            if any(fnmatch.fnmatch(filename, pattern) for pattern in ['*.cpp', '*.h', '*.mm', '*.m', '*.c']):
                projectSourceFiles.append(os.path.join(root, filename))


def CopyrightNames(filename):
    names = []
    with open(filename, 'r') as file:
        data = file.read()
        p = re.compile(ur'\* Copyright.*\d\d\d\d (.*?)\.?$', re.MULTILINE)
        names = re.findall(p, data)
    return names


names = Set()
for file in projectSourceFiles:
    copyrightNames = CopyrightNames(file)
    for name in copyrightNames:
        names.add(name)

for name in sorted(list(names)):
    print(name)