Skip to content
Myr

Improved support for composable cli

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 9ab5987 · Browse files · 1 file+6 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−6 removed

  • other:+6 added−6 removed

1 file+6 added−6 removed

modified:flask/cli.py+6 added-6 removed
137 unmodified lines
138 necessary to interface with as it's used internally in the dispatching139 to click.140 """141142 def __init__(self):143 self.app_import_path = None144 self.debug = None142 def __init__(self, app_import_path=None, debug=None):143 self.app_import_path = app_import_path144 self.debug = debug145 self._loaded_app = None146147 def get_app_import_path(self):148 """Return the actual application import path or fails if it is
37 unmodified lines
186 f.__flask_without_appcontext__ = True187 return f188189190class FlaskClickGroup(click.Group):190class FlaskGroup(click.Group):191 """Special subclass of the a regular click group that supports192 loading more commands from the configured Flask app.193 """194
48 unmodified lines
243 return click.Group.invoke_subcommand(244 self, ctx, cmd, cmd_name, args)245246247cli = FlaskClickGroup(help='''\247cli = FlaskGroup(help='''\248This shell command acts as general utility script for Flask applications.249250It loads the application configured (either through the FLASK_APP environment251variable or the --app parameter) and then provides commands either provided
93 unmodified lines
345 # we need to ensure that we restore the actual command line so that346 # the reloader can properly operate.347 sys.argv = ['-m', this_module] + sys.argv[1:]348 else:349 name = 'flask'349 name = None350351 cli.main(args=args, prog_name=name, obj=ScriptInfo(),352 auto_envvar_prefix='FLASK')353
3 unmodified lines