MCPcopy
hub / github.com/fluentpython/example-code-2e / final_report

Function final_report

20-executors/getflags/flags2_common.py:52–64  ·  view source on GitHub ↗
(cc_list: list[str],
                 counter: Counter[DownloadStatus],
                 start_time: float)

Source from the content-addressed store, hash-verified

50
51
52def final_report(cc_list: list[str],
53 counter: Counter[DownloadStatus],
54 start_time: float) -> None:
55 elapsed = time.perf_counter() - start_time
56 print('-' * 20)
57 plural = 's' if counter[DownloadStatus.OK] != 1 else ''
58 print(f'{counter[DownloadStatus.OK]:3} flag{plural} downloaded.')
59 if counter[DownloadStatus.NOT_FOUND]:
60 print(f'{counter[DownloadStatus.NOT_FOUND]:3} not found.')
61 if counter[DownloadStatus.ERROR]:
62 plural = 's' if counter[DownloadStatus.ERROR] != 1 else ''
63 print(f'{counter[DownloadStatus.ERROR]:3} error{plural}.')
64 print(f'Elapsed time: {elapsed:.2f}s')
65
66
67def expand_cc_args(every_cc: bool,

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected