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

Function decorator

src/flask/cli.py:395–400  ·  view source on GitHub ↗
(ctx: click.Context, /, *args: t.Any, **kwargs: t.Any)

Source from the content-addressed store, hash-verified

393
394 @click.pass_context
395 def decorator(ctx: click.Context, /, *args: t.Any, **kwargs: t.Any) -> t.Any:
396 if not current_app:
397 app = ctx.ensure_object(ScriptInfo).load_app()
398 ctx.with_resource(app.app_context())
399
400 return ctx.invoke(f, *args, **kwargs)
401
402 return update_wrapper(decorator, f) # type: ignore[return-value]
403

Callers 1

as_viewMethod · 0.70

Calls 3

load_appMethod · 0.80
app_contextMethod · 0.80
invokeMethod · 0.45

Tested by

no test coverage detected