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

Method make_context

src/flask/cli.py:665–684  ·  view source on GitHub ↗
(
        self,
        info_name: str | None,
        args: list[str],
        parent: click.Context | None = None,
        **extra: t.Any,
    )

Source from the content-addressed store, hash-verified

663 return sorted(rv)
664
665 def make_context(
666 self,
667 info_name: str | None,
668 args: list[str],
669 parent: click.Context | None = None,
670 **extra: t.Any,
671 ) -> click.Context:
672 # Set a flag to tell app.run to become a no-op. If app.run was
673 # not in a __name__ == __main__ guard, it would start the server
674 # when importing, blocking whatever command is being called.
675 os.environ["FLASK_RUN_FROM_CLI"] = "true"
676
677 if "obj" not in extra and "obj" not in self.context_settings:
678 extra["obj"] = ScriptInfo(
679 create_app=self.create_app,
680 set_debug_flag=self.set_debug_flag,
681 load_dotenv_defaults=self.load_dotenv,
682 )
683
684 return super().make_context(info_name, args, parent=parent, **extra)
685
686 def parse_args(self, ctx: click.Context, args: list[str]) -> list[str]:
687 if (not args and self.no_args_is_help) or (

Callers 5

test_run_cert_pathFunction · 0.80
test_run_cert_adhocFunction · 0.80
test_run_cert_importFunction · 0.80
test_run_cert_no_sslFunction · 0.80

Calls 1

ScriptInfoClass · 0.85

Tested by 5

test_run_cert_pathFunction · 0.64
test_run_cert_adhocFunction · 0.64
test_run_cert_importFunction · 0.64
test_run_cert_no_sslFunction · 0.64