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

Method format_options

celery/bin/base.py:249–262  ·  view source on GitHub ↗

Write all the options into the formatter if they exist.

(self, ctx, formatter)

Source from the content-addressed store, hash-verified

247 """Customized command for Celery."""
248
249 def format_options(self, ctx, formatter):
250 """Write all the options into the formatter if they exist."""
251 opts = OrderedDict()
252 for param in self.get_params(ctx):
253 rv = param.get_help_record(ctx)
254 if rv is not None:
255 if hasattr(param, 'help_group') and param.help_group:
256 opts.setdefault(str(param.help_group), []).append(rv)
257 else:
258 opts.setdefault('Options', []).append(rv)
259
260 for name, opts_group in opts.items():
261 with formatter.section(name):
262 formatter.write_dl(opts_group)
263
264
265class DaemonOption(CeleryOption):

Callers

nothing calls this directly

Calls 3

OrderedDictClass · 0.90
setdefaultMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected