summaryrefslogtreecommitdiff
path: root/cad/src/tools/old/checkui.py
blob: 37a9fee8cdd664145efdfaf6472d67cba72d8ca6 (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
#! /usr/bin/python
# Copyright 2004-2007 Nanorex, Inc.  See LICENSE file for details. 

"""
checkui.py

$Id$
"""

import sys
from commands import getoutput
import re
from StringIO import StringIO

isdef = re.compile("\s*def (\w*)\(self,?\W*([^)]*)\):")

if __name__ == '__main__':

    f = sys.argv[1]
    if f[-2:] == 'ui':
        foo = getoutput("pyuic " + sys.argv[1])
    else:
        foo = getoutput("cat " + sys.argv[1])
    bar = StringIO(foo)
    lis = []
    for l in bar.readlines():
        m = isdef.search(l)
        if m and not '__' == m.group(1)[:2]:
            if m.group(1) == 'languageChange':
                continue
            lis += [m.group(1) + '(' + m.group(2) + ')']
    lis.sort()
    for i in lis:
        print i

# end