MCPcopy Index your code
hub / github.com/python/cpython / left_align

Function left_align

Lib/_pyrepl/completing_reader.py:63–69  ·  view source on GitHub ↗
(s: str, maxlen: int)

Source from the content-addressed store, hash-verified

61
62
63def left_align(s: str, maxlen: int) -> str:
64 stripped = stripcolor(s)
65 if len(stripped) > maxlen:
66 # too bad, we remove the color
67 return stripped[:maxlen]
68 padding = maxlen - len(stripped)
69 return s + ' '*padding
70
71
72def build_menu(

Callers 1

build_menuFunction · 0.85

Calls 1

stripcolorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…