MCPcopy
hub / github.com/celery/celery / maybe_abbr

Function maybe_abbr

celery/bin/graph.py:140–150  ·  view source on GitHub ↗
(l, name, max=Wmax)

Source from the content-addressed store, hash-verified

138 Tmax = int(args.get('tmax', 3) or 0)
139
140 def maybe_abbr(l, name, max=Wmax):
141 size = len(l)
142 abbr = max and size > max
143 if 'enumerate' in args:
144 l = [f'{name}{subscript(i + 1)}'
145 for i, obj in enumerate(l)]
146 if abbr:
147 l = l[0:max - 1] + [l[size - 1]]
148 l[max - 2] = '{}⎨…{}⎬'.format(
149 name[0], subscript(size - (max - 1)))
150 return l
151
152 app = ctx.obj.app
153 try:

Callers 1

workersFunction · 0.85

Calls 2

subscriptFunction · 0.85
formatMethod · 0.45

Tested by

no test coverage detected