autodoc.py 文件源码

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

项目:tefla 作者: openAGI 项目源码 文件源码
def get_func_doc(name, func):
    doc_source = ''
    if name in SKIP:
        return ''
    # if name[0] == '_':
    #    return ''
    if func in classes_and_functions:
        return ''
    classes_and_functions.add(func)
    header = name + inspect.formatargspec(*inspect.getargspec(func))
    path = get_src_path(func)
    # FUNC_TEMP = "[{header}]({path})"
    # header = FUNC_TEMP.format(header=header, path=path)
    # print(header)
    docstring = format_func_doc(inspect.getdoc(func), module_name + '.' +
                                header, path)
    print(docstring)

    if docstring != '':
        doc_source += docstring
        doc_source += '\n\n ---------- \n\n'

    return doc_source
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号