MCPcopy
hub / github.com/pallets/click / to_info_dict

Method to_info_dict

src/click/core.py:1701–1717  ·  view source on GitHub ↗
(self, ctx: Context)

Source from the content-addressed store, hash-verified

1699 )
1700
1701 def to_info_dict(self, ctx: Context) -> dict[str, t.Any]:
1702 info_dict = super().to_info_dict(ctx)
1703 commands = {}
1704
1705 for name in self.list_commands(ctx):
1706 command = self.get_command(ctx, name)
1707
1708 if command is None:
1709 continue
1710
1711 sub_ctx = ctx._make_sub_context(command)
1712
1713 with sub_ctx.scope(cleanup=False):
1714 commands[name] = command.to_info_dict(sub_ctx)
1715
1716 info_dict.update(commands=commands, chain=self.chain)
1717 return info_dict
1718
1719 def add_command(self, cmd: Command, name: str | None = None) -> None:
1720 """Registers another :class:`Command` with this group. If the name

Callers 7

to_info_dictMethod · 0.45
to_info_dictMethod · 0.45
to_info_dictMethod · 0.45
to_info_dictMethod · 0.45
test_parameterFunction · 0.45
test_commandFunction · 0.45
test_paramtype_no_nameFunction · 0.45

Calls 5

list_commandsMethod · 0.95
get_commandMethod · 0.95
_make_sub_contextMethod · 0.80
scopeMethod · 0.80
updateMethod · 0.80

Tested by 3

test_parameterFunction · 0.36
test_commandFunction · 0.36
test_paramtype_no_nameFunction · 0.36