Show More
@@ -1,15 +1,31 b'' | |||||
1 |
import |
|
1 | import inspect | |
2 | import IPython.ipapi |
|
2 | import IPython.ipapi | |
3 | from IPython.genutils import arg_split |
|
3 | from IPython.genutils import arg_split | |
4 | ip = IPython.ipapi.get() |
|
4 | ip = IPython.ipapi.get() | |
5 |
|
5 | |||
|
6 | from IPython import Debugger | |||
|
7 | ||||
6 | def call_pydb(self, args): |
|
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 | argl = arg_split(args) |
|
18 | argl = arg_split(args) | |
8 | # print argl # dbg |
|
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 | ip.expose_magic("pydb",call_pydb) |
|
27 | ip.expose_magic("pydb",call_pydb) | |
12 |
|
28 | |||
13 |
|
29 | |||
14 |
|
30 | |||
15 | No newline at end of file |
|
31 |
General Comments 0
You need to be logged in to leave comments.
Login now