Skip to content
Myr

Added support for PYTHONSTARTUP to shell command.

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 9bf3615 · Browse files · 1 file+12 added−1 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+12 added−1 removed

  • other:+12 added−1 removed

1 file+12 added−1 removed

modified:flask/cli.py+12 added-1 removed
408 unmodified lines
409 app.import_name,410 app.debug and ' [debug]' or '',411 app.instance_path,412 )413 code.interact(banner=banner, local=app.make_shell_context())413 ctx = {}414415 # Support the regular Python interpreter startup script if someone416 # is using it.417 startup = os.environ.get('PYTHONSTARTUP')418 if startup and os.path.isfile(startup):419 with open(startup, 'r') as f:420 eval(compile(f.read(), startup, 'exec'), ctx)421422 ctx.update(app.make_shell_context())423424 code.interact(banner=banner, local=ctx)425426427cli = FlaskGroup(help="""\428This shell command acts as general utility script for Flask applications.429430It loads the application configured (either through the FLASK_APP environment
33 unmodified lines