当前位置: 首页>>代码示例>>Python>>正文


Python Report.is_usable方法代码示例

本文整理汇总了Python中report.Report.is_usable方法的典型用法代码示例。如果您正苦于以下问题:Python Report.is_usable方法的具体用法?Python Report.is_usable怎么用?Python Report.is_usable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在report.Report的用法示例。


在下文中一共展示了Report.is_usable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: CrashAnalyzer

# 需要导入模块: from report import Report [as 别名]
# 或者: from report.Report import is_usable [as 别名]
parser.add_argument('-v', '--verbose', action='count', help='increases the verbosity level')
parser.add_argument('-a', '--all', action='store_true', help='output all extracted information')
args = parser.parse_args()


crashalyzer = CrashAnalyzer()
crashes     = []
curr        = 1
out         = None
for entry in args.f:
    if os.path.isfile(entry):
        with open(entry, 'r') as file:
            print("[*] processing file %i of %i" % (curr, len(args.f)))
            curr += 1
            report = Report(file)
            if not report.is_usable():
                print("[!] unusable report: %s, skipping" % report.filename)
            else:
                crashes.append(crashalyzer.analyze_report(report))
    else:
        print("[!] could not open file %s, skipping" % entry)

if args.unique:
    unique_crashes = []
    for crash in crashes:
        if not crash in unique_crashes:
            unique_crashes.append(crash)
        else:
            print("[*] %s is (likely) a duplicate of %s" % (crash.id, unique_crashes[unique_crashes.index(crash)].id))

    crashes = unique_crashes
开发者ID:saelo,项目名称:iCrashalyzer,代码行数:33,代码来源:main.py


注:本文中的report.Report.is_usable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。