commands.py 文件源码

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

项目:vspheretools 作者: devopshq 项目源码 文件源码
def _writepydoc(doc, *args):
    """create pydoc html pages
    doc -- destination directory for documents
    *args -- modules run thru pydoc
    """
    if not os.path.isdir(doc):
        os.makedirs(doc)

    if os.path.curdir not in sys.path:
        sys.path.append(os.path.curdir)

    for f in args:
        if f.startswith('./'): f = f[2:]
        name = os.path.sep.join(f.strip('.py').split(os.path.sep))
        try:
            e = __import__(name)
        except Exception,ex:
            raise
#            _writebrokedoc(doc, ex, name)
#            continue

        if name.endswith('_client'):
            _writeclientdoc(doc, e)
            continue

        if name.endswith('_types'):
            _writetypesdoc(doc, e)
            continue

        try:
            _writedoc(doc, e)
        except IndexError,ex:
            _writebrokedoc(doc, ex, name)
            continue
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号