Indent text by prepending a given prefix to each line.
(self, text, prefix=' ')
| 1235 | return ''.join(ch + '\b' + ch for ch in text) |
| 1236 | |
| 1237 | def indent(self, text, prefix=' '): |
| 1238 | """Indent text by prepending a given prefix to each line.""" |
| 1239 | if not text: return '' |
| 1240 | lines = [(prefix + line).rstrip() for line in text.split('\n')] |
| 1241 | return '\n'.join(lines) |
| 1242 | |
| 1243 | def section(self, title, contents): |
| 1244 | """Format a section with a given heading.""" |
no test coverage detected