~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-private-shapes

« back to all changes in this revision

Viewing changes to tests/qmlapicheck.py

  • Committer: Christian Dywan
  • Date: 2014-04-30 10:22:44 UTC
  • mfrom: (1000.17.3 staging)
  • mto: (1000.41.5 staging)
  • mto: This revision was merged to the branch mainline in revision 1022.
  • Revision ID: christian.dywan@canonical.com-20140430102244-uti97msd0thmk31d
MergeĀ lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/staging

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
 
47
47
builtins = os.getenv('BUILTINS', '').split(',')
48
48
inputfiles = []
 
49
classes = {}
49
50
for line in fileinput.input():
50
51
    if fileinput.filename()[-6:] == 'qmldir':
51
52
        if line[:8] == 'internal':
59
60
                # Filenames are relative to the qmldir
60
61
                # Foo 1.0 Foo.qml
61
62
                folder = os.path.dirname(fileinput.filename())
62
 
                inputfiles.append(folder + '/' + filename)
 
63
                fullpath = folder + '/' + filename
 
64
                classname = pieces[0]
 
65
                version = pieces[1]
 
66
                if not fullpath in inputfiles:
 
67
                    inputfiles.append(fullpath)
 
68
                    classes[fullpath] = [classname, version]
 
69
                else:
 
70
                    versions = classes[fullpath]
 
71
                    if not classname in versions:
 
72
                        versions.append(classname)
 
73
                    versions.append(version)
63
74
    else:
64
75
        inputfiles.append(fileinput.filename())
65
76
        fileinput.nextfile()
87
98
        else:
88
99
            print('Unknown filetype %s' % fileinput.filename())
89
100
            sys.exit(1)
90
 
        print('%s' % fileinput.filename())
 
101
        if fileinput.filename() in classes:
 
102
            classname = ' '.join(classes[fileinput.filename()])
 
103
        else:
 
104
            classname = fileinput.filename()
 
105
        print(classname)
91
106
 
92
107
    line = line.split('//')[0]
93
108
    # alias properties only define their type through qdoc comments