| 73 | |
| 74 | |
| 75 | def do_check(baseline, checked, excluded, *, verbose_print): |
| 76 | successful = True |
| 77 | for name, baseline_ids in sorted(baseline.items()): |
| 78 | try: |
| 79 | checked_ids = checked[name] |
| 80 | except KeyError: |
| 81 | successful = False |
| 82 | print(f'{name}: (page missing)') |
| 83 | print() |
| 84 | else: |
| 85 | missing_ids = set(baseline_ids) - set(checked_ids) |
| 86 | if missing_ids: |
| 87 | missing_ids = { |
| 88 | a |
| 89 | for a in missing_ids |
| 90 | if not IGNORED_ID_RE.fullmatch(a) |
| 91 | and (name, a) not in excluded |
| 92 | } |
| 93 | if missing_ids: |
| 94 | successful = False |
| 95 | for missing_id in sorted(missing_ids): |
| 96 | print(f'{name}: {missing_id}') |
| 97 | print() |
| 98 | return successful |
| 99 | |
| 100 | |
| 101 | def main(argv): |