MCPcopy
hub / github.com/celery/celery / callback

Function callback

celery/bin/control.py:70–87  ·  view source on GitHub ↗
(ctx: click.Context, param, value)

Source from the content-addressed store, hash-verified

68
69def _list_option(type_: _RemoteControlType):
70 def callback(ctx: click.Context, param, value) -> None:
71 if not value:
72 return
73 choices = _get_commands_of_type(type_)
74
75 formatter = click.HelpFormatter()
76
77 with formatter.section(f'{type_.capitalize()} Commands'):
78 command_list = []
79 for command_name, info in choices.items():
80 if info.signature:
81 command_preview = f'{command_name} {info.signature}'
82 else:
83 command_preview = command_name
84 command_list.append((command_preview, info.help))
85 formatter.write_dl(command_list)
86 ctx.obj.echo(formatter.getvalue(), nl=False)
87 ctx.exit()
88
89 return click.option(
90 '--list',

Callers 15

test_moveMethod · 0.85
test_move_transformMethod · 0.85
test_limitMethod · 0.85
test_callbackMethod · 0.85
test_startMethod · 0.85
test_receieve_messageMethod · 0.85
test_revokeMethod · 0.85

Calls 3

_get_commands_of_typeFunction · 0.85
echoMethod · 0.80
itemsMethod · 0.45

Tested by 15

test_moveMethod · 0.68
test_move_transformMethod · 0.68
test_limitMethod · 0.68
test_callbackMethod · 0.68
test_startMethod · 0.68
test_receieve_messageMethod · 0.68
test_revokeMethod · 0.68