commit
c98b8e7d7b
@ -1769,6 +1769,8 @@ class DebuggerUI(FrameVarInfoKeeper):
|
||||
runner = shell.run_bpython_shell
|
||||
elif CONFIG["shell"] == "ptpython" and shell.HAVE_PTPYTHON:
|
||||
runner = shell.run_ptpython_shell
|
||||
elif CONFIG["shell"] == "ptipython" and shell.HAVE_PTIPYTHON:
|
||||
runner = shell.run_ptipython_shell
|
||||
elif CONFIG["shell"] == "classic":
|
||||
runner = shell.run_classic_shell
|
||||
else:
|
||||
|
@ -211,7 +211,7 @@ def edit_config(ui, conf_dict):
|
||||
|
||||
shell_info = urwid.Text("This is the shell that will be "
|
||||
"used when you hit '!'.\n")
|
||||
shells = ["internal", "classic", "ipython", "bpython", "ptpython"]
|
||||
shells = ["internal", "classic", "ipython", "bpython", "ptpython", "ptipython"]
|
||||
known_shell = conf_dict["shell"] in shells
|
||||
shell_edit = urwid.Edit(edit_text=conf_dict["custom_shell"])
|
||||
shell_edit_list_item = urwid.AttrMap(shell_edit, "value")
|
||||
|
@ -11,6 +11,16 @@ except ImportError:
|
||||
else:
|
||||
HAVE_BPYTHON = True
|
||||
|
||||
|
||||
|
||||
try:
|
||||
from ptpython.ipython import embed as ptipython_embed
|
||||
from ptpython.repl import run_config
|
||||
except ImportError:
|
||||
HAVE_PTIPYTHON = False
|
||||
else:
|
||||
HAVE_PTIPYTHON = True
|
||||
|
||||
try:
|
||||
from ptpython.repl import embed as ptpython_embed, run_config
|
||||
except ImportError:
|
||||
@ -237,4 +247,13 @@ def run_ptpython_shell(globals, locals):
|
||||
configure=run_config)
|
||||
|
||||
|
||||
|
||||
def run_ptipython_shell(globals, locals):
|
||||
# Use the default ptpython history
|
||||
import os
|
||||
history_filename = os.path.expanduser('~/.ptpython_history')
|
||||
ptipython_embed(globals.copy(), locals.copy(),
|
||||
history_filename=history_filename,
|
||||
configure=run_config)
|
||||
|
||||
# vim: foldmethod=marker
|
||||
|
Loading…
x
Reference in New Issue
Block a user