We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 515a502 + 0837cae commit 58e0878Copy full SHA for 58e0878
flask_shell_ptpython.py
@@ -20,7 +20,8 @@ def shell_command():
20
without having to manually configure the application.
21
"""
22
from flask.globals import _app_ctx_stack
23
- from ptpython.repl import embed
+ from ptpython.repl import embed, run_config
24
+ from ptpython.entry_points.run_ptpython import create_parser, get_config_and_history_file
25
26
app = _app_ctx_stack.top.app
27
ctx = {}
@@ -34,4 +35,15 @@ def shell_command():
34
35
36
ctx.update(app.make_shell_context())
37
- embed(globals=ctx)
38
+ config_file, history_filename = get_config_and_history_file(
39
+ create_parser().parse_args([])
40
+ )
41
+
42
+ def configure(repl):
43
+ run_config(repl, config_file=config_file)
44
45
+ embed(
46
+ globals=ctx,
47
+ history_filename=history_filename,
48
+ configure=configure
49
0 commit comments