|
Module generateComInterfaces
|
|
1
2
3
4
5
6
7 """Script to generate Python code for required COM interfaces.
8 This script will be run by SCons as appropriate.
9 """
10
11
12 import comtypes.client
13 comtypes.client.gen_dir='.\\comInterfaces'
14 import sys
15 sys.modules['comtypes.gen']=comtypes.gen=__import__("comInterfaces",globals(),locals(),[])
16
17 COM_INTERFACES = (
18 ("UI Automation", comtypes.client.GetModule, "UIAutomationCore.dll"),
19 ("IAccessible 2", comtypes.client.GetModule, "typelibs/ia2.tlb"),
20 ("MS Active Accessibility", comtypes.client.GetModule, "oleacc.dll"),
21 ("Rich Edit library", comtypes.client.GetModule, "msftedit.dll"),
22 ("SAPI 5", comtypes.client.CreateObject, "Sapi.SPVoice"),
23 ("Acrobat Access", comtypes.client.GetModule, "typelibs/AcrobatAccess.tlb"),
24 ("Flash Accessibility", comtypes.client.GetModule, "typelibs/FlashAccessibility.tlb"),
25 )
26
28 print "COM interfaces:"
29 for desc, func, interface in COM_INTERFACES:
30 print "%s:" % desc,
31 try:
32 func(interface)
33 print "done."
34 except:
35 print "not found."
36 print
37
38 if __name__ == "__main__":
39 main()
40