def trace(self, frame, event, arg): """Implements a line tracing function.""" if event not in self.valid_events: return self.trace fname = inspectors.find_file(frame) if fname in self.files: lineno = frame.f_lineno curr = (fname, lineno) if curr != self._last: line = linecache.getline(fname, lineno).rstrip() s = format_line(fname, lineno, line, color=self.usecolor, lexer=self.lexer, formatter=self.formatter) print_color(s) self._last = curr return self.trace
def trace(self, frame, event, arg): """Implements a line tracing function.""" if event not in self.valid_events: return self.trace fname = find_file(frame) if fname in self.files: lineno = frame.f_lineno curr = (fname, lineno) if curr != self._last: line = linecache.getline(fname, lineno).rstrip() s = tracer_format_line(fname, lineno, line, color=self.usecolor, lexer=self.lexer, formatter=self.formatter) print_color(s) self._last = curr return self.trace