MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / indent

Method indent

tools/python-3.11.9-amd64/Lib/pydoc.py:1229–1234  ·  view source on GitHub ↗

Indent text by prepending a given prefix to each line.

(self, text, prefix='    ')

Source from the content-addressed store, hash-verified

1227 return ''.join(ch + '\b' + ch for ch in text)
1228
1229 def indent(self, text, prefix=' '):
1230 """Indent text by prepending a given prefix to each line."""
1231 if not text: return ''
1232 lines = [prefix + line for line in text.split('\n')]
1233 if lines: lines[-1] = lines[-1].rstrip()
1234 return '\n'.join(lines)
1235
1236 def section(self, title, contents):
1237 """Format a section with a given heading."""

Callers 5

sectionMethod · 0.95
docclassMethod · 0.95
docroutineMethod · 0.95
docdataMethod · 0.95
docotherMethod · 0.95

Calls 3

splitMethod · 0.45
rstripMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected