MCPcopy Create free account
hub / github.com/python/cpython / finish

Method finish

Doc/tools/extensions/pydoc_topics.py:159–188  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

157 self.topics[topic_label] = body + "\n"
158
159 def finish(self) -> None:
160 topics_repr = "\n".join(
161 f" '{topic}': {_repr(self.topics[topic])},"
162 for topic in sorted(self.topics)
163 )
164 topics = f"""\
165# Autogenerated by Sphinx on {asctime()}
166# as part of the release process.
167
168topics = {{
169{topics_repr}
170}}
171"""
172 self.outdir.joinpath("topics.py").write_text(topics, encoding="utf-8")
173
174 module_docs_repr = "\n".join(
175 f" '{module}': '{doc_file}',"
176 for module, doc_file in sorted(self.module_docs.items())
177 )
178 module_docs = f"""\
179# Autogenerated by Sphinx on {asctime()}
180# as part of the release process.
181
182module_docs = {{
183{module_docs_repr}
184}}
185"""
186 self.outdir.joinpath("module_docs.py").write_text(
187 module_docs, encoding="utf-8"
188 )
189
190
191def _display_labels(item: tuple[str, Sequence[tuple[str, str]]]) -> str:

Callers

nothing calls this directly

Calls 5

_reprFunction · 0.70
joinMethod · 0.45
write_textMethod · 0.45
joinpathMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected