Permalink
Browse files

Support BPython as a shell.

  • Loading branch information...
1 parent 127388b commit 981340f6948266d81bdc52b344abf6efca6e70e4 @inducer committed May 27, 2012
Showing with 16 additions and 1 deletion.
  1. +2 −0 pudb/debugger.py
  2. +1 −1 pudb/settings.py
  3. +13 −0 pudb/shell.py
View
@@ -1020,6 +1020,8 @@ def run_shell(w, size, key):
import pudb.shell as shell
if shell.HAVE_IPYTHON and CONFIG["shell"] == "ipython":
runner = shell.run_ipython_shell
+ elif shell.HAVE_BPYTHON and CONFIG["shell"] == "bpython":
+ runner = shell.run_bpython_shell
else:
runner = shell.run_classic_shell
View
@@ -179,7 +179,7 @@ def _update_config(check_box, new_state, option_newvalue):
user_data=("line_numbers", None))
shell_info = urwid.Text("This is the shell that will be used when you hit '!'.\n")
- shells = ["classic", "ipython"]
+ shells = ["classic", "ipython", "bpython"]
shell_rb_group = []
shell_rbs = [
View
@@ -5,6 +5,14 @@
else:
HAVE_IPYTHON = True
+try:
+ import bpython
+except ImportError:
+ HAVE_BPYTHON = False
+else:
+ HAVE_BPYTHON = True
+
+
# readline wrangling ----------------------------------------------------------
def setup_readline():
@@ -67,6 +75,11 @@ def run_classic_shell(locals, globals, first_time):
cons.interact(banner)
+def run_bpython_shell(locals, globals, first_time):
+ ns = SetPropagatingDict([locals, globals], locals)
+
+ import bpython.cli
+ bpython.cli.main(locals_=ns)
def run_ipython_shell_v10(locals, globals, first_time):
'''IPython shell from IPython version 0.10'''

0 comments on commit 981340f

Please sign in to comment.