| Index: appengine/findit/crash/project_classifier.py
|
| diff --git a/appengine/findit/crash/project_classifier.py b/appengine/findit/crash/project_classifier.py
|
| index 5cc9d9428e2a9439f97780fcdb0e63700a3733fc..ec4de5c5f134669e21b4518cde616f44120422dd 100644
|
| --- a/appengine/findit/crash/project_classifier.py
|
| +++ b/appengine/findit/crash/project_classifier.py
|
| @@ -54,11 +54,11 @@ class ProjectClassifier(object):
|
|
|
| return self._GetProjectFromDepPath(frame.dep_path)
|
|
|
| - # TODO(wrengr): refactor this into a method on Result which returns
|
| + # TODO(wrengr): refactor this into a method on Suspect which returns
|
| # the cannonical frame (and documents why it's the one we return).
|
| - def GetClassFromResult(self, result):
|
| - """Determine which project is responsible for this result."""
|
| - if result.file_to_stack_infos:
|
| + def GetClassFromSuspect(self, suspect):
|
| + """Determine which project is responsible for this suspect."""
|
| + if suspect.file_to_stack_infos:
|
| # file_to_stack_infos is a dict mapping file_path to stack_infos,
|
| # where stack_infos is a list of (frame, callstack_priority)
|
| # pairs. So ``.values()`` returns a list of the stack_infos in an
|
| @@ -66,16 +66,16 @@ class ProjectClassifier(object):
|
| # the second ``[0]`` grabs the first pair from the list; and
|
| # the third ``[0]`` grabs the ``frame`` from the pair.
|
| # TODO(wrengr): why is that the right frame to look at?
|
| - frame = result.file_to_stack_infos.values()[0][0][0]
|
| + frame = suspect.file_to_stack_infos.values()[0][0][0]
|
| return self.GetClassFromStackFrame(frame)
|
|
|
| return ''
|
|
|
| - def Classify(self, results, crash_stack):
|
| + def Classify(self, suspects, crash_stack):
|
| """Classify project of a crash.
|
|
|
| Args:
|
| - results (list of Result): culprit results.
|
| + suspects (list of Suspect): culprit suspects.
|
| crash_stack (CallStack): the callstack that caused the crash.
|
|
|
| Returns:
|
| @@ -102,10 +102,10 @@ class ProjectClassifier(object):
|
| rank_function = _RankFunctionForJava
|
|
|
| top_n_frames = self.project_classifier_config['top_n']
|
| - # If ``results`` are available, we use the projects from there since
|
| + # If ``suspects`` are available, we use the projects from there since
|
| # they're more reliable than the ones from the ``crash_stack``.
|
| - if results:
|
| - classes = map(self.GetClassFromResult, results[:top_n_frames])
|
| + if suspects:
|
| + classes = map(self.GetClassFromSuspect, suspects[:top_n_frames])
|
| else:
|
| classes = map(self.GetClassFromStackFrame,
|
| crash_stack.frames[:top_n_frames])
|
|
|