(results_path: str)
| 306 | |
| 307 | |
| 308 | def timeoutReport(results_path: str) -> str: |
| 309 | html = '<!DOCTYPE html>\n' |
| 310 | html += '<html><head><title>Timeout report</title></head><body>\n' |
| 311 | html += '<h1>Timeout report</h1>\n' |
| 312 | html += '<pre>\n' |
| 313 | html += '<b>' + fmt('Package', 'Date Time', OLD_VERSION, 'Head', link=False) + '</b>\n' |
| 314 | current_year = datetime.date.today().year |
| 315 | for filename in sorted(glob.glob(os.path.expanduser(results_path + '/*'))): |
| 316 | if not os.path.isfile(filename) or filename.endswith('.diff'): |
| 317 | continue |
| 318 | with open(filename, 'rt') as file_: |
| 319 | datestr = None |
| 320 | for line in file_: |
| 321 | line = line.strip() |
| 322 | if line.startswith('cppcheck: '): |
| 323 | if OLD_VERSION not in line: |
| 324 | # Package results seem to be too old, skip |
| 325 | break |
| 326 | # Current package, parse on |
| 327 | continue |
| 328 | if datestr is None and line.startswith(str(current_year) + '-') or line.startswith(str(current_year - 1) + '-'): |
| 329 | datestr = line |
| 330 | elif line.startswith('count:'): |
| 331 | if line.find('TO!') < 0: |
| 332 | break |
| 333 | package = pkg_from_file(filename) |
| 334 | counts = line.split(' ') |
| 335 | c2 = '' |
| 336 | if counts[2] == 'TO!': |
| 337 | c2 = 'Timeout' |
| 338 | c1 = '' |
| 339 | if counts[1] == 'TO!': |
| 340 | c1 = 'Timeout' |
| 341 | html += fmt(package, datestr, c2, c1) + '\n' |
| 342 | break |
| 343 | |
| 344 | html += '</pre>\n' |
| 345 | html += '</body></html>\n' |
| 346 | return html |
| 347 | |
| 348 | |
| 349 | def staleReport(results_path: str, query_params: dict) -> str: |
no test coverage detected