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

Function _env_file_callback

src/quart/cli.py:415–435  ·  view source on GitHub ↗
(
    ctx: click.Context, param: click.Option, value: str | None
)

Source from the content-addressed store, hash-verified

413
414
415def _env_file_callback(
416 ctx: click.Context, param: click.Option, value: str | None
417) -> str | None:
418 if value is None:
419 return None
420
421 import importlib
422
423 try:
424 importlib.import_module("dotenv")
425 except ImportError:
426 raise click.BadParameter(
427 "python-dotenv must be installed to load an env file.",
428 ctx=ctx,
429 param=param,
430 ) from None
431
432 # Don't check QUART_SKIP_DOTENV, that only disables automatically
433 # loading .env and .quartenv files.
434 load_dotenv(value)
435 return value
436
437
438# This option is eager so env vars are loaded as early as possible to be

Callers

nothing calls this directly

Calls 1

load_dotenvFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…