MCPcopy Index your code
hub / github.com/idank/explainshell / on_result

Function on_result

explainshell/manager.py:242–263  ·  view source on GitHub ↗
(gz_path: str, entry: ExtractionResult)

Source from the content-addressed store, hash-verified

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

Callers 4

run_sequentialFunction · 0.50
run_parallelFunction · 0.50
run_batchFunction · 0.50
_handle_outputFunction · 0.50

Calls 5

format_diffFunction · 0.90
SkipEntryClass · 0.90
FailureEntryClass · 0.90
add_manpageMethod · 0.80
find_man_pageMethod · 0.45

Tested by

no test coverage detected