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

Function func_for_letter

bpython/curtsiesfrontend/parse.py:29–41  ·  view source on GitHub ↗

Returns FmtStr constructor for a bpython-style color code

(
    letter_color_code: str, default: str = "k"
)

Source from the content-addressed store, hash-verified

27
28
29def func_for_letter(
30 letter_color_code: str, default: str = "k"
31) -> Callable[..., FmtStr]:
32 """Returns FmtStr constructor for a bpython-style color code"""
33 if letter_color_code == "d":
34 letter_color_code = default
35 elif letter_color_code == "D":
36 letter_color_code = default.upper()
37 return partial(
38 fmtstr,
39 fg=CNAMES[letter_color_code.lower()],
40 bold=letter_color_code.isupper(),
41 )
42
43
44def color_for_letter(letter_color_code: str, default: str = "k") -> str:

Callers 8

matches_linesFunction · 0.85
formatted_argspecFunction · 0.85
formatted_docstringFunction · 0.85
paint_infoboxFunction · 0.85
paint_statusbarFunction · 0.85
display_buffer_linesMethod · 0.85
current_cursor_lineMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected