[ctypes-commit] ctypes/comtypes/tools tlbparser.py,1.4,1.5
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2005-03-22 12:30:40
|
Update of /cvsroot/ctypes/ctypes/comtypes/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20689 Modified Files: tlbparser.py Log Message: Don't use a relative import for comtypes.tools.typedesc (now that it's a package). The 'noncreatable' IDL flags wasn't emitted. Index: tlbparser.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/comtypes/tools/tlbparser.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tlbparser.py 16 Mar 2005 14:25:12 -0000 1.4 --- tlbparser.py 22 Mar 2005 12:30:14 -0000 1.5 *************** *** 2,6 **** import comtypes.automation as automation import comtypes.typeinfo as typeinfo ! import typedesc ################################ --- 2,6 ---- import comtypes.automation as automation import comtypes.typeinfo as typeinfo ! import comtypes.tools.typedesc as typedesc ################################ *************** *** 65,69 **** automation.VT_HRESULT: HRESULT_type, # 25 # This is wrong. We must create separate SAFEARRAY(type) things. ! # automation.VT_SAFEARRAY: SAFEARRAY_type, # 27 automation.VT_LPSTR: PTR(char_type), # 30 automation.VT_LPWSTR: PTR(wchar_t_type), # 31 --- 65,69 ---- automation.VT_HRESULT: HRESULT_type, # 25 # This is wrong. We must create separate SAFEARRAY(type) things. ! automation.VT_SAFEARRAY: SAFEARRAY_type, # 27 automation.VT_LPSTR: PTR(char_type), # 30 automation.VT_LPWSTR: PTR(wchar_t_type), # 31 *************** *** 115,119 **** # SAFEARRAY(long), see Don Box pp.331f print "SAFEARRAY", tdesc._.lptdesc[0].vt ! raise "HALT" return SAFEARRAY_type --- 115,119 ---- # SAFEARRAY(long), see Don Box pp.331f print "SAFEARRAY", tdesc._.lptdesc[0].vt ! ##XXX## raise "HALT" return SAFEARRAY_type *************** *** 353,357 **** # map TYPEFLAGS values to idl attributes NAMES = {typeinfo.TYPEFLAG_FAPPOBJECT: "appobject", - # typeinfo.TYPEFLAG_FCANCREATE: typeinfo.TYPEFLAG_FLICENSED: "licensed", # typeinfo.TYPEFLAG_FPREDECLID: --- 353,356 ---- *************** *** 368,372 **** typeinfo.TYPEFLAG_FPROXY: "proxy", } ! return [NAMES[bit] for bit in NAMES if bit & flags] def var_flags(self, flags): --- 367,374 ---- typeinfo.TYPEFLAG_FPROXY: "proxy", } ! NEGATIVE_NAMES = {typeinfo.TYPEFLAG_FCANCREATE: "noncreatable"} ! ! return [NAMES[bit] for bit in NAMES if bit & flags] + \ ! [NEGATIVE_NAMES[bit] for bit in NEGATIVE_NAMES if (bit & flags == 0)] def var_flags(self, flags): *************** *** 484,489 **** ################################################################ ! def main(): import sys ## these do NOT work: --- 486,492 ---- ################################################################ + # XXX ONLY FOR TESTING! ! if __name__ == "__main__": import sys ## these do NOT work: *************** *** 507,511 **** ## path = r"simpdata.tlb" ## path = r"nscompat.tlb" ! ## path = r"stdole32.tlb" ## path = r"shdocvw.dll" --- 510,514 ---- ## path = r"simpdata.tlb" ## path = r"nscompat.tlb" ! ## path = r"stdole32.tlb" # IEnumVARIANT ## path = r"shdocvw.dll" *************** *** 515,518 **** --- 518,523 ---- ## path = r"MSHFLXGD.OCX" # DispProperty, propputref ## path = r"scrrun.dll" # propput AND propputref on IDictionary::Item + + # This is interesting: It contains some functions with idl flags! ## path = r"C:\Dokumente und Einstellungen\thomas\Desktop\tlb\threadapi.tlb" *************** *** 528,540 **** items = p.parse() - from codegenerator import Generator gen = Generator(sys.stdout, use_decorators=True, known_symbols=known_symbols, - ## searched_dlls=None, ) gen.generate_code(items.values()) - - if __name__ == "__main__": - main() --- 533,541 ---- items = p.parse() + from comtypes.tools.codegenerator import Generator gen = Generator(sys.stdout, use_decorators=True, known_symbols=known_symbols, ) gen.generate_code(items.values()) |