MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / disp_len

Function disp_len

pager_lib/tqdm/utils.py:378–383  ·  view source on GitHub ↗

Returns the real on-screen length of a string which may contain ANSI control codes and wide chars.

(data)

Source from the content-addressed store, hash-verified

376
377
378def disp_len(data):
379 """
380 Returns the real on-screen length of a string which may contain
381 ANSI control codes and wide chars.
382 """
383 return _text_width(RE_ANSI.sub('', data))
384
385
386def disp_trim(data, length):

Callers 3

print_statusMethod · 0.85
format_meterMethod · 0.85
disp_trimFunction · 0.85

Calls 1

_text_widthFunction · 0.85

Tested by

no test coverage detected