MCPcopy
hub / github.com/celery/celery / get_abbr

Function get_abbr

docs/_ext/celerydocs.py:70–86  ·  view source on GitHub ↗
(pre, rest, type, orig=None)

Source from the content-addressed store, hash-verified

68
69
70def get_abbr(pre, rest, type, orig=None):
71 if pre:
72 for d in APPATTRS, ABBRS:
73 try:
74 return d[pre], rest, d
75 except KeyError:
76 pass
77 raise KeyError('Unknown abbreviation: {} ({})'.format(
78 '.'.join([pre, rest]) if orig is None else orig, type,
79 ))
80 else:
81 for d in APPATTRS, ABBRS:
82 try:
83 return d[rest], '', d
84 except KeyError:
85 pass
86 return ABBR_EMPTY.get(type, DEFAULT_EMPTY), rest, ABBR_EMPTY
87
88
89def resolve(S, type):

Callers 1

resolveFunction · 0.85

Calls 3

formatMethod · 0.45
joinMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected