Skip to content
Myr

Fixed the cli system failing syntax errors.

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 1b77a3f · Browse files · 1 file+16 added−4 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+16 added−4 removed

  • other:+16 added−4 removed

1 file+16 added−4 removed

modified:flask/cli.py+16 added-4 removed
259 unmodified lines
260 self.add_command(run_command)261 self.add_command(shell_command)262263 def get_command(self, ctx, name):264 # We load built-in commands first as these should always be the265 # same no matter what the app does. If the app does want to266 # override this it needs to make a custom instance of this group267 # and not attach the default commands.268 #269 # This also means that the script stays functional in case the270 # application completely fails.271 rv = click.Group.get_command(self, ctx, name)272 if rv is not None:273 return rv274275 info = ctx.ensure_object(ScriptInfo)265 # Find the command in the application first, if we can find it.266 # If the app is not available, we just ignore this silently.276 try:277 rv = info.load_app().cli.get_command(ctx, name)278 if rv is not None:279 return rv280 except NoAppException:281 pass273 return click.Group.get_command(self, ctx, name)282283 def list_commands(self, ctx):284 # The commands available is the list of both the application (if285 # available) plus the builtin commands.286 rv = set(click.Group.list_commands(self, ctx))287 info = ctx.ensure_object(ScriptInfo)288 try:289 rv.update(info.load_app().cli.list_commands(ctx))282 except NoAppException:290 except Exception:291 # Here we intentionally swallow all exceptions as we don't292 # want the help page to break if the app does not exist.293 # If someone attempts to use the command we try to create294 # the app again and this will give us the error.295 pass296 return sorted(rv)297298 def invoke_subcommand(self, ctx, cmd, cmd_name, args):
169 unmodified lines