MCPcopy Create free account
hub / github.com/bpython/bpython / formatted_docstring

Function formatted_docstring

bpython/curtsiesfrontend/replpainter.py:166–184  ·  view source on GitHub ↗
(docstring, columns, config)

Source from the content-addressed store, hash-verified

164
165
166def 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
187def paint_infobox(

Callers 1

paint_infoboxFunction · 0.85

Calls 2

func_for_letterFunction · 0.85
display_linizeFunction · 0.85

Tested by

no test coverage detected