##// END OF EJS Templates
don't use deprecated ipapi.get...
MinRK -
Show More
@@ -33,7 +33,6 b' import sys'
33
33
34 from IPython import get_ipython
34 from IPython import get_ipython
35 from IPython.utils import PyColorize, ulinecache
35 from IPython.utils import PyColorize, ulinecache
36 from IPython.core import ipapi
37 from IPython.utils import coloransi, io, py3compat
36 from IPython.utils import coloransi, io, py3compat
38 from IPython.core.excolors import exception_colors
37 from IPython.core.excolors import exception_colors
39
38
@@ -205,7 +204,7 b' class Pdb(OldPdb):'
205 # IPython changes...
204 # IPython changes...
206 self.is_pydb = has_pydb
205 self.is_pydb = has_pydb
207
206
208 self.shell = ipapi.get()
207 self.shell = get_ipython()
209
208
210 if self.is_pydb:
209 if self.is_pydb:
211
210
@@ -34,7 +34,7 b' import tempfile'
34
34
35 from io import UnsupportedOperation
35 from io import UnsupportedOperation
36
36
37 from IPython.core import ipapi
37 from IPython import get_ipython
38 from IPython.core.error import TryNext
38 from IPython.core.error import TryNext
39 from IPython.utils.data import chop
39 from IPython.utils.data import chop
40 from IPython.utils import io
40 from IPython.utils import io
@@ -158,7 +158,7 b' def page(strng, start=0, screen_lines=0, pager_cmd=None):'
158 start = max(0, start)
158 start = max(0, start)
159
159
160 # first, try the hook
160 # first, try the hook
161 ip = ipapi.get()
161 ip = get_ipython()
162 if ip:
162 if ip:
163 try:
163 try:
164 ip.hooks.show_in_pager(strng)
164 ip.hooks.show_in_pager(strng)
@@ -18,7 +18,7 b' test_run.py calls it.'
18 #-----------------------------------------------------------------------------
18 #-----------------------------------------------------------------------------
19 import sys
19 import sys
20
20
21 from IPython.core import ipapi
21 from IPython import get_ipython
22
22
23 #-----------------------------------------------------------------------------
23 #-----------------------------------------------------------------------------
24 # Globals
24 # Globals
@@ -29,7 +29,7 b' from IPython.core import ipapi'
29 # want to prevent.
29 # want to prevent.
30 if __name__ == '__main__':
30 if __name__ == '__main__':
31
31
32 ip = ipapi.get()
32 ip = get_ipython()
33
33
34 if not '_refbug_cache' in ip.user_ns:
34 if not '_refbug_cache' in ip.user_ns:
35 ip.user_ns['_refbug_cache'] = []
35 ip.user_ns['_refbug_cache'] = []
@@ -99,7 +99,8 b' from inspect import getsourcefile, getfile, getmodule,\\'
99
99
100 # IPython's own modules
100 # IPython's own modules
101 # Modified pdb which doesn't damage IPython's readline handling
101 # Modified pdb which doesn't damage IPython's readline handling
102 from IPython.core import debugger, ipapi
102 from IPython import get_ipython
103 from IPython.core import debugger
103 from IPython.core.display_trap import DisplayTrap
104 from IPython.core.display_trap import DisplayTrap
104 from IPython.core.excolors import exception_colors
105 from IPython.core.excolors import exception_colors
105 from IPython.utils import PyColorize
106 from IPython.utils import PyColorize
@@ -279,7 +280,7 b' def _format_traceback_lines(lnum, index, lines, Colors, lvals=None,scheme=None):'
279
280
280 # This lets us get fully syntax-highlighted tracebacks.
281 # This lets us get fully syntax-highlighted tracebacks.
281 if scheme is None:
282 if scheme is None:
282 ipinst = ipapi.get()
283 ipinst = get_ipython()
283 if ipinst is not None:
284 if ipinst is not None:
284 scheme = ipinst.colors
285 scheme = ipinst.colors
285 else:
286 else:
@@ -602,7 +603,7 b' class ListTB(TBTools):'
602
603
603 # sync with user hooks
604 # sync with user hooks
604 if have_filedata:
605 if have_filedata:
605 ipinst = ipapi.get()
606 ipinst = get_ipython()
606 if ipinst is not None:
607 if ipinst is not None:
607 ipinst.hooks.synchronize_with_editor(value.filename, value.lineno, 0)
608 ipinst.hooks.synchronize_with_editor(value.filename, value.lineno, 0)
608
609
@@ -957,7 +958,7 b' class VerboseTB(TBTools):'
957 filepath, lnum = records[-1][1:3]
958 filepath, lnum = records[-1][1:3]
958 #print "file:", str(file), "linenb", str(lnum) # dbg
959 #print "file:", str(file), "linenb", str(lnum) # dbg
959 filepath = os.path.abspath(filepath)
960 filepath = os.path.abspath(filepath)
960 ipinst = ipapi.get()
961 ipinst = get_ipython()
961 if ipinst is not None:
962 if ipinst is not None:
962 ipinst.hooks.synchronize_with_editor(filepath, lnum, 0)
963 ipinst.hooks.synchronize_with_editor(filepath, lnum, 0)
963 # vds: <<
964 # vds: <<
General Comments 0
You need to be logged in to leave comments. Login now