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

Function fmt_summary

Tools/c-analyzer/cpython/__main__.py:72–107  ·  view source on GitHub ↗
(analysis)

Source from the content-addressed store, hash-verified

70# the formats
71
72def fmt_summary(analysis):
73 # XXX Support sorting and grouping.
74 supported = []
75 unsupported = []
76 for item in analysis:
77 if item.supported:
78 supported.append(item)
79 else:
80 unsupported.append(item)
81 total = 0
82
83 def section(name, groupitems):
84 nonlocal total
85 items, render = c_analyzer.build_section(name, groupitems,
86 relroot=REPO_ROOT)
87 yield from render()
88 total += len(items)
89
90 yield ''
91 yield '===================='
92 yield 'supported'
93 yield '===================='
94
95 yield from section('types', supported)
96 yield from section('variables', supported)
97
98 yield ''
99 yield '===================='
100 yield 'unsupported'
101 yield '===================='
102
103 yield from section('types', unsupported)
104 yield from section('variables', unsupported)
105
106 yield ''
107 yield f'grand total: {total}'
108
109
110#######################################

Callers

nothing calls this directly

Calls 2

sectionFunction · 0.70
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…