(resultPath: str, marker: str, messageId: str, query_params: dict)
| 660 | |
| 661 | |
| 662 | def messageIdReport(resultPath: str, marker: str, messageId: str, query_params: dict) -> str: |
| 663 | pkgs = '' if query_params.get('pkgs') == '1' else None |
| 664 | text = messageId + '\n' |
| 665 | e = '[' + messageId + ']\n' |
| 666 | for filename in sorted(glob.glob(resultPath + '/*')): |
| 667 | if not os.path.isfile(filename) or filename.endswith('.diff'): |
| 668 | continue |
| 669 | url = None |
| 670 | inResults = False |
| 671 | for line in open(filename, 'rt'): |
| 672 | if line.startswith('cppcheck: '): |
| 673 | if OLD_VERSION not in line: |
| 674 | # Package results seem to be too old, skip |
| 675 | break |
| 676 | # Current package, parse on |
| 677 | continue |
| 678 | if line.startswith('ftp://'): |
| 679 | url = line |
| 680 | continue |
| 681 | if not inResults: |
| 682 | if line.startswith(marker): |
| 683 | inResults = True |
| 684 | continue |
| 685 | if line.startswith('diff:'): |
| 686 | break |
| 687 | if line.endswith(e): |
| 688 | if url: |
| 689 | text += url |
| 690 | if pkgs is not None: |
| 691 | pkgs += url |
| 692 | url = None |
| 693 | text += line |
| 694 | if pkgs is not None: |
| 695 | return pkgs |
| 696 | return text |
| 697 | |
| 698 | |
| 699 | def headMessageIdReport(resultPath: str, messageId: str, query_params: dict) -> str: |
no test coverage detected