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