MCPcopy Create free account
hub / github.com/pallets/quart / get_command

Method get_command

src/quart/cli.py:505–523  ·  view source on GitHub ↗
(self, ctx: click.Context, name: str)

Source from the content-addressed store, hash-verified

503 self._loaded_plugin_commands = True
504
505 def get_command(self, ctx: click.Context, name: str) -> click.Command:
506 self._load_plugin_commands()
507
508 rv = super().get_command(ctx, name)
509
510 if rv is not None:
511 return rv
512
513 info = ctx.ensure_object(ScriptInfo)
514
515 # Look up commands provided by the app, showing an error and
516 # continuing if the app couldn't be loaded.
517 try:
518 app = info.load_app()
519 except NoAppException as e:
520 click.secho(f"Error: {e.format_message()}\n", err=True, fg="red")
521 return None
522
523 return app.cli.get_command(ctx, name)
524
525 def list_commands(self, ctx: click.Context) -> list[str]:
526 self._load_plugin_commands()

Callers

nothing calls this directly

Calls 2

_load_plugin_commandsMethod · 0.95
load_appMethod · 0.80

Tested by

no test coverage detected