def get_text(self): markup = Report.get_text(self) unxeplained_errors = 0 for run in self.runs.values(): if run.get('error', '').startswith('unexplained'): logging.warning('Unexplained error in \'%s\': %s' % (run.get('run_dir'), run.get('error'))) unxeplained_errors += 1 if unxeplained_errors: logging.warning('There were %s runs with unexplained errors.' % unxeplained_errors) return markup