[ctypes-commit] ctypes/comtypes/tools tlbparser.py,1.4.2.9,1.4.2.10
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2005-07-08 17:15:11
|
Update of /cvsroot/ctypes/ctypes/comtypes/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32371 Modified Files: Tag: branch_1_0 tlbparser.py Log Message: Cleabn up a bit. Index: tlbparser.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/comtypes/tools/tlbparser.py,v retrieving revision 1.4.2.9 retrieving revision 1.4.2.10 diff -C2 -d -r1.4.2.9 -r1.4.2.10 *** tlbparser.py 6 Jul 2005 10:41:18 -0000 1.4.2.9 --- tlbparser.py 8 Jul 2005 17:15:00 -0000 1.4.2.10 *************** *** 536,542 **** ################################################################ - def main(): - import sys ## these do NOT work: # XXX infinite loop? --- 536,541 ---- ################################################################ + # some interesting typelibs ## these do NOT work: # XXX infinite loop? *************** *** 545,549 **** # has SAFEARRAY # HRESULT Run(BSTR, SAFEARRAY(VARIANT)*, VARIANT*) ! path = "msscript.ocx" # has SAFEARRAY --- 544,548 ---- # has SAFEARRAY # HRESULT Run(BSTR, SAFEARRAY(VARIANT)*, VARIANT*) ! ## path = "msscript.ocx" # has SAFEARRAY *************** *** 580,603 **** ## path = r"c:\vc98\include\activscp.tlb" - known_symbols = {} - for name in ("comtypes.typeinfo", "comtypes.automation", "comtypes", "ctypes"): - mod = __import__(name) - for submodule in name.split(".")[1:]: - mod = getattr(mod, submodule) - for name in mod.__dict__: - known_symbols[name] = mod.__name__ - - p = TlbFileParser(path) - items = p.parse() - - from codegenerator import Generator - - gen = Generator(sys.stdout, - use_decorators=sys.version_info >= (2, 4), - known_symbols=known_symbols, - ## searched_dlls=None, - ) - gen.generate_code(items.values()) - def generate_module(tlib, ofi, make_module, name_module): known_symbols = {} --- 579,582 ---- *************** *** 622,629 **** gen.generate_code(items.values()) ! if __name__ == "__main__": ! from comtypes.typeinfo import LoadRegTypeLib, LoadTypeLibEx ! from comtypes import GUID ! ! tlib = LoadRegTypeLib(GUID("{0002E157-0000-0000-C000-000000000046}"), 5, 0) ! generate_module(tlib, open("_0002E157_0000_0000_C000_000000000046_0_5_0.py", "w")) --- 601,603 ---- gen.generate_code(items.values()) ! # -eof- |