MCPcopy
hub / github.com/pallets/click / section

Method section

src/click/formatting.py:274–286  ·  view source on GitHub ↗

Helpful context manager that writes a paragraph, a heading, and the indents. :param name: the section name that is written as heading.

(self, name: str)

Source from the content-addressed store, hash-verified

272
273 @contextmanager
274 def section(self, name: str) -> cabc.Generator[None]:
275 """Helpful context manager that writes a paragraph, a heading,
276 and the indents.
277
278 :param name: the section name that is written as heading.
279 """
280 self.write_paragraph()
281 self.write_heading(name)
282 self.indent()
283 try:
284 yield
285 finally:
286 self.dedent()
287
288 @contextmanager
289 def indentation(self) -> cabc.Generator[None]:

Callers 2

format_optionsMethod · 0.80
format_commandsMethod · 0.80

Calls 4

write_paragraphMethod · 0.95
write_headingMethod · 0.95
indentMethod · 0.95
dedentMethod · 0.95

Tested by

no test coverage detected