MCPcopy
hub / github.com/pallets/flask / list_commands

Method list_commands

src/flask/cli.py:644–663  ·  view source on GitHub ↗
(self, ctx: click.Context)

Source from the content-addressed store, hash-verified

642 return app.cli.get_command(ctx, name)
643
644 def list_commands(self, ctx: click.Context) -> list[str]:
645 self._load_plugin_commands()
646 # Start with the built-in and plugin commands.
647 rv = set(super().list_commands(ctx))
648 info = ctx.ensure_object(ScriptInfo)
649
650 # Add commands provided by the app, showing an error and
651 # continuing if the app couldn't be loaded.
652 try:
653 rv.update(info.load_app().cli.list_commands(ctx))
654 except NoAppException as e:
655 # When an app couldn't be loaded, show the error message
656 # without the traceback.
657 click.secho(f"Error: {e.format_message()}\n", err=True, fg="red")
658 except Exception:
659 # When any other errors occurred during loading, show the
660 # full traceback.
661 click.secho(f"{traceback.format_exc()}\n", err=True, fg="red")
662
663 return sorted(rv)
664
665 def make_context(
666 self,

Callers

nothing calls this directly

Calls 3

_load_plugin_commandsMethod · 0.95
setFunction · 0.85
load_appMethod · 0.80

Tested by

no test coverage detected