[inferTraceBugs] fix selected/displayed bug mismatch

Summary:
inferTraceBugs filters the bugs to only show those which have a trace attached
to them. However, the number selected by the user would then be used in the
unfiltered list of bugs. This led to sometimes selecting the wrong bug from the
text interface and from the --select option.
master
Jules Villard 10 years ago
parent a94fab55e8
commit 5912e607ff

@ -177,13 +177,13 @@ class Selector(object):
describe_report(report, n_length + 2))
n += 1
def prompt_number(self):
def prompt_report(self):
report_number = 0
if self.args.select is not None:
return self.parse_report_number(self.args.select[0], True)
report_number = self.parse_report_number(self.args.select[0], True)
else:
self.show_choices()
report_number = 0
if len(self) > 1:
report_number_str = raw_input(
'Choose report to display (default=0): ')
@ -192,7 +192,7 @@ class Selector(object):
elif len(self) == 1:
print('Auto-selecting the only report.')
return report_number
return self.reports[report_number]
def prompt_level(self):
if self.args.max_level is not None:
@ -258,11 +258,11 @@ def main():
sel.show_choices()
exit(0)
report_number = sel.prompt_number()
report = sel.prompt_report()
max_level = sel.prompt_level()
tracer = Tracer(args, max_level)
tracer.build_report(reports[report_number])
tracer.build_report(report)
print(tracer)

Loading…
Cancel
Save