(gz_path: str, entry: ExtractionResult)
| 240 | ) |
| 241 | |
| 242 | def on_result(gz_path: str, entry: ExtractionResult) -> None: |
| 243 | short_path = config.source_from_path(gz_path) |
| 244 | if entry.outcome == ExtractionOutcome.SKIPPED: |
| 245 | logger.info("[%s] skipped: %s", short_path, entry.error) |
| 246 | return |
| 247 | if entry.outcome == ExtractionOutcome.FAILED: |
| 248 | logger.error("failed to process %s: %s", short_path, entry.error) |
| 249 | return |
| 250 | name = _manpage.extract_name(gz_path) |
| 251 | logger.info("=== %s ===", short_path) |
| 252 | try: |
| 253 | # Prefer exact source match (fully populated) over name lookup. |
| 254 | try: |
| 255 | results = s.find_man_page(short_path) |
| 256 | except errors.ProgramDoesNotExist: |
| 257 | results = s.find_man_page(name) |
| 258 | stored_mp = results[0] |
| 259 | except errors.ProgramDoesNotExist: |
| 260 | logger.info(" (not in DB, nothing to diff)") |
| 261 | else: |
| 262 | for line in format_diff(stored_mp, entry.mp): |
| 263 | logger.info(line) |
| 264 | |
| 265 | return run( |
| 266 | ext, gz_files, batch_size=batch_size, on_start=on_start, on_result=on_result |
no test coverage detected