__init__.py 文件源码

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

项目:bolero 作者: rock-learning 项目源码 文件源码
def format_parser_error(name, error, filename, state, lineno, do_unicode_warning):

    warning = '%s: Unable to parse xml file "%s". ' % (name, filename)
    explanation = 'Reported error: %s. ' % error

    unicode_explanation_text = ""
    unicode_explanation = []
    if do_unicode_warning:
        unicode_explanation_text = textwrap.dedent("""
        Parsing errors are often due to unicode errors associated with the encoding of the original
        source files. Doxygen propagates invalid characters from the input source files to the
        output xml.""").strip().replace("\n", " ")
        unicode_explanation = [nodes.paragraph("", "", nodes.Text(unicode_explanation_text))]

    return [nodes.warning("",
                nodes.paragraph("", "", nodes.Text(warning)),
                nodes.paragraph("", "", nodes.Text(explanation)),
                *unicode_explanation
                ),
            state.document.reporter.warning(warning + explanation + unicode_explanation_text, line=lineno)
            ]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号