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

Function abbrtask

celery/utils/text.py:73–81  ·  view source on GitHub ↗

Abbreviate task name.

(S: str, max: int)

Source from the content-addressed store, hash-verified

71
72
73def abbrtask(S: str, max: int) -> str:
74 """Abbreviate task name."""
75 if S is None:
76 return '???'
77 if len(S) > max:
78 module, _, cls = S.rpartition('.')
79 module = abbr(module, max - len(cls) - 3, False)
80 return module + '[.]' + cls
81 return S
82
83
84def indent(t: str, indent: int = 0, sep: str = '\n') -> str:

Callers 2

test_abbrtaskFunction · 0.90
format_rowMethod · 0.90

Calls 1

abbrFunction · 0.85

Tested by 1

test_abbrtaskFunction · 0.72