Show More
@@ -1,12 +1,28 b'' | |||
|
1 |
import |
|
|
1 | import inspect | |
|
2 | 2 | import IPython.ipapi |
|
3 | 3 | from IPython.genutils import arg_split |
|
4 | 4 | ip = IPython.ipapi.get() |
|
5 | 5 | |
|
6 | from IPython import Debugger | |
|
7 | ||
|
6 | 8 | def call_pydb(self, args): |
|
9 | """Invoke pydb with the supplied parameters.""" | |
|
10 | try: | |
|
11 | import pydb | |
|
12 | except ImportError: | |
|
13 | raise ImportError("pydb doesn't seem to be installed.") | |
|
14 | ||
|
15 | if not hasattr(pydb.pydb, "runv"): | |
|
16 | raise ImportError("You need pydb version 1.19 or later installed.") | |
|
17 | ||
|
7 | 18 | argl = arg_split(args) |
|
8 | 19 | # print argl # dbg |
|
9 | ip.IP.history_saving_wrapper( lambda : pydb.runl(*argl) )() | |
|
20 | if len(inspect.getargspec(pydb.runv)[0]) == 2: | |
|
21 | pdb = Debugger.Pdb() | |
|
22 | ip.IP.history_saving_wrapper( lambda : pydb.runv(argl, pdb) )() | |
|
23 | else: | |
|
24 | ip.IP.history_saving_wrapper( lambda : pydb.runv(argl) )() | |
|
25 | ||
|
10 | 26 | |
|
11 | 27 | ip.expose_magic("pydb",call_pydb) |
|
12 | 28 |
General Comments 0
You need to be logged in to leave comments.
Login now