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

Method __init__

src/flask/cli.py:305–331  ·  view source on GitHub ↗
(
        self,
        app_import_path: str | None = None,
        create_app: t.Callable[..., Flask] | None = None,
        set_debug_flag: bool = True,
        load_dotenv_defaults: bool = True,
    )

Source from the content-addressed store, hash-verified

303 """
304
305 def __init__(
306 self,
307 app_import_path: str | None = None,
308 create_app: t.Callable[..., Flask] | None = None,
309 set_debug_flag: bool = True,
310 load_dotenv_defaults: bool = True,
311 ) -> None:
312 #: Optionally the import path for the Flask application.
313 self.app_import_path = app_import_path
314 #: Optionally a function that is passed the script info to create
315 #: the instance of the application.
316 self.create_app = create_app
317 #: A dictionary with arbitrary data that can be associated with
318 #: this script info.
319 self.data: dict[t.Any, t.Any] = {}
320 self.set_debug_flag = set_debug_flag
321
322 self.load_dotenv_defaults = get_load_dotenv(load_dotenv_defaults)
323 """Whether default ``.flaskenv`` and ``.env`` files should be loaded.
324
325 ``ScriptInfo`` doesn't load anything, this is for reference when doing
326 the load elsewhere during processing.
327
328 .. versionadded:: 3.1
329 """
330
331 self._loaded_app: Flask | None = None
332
333 def load_app(self) -> Flask:
334 """Loads the Flask app (if not yet loaded) and returns it. Calling

Callers 1

__init__Method · 0.45

Calls 1

get_load_dotenvFunction · 0.85

Tested by

no test coverage detected