Skip to content
Myr

app.run is not lazy

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

use click.echo for banner messages

authored by David Lord · committed by David Lord · parent 8f5168c · Browse files · 2 files+7 added−5 removed
This commit

State

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

Diff stats

2 files+7 added−5 removed

  • other:+7 added−5 removed

2 files+7 added−5 removed

modified:flask/app.py+1 added-1 removed
931 unmodified lines
932 options.setdefault('use_reloader', self.debug)933 options.setdefault('use_debugger', self.debug)934 options.setdefault('threaded', True)935936 cli.show_server_banner(self.env, self.debug, self.name)936 cli.show_server_banner(self.env, self.debug, self.name, False)937938 from werkzeug.serving import run_simple939940 try:
1367 unmodified lines
modified:flask/cli.py+6 added-4 removed
612 unmodified lines
613614 return new_dir is not None # at least one file was located and loaded615616617def show_server_banner(env, debug, app_import_path, eager_loading=True):617def show_server_banner(env, debug, app_import_path, eager_loading):618 """Show extra startup messages the first time the server is run,619 ignoring the reloader.620 """621 if os.environ.get('WERKZEUG_RUN_MAIN') == 'true':622 return623624 if app_import_path is not None:625 message = ' * Serving Flask app "{0}"'.format(app_import_path)626627 if not eager_loading:628 message += ' (lazy loading)'628 print(message)629630 print(' * Environment: {0}'.format(env))630 click.echo(message)631632 click.echo(' * Environment: {0}'.format(env))633634 if env == 'production':635 click.secho(636 ' WARNING: Do not use the development server in a production'637 ' environment.', fg='red')638 click.secho(' Use a production WSGI server instead.', dim=True)639640 if debug is not None:639 print(' * Debug mode: {0}'.format('on' if debug else 'off'))641 click.echo(' * Debug mode: {0}'.format('on' if debug else 'off'))642643644class CertParamType(click.ParamType):645 """Click option type for the ``--cert`` option. Allows either an
250 unmodified lines