##// END OF EJS Templates
Remove Pydb integration as Pydb is unmaintained and not ion PyPI...
Matthias Bussonnier -
Show More
@@ -0,0 +1,1 b''
1 Integration with pydb has been removed since pydb development has been stopped since 2012, and pydb is not installable from PyPI
@@ -657,8 +657,7 b' class IPCompleter(Completer):'
657
657
658 def all_completions(self, text):
658 def all_completions(self, text):
659 """
659 """
660 Wrapper around the complete method for the benefit of emacs
660 Wrapper around the complete method for the benefit of emacs.
661 and pydb.
662 """
661 """
663 return self.complete(text)[1]
662 return self.complete(text)[1]
664
663
@@ -37,25 +37,10 b' from IPython.utils import coloransi, py3compat'
37 from IPython.core.excolors import exception_colors
37 from IPython.core.excolors import exception_colors
38 from IPython.testing.skipdoctest import skip_doctest
38 from IPython.testing.skipdoctest import skip_doctest
39
39
40 # See if we can use pydb.
41 has_pydb = False
42 prompt = 'ipdb> '
40 prompt = 'ipdb> '
41
43 #We have to check this directly from sys.argv, config struct not yet available
42 #We have to check this directly from sys.argv, config struct not yet available
44 if '--pydb' in sys.argv:
43 from pdb import Pdb as OldPdb
45 try:
46 import pydb
47 if hasattr(pydb.pydb, "runl") and pydb.version>'1.17':
48 # Version 1.17 is broken, and that's what ships with Ubuntu Edgy, so we
49 # better protect against it.
50 has_pydb = True
51 except ImportError:
52 print("Pydb (http://bashdb.sourceforge.net/pydb/) does not seem to be available")
53
54 if has_pydb:
55 from pydb import Pdb as OldPdb
56 prompt = 'ipydb> '
57 else:
58 from pdb import Pdb as OldPdb
59
44
60 # Allow the set_trace code to operate outside of an ipython instance, even if
45 # Allow the set_trace code to operate outside of an ipython instance, even if
61 # it does so with some limitations. The rest of this support is implemented in
46 # it does so with some limitations. The rest of this support is implemented in
@@ -220,14 +205,9 b' class Pdb(OldPdb):'
220 except (TypeError, ValueError):
205 except (TypeError, ValueError):
221 raise ValueError("Context must be a positive integer")
206 raise ValueError("Context must be a positive integer")
222
207
223 if has_pydb and completekey is None:
208 OldPdb.__init__(self,completekey,stdin,stdout)
224 OldPdb.__init__(self,stdin=stdin,stdout=sys.stdout)
225 else:
226 OldPdb.__init__(self,completekey,stdin,stdout)
227
209
228 # IPython changes...
210 # IPython changes...
229 self.is_pydb = has_pydb
230
231 self.shell = get_ipython()
211 self.shell = get_ipython()
232
212
233 if self.shell is None:
213 if self.shell is None:
@@ -236,26 +216,6 b' class Pdb(OldPdb):'
236 TerminalInteractiveShell
216 TerminalInteractiveShell
237 self.shell = TerminalInteractiveShell.instance()
217 self.shell = TerminalInteractiveShell.instance()
238
218
239 if self.is_pydb:
240
241 # interactiveshell.py's ipalias seems to want pdb's checkline
242 # which located in pydb.fn
243 import pydb.fns
244 self.checkline = lambda filename, lineno: \
245 pydb.fns.checkline(self, filename, lineno)
246
247 self.curframe = None
248 self.do_restart = self.new_do_restart
249
250 self.old_all_completions = self.shell.Completer.all_completions
251 self.shell.Completer.all_completions=self.all_completions
252
253 self.do_list = decorate_fn_with_doc(self.list_command_pydb,
254 OldPdb.do_list)
255 self.do_l = self.do_list
256 self.do_frame = decorate_fn_with_doc(self.new_do_frame,
257 OldPdb.do_frame)
258
259 self.aliases = {}
219 self.aliases = {}
260
220
261 # Create color table: we copy the default one from the traceback
221 # Create color table: we copy the default one from the traceback
@@ -482,12 +442,6 b' class Pdb(OldPdb):'
482 return tpl_line % (bp_mark_color + bp_mark, num, line)
442 return tpl_line % (bp_mark_color + bp_mark, num, line)
483
443
484
444
485 def list_command_pydb(self, arg):
486 """List command to use if we have a newer pydb installed"""
487 filename, first, last = OldPdb.parse_list_cmd(self, arg)
488 if filename is not None:
489 self.print_list_lines(filename, first, last)
490
491 def print_list_lines(self, filename, first, last):
445 def print_list_lines(self, filename, first, last):
492 """The printing (as opposed to the parsing part of a 'list'
446 """The printing (as opposed to the parsing part of a 'list'
493 command."""
447 command."""
@@ -31,7 +31,7 b' from io import open as io_open'
31 from pickleshare import PickleShareDB
31 from pickleshare import PickleShareDB
32
32
33 from traitlets.config.configurable import SingletonConfigurable
33 from traitlets.config.configurable import SingletonConfigurable
34 from IPython.core import debugger, oinspect
34 from IPython.core import oinspect
35 from IPython.core import magic
35 from IPython.core import magic
36 from IPython.core import page
36 from IPython.core import page
37 from IPython.core import prefilter
37 from IPython.core import prefilter
@@ -974,7 +974,7 b' class InteractiveShell(SingletonConfigurable):'
974 'Control auto-activation of pdb at exceptions')
974 'Control auto-activation of pdb at exceptions')
975
975
976 def debugger(self,force=False):
976 def debugger(self,force=False):
977 """Call the pydb/pdb debugger.
977 """Call the pdb debugger.
978
978
979 Keywords:
979 Keywords:
980
980
@@ -991,15 +991,9 b' class InteractiveShell(SingletonConfigurable):'
991 error('No traceback has been produced, nothing to debug.')
991 error('No traceback has been produced, nothing to debug.')
992 return
992 return
993
993
994 # use pydb if available
995 if debugger.has_pydb:
996 from pydb import pm
997 else:
998 # fallback to our internal debugger
999 pm = lambda : self.InteractiveTB.debugger(force=True)
1000
994
1001 with self.readline_no_record:
995 with self.readline_no_record:
1002 pm()
996 self.InteractiveTB.debugger(force=True)
1003
997
1004 #-------------------------------------------------------------------------
998 #-------------------------------------------------------------------------
1005 # Things related to IPython's various namespaces
999 # Things related to IPython's various namespaces
@@ -22,7 +22,7 b' from IPython.utils import py3compat'
22 from IPython.utils.contexts import preserve_keys
22 from IPython.utils.contexts import preserve_keys
23 from IPython.utils.path import filefind
23 from IPython.utils.path import filefind
24 from traitlets import (
24 from traitlets import (
25 Unicode, Instance, List, Bool, CaselessStrEnum, default, observe,
25 Unicode, Instance, List, Bool, CaselessStrEnum, observe,
26 )
26 )
27 from IPython.lib.inputhook import guis
27 from IPython.lib.inputhook import guis
28
28
@@ -50,14 +50,6 b" addflag('pdb', 'InteractiveShell.pdb',"
50 "Enable auto calling the pdb debugger after every exception.",
50 "Enable auto calling the pdb debugger after every exception.",
51 "Disable auto calling the pdb debugger after every exception."
51 "Disable auto calling the pdb debugger after every exception."
52 )
52 )
53 # pydb flag doesn't do any config, as core.debugger switches on import,
54 # which is before parsing. This just allows the flag to be passed.
55 shell_flags.update(dict(
56 pydb = ({},
57 """Use the third party 'pydb' package as debugger, instead of pdb.
58 Requires that pydb is installed."""
59 )
60 ))
61 addflag('pprint', 'PlainTextFormatter.pprint',
53 addflag('pprint', 'PlainTextFormatter.pprint',
62 "Enable auto pretty printing of results.",
54 "Enable auto pretty printing of results.",
63 "Disable auto pretty printing of results."
55 "Disable auto pretty printing of results."
@@ -321,7 +313,7 b' class InteractiveShellApp(Configurable):'
321 def _exec_file(self, fname, shell_futures=False):
313 def _exec_file(self, fname, shell_futures=False):
322 try:
314 try:
323 full_filename = filefind(fname, [u'.', self.ipython_dir])
315 full_filename = filefind(fname, [u'.', self.ipython_dir])
324 except IOError as e:
316 except IOError:
325 self.log.warning("File not found: %r"%fname)
317 self.log.warning("File not found: %r"%fname)
326 return
318 return
327 # Make sure that the running script gets a proper sys.argv as if it
319 # Make sure that the running script gets a proper sys.argv as if it
General Comments 0
You need to be logged in to leave comments. Login now