MCPcopy Create free account
hub / github.com/celery/celery / abbr

Function abbr

celery/utils/text.py:63–70  ·  view source on GitHub ↗

Abbreviate word.

(S: str, max: int, ellipsis: str | bool = '...')

Source from the content-addressed store, hash-verified

61
62
63def abbr(S: str, max: int, ellipsis: str | bool = '...') -> str:
64 """Abbreviate word."""
65 if S is None:
66 return '???'
67 if len(S) > max:
68 return isinstance(ellipsis, str) and (
69 S[: max - len(ellipsis)] + ellipsis) or S[: max]
70 return S
71
72
73def abbrtask(S: str, max: int) -> str:

Callers 5

test_abbrFunction · 0.90
format_rowMethod · 0.90
alert_callbackMethod · 0.90
drawMethod · 0.90
abbrtaskFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_abbrFunction · 0.72