##// END OF EJS Templates
iplib.py => core/iplib.py and updated tests and imports.
Brian Granger -
Show More
@@ -43,7 +43,7 b' def prefilter_shell(self,line,continuation):'
43 return self._prefilter(line,continuation)
43 return self._prefilter(line,continuation)
44
44
45 # Rebind this to be the new IPython prefilter:
45 # Rebind this to be the new IPython prefilter:
46 from IPython.iplib import InteractiveShell
46 from IPython.core.iplib import InteractiveShell
47 InteractiveShell.prefilter = prefilter_shell
47 InteractiveShell.prefilter = prefilter_shell
48 # Clean up the namespace.
48 # Clean up the namespace.
49 del InteractiveShell,prefilter_shell
49 del InteractiveShell,prefilter_shell
@@ -85,7 +85,7 b' Authors'
85
85
86 import re
86 import re
87
87
88 from IPython.iplib import InteractiveShell
88 from IPython.core.iplib import InteractiveShell
89
89
90 PROMPT_RE = re.compile(r'(^[ \t]*>>> |^[ \t]*\.\.\. )')
90 PROMPT_RE = re.compile(r'(^[ \t]*>>> |^[ \t]*\.\.\. )')
91
91
@@ -52,7 +52,7 b' def prefilter_PQ(self,line,continuation):'
52 imported."""
52 imported."""
53
53
54 from re import match
54 from re import match
55 from IPython.iplib import InteractiveShell
55 from IPython.core.iplib import InteractiveShell
56
56
57 # This regexp is what does the real work
57 # This regexp is what does the real work
58 unit_split = match(r'\s*(\w+)\s*=\s*(-?\d*\.?\d*[eE]?-?\d*)\s+([a-zA-Z].*)',
58 unit_split = match(r'\s*(\w+)\s*=\s*(-?\d*\.?\d*[eE]?-?\d*)\s+([a-zA-Z].*)',
@@ -74,7 +74,7 b' def prefilter_PQ(self,line,continuation):'
74 return InteractiveShell._prefilter(self,line,continuation)
74 return InteractiveShell._prefilter(self,line,continuation)
75
75
76 # Rebind this to be the new IPython prefilter:
76 # Rebind this to be the new IPython prefilter:
77 from IPython.iplib import InteractiveShell
77 from IPython.core.iplib import InteractiveShell
78 InteractiveShell.prefilter = prefilter_PQ
78 InteractiveShell.prefilter = prefilter_PQ
79
79
80 # Clean up the namespace.
80 # Clean up the namespace.
@@ -3309,7 +3309,7 b' Defaulting color scheme to \'NoColor\'"""'
3309
3309
3310 strip_from_start = map(re.compile,strip_re)
3310 strip_from_start = map(re.compile,strip_re)
3311
3311
3312 from IPython import iplib
3312 from IPython.core import iplib
3313 lines = []
3313 lines = []
3314 print "Pasting code; enter '%s' alone on the line to stop." % sentinel
3314 print "Pasting code; enter '%s' alone on the line to stop." % sentinel
3315 while 1:
3315 while 1:
@@ -38,7 +38,7 b' from IPython import ultraTB'
38 from IPython.core import ipapi
38 from IPython.core import ipapi
39 from IPython.Magic import Magic
39 from IPython.Magic import Magic
40 from IPython.utils.genutils import Term,warn,error,flag_calls, ask_yes_no
40 from IPython.utils.genutils import Term,warn,error,flag_calls, ask_yes_no
41 from IPython.iplib import InteractiveShell
41 from IPython.core.iplib import InteractiveShell
42 from IPython.ipmaker import make_IPython
42 from IPython.ipmaker import make_IPython
43 from IPython.ipstruct import Struct
43 from IPython.ipstruct import Struct
44 from IPython.testing import decorators as testdec
44 from IPython.testing import decorators as testdec
@@ -593,8 +593,8 b' execfile'
593
593
594 # execfile example-magic.py
594 # execfile example-magic.py
595
595
596 # Look at the examples in IPython/iplib.py for more details on how these magic
596 # Look at the examples in IPython/core/iplib.py for more details on how
597 # functions need to process their arguments.
597 # these magic functions need to process their arguments.
598
598
599 #---------------------------------------------------------------------------
599 #---------------------------------------------------------------------------
600 # Section: aliases for system shell commands
600 # Section: aliases for system shell commands
1 NO CONTENT: file renamed from IPython/iplib.py to IPython/core/iplib.py
NO CONTENT: file renamed from IPython/iplib.py to IPython/core/iplib.py
@@ -25,5 +25,9 b' def test_import_hooks():'
25 def test_import_ipapi():
25 def test_import_ipapi():
26 from IPython.core import ipapi
26 from IPython.core import ipapi
27
27
28 def test_imort_iplib():
29 from IPython.core import iplib
30
31
28
32
29
33
@@ -13,7 +13,7 b' import tempfile'
13 import nose.tools as nt
13 import nose.tools as nt
14
14
15 # our own packages
15 # our own packages
16 from IPython import iplib
16 from IPython.core import iplib
17 from IPython.core import ipapi
17 from IPython.core import ipapi
18
18
19 #-----------------------------------------------------------------------------
19 #-----------------------------------------------------------------------------
@@ -140,7 +140,7 b' else:'
140 print """*** Type `gphelp` for help on the Gnuplot integration features."""
140 print """*** Type `gphelp` for help on the Gnuplot integration features."""
141
141
142 # Add the new magic functions to the class dict
142 # Add the new magic functions to the class dict
143 from IPython.iplib import InteractiveShell
143 from IPython.core.iplib import InteractiveShell
144 InteractiveShell.magic_gpc = magic_gpc
144 InteractiveShell.magic_gpc = magic_gpc
145 InteractiveShell.magic_gp_set_default = magic_gp_set_default
145 InteractiveShell.magic_gp_set_default = magic_gp_set_default
146
146
@@ -7,7 +7,7 b' import sys'
7 from twisted.internet import reactor, threads
7 from twisted.internet import reactor, threads
8
8
9 from IPython.ipmaker import make_IPython
9 from IPython.ipmaker import make_IPython
10 from IPython.iplib import InteractiveShell
10 from IPython.core.iplib import InteractiveShell
11 from IPython.ipstruct import Struct
11 from IPython.ipstruct import Struct
12 import Queue,thread,threading,signal
12 import Queue,thread,threading,signal
13 from signal import signal, SIGINT
13 from signal import signal, SIGINT
@@ -80,7 +80,7 b' class PrefilterFrontEnd(LineFrontEndBase):'
80 # on exceptions (https://bugs.launchpad.net/bugs/337105)
80 # on exceptions (https://bugs.launchpad.net/bugs/337105)
81 # XXX: This is horrible: module-leve monkey patching -> side
81 # XXX: This is horrible: module-leve monkey patching -> side
82 # effects.
82 # effects.
83 from IPython import iplib
83 from IPython.core import iplib
84 iplib.InteractiveShell.isthreaded = True
84 iplib.InteractiveShell.isthreaded = True
85
85
86 LineFrontEndBase.__init__(self, *args, **kwargs)
86 LineFrontEndBase.__init__(self, *args, **kwargs)
@@ -84,7 +84,7 b' def isolate_ipython0(func):'
84 ipython0.user_ns = user_ns
84 ipython0.user_ns = user_ns
85 ipython0.user_global_ns = global_ns
85 ipython0.user_global_ns = global_ns
86 # Undo the hack at creation of PrefilterFrontEnd
86 # Undo the hack at creation of PrefilterFrontEnd
87 from IPython import iplib
87 from IPythoncore. import iplib
88 iplib.InteractiveShell.isthreaded = False
88 iplib.InteractiveShell.isthreaded = False
89 return out
89 return out
90
90
@@ -26,6 +26,7 b' from thread_ex import ThreadEx'
26 try:
26 try:
27 import IPython
27 import IPython
28 from IPython.utils import genutils
28 from IPython.utils import genutils
29 from IPython.core import iplib
29 except Exception,e:
30 except Exception,e:
30 print "Error importing IPython (%s)" % str(e)
31 print "Error importing IPython (%s)" % str(e)
31 raise Exception, e
32 raise Exception, e
@@ -177,7 +178,7 b' class NonBlockingIPShell(object):'
177 self._IP.set_hook('shell_hook', self._shell)
178 self._IP.set_hook('shell_hook', self._shell)
178
179
179 #we replace the ipython default input command caller by our method
180 #we replace the ipython default input command caller by our method
180 IPython.iplib.raw_input_original = self._raw_input_original
181 iplib.raw_input_original = self._raw_input_original
181 #we replace the ipython default exit command by our method
182 #we replace the ipython default exit command by our method
182 self._IP.exit = ask_exit_handler
183 self._IP.exit = ask_exit_handler
183 #we replace the help command
184 #we replace the help command
@@ -49,7 +49,7 b' from IPython import Release'
49 from IPython.ipstruct import Struct
49 from IPython.ipstruct import Struct
50 from IPython.OutputTrap import OutputTrap
50 from IPython.OutputTrap import OutputTrap
51 from IPython.config.configloader import ConfigLoader
51 from IPython.config.configloader import ConfigLoader
52 from IPython.iplib import InteractiveShell
52 from IPython.core.iplib import InteractiveShell
53 from IPython.usage import cmd_line_usage,interactive_usage
53 from IPython.usage import cmd_line_usage,interactive_usage
54 from IPython.utils.genutils import *
54 from IPython.utils.genutils import *
55
55
@@ -17,7 +17,7 b' __docformat__ = "restructuredtext en"'
17
17
18 import new
18 import new
19
19
20 from IPython.iplib import InteractiveShell
20 from IPython.core.iplib import InteractiveShell
21 from IPython.Shell import MTInteractiveShell
21 from IPython.Shell import MTInteractiveShell
22
22
23 from twisted.internet.defer import Deferred
23 from twisted.internet.defer import Deferred
@@ -39,7 +39,7 b' from IPython.kernel.fcutil import have_crypto'
39
39
40 # Create various ipython directories if they don't exist.
40 # Create various ipython directories if they don't exist.
41 # This must be done before IPython.kernel.config is imported.
41 # This must be done before IPython.kernel.config is imported.
42 from IPython.iplib import user_setup
42 from IPython.core.iplib import user_setup
43 if os.name == 'posix':
43 if os.name == 'posix':
44 rc_suffix = ''
44 rc_suffix = ''
45 else:
45 else:
@@ -41,7 +41,7 b' from IPython.kernel.fcutil import check_furl_file_security'
41
41
42 # Create various ipython directories if they don't exist.
42 # Create various ipython directories if they don't exist.
43 # This must be done before IPython.kernel.config is imported.
43 # This must be done before IPython.kernel.config is imported.
44 from IPython.iplib import user_setup
44 from IPython.core.iplib import user_setup
45 from IPython.utils.genutils import get_ipython_dir, get_log_dir, get_security_dir
45 from IPython.utils.genutils import get_ipython_dir, get_log_dir, get_security_dir
46 if os.name == 'posix':
46 if os.name == 'posix':
47 rc_suffix = ''
47 rc_suffix = ''
@@ -36,7 +36,7 b' from IPython.kernel.engineservice import EngineService'
36
36
37 # Create various ipython directories if they don't exist.
37 # Create various ipython directories if they don't exist.
38 # This must be done before IPython.kernel.config is imported.
38 # This must be done before IPython.kernel.config is imported.
39 from IPython.iplib import user_setup
39 from IPython.core.iplib import user_setup
40 from IPython.utils.genutils import get_ipython_dir, get_log_dir, get_security_dir
40 from IPython.utils.genutils import get_ipython_dir, get_log_dir, get_security_dir
41 if os.name == 'posix':
41 if os.name == 'posix':
42 rc_suffix = ''
42 rc_suffix = ''
@@ -40,7 +40,7 b' excolors: plugin'
40 $(NOSE) IPython.core.excolors
40 $(NOSE) IPython.core.excolors
41
41
42 iplib: plugin
42 iplib: plugin
43 $(NOSE) IPython.iplib
43 $(NOSE) IPython.core.iplib
44
44
45 strd: plugin
45 strd: plugin
46 $(NOSE) IPython.strdispatch
46 $(NOSE) IPython.strdispatch
@@ -195,7 +195,7 b' def start_ipython():'
195
195
196 # So that ipython magics and aliases can be doctested (they work by making
196 # So that ipython magics and aliases can be doctested (they work by making
197 # a call into a global _ip object)
197 # a call into a global _ip object)
198 _ip = IPython.ipapi.get()
198 _ip = ipapi.get()
199 __builtin__._ip = _ip
199 __builtin__._ip = _ip
200
200
201 # Modify the IPython system call with one that uses getoutput, so that we
201 # Modify the IPython system call with one that uses getoutput, so that we
@@ -133,6 +133,9 b' Where things will be moved'
133
133
134 * :file:`hooks.py`. Move to :file:`IPython.core`.
134 * :file:`hooks.py`. Move to :file:`IPython.core`.
135
135
136 * :file:`ipapi.py`. Move to :file:`IPython.core`.
137
138
136
139
137 * :file:`Itpl.py`. Remove. Version already in :file:`IPython.external`.
140 * :file:`Itpl.py`. Remove. Version already in :file:`IPython.external`.
138
141
@@ -176,7 +179,7 b' Where things will be moved'
176
179
177
180
178
181
179 * :file:`ipapi.py`. Move to :file:`IPython.core`.
182
180
183
181 * :file:`iplib.py`. Move to :file:`IPython.core`.
184 * :file:`iplib.py`. Move to :file:`IPython.core`.
182
185
General Comments 0
You need to be logged in to leave comments. Login now