MCPcopy Index your code
hub / github.com/python/cpython / main

Function main

Doc/tools/check-epub.py:12–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11
12def main() -> int:
13 lines = EPUBCHECK_PATH.read_text(encoding='utf-8').splitlines()
14 fatal_errors = [line for line in lines if line.startswith('FATAL')]
15
16 if fatal_errors:
17 err_count = len(fatal_errors)
18 s = 's' * (err_count != 1)
19 print()
20 print(f'Error: epubcheck reported {err_count} fatal error{s}:')
21 print()
22 print('\n'.join(fatal_errors))
23 return 1
24
25 print('Success: no fatal errors found.')
26 return 0
27
28
29if __name__ == '__main__':

Callers 1

check-epub.pyFile · 0.70

Calls 4

splitlinesMethod · 0.45
read_textMethod · 0.45
startswithMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…