summaryrefslogtreecommitdiffstats
path: root/examples/pytde-sampler/about.py
blob: c58de92b7371b9ba6d3f49cf95c21684f2dc7ec0 (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env python
""" About the PyTDE Sampler

Defines the 'about' function to create a TDEAboutData instance for the
sampler application.
"""
from os.path import dirname, join
from tdecore import TDEAboutData


appName = b'pytdesampler'
progName = b'PyTDE Sampler'
authorName = b'Troy Melhase'
authorEmail = bugsEmailAddress = b'[email protected]'
version = b'0.1'
shortDescription = b'The PyTDE Sampler'
licenseType = TDEAboutData.License_GPL_V2
copyrightStatement = '(c) 2006, Troy Melhase'
homePageAddress = b'http://www.riverbankcomputing.co.uk/pytde/'
aboutText = (b"The application sampler for PyTDE.")
contributors = [] # module-level global for keeping the strings around; intentional


def about():
    """ creates TDEAboutData instance for the app

    """
    about = TDEAboutData(
        appName,
        progName,
        version,
        shortDescription,
        licenseType,
        copyrightStatement,
        aboutText,
        homePageAddress,
        bugsEmailAddress)
    about.addAuthor(authorName, '', authorEmail)

    try:
        contrib = open(join(dirname(__file__), 'contributors.txt'))
        contrib = [line.strip() for line in contrib]
        contrib = [line for line in contrib if not line.startswith('#')]
        for line in contrib:
            try:
                name, task, addr = [s.strip() for s in line.split(',')]
                contributors.append((name, task, addr))                            
            except:
                pass
    except:
        pass

    contributors.sort(lambda a, b:cmp(a[0], b[0]))
    for name, task, addr in contributors:
        about.addCredit(name, task, addr)

    return about