OpenQuizz
Une application de gestion des contenus pédagogiques
flask.cli Namespace Reference

Data Structures

class  AppGroup
 
class  CertParamType
 
class  DispatchingApp
 
class  FlaskGroup
 
class  NoAppException
 
class  ScriptInfo
 
class  SeparatedPathType
 

Functions

def find_best_app (script_info, module)
 
def call_factory (script_info, app_factory, arguments=())
 
def find_app_by_string (script_info, module, app_name)
 
def prepare_import (path)
 
def locate_app (script_info, module_name, app_name, raise_if_not_found=True)
 
def get_version (ctx, param, value)
 
def with_appcontext (f)
 
def load_dotenv (path=None)
 
def show_server_banner (env, debug, app_import_path, eager_loading)
 
def run_command (info, host, port, reload, debugger, eager_loading, with_threads, cert, extra_files)
 
def shell_command ()
 
def routes_command (sort, all_methods)
 
def main (as_module=False)
 

Variables

 dotenv = None
 
 ssl = None
 
 version_option
 
 pass_script_info = click.make_pass_decorator(ScriptInfo, ensure=True)
 
 cli
 
 as_module
 

Function Documentation

◆ call_factory()

def flask.cli.call_factory (   script_info,
  app_factory,
  arguments = () 
)
Takes an app factory, a ``script_info` object and  optionally a tuple
of arguments. Checks for the existence of a script_info argument and calls
the app_factory depending on that and the arguments provided.

◆ find_app_by_string()

def flask.cli.find_app_by_string (   script_info,
  module,
  app_name 
)
Checks if the given string is a variable name or a function. If it is a
function, it checks for specified arguments and whether it takes a
``script_info`` argument and calls the function with the appropriate
arguments.

◆ find_best_app()

def flask.cli.find_best_app (   script_info,
  module 
)
Given a module instance this tries to find the best possible
application in the module or raises an exception.

◆ get_version()

def flask.cli.get_version (   ctx,
  param,
  value 
)

◆ load_dotenv()

def flask.cli.load_dotenv (   path = None)
Load "dotenv" files in order of precedence to set environment variables.

If an env var is already set it is not overwritten, so earlier files in the
list are preferred over later files.

Changes the current working directory to the location of the first file
found, with the assumption that it is in the top level project directory
and will be where the Python path should import local packages from.

This is a no-op if `python-dotenv`_ is not installed.

.. _python-dotenv: https://github.com/theskumar/python-dotenv#readme

:param path: Load the file at this location instead of searching.
:return: ``True`` if a file was loaded.

.. versionchanged:: 1.1.0
    Returns ``False`` when python-dotenv is not installed, or when
    the given path isn't a file.

.. versionadded:: 1.0

◆ locate_app()

def flask.cli.locate_app (   script_info,
  module_name,
  app_name,
  raise_if_not_found = True 
)

◆ main()

def flask.cli.main (   as_module = False)

◆ prepare_import()

def flask.cli.prepare_import (   path)
Given a filename this will try to calculate the python path, add it
to the search path and return the actual module name that is expected.

◆ routes_command()

def flask.cli.routes_command (   sort,
  all_methods 
)
Show all registered routes with endpoints and methods.

◆ run_command()

def flask.cli.run_command (   info,
  host,
  port,
  reload,
  debugger,
  eager_loading,
  with_threads,
  cert,
  extra_files 
)
Run a local development server.

This server is for development purposes only. It does not provide
the stability, security, or performance of production WSGI servers.

The reloader and debugger are enabled by default if
FLASK_ENV=development or FLASK_DEBUG=1.

◆ shell_command()

def flask.cli.shell_command ( )
Run an interactive Python shell in the context of a given
Flask application.  The application will populate the default
namespace of this shell according to it's configuration.

This is useful for executing small snippets of management code
without having to manually configure the application.

◆ show_server_banner()

def flask.cli.show_server_banner (   env,
  debug,
  app_import_path,
  eager_loading 
)
Show extra startup messages the first time the server is run,
ignoring the reloader.

◆ with_appcontext()

def flask.cli.with_appcontext (   f)
Wraps a callback so that it's guaranteed to be executed with the
script's application context.  If callbacks are registered directly
to the ``app.cli`` object then they are wrapped with this function
by default unless it's disabled.

Variable Documentation

◆ as_module

as_module

◆ cli

cli
Initial value:
1 = FlaskGroup(
2  help=.format(
3  cmd="export" if os.name == "posix" else "set",
4  prefix="$ " if os.name == "posix" else "> ",
5  )
6 )

◆ dotenv

dotenv = None

◆ pass_script_info

pass_script_info = click.make_pass_decorator(ScriptInfo, ensure=True)

◆ ssl

ssl = None

◆ version_option

version_option
Initial value:
2  ["--version"],
3  help="Show the flask version",
4  expose_value=False,
5  callback=get_version,
6  is_flag=True,
7  is_eager=True,
8 )
click.core.Option
Definition: core.py:1653
jsonschema._validators.format
def format(validator, format, instance, schema)
Definition: _validators.py:205