testmakepy.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:pupy 作者: ru-faraon 项目源码 文件源码
def TestBuildAll(verbose = 1):
    num = 0
    tlbInfos = selecttlb.EnumTlbs()
    for info in tlbInfos:
        if verbose:
            print "%s (%s)" % (info.desc, info.dll)
        try:
            makepy.GenerateFromTypeLibSpec(info)
#          sys.stderr.write("Attr typeflags for coclass referenced object %s=%d (%d), typekind=%d\n" % (name, refAttr.wTypeFlags, refAttr.wTypeFlags & pythoncom.TYPEFLAG_FDUAL,refAttr.typekind))
            num += 1
        except pythoncom.com_error, details:
            # Ignore these 2 errors, as the are very common and can obscure
            # useful warnings.
            if details.hresult not in [winerror.TYPE_E_CANTLOADLIBRARY,
                              winerror.TYPE_E_LIBNOTREGISTERED]:
                print "** COM error on", info.desc
                print details
        except KeyboardInterrupt:
            print "Interrupted!"
            raise KeyboardInterrupt
        except:
            print "Failed:", info.desc
            traceback.print_exc()
        if makepy.bForDemandDefault:
            # This only builds enums etc by default - build each
            # interface manually
            tinfo = (info.clsid, info.lcid, info.major, info.minor)
            mod = gencache.EnsureModule(info.clsid, info.lcid, info.major, info.minor)
            for name in mod.NamesToIIDMap.iterkeys():
                makepy.GenerateChildFromTypeLibSpec(name, tinfo)
    return num
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号