Show More
@@ -13,7 +13,7 b' import exceptions' | |||
|
13 | 13 | import os |
|
14 | 14 | from pprint import pprint |
|
15 | 15 | |
|
16 |
from IPython import ultra |
|
|
16 | from IPython.core import ultratb | |
|
17 | 17 | from IPython.utils.ipstruct import Struct |
|
18 | 18 | from IPython.utils.genutils import * |
|
19 | 19 | |
@@ -68,7 +68,7 b' class ConfigLoader:' | |||
|
68 | 68 | # avoid including the same file more than once |
|
69 | 69 | if fname in self.included: |
|
70 | 70 | return data |
|
71 |
Xinfo = ultra |
|
|
71 | Xinfo = ultratb.AutoFormattedTB(color_scheme='NoColor') | |
|
72 | 72 | if convert==None and recurse_key : convert = {qwflat:recurse_key} |
|
73 | 73 | # for production, change warn to 0: |
|
74 | 74 | data.merge(read_dict(fname,convert,fs=self.field_sep,strip=1, |
@@ -632,7 +632,7 b' class IPCompleter(Completer):' | |||
|
632 | 632 | except IndexError: |
|
633 | 633 | return None |
|
634 | 634 | except: |
|
635 |
#from IPython. |
|
|
635 | #from IPython.core.ultratb import AutoFormattedTB; # dbg | |
|
636 | 636 | #tb=AutoFormattedTB('Verbose');tb() #dbg |
|
637 | 637 | |
|
638 | 638 | # If completion fails, don't annoy the user. |
@@ -25,7 +25,7 b' from pprint import pformat' | |||
|
25 | 25 | |
|
26 | 26 | # Our own |
|
27 | 27 | from IPython.core import release |
|
28 |
from IPython import ultra |
|
|
28 | from IPython.core import ultratb | |
|
29 | 29 | from IPython.external.Itpl import itpl |
|
30 | 30 | |
|
31 | 31 | from IPython.utils.genutils import * |
@@ -133,7 +133,7 b' $self.bug_tracker' | |||
|
133 | 133 | # write the report filename into the instance dict so it can get |
|
134 | 134 | # properly expanded out in the user message template |
|
135 | 135 | self.crash_report_fname = report_name |
|
136 |
TBhandler = ultra |
|
|
136 | TBhandler = ultratb.VerboseTB(color_scheme=color_scheme, | |
|
137 | 137 | long_header=1) |
|
138 | 138 | traceback = TBhandler.text(etype,evalue,etb,context=31) |
|
139 | 139 |
@@ -45,7 +45,7 b' import tempfile' | |||
|
45 | 45 | |
|
46 | 46 | # IPython's own modules |
|
47 | 47 | #import IPython |
|
48 |
from IPython import ultra |
|
|
48 | from IPython.core import ultratb | |
|
49 | 49 | from IPython.utils import PyColorize |
|
50 | 50 | from IPython.core import debugger, oinspect |
|
51 | 51 | from IPython.Extensions import pickleshare |
@@ -57,7 +57,7 b' from IPython.core.prompts import CachedOutput' | |||
|
57 | 57 | from IPython.utils.ipstruct import Struct |
|
58 | 58 | from IPython.lib.backgroundjobs import BackgroundJobManager |
|
59 | 59 | from IPython.utils.genutils import * |
|
60 | from IPython.strdispatch import StrDispatch | |
|
60 | from IPython.utils.strdispatch import StrDispatch | |
|
61 | 61 | from IPython.core import ipapi |
|
62 | 62 | import IPython.core.history |
|
63 | 63 | import IPython.core.prefilter as prefilter |
@@ -340,16 +340,16 b' class InputList(list):' | |||
|
340 | 340 | def __getslice__(self,i,j): |
|
341 | 341 | return ''.join(list.__getslice__(self,i,j)) |
|
342 | 342 | |
|
343 |
class SyntaxTB(ultra |
|
|
343 | class SyntaxTB(ultratb.ListTB): | |
|
344 | 344 | """Extension which holds some state: the last exception value""" |
|
345 | 345 | |
|
346 | 346 | def __init__(self,color_scheme = 'NoColor'): |
|
347 |
ultra |
|
|
347 | ultratb.ListTB.__init__(self,color_scheme) | |
|
348 | 348 | self.last_syntax_error = None |
|
349 | 349 | |
|
350 | 350 | def __call__(self, etype, value, elist): |
|
351 | 351 | self.last_syntax_error = value |
|
352 |
ultra |
|
|
352 | ultratb.ListTB.__call__(self,etype,value,elist) | |
|
353 | 353 | |
|
354 | 354 | def clear_err_state(self): |
|
355 | 355 | """Return the current error state and clear it""" |
@@ -714,7 +714,7 b' class InteractiveShell(object,Magic):' | |||
|
714 | 714 | # The interactive one is initialized with an offset, meaning we always |
|
715 | 715 | # want to remove the topmost item in the traceback, which is our own |
|
716 | 716 | # internal code. Valid modes: ['Plain','Context','Verbose'] |
|
717 |
self.InteractiveTB = ultra |
|
|
717 | self.InteractiveTB = ultratb.AutoFormattedTB(mode = 'Plain', | |
|
718 | 718 | color_scheme='NoColor', |
|
719 | 719 | tb_offset = 1) |
|
720 | 720 | |
@@ -725,7 +725,7 b' class InteractiveShell(object,Magic):' | |||
|
725 | 725 | # thread (such as in GUI code) propagate directly to sys.excepthook, |
|
726 | 726 | # and there's no point in printing crash dumps for every user exception. |
|
727 | 727 | if self.isthreaded: |
|
728 |
ipCrashHandler = ultra |
|
|
728 | ipCrashHandler = ultratb.FormattedTB() | |
|
729 | 729 | else: |
|
730 | 730 | from IPython.core import crashhandler |
|
731 | 731 | ipCrashHandler = crashhandler.IPythonCrashHandler(self) |
@@ -106,8 +106,8 b' def make_IPython(argv=None,user_ns=None,user_global_ns=None,debug=1,' | |||
|
106 | 106 | |
|
107 | 107 | if DEVDEBUG: |
|
108 | 108 | # For developer debugging only (global flag) |
|
109 |
from IPython import ultra |
|
|
110 |
sys.excepthook = ultra |
|
|
109 | from IPython.core import ultratb | |
|
110 | sys.excepthook = ultratb.VerboseTB(call_pdb=1) | |
|
111 | 111 | |
|
112 | 112 | IP.BANNER_PARTS = ['Python %s\n' |
|
113 | 113 | 'Type "copyright", "credits" or "license" ' |
@@ -34,7 +34,7 b' except ImportError:' | |||
|
34 | 34 | |
|
35 | 35 | # IPython imports |
|
36 | 36 | import IPython |
|
37 |
from IPython import ultra |
|
|
37 | from IPython.core import ultratb | |
|
38 | 38 | from IPython.core import ipapi |
|
39 | 39 | from IPython.core.magic import Magic |
|
40 | 40 | from IPython.utils.genutils import Term,warn,error,flag_calls, ask_yes_no |
@@ -178,7 +178,7 b' class IPShellEmbed:' | |||
|
178 | 178 | sys.displayhook = self.sys_displayhook_ori |
|
179 | 179 | # don't use the ipython crash handler so that user exceptions aren't |
|
180 | 180 | # trapped |
|
181 |
sys.excepthook = ultra |
|
|
181 | sys.excepthook = ultratb.FormattedTB(color_scheme = self.IP.rc.colors, | |
|
182 | 182 | mode = self.IP.rc.xmode, |
|
183 | 183 | call_pdb = self.IP.rc.pdb) |
|
184 | 184 | self.restore_system_completer() |
@@ -63,3 +63,6 b' def test_import_shell():' | |||
|
63 | 63 | |
|
64 | 64 | def test_import_shellglobals(): |
|
65 | 65 | from IPython.core import shellglobals |
|
66 | ||
|
67 | def test_import_ultratb(): | |
|
68 | from IPython.core import ultratb |
@@ -1,6 +1,6 b'' | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | 2 | """ |
|
3 |
ultra |
|
|
3 | ultratb.py -- Spice up your tracebacks! | |
|
4 | 4 | |
|
5 | 5 | * ColorTB |
|
6 | 6 | I've always found it a bit hard to visually parse tracebacks in Python. The |
@@ -9,8 +9,8 b' traceback in a manner similar to what you would expect from a syntax-highlightin' | |||
|
9 | 9 | text editor. |
|
10 | 10 | |
|
11 | 11 | Installation instructions for ColorTB: |
|
12 |
import sys,ultra |
|
|
13 |
sys.excepthook = ultra |
|
|
12 | import sys,ultratb | |
|
13 | sys.excepthook = ultratb.ColorTB() | |
|
14 | 14 | |
|
15 | 15 | * VerboseTB |
|
16 | 16 | I've also included a port of Ka-Ping Yee's "cgitb.py" that produces all kinds |
@@ -37,8 +37,8 b' Note:' | |||
|
37 | 37 | |
|
38 | 38 | |
|
39 | 39 | Installation instructions for ColorTB: |
|
40 |
import sys,ultra |
|
|
41 |
sys.excepthook = ultra |
|
|
40 | import sys,ultratb | |
|
41 | sys.excepthook = ultratb.VerboseTB() | |
|
42 | 42 | |
|
43 | 43 | Note: Much of the code in this module was lifted verbatim from the standard |
|
44 | 44 | library module 'traceback.py' and Ka-Ping Yee's 'cgitb.py'. |
@@ -103,7 +103,7 b' INDENT_SIZE = 8' | |||
|
103 | 103 | # Default color scheme. This is used, for example, by the traceback |
|
104 | 104 | # formatter. When running in an actual IPython instance, the user's rc.colors |
|
105 | 105 | # value is used, but havinga module global makes this functionality available |
|
106 |
# to users of ultra |
|
|
106 | # to users of ultratb who are NOT running inside ipython. | |
|
107 | 107 | DEFAULT_SCHEME = 'NoColor' |
|
108 | 108 | |
|
109 | 109 | #--------------------------------------------------------------------------- |
@@ -30,7 +30,7 b' separate implementation).' | |||
|
30 | 30 | import sys |
|
31 | 31 | import threading |
|
32 | 32 | |
|
33 |
from IPython. |
|
|
33 | from IPython.core.ultratb import AutoFormattedTB | |
|
34 | 34 | from IPython.utils.genutils import warn,error |
|
35 | 35 | |
|
36 | 36 | class BackgroundJobManager: |
@@ -207,7 +207,7 b' def make_runners():' | |||
|
207 | 207 | 'outputtrap.py', 'platutils.py', 'prefilter.py', 'prompts.py', |
|
208 | 208 | 'PyColorize.py', 'release.py', 'rlineimpl.py', 'shadowns.py', |
|
209 | 209 | 'shellglobals.py', 'strdispatch.py', 'twshell.py', |
|
210 |
'ultra |
|
|
210 | 'ultratb.py', 'upgrade_dir.py', 'usage.py', 'wildcard.py', | |
|
211 | 211 | # See note above for why this is skipped |
|
212 | 212 | # 'shell.py', |
|
213 | 213 | 'winconsole.py'] |
@@ -43,7 +43,7 b' iplib: plugin' | |||
|
43 | 43 | $(NOSE) IPython.core.iplib |
|
44 | 44 | |
|
45 | 45 | strd: plugin |
|
46 | $(NOSE) IPython.strdispatch | |
|
46 | $(NOSE) IPython.core.strdispatch | |
|
47 | 47 | |
|
48 | 48 | engine: plugin |
|
49 | 49 | $(NOSE) IPython.kernel |
|
1 | NO CONTENT: file renamed from IPython/strdispatch.py to IPython/utils/strdispatch.py |
@@ -23,4 +23,7 b' def test_import_PyColorize():' | |||
|
23 | 23 | from IPython.utils import PyColorize |
|
24 | 24 | |
|
25 | 25 | def test_import_rlineimpl(): |
|
26 | from IPython.utils import rlineimpl No newline at end of file | |
|
26 | from IPython.utils import rlineimpl | |
|
27 | ||
|
28 | def test_import_strdispatch(): | |
|
29 | from IPython.utils import strdispatch No newline at end of file |
@@ -135,18 +135,37 b' Where things will be moved' | |||
|
135 | 135 | |
|
136 | 136 | * :file:`ipapi.py`. Move to :file:`IPython.core`. |
|
137 | 137 | |
|
138 | * :file:`iplib.py`. Move to :file:`IPython.core`. | |
|
139 | ||
|
140 | * :file:`ipmaker.py`: Move to :file:`IPython.core`. | |
|
138 | 141 | |
|
142 | * :file:`ipstruct.py`. Move to :file:`IPython.python`. | |
|
143 | ||
|
144 | * :file:`irunner.py`. Move to :file:`IPython.scripts`. ??? | |
|
139 | 145 | |
|
140 | * :file:`Itpl.py`. Remove. Version already in :file:`IPython.external`. | |
|
146 | * :file:`Itpl.py`. Move to :file:`deathrow/Itpl.py`. Copy already in | |
|
147 | :file:`IPython.external`. | |
|
141 | 148 | |
|
142 | 149 | * :file:`Logger.py`. Move to :file:`IPython/core/logger.py`. |
|
143 | 150 | |
|
151 | * :file:`macro.py`. Move to :file:`IPython.core`. | |
|
152 | ||
|
144 | 153 | * :file:`Magic.py`. Move to :file:`IPython/core/magic.py`. |
|
145 | 154 | |
|
146 | 155 | * :file:`OInspect.py`. Move to :file:`IPython/core/oinspect.py`. |
|
147 | 156 | |
|
148 | 157 | * :file:`OutputTrap.py`. Move to :file:`IPython/core/outputtrap.py`. |
|
149 | 158 | |
|
159 | * :file:`platutils.py`. Move to :file:`IPython.python`. | |
|
160 | ||
|
161 | * :file:`platutils_dummy.py`. Move to :file:`IPython.python`. | |
|
162 | ||
|
163 | * :file:`platutils_posix.py`. Move to :file:`IPython.python`. | |
|
164 | ||
|
165 | * :file:`platutils_win32.py`. Move to :file:`IPython.python`. | |
|
166 | ||
|
167 | * :file:`prefilter.py`: Move to :file:`IPython.core`. | |
|
168 | ||
|
150 | 169 | * :file:`Prompts.py`. Move to :file:`IPython/core/prompts.py` or |
|
151 | 170 | :file:`IPython/frontend/prompts.py`. |
|
152 | 171 | |
@@ -156,9 +175,24 b' Where things will be moved' | |||
|
156 | 175 | |
|
157 | 176 | * :file:`Release.py`. Move to ??? or remove? |
|
158 | 177 | |
|
178 | * :file:`rlineimpl.py`. Move to :file:`IPython.core`. | |
|
179 | ||
|
180 | * :file:`shadowns.py`. Move to :file:`IPython.core`. | |
|
181 | ||
|
159 | 182 | * :file:`Shell.py`. Move to :file:`IPython.core.shell.py` or |
|
160 | 183 | :file:`IPython/frontend/shell.py`. |
|
161 | 184 | |
|
185 | * :file:`shellglobals.py`. Move to :file:`IPython.core`. | |
|
186 | ||
|
187 | * :file:`strdispatch.py`. Move to :file:`IPython.python`. | |
|
188 | ||
|
189 | * :file:`testing`. Good where it is. | |
|
190 | ||
|
191 | * :file:`tests`. Good where it is. | |
|
192 | ||
|
193 | * :file:`tools`. Things in here need to be looked at and moved elsewhere like | |
|
194 | :file:`IPython.python`. | |
|
195 | ||
|
162 | 196 | * :file:`UserConfig`. Move to a subdirectory of :file:`IPython.config`. |
|
163 | 197 | |
|
164 | 198 | |
@@ -181,44 +215,25 b' Where things will be moved' | |||
|
181 | 215 | |
|
182 | 216 | |
|
183 | 217 | |
|
184 | * :file:`iplib.py`. Move to :file:`IPython.core`. | |
|
185 | 218 | |
|
186 | * :file:`ipmaker.py`: Move to :file:`IPython.core`. | |
|
187 | 219 | |
|
188 | * :file:`ipstruct.py`. Move to :file:`IPython.python`. | |
|
189 | 220 | |
|
190 | * :file:`irunner.py`. Move to :file:`IPython.scripts`. | |
|
191 | 221 | |
|
192 | 222 | * :file:`kernel`. Good where it is. |
|
193 | 223 | |
|
194 | * :file:`macro.py`. Move to :file:`IPython.core`. | |
|
195 | ||
|
196 | 224 | |
|
197 | 225 | |
|
198 | * :file:`platutils.py`. Move to :file:`IPython.python`. | |
|
199 | 226 | |
|
200 | * :file:`platutils_dummy.py`. Move to :file:`IPython.python`. | |
|
201 | 227 | |
|
202 | * :file:`platutils_posix.py`. Move to :file:`IPython.python`. | |
|
203 | 228 | |
|
204 | * :file:`platutils_win32.py`. Move to :file:`IPython.python`. | |
|
205 | 229 | |
|
206 | * :file:`prefilter.py`: Move to :file:`IPython.core`. | |
|
207 | 230 | |
|
208 | * :file:`rlineimpl.py`. Move to :file:`IPython.core`. | |
|
209 | 231 | |
|
210 | * :file:`shadowns.py`. Move to :file:`IPython.core`. | |
|
211 | 232 | |
|
212 | * :file:`shellglobals.py`. Move to :file:`IPython.core`. | |
|
213 | 233 | |
|
214 | * :file:`strdispatch.py`. Move to :file:`IPython.python`. | |
|
215 | 234 | |
|
216 | * :file:`testing`. Good where it is. | |
|
217 | 235 | |
|
218 | * :file:`tests`. Good where it is. | |
|
219 | 236 | |
|
220 | * :file:`tools`. Things in here need to be looked at and moved elsewhere like | |
|
221 | :file:`IPython.python`. | |
|
222 | 237 | |
|
223 | 238 | * :file:`twshell.py`. Move to :file:`IPython.sandbox`. |
|
224 | 239 |
General Comments 0
You need to be logged in to leave comments.
Login now