(resultPath: str, messageId: str)
| 523 | |
| 524 | |
| 525 | def diffMessageIdTodayReport(resultPath: str, messageId: str) -> str: |
| 526 | text = messageId + '\n' |
| 527 | e = '[' + messageId + ']\n' |
| 528 | today = strDateTime()[:10] |
| 529 | for filename in sorted(glob.glob(resultPath + '/*.diff')): |
| 530 | if not os.path.isfile(filename): |
| 531 | continue |
| 532 | with open(filename, 'rt') as f: |
| 533 | diff_stats = json.loads(f.read()) |
| 534 | if messageId not in diff_stats['sums']: |
| 535 | continue |
| 536 | if OLD_VERSION not in diff_stats['sums'][messageId]: |
| 537 | continue |
| 538 | if today not in diff_stats["date"]: |
| 539 | continue |
| 540 | |
| 541 | url = None |
| 542 | diff = False |
| 543 | firstLine = True |
| 544 | for line in open(filename[:-5], 'rt'): |
| 545 | if firstLine: |
| 546 | firstLine = False |
| 547 | if not line.startswith(today): |
| 548 | break |
| 549 | if line.startswith('ftp://'): |
| 550 | url = line |
| 551 | elif line == 'diff:\n': |
| 552 | diff = True |
| 553 | elif not diff: |
| 554 | continue |
| 555 | elif line.endswith(e): |
| 556 | if url: |
| 557 | text += url |
| 558 | url = None |
| 559 | text += line |
| 560 | return text |
| 561 | |
| 562 | |
| 563 | def summaryReportFromDict(out: dict, prefix: str, today: str) -> str: |
no test coverage detected