-
Notifications
You must be signed in to change notification settings - Fork 10
/
list_classes.py
41 lines (33 loc) · 1.17 KB
/
list_classes.py
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
from doxybindgen.model import Class, ClassManager
from doxybindgen.binding import CxxClassBinding, RustClassBinding
import os
import toml
# place wxWidgets doxygen xml files in wxml/ dir and run this.
def main():
with open('Doxybindgen.toml', 'r') as f:
config = toml.load(f)
classes = ClassManager()
parsed = []
for (file, path) in wxml_files():
for cls in Class.in_xml(classes, path, config['types']):
cls.file = file
parsed.append(cls)
classes.register(parsed)
# print_classes_in_lib(classes, config, 'base')
print_classes_in_lib(classes, config, 'core')
def wxml_files():
for root, dirs, files in os.walk('wxml'):
for file in files:
if (file.startswith('classwx_') and
file.endswith('.xml')):
yield (file, os.path.join(root, file))
generated = []
def print_classes_in_lib(classes, config, libname):
# print('%s:' % (libname,))
n = 0
for file in sorted(cls.file for cls in classes.in_lib(libname, generated)):
print(" 'wxml/%s'," % (file,))
n += 1
# print('\t%s classes.' % (n))
if __name__ == '__main__':
main()