2
from IPython.core import ipapi
3
from IPython.utils.process import arg_split
6
from IPython.core import debugger
8
def call_pydb(self, args):
9
"""Invoke pydb with the supplied parameters."""
13
raise ImportError("pydb doesn't seem to be installed.")
15
if not hasattr(pydb.pydb, "runv"):
16
raise ImportError("You need pydb version 1.19 or later installed.")
18
argl = arg_split(args)
20
if len(inspect.getargspec(pydb.runv)[0]) == 2:
21
pdb = debugger.Pdb(color_scheme=self.colors)
22
ip.history_saving_wrapper( lambda : pydb.runv(argl, pdb) )()
24
ip.history_saving_wrapper( lambda : pydb.runv(argl) )()
27
ip.define_magic("pydb",call_pydb)