(docstring, columns, config)
| 164 | |
| 165 | |
| 166 | def formatted_docstring(docstring, columns, config): |
| 167 | if isinstance(docstring, bytes): |
| 168 | docstring = docstring.decode("utf8") |
| 169 | elif isinstance(docstring, str): |
| 170 | pass |
| 171 | else: |
| 172 | # TODO: fail properly here and catch possible exceptions in callers. |
| 173 | return [] |
| 174 | color = func_for_letter(config.color_scheme["comment"]) |
| 175 | return sum( |
| 176 | ( |
| 177 | [ |
| 178 | color(x) |
| 179 | for x in (display_linize(line, columns) if line else fmtstr("")) |
| 180 | ] |
| 181 | for line in docstring.split("\n") |
| 182 | ), |
| 183 | [], |
| 184 | ) |
| 185 | |
| 186 | |
| 187 | def paint_infobox( |
no test coverage detected