makepy.py 文件源码

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

项目:CodeReader 作者: jasonrbr 项目源码 文件源码
def ShowInfo(spec):
    if not spec:
        tlbSpec = selecttlb.SelectTlb(excludeFlags=selecttlb.FLAG_HIDDEN)
        if tlbSpec is None:
            return
        try:
            tlb = pythoncom.LoadRegTypeLib(tlbSpec.clsid, tlbSpec.major, tlbSpec.minor, tlbSpec.lcid)
        except pythoncom.com_error: # May be badly registered.
            sys.stderr.write("Warning - could not load registered typelib '%s'\n" % (tlbSpec.clsid))
            tlb = None

        infos = [(tlb, tlbSpec)]
    else:
        infos = GetTypeLibsForSpec(spec)
    for (tlb, tlbSpec) in infos:
        desc = tlbSpec.desc
        if desc is None:
            if tlb is None:
                desc = "<Could not load typelib %s>" % (tlbSpec.dll)
            else:
                desc = tlb.GetDocumentation(-1)[0]
        print(desc)
        print(" %s, lcid=%s, major=%s, minor=%s" % (tlbSpec.clsid, tlbSpec.lcid, tlbSpec.major, tlbSpec.minor))
        print(" >>> # Use these commands in Python code to auto generate .py support")
        print(" >>> from win32com.client import gencache")
        print(" >>> gencache.EnsureModule('%s', %s, %s, %s)" % (tlbSpec.clsid, tlbSpec.lcid, tlbSpec.major, tlbSpec.minor))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号