本文整理汇总了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