plugin.py 文件源码

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

项目:haros_plugins 作者: git-afsantos 项目源码 文件源码
def package_analysis(iface, scope):
    FNULL   = open(os.devnull, "w")
    output  = open(scope.id + ".xml", "w")
    try:
        subprocess.call(["cppcheck", "--xml-version=2", "--enable=all",
                            "--rule-file=" + iface.get_file("rules.xml"),
                            scope.path
                        ], stdout=FNULL, stderr=output)
    finally:
        FNULL.close()
        output.close()
    files   = file_mapping(scope)
    try:
        xml     = ET.parse(scope.id + ".xml").getroot()
        errors  = xml.find("errors")
        for error in errors:
            handle_report(iface, files, error)
    except ET.ParseError as e:
        pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号