##// END OF EJS Templates
- R. Bernstein's patches (minor reworks) to provide full syntax highlight in...
fperez -
Show More
@@ -1,505 +1,518 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """
2 """
3 Pdb debugger class.
3 Pdb debugger class.
4
4
5 Modified from the standard pdb.Pdb class to avoid including readline, so that
5 Modified from the standard pdb.Pdb class to avoid including readline, so that
6 the command line completion of other programs which include this isn't
6 the command line completion of other programs which include this isn't
7 damaged.
7 damaged.
8
8
9 In the future, this class will be expanded with improvements over the standard
9 In the future, this class will be expanded with improvements over the standard
10 pdb.
10 pdb.
11
11
12 The code in this file is mainly lifted out of cmd.py in Python 2.2, with minor
12 The code in this file is mainly lifted out of cmd.py in Python 2.2, with minor
13 changes. Licensing should therefore be under the standard Python terms. For
13 changes. Licensing should therefore be under the standard Python terms. For
14 details on the PSF (Python Software Foundation) standard license, see:
14 details on the PSF (Python Software Foundation) standard license, see:
15
15
16 http://www.python.org/2.2.3/license.html
16 http://www.python.org/2.2.3/license.html
17
17
18 $Id: Debugger.py 2154 2007-03-19 00:10:07Z fperez $"""
18 $Id: Debugger.py 2155 2007-03-19 00:45:51Z fperez $"""
19
19
20 #*****************************************************************************
20 #*****************************************************************************
21 #
21 #
22 # Since this file is essentially a modified copy of the pdb module which is
22 # Since this file is essentially a modified copy of the pdb module which is
23 # part of the standard Python distribution, I assume that the proper procedure
23 # part of the standard Python distribution, I assume that the proper procedure
24 # is to maintain its copyright as belonging to the Python Software Foundation
24 # is to maintain its copyright as belonging to the Python Software Foundation
25 # (in addition to my own, for all new code).
25 # (in addition to my own, for all new code).
26 #
26 #
27 # Copyright (C) 2001 Python Software Foundation, www.python.org
27 # Copyright (C) 2001 Python Software Foundation, www.python.org
28 # Copyright (C) 2005-2006 Fernando Perez. <fperez@colorado.edu>
28 # Copyright (C) 2005-2006 Fernando Perez. <fperez@colorado.edu>
29 #
29 #
30 # Distributed under the terms of the BSD License. The full license is in
30 # Distributed under the terms of the BSD License. The full license is in
31 # the file COPYING, distributed as part of this software.
31 # the file COPYING, distributed as part of this software.
32 #
32 #
33 #*****************************************************************************
33 #*****************************************************************************
34
34
35 from IPython import Release
35 from IPython import Release
36 __author__ = '%s <%s>' % Release.authors['Fernando']
36 __author__ = '%s <%s>' % Release.authors['Fernando']
37 __license__ = 'Python'
37 __license__ = 'Python'
38
38
39 import bdb
39 import bdb
40 import cmd
40 import cmd
41 import linecache
41 import linecache
42 import os
42 import os
43 import sys
43 import sys
44
44
45 from IPython import PyColorize, ColorANSI, ipapi
45 from IPython import PyColorize, ColorANSI, ipapi
46 from IPython.genutils import Term
46 from IPython.genutils import Term
47 from IPython.excolors import ExceptionColors
47 from IPython.excolors import ExceptionColors
48
48
49 # See if we can use pydb.
49 # See if we can use pydb.
50 has_pydb = False
50 has_pydb = False
51 prompt = 'ipdb> '
51 prompt = 'ipdb> '
52 try:
52 try:
53 import pydb
53 import pydb
54 if hasattr(pydb.pydb, "runl"):
54 if hasattr(pydb.pydb, "runl"):
55 has_pydb = True
55 has_pydb = True
56 from pydb import Pdb as OldPdb
56 from pydb import Pdb as OldPdb
57 except ImportError:
57 except ImportError:
58 pass
58 pass
59
59
60 if has_pydb:
60 if has_pydb:
61 from pydb import Pdb as OldPdb
61 from pydb import Pdb as OldPdb
62 prompt = 'ipydb> '
62 prompt = 'ipydb> '
63 else:
63 else:
64 from pdb import Pdb as OldPdb
64 from pdb import Pdb as OldPdb
65
65
66 # Allow the set_trace code to operate outside of an ipython instance, even if
66 # Allow the set_trace code to operate outside of an ipython instance, even if
67 # it does so with some limitations. The rest of this support is implemented in
67 # it does so with some limitations. The rest of this support is implemented in
68 # the Tracer constructor.
68 # the Tracer constructor.
69 def BdbQuit_excepthook(et,ev,tb):
69 def BdbQuit_excepthook(et,ev,tb):
70 if et==bdb.BdbQuit:
70 if et==bdb.BdbQuit:
71 print 'Exiting Debugger.'
71 print 'Exiting Debugger.'
72 else:
72 else:
73 ehook.excepthook_ori(et,ev,tb)
73 ehook.excepthook_ori(et,ev,tb)
74
74
75 def BdbQuit_IPython_excepthook(self,et,ev,tb):
75 def BdbQuit_IPython_excepthook(self,et,ev,tb):
76 print 'Exiting Debugger.'
76 print 'Exiting Debugger.'
77
77
78 class Tracer(object):
78 class Tracer(object):
79 """Class for local debugging, similar to pdb.set_trace.
79 """Class for local debugging, similar to pdb.set_trace.
80
80
81 Instances of this class, when called, behave like pdb.set_trace, but
81 Instances of this class, when called, behave like pdb.set_trace, but
82 providing IPython's enhanced capabilities.
82 providing IPython's enhanced capabilities.
83
83
84 This is implemented as a class which must be initialized in your own code
84 This is implemented as a class which must be initialized in your own code
85 and not as a standalone function because we need to detect at runtime
85 and not as a standalone function because we need to detect at runtime
86 whether IPython is already active or not. That detection is done in the
86 whether IPython is already active or not. That detection is done in the
87 constructor, ensuring that this code plays nicely with a running IPython,
87 constructor, ensuring that this code plays nicely with a running IPython,
88 while functioning acceptably (though with limitations) if outside of it.
88 while functioning acceptably (though with limitations) if outside of it.
89 """
89 """
90
90
91 def __init__(self,colors=None):
91 def __init__(self,colors=None):
92 """Create a local debugger instance.
92 """Create a local debugger instance.
93
93
94 :Parameters:
94 :Parameters:
95
95
96 - `colors` (None): a string containing the name of the color scheme to
96 - `colors` (None): a string containing the name of the color scheme to
97 use, it must be one of IPython's valid color schemes. If not given, the
97 use, it must be one of IPython's valid color schemes. If not given, the
98 function will default to the current IPython scheme when running inside
98 function will default to the current IPython scheme when running inside
99 IPython, and to 'NoColor' otherwise.
99 IPython, and to 'NoColor' otherwise.
100
100
101 Usage example:
101 Usage example:
102
102
103 from IPython.Debugger import Tracer; debug_here = Tracer()
103 from IPython.Debugger import Tracer; debug_here = Tracer()
104
104
105 ... later in your code
105 ... later in your code
106 debug_here() # -> will open up the debugger at that point.
106 debug_here() # -> will open up the debugger at that point.
107
107
108 Once the debugger activates, you can use all of its regular commands to
108 Once the debugger activates, you can use all of its regular commands to
109 step through code, set breakpoints, etc. See the pdb documentation
109 step through code, set breakpoints, etc. See the pdb documentation
110 from the Python standard library for usage details.
110 from the Python standard library for usage details.
111 """
111 """
112
112
113 global __IPYTHON__
113 global __IPYTHON__
114 try:
114 try:
115 __IPYTHON__
115 __IPYTHON__
116 except NameError:
116 except NameError:
117 # Outside of ipython, we set our own exception hook manually
117 # Outside of ipython, we set our own exception hook manually
118 __IPYTHON__ = ipapi.get(True,False)
118 __IPYTHON__ = ipapi.get(True,False)
119 BdbQuit_excepthook.excepthook_ori = sys.excepthook
119 BdbQuit_excepthook.excepthook_ori = sys.excepthook
120 sys.excepthook = BdbQuit_excepthook
120 sys.excepthook = BdbQuit_excepthook
121 def_colors = 'NoColor'
121 def_colors = 'NoColor'
122 try:
122 try:
123 # Limited tab completion support
123 # Limited tab completion support
124 import rlcompleter,readline
124 import rlcompleter,readline
125 readline.parse_and_bind('tab: complete')
125 readline.parse_and_bind('tab: complete')
126 except ImportError:
126 except ImportError:
127 pass
127 pass
128 else:
128 else:
129 # In ipython, we use its custom exception handler mechanism
129 # In ipython, we use its custom exception handler mechanism
130 ip = ipapi.get()
130 ip = ipapi.get()
131 def_colors = ip.options.colors
131 def_colors = ip.options.colors
132 ip.set_custom_exc((bdb.BdbQuit,),BdbQuit_IPython_excepthook)
132 ip.set_custom_exc((bdb.BdbQuit,),BdbQuit_IPython_excepthook)
133
133
134 if colors is None:
134 if colors is None:
135 colors = def_colors
135 colors = def_colors
136 self.debugger = Pdb(colors)
136 self.debugger = Pdb(colors)
137
137
138 def __call__(self):
138 def __call__(self):
139 """Starts an interactive debugger at the point where called.
139 """Starts an interactive debugger at the point where called.
140
140
141 This is similar to the pdb.set_trace() function from the std lib, but
141 This is similar to the pdb.set_trace() function from the std lib, but
142 using IPython's enhanced debugger."""
142 using IPython's enhanced debugger."""
143
143
144 self.debugger.set_trace(sys._getframe().f_back)
144 self.debugger.set_trace(sys._getframe().f_back)
145
145
146 def decorate_fn_with_doc(new_fn, old_fn, additional_text=""):
146 def decorate_fn_with_doc(new_fn, old_fn, additional_text=""):
147 """Make new_fn have old_fn's doc string. This is particularly useful
147 """Make new_fn have old_fn's doc string. This is particularly useful
148 for the do_... commands that hook into the help system.
148 for the do_... commands that hook into the help system.
149 Adapted from from a comp.lang.python posting
149 Adapted from from a comp.lang.python posting
150 by Duncan Booth."""
150 by Duncan Booth."""
151 def wrapper(*args, **kw):
151 def wrapper(*args, **kw):
152 return new_fn(*args, **kw)
152 return new_fn(*args, **kw)
153 if old_fn.__doc__:
153 if old_fn.__doc__:
154 wrapper.__doc__ = old_fn.__doc__ + additional_text
154 wrapper.__doc__ = old_fn.__doc__ + additional_text
155 return wrapper
155 return wrapper
156
156
157 def _file_lines(fname):
157 def _file_lines(fname):
158 """Return the contents of a named file as a list of lines.
158 """Return the contents of a named file as a list of lines.
159
159
160 This function never raises an IOError exception: if the file can't be
160 This function never raises an IOError exception: if the file can't be
161 read, it simply returns an empty list."""
161 read, it simply returns an empty list."""
162
162
163 try:
163 try:
164 outfile = open(fname)
164 outfile = open(fname)
165 except IOError:
165 except IOError:
166 return []
166 return []
167 else:
167 else:
168 out = outfile.readlines()
168 out = outfile.readlines()
169 outfile.close()
169 outfile.close()
170 return out
170 return out
171
171
172 class Pdb(OldPdb):
172 class Pdb(OldPdb):
173 """Modified Pdb class, does not load readline."""
173 """Modified Pdb class, does not load readline."""
174
174
175 if sys.version[:3] >= '2.5' or has_pydb:
175 if sys.version[:3] >= '2.5' or has_pydb:
176 def __init__(self,color_scheme='NoColor',completekey=None,
176 def __init__(self,color_scheme='NoColor',completekey=None,
177 stdin=None, stdout=None):
177 stdin=None, stdout=None):
178
178
179 # Parent constructor:
179 # Parent constructor:
180 if has_pydb and completekey is None:
180 if has_pydb and completekey is None:
181 OldPdb.__init__(self,stdin=stdin,stdout=Term.cout) #stdout)
181 OldPdb.__init__(self,stdin=stdin,stdout=Term.cout)
182 else:
182 else:
183 OldPdb.__init__(self,completekey,stdin,stdout)
183 OldPdb.__init__(self,completekey,stdin,stdout)
184
184
185 self.prompt = prompt # The default prompt is '(Pdb)'
185 self.prompt = prompt # The default prompt is '(Pdb)'
186
186
187 # IPython changes...
187 # IPython changes...
188 self.is_pydb = has_pydb
188 self.is_pydb = has_pydb
189
189
190 if self.is_pydb:
190 if self.is_pydb:
191
191
192 # iplib.py's ipalias seems to want pdb's checkline
192 # iplib.py's ipalias seems to want pdb's checkline
193 # which located in pydb.fn
193 # which located in pydb.fn
194 import pydb.fns
194 import pydb.fns
195 self.checkline = lambda filename, lineno: \
195 self.checkline = lambda filename, lineno: \
196 pydb.fns.checkline(self, filename, lineno)
196 pydb.fns.checkline(self, filename, lineno)
197
197
198 self.curframe = None
198 self.curframe = None
199 self.do_restart = self.new_do_restart
199 self.do_restart = self.new_do_restart
200
200
201 self.old_all_completions = __IPYTHON__.Completer.all_completions
201 self.old_all_completions = __IPYTHON__.Completer.all_completions
202 __IPYTHON__.Completer.all_completions=self.all_completions
202 __IPYTHON__.Completer.all_completions=self.all_completions
203
203
204 self.do_list = decorate_fn_with_doc(self.list_command_pydb,
204 self.do_list = decorate_fn_with_doc(self.list_command_pydb,
205 OldPdb.do_list)
205 OldPdb.do_list)
206 self.do_l = self.do_list
206 self.do_l = self.do_list
207 self.do_frame = decorate_fn_with_doc(self.new_do_frame,
207 self.do_frame = decorate_fn_with_doc(self.new_do_frame,
208 OldPdb.do_frame)
208 OldPdb.do_frame)
209
209
210 self.aliases = {}
210 self.aliases = {}
211
211
212 # Create color table: we copy the default one from the traceback
212 # Create color table: we copy the default one from the traceback
213 # module and add a few attributes needed for debugging
213 # module and add a few attributes needed for debugging
214 self.color_scheme_table = ExceptionColors.copy()
214 self.color_scheme_table = ExceptionColors.copy()
215
215
216 # shorthands
216 # shorthands
217 C = ColorANSI.TermColors
217 C = ColorANSI.TermColors
218 cst = self.color_scheme_table
218 cst = self.color_scheme_table
219
219
220 cst['NoColor'].colors.breakpoint_enabled = C.NoColor
220 cst['NoColor'].colors.breakpoint_enabled = C.NoColor
221 cst['NoColor'].colors.breakpoint_disabled = C.NoColor
221 cst['NoColor'].colors.breakpoint_disabled = C.NoColor
222
222
223 cst['Linux'].colors.breakpoint_enabled = C.LightRed
223 cst['Linux'].colors.breakpoint_enabled = C.LightRed
224 cst['Linux'].colors.breakpoint_disabled = C.Red
224 cst['Linux'].colors.breakpoint_disabled = C.Red
225
225
226 cst['LightBG'].colors.breakpoint_enabled = C.LightRed
226 cst['LightBG'].colors.breakpoint_enabled = C.LightRed
227 cst['LightBG'].colors.breakpoint_disabled = C.Red
227 cst['LightBG'].colors.breakpoint_disabled = C.Red
228
228
229 self.set_colors(color_scheme)
229 self.set_colors(color_scheme)
230
230
231 # Add a python parser so we can syntax highlight source while
232 # debugging.
233 self.parser = PyColorize.Parser()
234
235
231 else:
236 else:
232 # Ugly hack: for Python 2.3-2.4, we can't call the parent constructor,
237 # Ugly hack: for Python 2.3-2.4, we can't call the parent constructor,
233 # because it binds readline and breaks tab-completion. This means we
238 # because it binds readline and breaks tab-completion. This means we
234 # have to COPY the constructor here.
239 # have to COPY the constructor here.
235 def __init__(self,color_scheme='NoColor'):
240 def __init__(self,color_scheme='NoColor'):
236 bdb.Bdb.__init__(self)
241 bdb.Bdb.__init__(self)
237 cmd.Cmd.__init__(self,completekey=None) # don't load readline
242 cmd.Cmd.__init__(self,completekey=None) # don't load readline
238 self.prompt = 'ipdb> ' # The default prompt is '(Pdb)'
243 self.prompt = 'ipdb> ' # The default prompt is '(Pdb)'
239 self.aliases = {}
244 self.aliases = {}
240
245
241 # These two lines are part of the py2.4 constructor, let's put them
246 # These two lines are part of the py2.4 constructor, let's put them
242 # unconditionally here as they won't cause any problems in 2.3.
247 # unconditionally here as they won't cause any problems in 2.3.
243 self.mainpyfile = ''
248 self.mainpyfile = ''
244 self._wait_for_mainpyfile = 0
249 self._wait_for_mainpyfile = 0
245
250
246 # Read $HOME/.pdbrc and ./.pdbrc
251 # Read $HOME/.pdbrc and ./.pdbrc
247 try:
252 try:
248 self.rcLines = _file_lines(os.path.join(os.environ['HOME'],
253 self.rcLines = _file_lines(os.path.join(os.environ['HOME'],
249 ".pdbrc"))
254 ".pdbrc"))
250 except KeyError:
255 except KeyError:
251 self.rcLines = []
256 self.rcLines = []
252 self.rcLines.extend(_file_lines(".pdbrc"))
257 self.rcLines.extend(_file_lines(".pdbrc"))
253
258
254 # Create color table: we copy the default one from the traceback
259 # Create color table: we copy the default one from the traceback
255 # module and add a few attributes needed for debugging
260 # module and add a few attributes needed for debugging
256 ExceptionColors.set_active_scheme(color_scheme)
261 ExceptionColors.set_active_scheme(color_scheme)
257 self.color_scheme_table = ExceptionColors.copy()
262 self.color_scheme_table = ExceptionColors.copy()
258
263
259 # shorthands
264 # shorthands
260 C = ColorANSI.TermColors
265 C = ColorANSI.TermColors
261 cst = self.color_scheme_table
266 cst = self.color_scheme_table
262
267
263 cst['NoColor'].colors.breakpoint_enabled = C.NoColor
268 cst['NoColor'].colors.breakpoint_enabled = C.NoColor
264 cst['NoColor'].colors.breakpoint_disabled = C.NoColor
269 cst['NoColor'].colors.breakpoint_disabled = C.NoColor
265
270
266 cst['Linux'].colors.breakpoint_enabled = C.LightRed
271 cst['Linux'].colors.breakpoint_enabled = C.LightRed
267 cst['Linux'].colors.breakpoint_disabled = C.Red
272 cst['Linux'].colors.breakpoint_disabled = C.Red
268
273
269 cst['LightBG'].colors.breakpoint_enabled = C.LightRed
274 cst['LightBG'].colors.breakpoint_enabled = C.LightRed
270 cst['LightBG'].colors.breakpoint_disabled = C.Red
275 cst['LightBG'].colors.breakpoint_disabled = C.Red
271
276
272 self.set_colors(color_scheme)
277 self.set_colors(color_scheme)
273
278
279 # Add a python parser so we can syntax highlight source while
280 # debugging.
281 self.parser = PyColorize.Parser()
282
274 def set_colors(self, scheme):
283 def set_colors(self, scheme):
275 """Shorthand access to the color table scheme selector method."""
284 """Shorthand access to the color table scheme selector method."""
276 self.color_scheme_table.set_active_scheme(scheme)
285 self.color_scheme_table.set_active_scheme(scheme)
277
286
278 def interaction(self, frame, traceback):
287 def interaction(self, frame, traceback):
279 __IPYTHON__.set_completer_frame(frame)
288 __IPYTHON__.set_completer_frame(frame)
280 OldPdb.interaction(self, frame, traceback)
289 OldPdb.interaction(self, frame, traceback)
281
290
282 def new_do_up(self, arg):
291 def new_do_up(self, arg):
283 OldPdb.do_up(self, arg)
292 OldPdb.do_up(self, arg)
284 __IPYTHON__.set_completer_frame(self.curframe)
293 __IPYTHON__.set_completer_frame(self.curframe)
285 do_u = do_up = decorate_fn_with_doc(new_do_up, OldPdb.do_up)
294 do_u = do_up = decorate_fn_with_doc(new_do_up, OldPdb.do_up)
286
295
287 def new_do_down(self, arg):
296 def new_do_down(self, arg):
288 OldPdb.do_down(self, arg)
297 OldPdb.do_down(self, arg)
289 __IPYTHON__.set_completer_frame(self.curframe)
298 __IPYTHON__.set_completer_frame(self.curframe)
290
299
291 do_d = do_down = decorate_fn_with_doc(new_do_down, OldPdb.do_down)
300 do_d = do_down = decorate_fn_with_doc(new_do_down, OldPdb.do_down)
292
301
293 def new_do_frame(self, arg):
302 def new_do_frame(self, arg):
294 OldPdb.do_frame(self, arg)
303 OldPdb.do_frame(self, arg)
295 __IPYTHON__.set_completer_frame(self.curframe)
304 __IPYTHON__.set_completer_frame(self.curframe)
296
305
297 def new_do_quit(self, arg):
306 def new_do_quit(self, arg):
298
307
299 if hasattr(self, 'old_all_completions'):
308 if hasattr(self, 'old_all_completions'):
300 __IPYTHON__.Completer.all_completions=self.old_all_completions
309 __IPYTHON__.Completer.all_completions=self.old_all_completions
301
310
302
311
303 return OldPdb.do_quit(self, arg)
312 return OldPdb.do_quit(self, arg)
304
313
305 do_q = do_quit = decorate_fn_with_doc(new_do_quit, OldPdb.do_quit)
314 do_q = do_quit = decorate_fn_with_doc(new_do_quit, OldPdb.do_quit)
306
315
307 def new_do_restart(self, arg):
316 def new_do_restart(self, arg):
308 """Restart command. In the context of ipython this is exactly the same
317 """Restart command. In the context of ipython this is exactly the same
309 thing as 'quit'."""
318 thing as 'quit'."""
310 self.msg("Restart doesn't make sense here. Using 'quit' instead.")
319 self.msg("Restart doesn't make sense here. Using 'quit' instead.")
311 return self.do_quit(arg)
320 return self.do_quit(arg)
312
321
313 def postloop(self):
322 def postloop(self):
314 __IPYTHON__.set_completer_frame(None)
323 __IPYTHON__.set_completer_frame(None)
315
324
316 def print_stack_trace(self):
325 def print_stack_trace(self):
317 try:
326 try:
318 for frame_lineno in self.stack:
327 for frame_lineno in self.stack:
319 self.print_stack_entry(frame_lineno, context = 5)
328 self.print_stack_entry(frame_lineno, context = 5)
320 except KeyboardInterrupt:
329 except KeyboardInterrupt:
321 pass
330 pass
322
331
323 def print_stack_entry(self,frame_lineno,prompt_prefix='\n-> ',
332 def print_stack_entry(self,frame_lineno,prompt_prefix='\n-> ',
324 context = 3):
333 context = 3):
325 #frame, lineno = frame_lineno
334 #frame, lineno = frame_lineno
326 print >>Term.cout, self.format_stack_entry(frame_lineno, '', context)
335 print >>Term.cout, self.format_stack_entry(frame_lineno, '', context)
327
336
328 def format_stack_entry(self, frame_lineno, lprefix=': ', context = 3):
337 def format_stack_entry(self, frame_lineno, lprefix=': ', context = 3):
329 import linecache, repr
338 import linecache, repr
330
339
331 ret = []
340 ret = []
332
341
333 Colors = self.color_scheme_table.active_colors
342 Colors = self.color_scheme_table.active_colors
334 ColorsNormal = Colors.Normal
343 ColorsNormal = Colors.Normal
335 tpl_link = '%s%%s%s' % (Colors.filenameEm, ColorsNormal)
344 tpl_link = '%s%%s%s' % (Colors.filenameEm, ColorsNormal)
336 tpl_call = '%s%%s%s%%s%s' % (Colors.vName, Colors.valEm, ColorsNormal)
345 tpl_call = '%s%%s%s%%s%s' % (Colors.vName, Colors.valEm, ColorsNormal)
337 tpl_line = '%%s%s%%s %s%%s' % (Colors.lineno, ColorsNormal)
346 tpl_line = '%%s%s%%s %s%%s' % (Colors.lineno, ColorsNormal)
338 tpl_line_em = '%%s%s%%s %s%%s%s' % (Colors.linenoEm, Colors.line,
347 tpl_line_em = '%%s%s%%s %s%%s%s' % (Colors.linenoEm, Colors.line,
339 ColorsNormal)
348 ColorsNormal)
340
349
341 frame, lineno = frame_lineno
350 frame, lineno = frame_lineno
342
351
343 return_value = ''
352 return_value = ''
344 if '__return__' in frame.f_locals:
353 if '__return__' in frame.f_locals:
345 rv = frame.f_locals['__return__']
354 rv = frame.f_locals['__return__']
346 #return_value += '->'
355 #return_value += '->'
347 return_value += repr.repr(rv) + '\n'
356 return_value += repr.repr(rv) + '\n'
348 ret.append(return_value)
357 ret.append(return_value)
349
358
350 #s = filename + '(' + `lineno` + ')'
359 #s = filename + '(' + `lineno` + ')'
351 filename = self.canonic(frame.f_code.co_filename)
360 filename = self.canonic(frame.f_code.co_filename)
352 link = tpl_link % filename
361 link = tpl_link % filename
353
362
354 if frame.f_code.co_name:
363 if frame.f_code.co_name:
355 func = frame.f_code.co_name
364 func = frame.f_code.co_name
356 else:
365 else:
357 func = "<lambda>"
366 func = "<lambda>"
358
367
359 call = ''
368 call = ''
360 if func != '?':
369 if func != '?':
361 if '__args__' in frame.f_locals:
370 if '__args__' in frame.f_locals:
362 args = repr.repr(frame.f_locals['__args__'])
371 args = repr.repr(frame.f_locals['__args__'])
363 else:
372 else:
364 args = '()'
373 args = '()'
365 call = tpl_call % (func, args)
374 call = tpl_call % (func, args)
366
375
367 # The level info should be generated in the same format pdb uses, to
376 # The level info should be generated in the same format pdb uses, to
368 # avoid breaking the pdbtrack functionality of python-mode in *emacs.
377 # avoid breaking the pdbtrack functionality of python-mode in *emacs.
369 if frame is self.curframe:
378 if frame is self.curframe:
370 ret.append('> ')
379 ret.append('> ')
371 else:
380 else:
372 ret.append(' ')
381 ret.append(' ')
373 ret.append('%s(%s)%s\n' % (link,lineno,call))
382 ret.append('%s(%s)%s\n' % (link,lineno,call))
374
383
375 start = lineno - 1 - context//2
384 start = lineno - 1 - context//2
376 lines = linecache.getlines(filename)
385 lines = linecache.getlines(filename)
377 start = max(start, 0)
386 start = max(start, 0)
378 start = min(start, len(lines) - context)
387 start = min(start, len(lines) - context)
379 lines = lines[start : start + context]
388 lines = lines[start : start + context]
380
389
381 for i,line in enumerate(lines):
390 for i,line in enumerate(lines):
382 show_arrow = (start + 1 + i == lineno)
391 show_arrow = (start + 1 + i == lineno)
383 linetpl = (frame is self.curframe or show_arrow) \
392 linetpl = (frame is self.curframe or show_arrow) \
384 and tpl_line_em \
393 and tpl_line_em \
385 or tpl_line
394 or tpl_line
386 ret.append(self.__format_line(linetpl, filename,
395 ret.append(self.__format_line(linetpl, filename,
387 start + 1 + i, line,
396 start + 1 + i, line,
388 arrow = show_arrow) )
397 arrow = show_arrow) )
389
398
390 return ''.join(ret)
399 return ''.join(ret)
391
400
392 def __format_line(self, tpl_line, filename, lineno, line, arrow = False):
401 def __format_line(self, tpl_line, filename, lineno, line, arrow = False):
393 bp_mark = ""
402 bp_mark = ""
394 bp_mark_color = ""
403 bp_mark_color = ""
395
404
405 scheme = self.color_scheme_table.active_scheme_name
406 new_line, err = self.parser.format2(line, 'str', scheme)
407 if not err: line = new_line
408
396 bp = None
409 bp = None
397 if lineno in self.get_file_breaks(filename):
410 if lineno in self.get_file_breaks(filename):
398 bps = self.get_breaks(filename, lineno)
411 bps = self.get_breaks(filename, lineno)
399 bp = bps[-1]
412 bp = bps[-1]
400
413
401 if bp:
414 if bp:
402 Colors = self.color_scheme_table.active_colors
415 Colors = self.color_scheme_table.active_colors
403 bp_mark = str(bp.number)
416 bp_mark = str(bp.number)
404 bp_mark_color = Colors.breakpoint_enabled
417 bp_mark_color = Colors.breakpoint_enabled
405 if not bp.enabled:
418 if not bp.enabled:
406 bp_mark_color = Colors.breakpoint_disabled
419 bp_mark_color = Colors.breakpoint_disabled
407
420
408 numbers_width = 7
421 numbers_width = 7
409 if arrow:
422 if arrow:
410 # This is the line with the error
423 # This is the line with the error
411 pad = numbers_width - len(str(lineno)) - len(bp_mark)
424 pad = numbers_width - len(str(lineno)) - len(bp_mark)
412 if pad >= 3:
425 if pad >= 3:
413 marker = '-'*(pad-3) + '-> '
426 marker = '-'*(pad-3) + '-> '
414 elif pad == 2:
427 elif pad == 2:
415 marker = '> '
428 marker = '> '
416 elif pad == 1:
429 elif pad == 1:
417 marker = '>'
430 marker = '>'
418 else:
431 else:
419 marker = ''
432 marker = ''
420 num = '%s%s' % (marker, str(lineno))
433 num = '%s%s' % (marker, str(lineno))
421 line = tpl_line % (bp_mark_color + bp_mark, num, line)
434 line = tpl_line % (bp_mark_color + bp_mark, num, line)
422 else:
435 else:
423 num = '%*s' % (numbers_width - len(bp_mark), str(lineno))
436 num = '%*s' % (numbers_width - len(bp_mark), str(lineno))
424 line = tpl_line % (bp_mark_color + bp_mark, num, line)
437 line = tpl_line % (bp_mark_color + bp_mark, num, line)
425
438
426 return line
439 return line
427
440
428 def list_command_pydb(self, arg):
441 def list_command_pydb(self, arg):
429 """List command to use if we have a newer pydb installed"""
442 """List command to use if we have a newer pydb installed"""
430 filename, first, last = OldPdb.parse_list_cmd(self, arg)
443 filename, first, last = OldPdb.parse_list_cmd(self, arg)
431 if filename is not None:
444 if filename is not None:
432 self.print_list_lines(filename, first, last)
445 self.print_list_lines(filename, first, last)
433
446
434 def print_list_lines(self, filename, first, last):
447 def print_list_lines(self, filename, first, last):
435 """The printing (as opposed to the parsing part of a 'list'
448 """The printing (as opposed to the parsing part of a 'list'
436 command."""
449 command."""
437 try:
450 try:
438 Colors = self.color_scheme_table.active_colors
451 Colors = self.color_scheme_table.active_colors
439 ColorsNormal = Colors.Normal
452 ColorsNormal = Colors.Normal
440 tpl_line = '%%s%s%%s %s%%s' % (Colors.lineno, ColorsNormal)
453 tpl_line = '%%s%s%%s %s%%s' % (Colors.lineno, ColorsNormal)
441 tpl_line_em = '%%s%s%%s %s%%s%s' % (Colors.linenoEm, Colors.line, ColorsNormal)
454 tpl_line_em = '%%s%s%%s %s%%s%s' % (Colors.linenoEm, Colors.line, ColorsNormal)
442 src = []
455 src = []
443 for lineno in range(first, last+1):
456 for lineno in range(first, last+1):
444 line = linecache.getline(filename, lineno)
457 line = linecache.getline(filename, lineno)
445 if not line:
458 if not line:
446 break
459 break
447
460
448 if lineno == self.curframe.f_lineno:
461 if lineno == self.curframe.f_lineno:
449 line = self.__format_line(tpl_line_em, filename, lineno, line, arrow = True)
462 line = self.__format_line(tpl_line_em, filename, lineno, line, arrow = True)
450 else:
463 else:
451 line = self.__format_line(tpl_line, filename, lineno, line, arrow = False)
464 line = self.__format_line(tpl_line, filename, lineno, line, arrow = False)
452
465
453 src.append(line)
466 src.append(line)
454 self.lineno = lineno
467 self.lineno = lineno
455
468
456 print >>Term.cout, ''.join(src)
469 print >>Term.cout, ''.join(src)
457
470
458 except KeyboardInterrupt:
471 except KeyboardInterrupt:
459 pass
472 pass
460
473
461 def do_list(self, arg):
474 def do_list(self, arg):
462 self.lastcmd = 'list'
475 self.lastcmd = 'list'
463 last = None
476 last = None
464 if arg:
477 if arg:
465 try:
478 try:
466 x = eval(arg, {}, {})
479 x = eval(arg, {}, {})
467 if type(x) == type(()):
480 if type(x) == type(()):
468 first, last = x
481 first, last = x
469 first = int(first)
482 first = int(first)
470 last = int(last)
483 last = int(last)
471 if last < first:
484 if last < first:
472 # Assume it's a count
485 # Assume it's a count
473 last = first + last
486 last = first + last
474 else:
487 else:
475 first = max(1, int(x) - 5)
488 first = max(1, int(x) - 5)
476 except:
489 except:
477 print '*** Error in argument:', `arg`
490 print '*** Error in argument:', `arg`
478 return
491 return
479 elif self.lineno is None:
492 elif self.lineno is None:
480 first = max(1, self.curframe.f_lineno - 5)
493 first = max(1, self.curframe.f_lineno - 5)
481 else:
494 else:
482 first = self.lineno + 1
495 first = self.lineno + 1
483 if last is None:
496 if last is None:
484 last = first + 10
497 last = first + 10
485 self.print_list_lines(self.curframe.f_code.co_filename, first, last)
498 self.print_list_lines(self.curframe.f_code.co_filename, first, last)
486
499
487 do_l = do_list
500 do_l = do_list
488
501
489 def do_pdef(self, arg):
502 def do_pdef(self, arg):
490 """The debugger interface to magic_pdef"""
503 """The debugger interface to magic_pdef"""
491 namespaces = [('Locals', self.curframe.f_locals),
504 namespaces = [('Locals', self.curframe.f_locals),
492 ('Globals', self.curframe.f_globals)]
505 ('Globals', self.curframe.f_globals)]
493 __IPYTHON__.magic_pdef(arg, namespaces=namespaces)
506 __IPYTHON__.magic_pdef(arg, namespaces=namespaces)
494
507
495 def do_pdoc(self, arg):
508 def do_pdoc(self, arg):
496 """The debugger interface to magic_pdoc"""
509 """The debugger interface to magic_pdoc"""
497 namespaces = [('Locals', self.curframe.f_locals),
510 namespaces = [('Locals', self.curframe.f_locals),
498 ('Globals', self.curframe.f_globals)]
511 ('Globals', self.curframe.f_globals)]
499 __IPYTHON__.magic_pdoc(arg, namespaces=namespaces)
512 __IPYTHON__.magic_pdoc(arg, namespaces=namespaces)
500
513
501 def do_pinfo(self, arg):
514 def do_pinfo(self, arg):
502 """The debugger equivalant of ?obj"""
515 """The debugger equivalant of ?obj"""
503 namespaces = [('Locals', self.curframe.f_locals),
516 namespaces = [('Locals', self.curframe.f_locals),
504 ('Globals', self.curframe.f_globals)]
517 ('Globals', self.curframe.f_globals)]
505 __IPYTHON__.magic_pinfo("pinfo %s" % arg, namespaces=namespaces)
518 __IPYTHON__.magic_pinfo("pinfo %s" % arg, namespaces=namespaces)
@@ -1,260 +1,267 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """
2 """
3 Class and program to colorize python source code for ANSI terminals.
3 Class and program to colorize python source code for ANSI terminals.
4
4
5 Based on an HTML code highlighter by Jurgen Hermann found at:
5 Based on an HTML code highlighter by Jurgen Hermann found at:
6 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52298
6 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52298
7
7
8 Modifications by Fernando Perez (fperez@colorado.edu).
8 Modifications by Fernando Perez (fperez@colorado.edu).
9
9
10 Information on the original HTML highlighter follows:
10 Information on the original HTML highlighter follows:
11
11
12 MoinMoin - Python Source Parser
12 MoinMoin - Python Source Parser
13
13
14 Title:olorize Python source using the built-in tokenizer
14 Title:olorize Python source using the built-in tokenizer
15
15
16 Submitter: Jurgen Hermann
16 Submitter: Jurgen Hermann
17 Last Updated:2001/04/06
17 Last Updated:2001/04/06
18
18
19 Version no:1.2
19 Version no:1.2
20
20
21 Description:
21 Description:
22
22
23 This code is part of MoinMoin (http://moin.sourceforge.net/) and converts
23 This code is part of MoinMoin (http://moin.sourceforge.net/) and converts
24 Python source code to HTML markup, rendering comments, keywords,
24 Python source code to HTML markup, rendering comments, keywords,
25 operators, numeric and string literals in different colors.
25 operators, numeric and string literals in different colors.
26
26
27 It shows how to use the built-in keyword, token and tokenize modules to
27 It shows how to use the built-in keyword, token and tokenize modules to
28 scan Python source code and re-emit it with no changes to its original
28 scan Python source code and re-emit it with no changes to its original
29 formatting (which is the hard part).
29 formatting (which is the hard part).
30
30
31 $Id: PyColorize.py 958 2005-12-27 23:17:51Z fperez $"""
31 $Id: PyColorize.py 2155 2007-03-19 00:45:51Z fperez $"""
32
32
33 __all__ = ['ANSICodeColors','Parser']
33 __all__ = ['ANSICodeColors','Parser']
34
34
35 _scheme_default = 'Linux'
35 _scheme_default = 'Linux'
36
36
37 # Imports
37 # Imports
38 import cStringIO
38 import cStringIO
39 import keyword
39 import keyword
40 import os
40 import os
41 import string
41 import string
42 import sys
42 import sys
43 import token
43 import token
44 import tokenize
44 import tokenize
45
45
46 from IPython.ColorANSI import *
46 from IPython.ColorANSI import *
47
47
48 #############################################################################
48 #############################################################################
49 ### Python Source Parser (does Hilighting)
49 ### Python Source Parser (does Hilighting)
50 #############################################################################
50 #############################################################################
51
51
52 _KEYWORD = token.NT_OFFSET + 1
52 _KEYWORD = token.NT_OFFSET + 1
53 _TEXT = token.NT_OFFSET + 2
53 _TEXT = token.NT_OFFSET + 2
54
54
55 #****************************************************************************
55 #****************************************************************************
56 # Builtin color schemes
56 # Builtin color schemes
57
57
58 Colors = TermColors # just a shorthand
58 Colors = TermColors # just a shorthand
59
59
60 # Build a few color schemes
60 # Build a few color schemes
61 NoColor = ColorScheme(
61 NoColor = ColorScheme(
62 'NoColor',{
62 'NoColor',{
63 token.NUMBER : Colors.NoColor,
63 token.NUMBER : Colors.NoColor,
64 token.OP : Colors.NoColor,
64 token.OP : Colors.NoColor,
65 token.STRING : Colors.NoColor,
65 token.STRING : Colors.NoColor,
66 tokenize.COMMENT : Colors.NoColor,
66 tokenize.COMMENT : Colors.NoColor,
67 token.NAME : Colors.NoColor,
67 token.NAME : Colors.NoColor,
68 token.ERRORTOKEN : Colors.NoColor,
68 token.ERRORTOKEN : Colors.NoColor,
69
69
70 _KEYWORD : Colors.NoColor,
70 _KEYWORD : Colors.NoColor,
71 _TEXT : Colors.NoColor,
71 _TEXT : Colors.NoColor,
72
72
73 'normal' : Colors.NoColor # color off (usu. Colors.Normal)
73 'normal' : Colors.NoColor # color off (usu. Colors.Normal)
74 } )
74 } )
75
75
76 LinuxColors = ColorScheme(
76 LinuxColors = ColorScheme(
77 'Linux',{
77 'Linux',{
78 token.NUMBER : Colors.LightCyan,
78 token.NUMBER : Colors.LightCyan,
79 token.OP : Colors.Yellow,
79 token.OP : Colors.Yellow,
80 token.STRING : Colors.LightBlue,
80 token.STRING : Colors.LightBlue,
81 tokenize.COMMENT : Colors.LightRed,
81 tokenize.COMMENT : Colors.LightRed,
82 token.NAME : Colors.White,
82 token.NAME : Colors.White,
83 token.ERRORTOKEN : Colors.Red,
83 token.ERRORTOKEN : Colors.Red,
84
84
85 _KEYWORD : Colors.LightGreen,
85 _KEYWORD : Colors.LightGreen,
86 _TEXT : Colors.Yellow,
86 _TEXT : Colors.Yellow,
87
87
88 'normal' : Colors.Normal # color off (usu. Colors.Normal)
88 'normal' : Colors.Normal # color off (usu. Colors.Normal)
89 } )
89 } )
90
90
91 LightBGColors = ColorScheme(
91 LightBGColors = ColorScheme(
92 'LightBG',{
92 'LightBG',{
93 token.NUMBER : Colors.Cyan,
93 token.NUMBER : Colors.Cyan,
94 token.OP : Colors.Blue,
94 token.OP : Colors.Blue,
95 token.STRING : Colors.Blue,
95 token.STRING : Colors.Blue,
96 tokenize.COMMENT : Colors.Red,
96 tokenize.COMMENT : Colors.Red,
97 token.NAME : Colors.Black,
97 token.NAME : Colors.Black,
98 token.ERRORTOKEN : Colors.Red,
98 token.ERRORTOKEN : Colors.Red,
99
99
100 _KEYWORD : Colors.Green,
100 _KEYWORD : Colors.Green,
101 _TEXT : Colors.Blue,
101 _TEXT : Colors.Blue,
102
102
103 'normal' : Colors.Normal # color off (usu. Colors.Normal)
103 'normal' : Colors.Normal # color off (usu. Colors.Normal)
104 } )
104 } )
105
105
106 # Build table of color schemes (needed by the parser)
106 # Build table of color schemes (needed by the parser)
107 ANSICodeColors = ColorSchemeTable([NoColor,LinuxColors,LightBGColors],
107 ANSICodeColors = ColorSchemeTable([NoColor,LinuxColors,LightBGColors],
108 _scheme_default)
108 _scheme_default)
109
109
110 class Parser:
110 class Parser:
111 """ Format colored Python source.
111 """ Format colored Python source.
112 """
112 """
113
113
114 def __init__(self, color_table=None,out = sys.stdout):
114 def __init__(self, color_table=None,out = sys.stdout):
115 """ Create a parser with a specified color table and output channel.
115 """ Create a parser with a specified color table and output channel.
116
116
117 Call format() to process code.
117 Call format() to process code.
118 """
118 """
119 self.color_table = color_table and color_table or ANSICodeColors
119 self.color_table = color_table and color_table or ANSICodeColors
120 self.out = out
120 self.out = out
121
121
122 def format(self, raw, out = None, scheme = ''):
122 def format(self, raw, out = None, scheme = ''):
123 return self.format2(raw, out, scheme)[0]
124
125 def format2(self, raw, out = None, scheme = ''):
123 """ Parse and send the colored source.
126 """ Parse and send the colored source.
124
127
125 If out and scheme are not specified, the defaults (given to
128 If out and scheme are not specified, the defaults (given to
126 constructor) are used.
129 constructor) are used.
127
130
128 out should be a file-type object. Optionally, out can be given as the
131 out should be a file-type object. Optionally, out can be given as the
129 string 'str' and the parser will automatically return the output in a
132 string 'str' and the parser will automatically return the output in a
130 string."""
133 string."""
131
134
132 self.raw = string.strip(string.expandtabs(raw))
135 self.raw = string.strip(string.expandtabs(raw))
133 string_output = 0
136 string_output = 0
134 if out == 'str' or self.out == 'str':
137 if out == 'str' or self.out == 'str':
135 out_old = self.out
138 out_old = self.out
136 self.out = cStringIO.StringIO()
139 self.out = cStringIO.StringIO()
137 string_output = 1
140 string_output = 1
138 elif out is not None:
141 elif out is not None:
139 self.out = out
142 self.out = out
140 # local shorthand
143 # local shorthand
141 colors = self.color_table[scheme].colors
144 colors = self.color_table[scheme].colors
142 self.colors = colors # put in object so __call__ sees it
145 self.colors = colors # put in object so __call__ sees it
143 # store line offsets in self.lines
146 # store line offsets in self.lines
144 self.lines = [0, 0]
147 self.lines = [0, 0]
145 pos = 0
148 pos = 0
146 while 1:
149 while 1:
147 pos = string.find(self.raw, '\n', pos) + 1
150 pos = string.find(self.raw, '\n', pos) + 1
148 if not pos: break
151 if not pos: break
149 self.lines.append(pos)
152 self.lines.append(pos)
150 self.lines.append(len(self.raw))
153 self.lines.append(len(self.raw))
151
154
152 # parse the source and write it
155 # parse the source and write it
153 self.pos = 0
156 self.pos = 0
154 text = cStringIO.StringIO(self.raw)
157 text = cStringIO.StringIO(self.raw)
155 #self.out.write('<pre><font face="Courier New">')
158 #self.out.write('<pre><font face="Courier New">')
159
160 error = False
156 try:
161 try:
157 tokenize.tokenize(text.readline, self)
162 tokenize.tokenize(text.readline, self)
158 except tokenize.TokenError, ex:
163 except tokenize.TokenError, ex:
159 msg = ex[0]
164 msg = ex[0]
160 line = ex[1][0]
165 line = ex[1][0]
161 self.out.write("%s\n\n*** ERROR: %s%s%s\n" %
166 self.out.write("%s\n\n*** ERROR: %s%s%s\n" %
162 (colors[token.ERRORTOKEN],
167 (colors[token.ERRORTOKEN],
163 msg, self.raw[self.lines[line]:],
168 msg, self.raw[self.lines[line]:],
164 colors.normal)
169 colors.normal)
165 )
170 )
171 error = True
166 self.out.write(colors.normal+'\n')
172 self.out.write(colors.normal+'\n')
167 if string_output:
173 if string_output:
168 output = self.out.getvalue()
174 output = self.out.getvalue()
169 self.out = out_old
175 self.out = out_old
170 return output
176 return (output, error)
177 return (None, error)
171
178
172 def __call__(self, toktype, toktext, (srow,scol), (erow,ecol), line):
179 def __call__(self, toktype, toktext, (srow,scol), (erow,ecol), line):
173 """ Token handler, with syntax highlighting."""
180 """ Token handler, with syntax highlighting."""
174
181
175 # local shorthand
182 # local shorthand
176 colors = self.colors
183 colors = self.colors
177
184
178 # line separator, so this works across platforms
185 # line separator, so this works across platforms
179 linesep = os.linesep
186 linesep = os.linesep
180
187
181 # calculate new positions
188 # calculate new positions
182 oldpos = self.pos
189 oldpos = self.pos
183 newpos = self.lines[srow] + scol
190 newpos = self.lines[srow] + scol
184 self.pos = newpos + len(toktext)
191 self.pos = newpos + len(toktext)
185
192
186 # handle newlines
193 # handle newlines
187 if toktype in [token.NEWLINE, tokenize.NL]:
194 if toktype in [token.NEWLINE, tokenize.NL]:
188 self.out.write(linesep)
195 self.out.write(linesep)
189 return
196 return
190
197
191 # send the original whitespace, if needed
198 # send the original whitespace, if needed
192 if newpos > oldpos:
199 if newpos > oldpos:
193 self.out.write(self.raw[oldpos:newpos])
200 self.out.write(self.raw[oldpos:newpos])
194
201
195 # skip indenting tokens
202 # skip indenting tokens
196 if toktype in [token.INDENT, token.DEDENT]:
203 if toktype in [token.INDENT, token.DEDENT]:
197 self.pos = newpos
204 self.pos = newpos
198 return
205 return
199
206
200 # map token type to a color group
207 # map token type to a color group
201 if token.LPAR <= toktype and toktype <= token.OP:
208 if token.LPAR <= toktype and toktype <= token.OP:
202 toktype = token.OP
209 toktype = token.OP
203 elif toktype == token.NAME and keyword.iskeyword(toktext):
210 elif toktype == token.NAME and keyword.iskeyword(toktext):
204 toktype = _KEYWORD
211 toktype = _KEYWORD
205 color = colors.get(toktype, colors[_TEXT])
212 color = colors.get(toktype, colors[_TEXT])
206
213
207 #print '<%s>' % toktext, # dbg
214 #print '<%s>' % toktext, # dbg
208
215
209 # Triple quoted strings must be handled carefully so that backtracking
216 # Triple quoted strings must be handled carefully so that backtracking
210 # in pagers works correctly. We need color terminators on _each_ line.
217 # in pagers works correctly. We need color terminators on _each_ line.
211 if linesep in toktext:
218 if linesep in toktext:
212 toktext = toktext.replace(linesep, '%s%s%s' %
219 toktext = toktext.replace(linesep, '%s%s%s' %
213 (colors.normal,linesep,color))
220 (colors.normal,linesep,color))
214
221
215 # send text
222 # send text
216 self.out.write('%s%s%s' % (color,toktext,colors.normal))
223 self.out.write('%s%s%s' % (color,toktext,colors.normal))
217
224
218 def main():
225 def main():
219 """Colorize a python file using ANSI color escapes and print to stdout.
226 """Colorize a python file using ANSI color escapes and print to stdout.
220
227
221 Usage:
228 Usage:
222 %s [-s scheme] filename
229 %s [-s scheme] filename
223
230
224 Options:
231 Options:
225
232
226 -s scheme: give the color scheme to use. Currently only 'Linux'
233 -s scheme: give the color scheme to use. Currently only 'Linux'
227 (default) and 'LightBG' and 'NoColor' are implemented (give without
234 (default) and 'LightBG' and 'NoColor' are implemented (give without
228 quotes). """
235 quotes). """
229
236
230 def usage():
237 def usage():
231 print >> sys.stderr, main.__doc__ % sys.argv[0]
238 print >> sys.stderr, main.__doc__ % sys.argv[0]
232 sys.exit(1)
239 sys.exit(1)
233
240
234 # FIXME: rewrite this to at least use getopt
241 # FIXME: rewrite this to at least use getopt
235 try:
242 try:
236 if sys.argv[1] == '-s':
243 if sys.argv[1] == '-s':
237 scheme_name = sys.argv[2]
244 scheme_name = sys.argv[2]
238 del sys.argv[1:3]
245 del sys.argv[1:3]
239 else:
246 else:
240 scheme_name = _scheme_default
247 scheme_name = _scheme_default
241
248
242 except:
249 except:
243 usage()
250 usage()
244
251
245 try:
252 try:
246 fname = sys.argv[1]
253 fname = sys.argv[1]
247 except:
254 except:
248 usage()
255 usage()
249
256
250 # write colorized version to stdout
257 # write colorized version to stdout
251 parser = Parser()
258 parser = Parser()
252 try:
259 try:
253 parser.format(file(fname).read(),scheme = scheme_name)
260 parser.format(file(fname).read(),scheme = scheme_name)
254 except IOError,msg:
261 except IOError,msg:
255 # if user reads through a pager and quits, don't print traceback
262 # if user reads through a pager and quits, don't print traceback
256 if msg.args != (32,'Broken pipe'):
263 if msg.args != (32,'Broken pipe'):
257 raise
264 raise
258
265
259 if __name__ == "__main__":
266 if __name__ == "__main__":
260 main()
267 main()
@@ -1,903 +1,924 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """
2 """
3 ultraTB.py -- Spice up your tracebacks!
3 ultraTB.py -- Spice up your tracebacks!
4
4
5 * ColorTB
5 * ColorTB
6 I've always found it a bit hard to visually parse tracebacks in Python. The
6 I've always found it a bit hard to visually parse tracebacks in Python. The
7 ColorTB class is a solution to that problem. It colors the different parts of a
7 ColorTB class is a solution to that problem. It colors the different parts of a
8 traceback in a manner similar to what you would expect from a syntax-highlighting
8 traceback in a manner similar to what you would expect from a syntax-highlighting
9 text editor.
9 text editor.
10
10
11 Installation instructions for ColorTB:
11 Installation instructions for ColorTB:
12 import sys,ultraTB
12 import sys,ultraTB
13 sys.excepthook = ultraTB.ColorTB()
13 sys.excepthook = ultraTB.ColorTB()
14
14
15 * VerboseTB
15 * VerboseTB
16 I've also included a port of Ka-Ping Yee's "cgitb.py" that produces all kinds
16 I've also included a port of Ka-Ping Yee's "cgitb.py" that produces all kinds
17 of useful info when a traceback occurs. Ping originally had it spit out HTML
17 of useful info when a traceback occurs. Ping originally had it spit out HTML
18 and intended it for CGI programmers, but why should they have all the fun? I
18 and intended it for CGI programmers, but why should they have all the fun? I
19 altered it to spit out colored text to the terminal. It's a bit overwhelming,
19 altered it to spit out colored text to the terminal. It's a bit overwhelming,
20 but kind of neat, and maybe useful for long-running programs that you believe
20 but kind of neat, and maybe useful for long-running programs that you believe
21 are bug-free. If a crash *does* occur in that type of program you want details.
21 are bug-free. If a crash *does* occur in that type of program you want details.
22 Give it a shot--you'll love it or you'll hate it.
22 Give it a shot--you'll love it or you'll hate it.
23
23
24 Note:
24 Note:
25
25
26 The Verbose mode prints the variables currently visible where the exception
26 The Verbose mode prints the variables currently visible where the exception
27 happened (shortening their strings if too long). This can potentially be
27 happened (shortening their strings if too long). This can potentially be
28 very slow, if you happen to have a huge data structure whose string
28 very slow, if you happen to have a huge data structure whose string
29 representation is complex to compute. Your computer may appear to freeze for
29 representation is complex to compute. Your computer may appear to freeze for
30 a while with cpu usage at 100%. If this occurs, you can cancel the traceback
30 a while with cpu usage at 100%. If this occurs, you can cancel the traceback
31 with Ctrl-C (maybe hitting it more than once).
31 with Ctrl-C (maybe hitting it more than once).
32
32
33 If you encounter this kind of situation often, you may want to use the
33 If you encounter this kind of situation often, you may want to use the
34 Verbose_novars mode instead of the regular Verbose, which avoids formatting
34 Verbose_novars mode instead of the regular Verbose, which avoids formatting
35 variables (but otherwise includes the information and context given by
35 variables (but otherwise includes the information and context given by
36 Verbose).
36 Verbose).
37
37
38
38
39 Installation instructions for ColorTB:
39 Installation instructions for ColorTB:
40 import sys,ultraTB
40 import sys,ultraTB
41 sys.excepthook = ultraTB.VerboseTB()
41 sys.excepthook = ultraTB.VerboseTB()
42
42
43 Note: Much of the code in this module was lifted verbatim from the standard
43 Note: Much of the code in this module was lifted verbatim from the standard
44 library module 'traceback.py' and Ka-Ping Yee's 'cgitb.py'.
44 library module 'traceback.py' and Ka-Ping Yee's 'cgitb.py'.
45
45
46 * Color schemes
46 * Color schemes
47 The colors are defined in the class TBTools through the use of the
47 The colors are defined in the class TBTools through the use of the
48 ColorSchemeTable class. Currently the following exist:
48 ColorSchemeTable class. Currently the following exist:
49
49
50 - NoColor: allows all of this module to be used in any terminal (the color
50 - NoColor: allows all of this module to be used in any terminal (the color
51 escapes are just dummy blank strings).
51 escapes are just dummy blank strings).
52
52
53 - Linux: is meant to look good in a terminal like the Linux console (black
53 - Linux: is meant to look good in a terminal like the Linux console (black
54 or very dark background).
54 or very dark background).
55
55
56 - LightBG: similar to Linux but swaps dark/light colors to be more readable
56 - LightBG: similar to Linux but swaps dark/light colors to be more readable
57 in light background terminals.
57 in light background terminals.
58
58
59 You can implement other color schemes easily, the syntax is fairly
59 You can implement other color schemes easily, the syntax is fairly
60 self-explanatory. Please send back new schemes you develop to the author for
60 self-explanatory. Please send back new schemes you develop to the author for
61 possible inclusion in future releases.
61 possible inclusion in future releases.
62
62
63 $Id: ultraTB.py 2027 2007-01-19 00:55:09Z fperez $"""
63 $Id: ultraTB.py 2155 2007-03-19 00:45:51Z fperez $"""
64
64
65 #*****************************************************************************
65 #*****************************************************************************
66 # Copyright (C) 2001 Nathaniel Gray <n8gray@caltech.edu>
66 # Copyright (C) 2001 Nathaniel Gray <n8gray@caltech.edu>
67 # Copyright (C) 2001-2004 Fernando Perez <fperez@colorado.edu>
67 # Copyright (C) 2001-2004 Fernando Perez <fperez@colorado.edu>
68 #
68 #
69 # Distributed under the terms of the BSD License. The full license is in
69 # Distributed under the terms of the BSD License. The full license is in
70 # the file COPYING, distributed as part of this software.
70 # the file COPYING, distributed as part of this software.
71 #*****************************************************************************
71 #*****************************************************************************
72
72
73 from IPython import Release
73 from IPython import Release
74 __author__ = '%s <%s>\n%s <%s>' % (Release.authors['Nathan']+
74 __author__ = '%s <%s>\n%s <%s>' % (Release.authors['Nathan']+
75 Release.authors['Fernando'])
75 Release.authors['Fernando'])
76 __license__ = Release.license
76 __license__ = Release.license
77
77
78 # Required modules
78 # Required modules
79 import inspect
79 import inspect
80 import keyword
80 import keyword
81 import linecache
81 import linecache
82 import os
82 import os
83 import pydoc
83 import pydoc
84 import string
84 import string
85 import sys
85 import sys
86 import time
86 import time
87 import tokenize
87 import tokenize
88 import traceback
88 import traceback
89 import types
89 import types
90
90
91 # IPython's own modules
91 # IPython's own modules
92 # Modified pdb which doesn't damage IPython's readline handling
92 # Modified pdb which doesn't damage IPython's readline handling
93 from IPython import Debugger
93 from IPython import Debugger, PyColorize
94 from IPython.ipstruct import Struct
94 from IPython.ipstruct import Struct
95 from IPython.excolors import ExceptionColors
95 from IPython.excolors import ExceptionColors
96 from IPython.genutils import Term,uniq_stable,error,info
96 from IPython.genutils import Term,uniq_stable,error,info
97
97
98 # Globals
98 # Globals
99 # amount of space to put line numbers before verbose tracebacks
99 # amount of space to put line numbers before verbose tracebacks
100 INDENT_SIZE = 8
100 INDENT_SIZE = 8
101
101
102 # Default color scheme. This is used, for example, by the traceback
103 # formatter. When running in an actual IPython instance, the user's rc.colors
104 # value is used, but havinga module global makes this functionality available
105 # to users of ultraTB who are NOT running inside ipython.
106 DEFAULT_SCHEME = 'NoColors'
107
102 #---------------------------------------------------------------------------
108 #---------------------------------------------------------------------------
103 # Code begins
109 # Code begins
104
110
105 # Utility functions
111 # Utility functions
106 def inspect_error():
112 def inspect_error():
107 """Print a message about internal inspect errors.
113 """Print a message about internal inspect errors.
108
114
109 These are unfortunately quite common."""
115 These are unfortunately quite common."""
110
116
111 error('Internal Python error in the inspect module.\n'
117 error('Internal Python error in the inspect module.\n'
112 'Below is the traceback from this internal error.\n')
118 'Below is the traceback from this internal error.\n')
113
119
114 def _fixed_getinnerframes(etb, context=1,tb_offset=0):
120 def _fixed_getinnerframes(etb, context=1,tb_offset=0):
115 import linecache
121 import linecache
116 LNUM_POS, LINES_POS, INDEX_POS = 2, 4, 5
122 LNUM_POS, LINES_POS, INDEX_POS = 2, 4, 5
117
123
118 records = inspect.getinnerframes(etb, context)
124 records = inspect.getinnerframes(etb, context)
119
125
120 # If the error is at the console, don't build any context, since it would
126 # If the error is at the console, don't build any context, since it would
121 # otherwise produce 5 blank lines printed out (there is no file at the
127 # otherwise produce 5 blank lines printed out (there is no file at the
122 # console)
128 # console)
123 rec_check = records[tb_offset:]
129 rec_check = records[tb_offset:]
124 try:
130 try:
125 rname = rec_check[0][1]
131 rname = rec_check[0][1]
126 if rname == '<ipython console>' or rname.endswith('<string>'):
132 if rname == '<ipython console>' or rname.endswith('<string>'):
127 return rec_check
133 return rec_check
128 except IndexError:
134 except IndexError:
129 pass
135 pass
130
136
131 aux = traceback.extract_tb(etb)
137 aux = traceback.extract_tb(etb)
132 assert len(records) == len(aux)
138 assert len(records) == len(aux)
133 for i, (file, lnum, _, _) in zip(range(len(records)), aux):
139 for i, (file, lnum, _, _) in zip(range(len(records)), aux):
134 maybeStart = lnum-1 - context//2
140 maybeStart = lnum-1 - context//2
135 start = max(maybeStart, 0)
141 start = max(maybeStart, 0)
136 end = start + context
142 end = start + context
137 lines = linecache.getlines(file)[start:end]
143 lines = linecache.getlines(file)[start:end]
138 # pad with empty lines if necessary
144 # pad with empty lines if necessary
139 if maybeStart < 0:
145 if maybeStart < 0:
140 lines = (['\n'] * -maybeStart) + lines
146 lines = (['\n'] * -maybeStart) + lines
141 if len(lines) < context:
147 if len(lines) < context:
142 lines += ['\n'] * (context - len(lines))
148 lines += ['\n'] * (context - len(lines))
143 buf = list(records[i])
149 buf = list(records[i])
144 buf[LNUM_POS] = lnum
150 buf[LNUM_POS] = lnum
145 buf[INDEX_POS] = lnum - 1 - start
151 buf[INDEX_POS] = lnum - 1 - start
146 buf[LINES_POS] = lines
152 buf[LINES_POS] = lines
147 records[i] = tuple(buf)
153 records[i] = tuple(buf)
148 return records[tb_offset:]
154 return records[tb_offset:]
149
155
150 # Helper function -- largely belongs to VerboseTB, but we need the same
156 # Helper function -- largely belongs to VerboseTB, but we need the same
151 # functionality to produce a pseudo verbose TB for SyntaxErrors, so that they
157 # functionality to produce a pseudo verbose TB for SyntaxErrors, so that they
152 # can be recognized properly by ipython.el's py-traceback-line-re
158 # can be recognized properly by ipython.el's py-traceback-line-re
153 # (SyntaxErrors have to be treated specially because they have no traceback)
159 # (SyntaxErrors have to be treated specially because they have no traceback)
160
161 _parser = PyColorize.Parser()
162
154 def _formatTracebackLines(lnum, index, lines, Colors, lvals=None):
163 def _formatTracebackLines(lnum, index, lines, Colors, lvals=None):
155 numbers_width = INDENT_SIZE - 1
164 numbers_width = INDENT_SIZE - 1
156 res = []
165 res = []
157 i = lnum - index
166 i = lnum - index
167
168 # This lets us get fully syntax-highlighted tracebacks.
169 try:
170 scheme = __IPYTHON__.rc.colors
171 except:
172 scheme = DEFAULT_SCHEME
173 _line_format = _parser.format2
174
158 for line in lines:
175 for line in lines:
176 new_line, err = _line_format(line,'str',scheme)
177 if not err: line = new_line
178
159 if i == lnum:
179 if i == lnum:
160 # This is the line with the error
180 # This is the line with the error
161 pad = numbers_width - len(str(i))
181 pad = numbers_width - len(str(i))
162 if pad >= 3:
182 if pad >= 3:
163 marker = '-'*(pad-3) + '-> '
183 marker = '-'*(pad-3) + '-> '
164 elif pad == 2:
184 elif pad == 2:
165 marker = '> '
185 marker = '> '
166 elif pad == 1:
186 elif pad == 1:
167 marker = '>'
187 marker = '>'
168 else:
188 else:
169 marker = ''
189 marker = ''
170 num = marker + str(i)
190 num = marker + str(i)
171 line = '%s%s%s %s%s' %(Colors.linenoEm, num,
191 line = '%s%s%s %s%s' %(Colors.linenoEm, num,
172 Colors.line, line, Colors.Normal)
192 Colors.line, line, Colors.Normal)
173 else:
193 else:
174 num = '%*s' % (numbers_width,i)
194 num = '%*s' % (numbers_width,i)
175 line = '%s%s%s %s' %(Colors.lineno, num,
195 line = '%s%s%s %s' %(Colors.lineno, num,
176 Colors.Normal, line)
196 Colors.Normal, line)
177
197
178 res.append(line)
198 res.append(line)
179 if lvals and i == lnum:
199 if lvals and i == lnum:
180 res.append(lvals + '\n')
200 res.append(lvals + '\n')
181 i = i + 1
201 i = i + 1
182 return res
202 return res
183
203
204
184 #---------------------------------------------------------------------------
205 #---------------------------------------------------------------------------
185 # Module classes
206 # Module classes
186 class TBTools:
207 class TBTools:
187 """Basic tools used by all traceback printer classes."""
208 """Basic tools used by all traceback printer classes."""
188
209
189 def __init__(self,color_scheme = 'NoColor',call_pdb=False):
210 def __init__(self,color_scheme = 'NoColor',call_pdb=False):
190 # Whether to call the interactive pdb debugger after printing
211 # Whether to call the interactive pdb debugger after printing
191 # tracebacks or not
212 # tracebacks or not
192 self.call_pdb = call_pdb
213 self.call_pdb = call_pdb
193
214
194 # Create color table
215 # Create color table
195 self.color_scheme_table = ExceptionColors
216 self.color_scheme_table = ExceptionColors
196
217
197 self.set_colors(color_scheme)
218 self.set_colors(color_scheme)
198 self.old_scheme = color_scheme # save initial value for toggles
219 self.old_scheme = color_scheme # save initial value for toggles
199
220
200 if call_pdb:
221 if call_pdb:
201 self.pdb = Debugger.Pdb(self.color_scheme_table.active_scheme_name)
222 self.pdb = Debugger.Pdb(self.color_scheme_table.active_scheme_name)
202 else:
223 else:
203 self.pdb = None
224 self.pdb = None
204
225
205 def set_colors(self,*args,**kw):
226 def set_colors(self,*args,**kw):
206 """Shorthand access to the color table scheme selector method."""
227 """Shorthand access to the color table scheme selector method."""
207
228
208 # Set own color table
229 # Set own color table
209 self.color_scheme_table.set_active_scheme(*args,**kw)
230 self.color_scheme_table.set_active_scheme(*args,**kw)
210 # for convenience, set Colors to the active scheme
231 # for convenience, set Colors to the active scheme
211 self.Colors = self.color_scheme_table.active_colors
232 self.Colors = self.color_scheme_table.active_colors
212 # Also set colors of debugger
233 # Also set colors of debugger
213 if hasattr(self,'pdb') and self.pdb is not None:
234 if hasattr(self,'pdb') and self.pdb is not None:
214 self.pdb.set_colors(*args,**kw)
235 self.pdb.set_colors(*args,**kw)
215
236
216 def color_toggle(self):
237 def color_toggle(self):
217 """Toggle between the currently active color scheme and NoColor."""
238 """Toggle between the currently active color scheme and NoColor."""
218
239
219 if self.color_scheme_table.active_scheme_name == 'NoColor':
240 if self.color_scheme_table.active_scheme_name == 'NoColor':
220 self.color_scheme_table.set_active_scheme(self.old_scheme)
241 self.color_scheme_table.set_active_scheme(self.old_scheme)
221 self.Colors = self.color_scheme_table.active_colors
242 self.Colors = self.color_scheme_table.active_colors
222 else:
243 else:
223 self.old_scheme = self.color_scheme_table.active_scheme_name
244 self.old_scheme = self.color_scheme_table.active_scheme_name
224 self.color_scheme_table.set_active_scheme('NoColor')
245 self.color_scheme_table.set_active_scheme('NoColor')
225 self.Colors = self.color_scheme_table.active_colors
246 self.Colors = self.color_scheme_table.active_colors
226
247
227 #---------------------------------------------------------------------------
248 #---------------------------------------------------------------------------
228 class ListTB(TBTools):
249 class ListTB(TBTools):
229 """Print traceback information from a traceback list, with optional color.
250 """Print traceback information from a traceback list, with optional color.
230
251
231 Calling: requires 3 arguments:
252 Calling: requires 3 arguments:
232 (etype, evalue, elist)
253 (etype, evalue, elist)
233 as would be obtained by:
254 as would be obtained by:
234 etype, evalue, tb = sys.exc_info()
255 etype, evalue, tb = sys.exc_info()
235 if tb:
256 if tb:
236 elist = traceback.extract_tb(tb)
257 elist = traceback.extract_tb(tb)
237 else:
258 else:
238 elist = None
259 elist = None
239
260
240 It can thus be used by programs which need to process the traceback before
261 It can thus be used by programs which need to process the traceback before
241 printing (such as console replacements based on the code module from the
262 printing (such as console replacements based on the code module from the
242 standard library).
263 standard library).
243
264
244 Because they are meant to be called without a full traceback (only a
265 Because they are meant to be called without a full traceback (only a
245 list), instances of this class can't call the interactive pdb debugger."""
266 list), instances of this class can't call the interactive pdb debugger."""
246
267
247 def __init__(self,color_scheme = 'NoColor'):
268 def __init__(self,color_scheme = 'NoColor'):
248 TBTools.__init__(self,color_scheme = color_scheme,call_pdb=0)
269 TBTools.__init__(self,color_scheme = color_scheme,call_pdb=0)
249
270
250 def __call__(self, etype, value, elist):
271 def __call__(self, etype, value, elist):
251 Term.cout.flush()
272 Term.cout.flush()
252 Term.cerr.flush()
273 Term.cerr.flush()
253 print >> Term.cerr, self.text(etype,value,elist)
274 print >> Term.cerr, self.text(etype,value,elist)
254
275
255 def text(self,etype, value, elist,context=5):
276 def text(self,etype, value, elist,context=5):
256 """Return a color formatted string with the traceback info."""
277 """Return a color formatted string with the traceback info."""
257
278
258 Colors = self.Colors
279 Colors = self.Colors
259 out_string = ['%s%s%s\n' % (Colors.topline,'-'*60,Colors.Normal)]
280 out_string = ['%s%s%s\n' % (Colors.topline,'-'*60,Colors.Normal)]
260 if elist:
281 if elist:
261 out_string.append('Traceback %s(most recent call last)%s:' % \
282 out_string.append('Traceback %s(most recent call last)%s:' % \
262 (Colors.normalEm, Colors.Normal) + '\n')
283 (Colors.normalEm, Colors.Normal) + '\n')
263 out_string.extend(self._format_list(elist))
284 out_string.extend(self._format_list(elist))
264 lines = self._format_exception_only(etype, value)
285 lines = self._format_exception_only(etype, value)
265 for line in lines[:-1]:
286 for line in lines[:-1]:
266 out_string.append(" "+line)
287 out_string.append(" "+line)
267 out_string.append(lines[-1])
288 out_string.append(lines[-1])
268 return ''.join(out_string)
289 return ''.join(out_string)
269
290
270 def _format_list(self, extracted_list):
291 def _format_list(self, extracted_list):
271 """Format a list of traceback entry tuples for printing.
292 """Format a list of traceback entry tuples for printing.
272
293
273 Given a list of tuples as returned by extract_tb() or
294 Given a list of tuples as returned by extract_tb() or
274 extract_stack(), return a list of strings ready for printing.
295 extract_stack(), return a list of strings ready for printing.
275 Each string in the resulting list corresponds to the item with the
296 Each string in the resulting list corresponds to the item with the
276 same index in the argument list. Each string ends in a newline;
297 same index in the argument list. Each string ends in a newline;
277 the strings may contain internal newlines as well, for those items
298 the strings may contain internal newlines as well, for those items
278 whose source text line is not None.
299 whose source text line is not None.
279
300
280 Lifted almost verbatim from traceback.py
301 Lifted almost verbatim from traceback.py
281 """
302 """
282
303
283 Colors = self.Colors
304 Colors = self.Colors
284 list = []
305 list = []
285 for filename, lineno, name, line in extracted_list[:-1]:
306 for filename, lineno, name, line in extracted_list[:-1]:
286 item = ' File %s"%s"%s, line %s%d%s, in %s%s%s\n' % \
307 item = ' File %s"%s"%s, line %s%d%s, in %s%s%s\n' % \
287 (Colors.filename, filename, Colors.Normal,
308 (Colors.filename, filename, Colors.Normal,
288 Colors.lineno, lineno, Colors.Normal,
309 Colors.lineno, lineno, Colors.Normal,
289 Colors.name, name, Colors.Normal)
310 Colors.name, name, Colors.Normal)
290 if line:
311 if line:
291 item = item + ' %s\n' % line.strip()
312 item = item + ' %s\n' % line.strip()
292 list.append(item)
313 list.append(item)
293 # Emphasize the last entry
314 # Emphasize the last entry
294 filename, lineno, name, line = extracted_list[-1]
315 filename, lineno, name, line = extracted_list[-1]
295 item = '%s File %s"%s"%s, line %s%d%s, in %s%s%s%s\n' % \
316 item = '%s File %s"%s"%s, line %s%d%s, in %s%s%s%s\n' % \
296 (Colors.normalEm,
317 (Colors.normalEm,
297 Colors.filenameEm, filename, Colors.normalEm,
318 Colors.filenameEm, filename, Colors.normalEm,
298 Colors.linenoEm, lineno, Colors.normalEm,
319 Colors.linenoEm, lineno, Colors.normalEm,
299 Colors.nameEm, name, Colors.normalEm,
320 Colors.nameEm, name, Colors.normalEm,
300 Colors.Normal)
321 Colors.Normal)
301 if line:
322 if line:
302 item = item + '%s %s%s\n' % (Colors.line, line.strip(),
323 item = item + '%s %s%s\n' % (Colors.line, line.strip(),
303 Colors.Normal)
324 Colors.Normal)
304 list.append(item)
325 list.append(item)
305 return list
326 return list
306
327
307 def _format_exception_only(self, etype, value):
328 def _format_exception_only(self, etype, value):
308 """Format the exception part of a traceback.
329 """Format the exception part of a traceback.
309
330
310 The arguments are the exception type and value such as given by
331 The arguments are the exception type and value such as given by
311 sys.exc_info()[:2]. The return value is a list of strings, each ending
332 sys.exc_info()[:2]. The return value is a list of strings, each ending
312 in a newline. Normally, the list contains a single string; however,
333 in a newline. Normally, the list contains a single string; however,
313 for SyntaxError exceptions, it contains several lines that (when
334 for SyntaxError exceptions, it contains several lines that (when
314 printed) display detailed information about where the syntax error
335 printed) display detailed information about where the syntax error
315 occurred. The message indicating which exception occurred is the
336 occurred. The message indicating which exception occurred is the
316 always last string in the list.
337 always last string in the list.
317
338
318 Also lifted nearly verbatim from traceback.py
339 Also lifted nearly verbatim from traceback.py
319 """
340 """
320
341
321 Colors = self.Colors
342 Colors = self.Colors
322 list = []
343 list = []
323 if type(etype) == types.ClassType:
344 if type(etype) == types.ClassType:
324 stype = Colors.excName + etype.__name__ + Colors.Normal
345 stype = Colors.excName + etype.__name__ + Colors.Normal
325 else:
346 else:
326 stype = etype # String exceptions don't get special coloring
347 stype = etype # String exceptions don't get special coloring
327 if value is None:
348 if value is None:
328 list.append( str(stype) + '\n')
349 list.append( str(stype) + '\n')
329 else:
350 else:
330 if etype is SyntaxError:
351 if etype is SyntaxError:
331 try:
352 try:
332 msg, (filename, lineno, offset, line) = value
353 msg, (filename, lineno, offset, line) = value
333 except:
354 except:
334 pass
355 pass
335 else:
356 else:
336 #print 'filename is',filename # dbg
357 #print 'filename is',filename # dbg
337 if not filename: filename = "<string>"
358 if not filename: filename = "<string>"
338 list.append('%s File %s"%s"%s, line %s%d%s\n' % \
359 list.append('%s File %s"%s"%s, line %s%d%s\n' % \
339 (Colors.normalEm,
360 (Colors.normalEm,
340 Colors.filenameEm, filename, Colors.normalEm,
361 Colors.filenameEm, filename, Colors.normalEm,
341 Colors.linenoEm, lineno, Colors.Normal ))
362 Colors.linenoEm, lineno, Colors.Normal ))
342 if line is not None:
363 if line is not None:
343 i = 0
364 i = 0
344 while i < len(line) and line[i].isspace():
365 while i < len(line) and line[i].isspace():
345 i = i+1
366 i = i+1
346 list.append('%s %s%s\n' % (Colors.line,
367 list.append('%s %s%s\n' % (Colors.line,
347 line.strip(),
368 line.strip(),
348 Colors.Normal))
369 Colors.Normal))
349 if offset is not None:
370 if offset is not None:
350 s = ' '
371 s = ' '
351 for c in line[i:offset-1]:
372 for c in line[i:offset-1]:
352 if c.isspace():
373 if c.isspace():
353 s = s + c
374 s = s + c
354 else:
375 else:
355 s = s + ' '
376 s = s + ' '
356 list.append('%s%s^%s\n' % (Colors.caret, s,
377 list.append('%s%s^%s\n' % (Colors.caret, s,
357 Colors.Normal) )
378 Colors.Normal) )
358 value = msg
379 value = msg
359 s = self._some_str(value)
380 s = self._some_str(value)
360 if s:
381 if s:
361 list.append('%s%s:%s %s\n' % (str(stype), Colors.excName,
382 list.append('%s%s:%s %s\n' % (str(stype), Colors.excName,
362 Colors.Normal, s))
383 Colors.Normal, s))
363 else:
384 else:
364 list.append('%s\n' % str(stype))
385 list.append('%s\n' % str(stype))
365 return list
386 return list
366
387
367 def _some_str(self, value):
388 def _some_str(self, value):
368 # Lifted from traceback.py
389 # Lifted from traceback.py
369 try:
390 try:
370 return str(value)
391 return str(value)
371 except:
392 except:
372 return '<unprintable %s object>' % type(value).__name__
393 return '<unprintable %s object>' % type(value).__name__
373
394
374 #----------------------------------------------------------------------------
395 #----------------------------------------------------------------------------
375 class VerboseTB(TBTools):
396 class VerboseTB(TBTools):
376 """A port of Ka-Ping Yee's cgitb.py module that outputs color text instead
397 """A port of Ka-Ping Yee's cgitb.py module that outputs color text instead
377 of HTML. Requires inspect and pydoc. Crazy, man.
398 of HTML. Requires inspect and pydoc. Crazy, man.
378
399
379 Modified version which optionally strips the topmost entries from the
400 Modified version which optionally strips the topmost entries from the
380 traceback, to be used with alternate interpreters (because their own code
401 traceback, to be used with alternate interpreters (because their own code
381 would appear in the traceback)."""
402 would appear in the traceback)."""
382
403
383 def __init__(self,color_scheme = 'Linux',tb_offset=0,long_header=0,
404 def __init__(self,color_scheme = 'Linux',tb_offset=0,long_header=0,
384 call_pdb = 0, include_vars=1):
405 call_pdb = 0, include_vars=1):
385 """Specify traceback offset, headers and color scheme.
406 """Specify traceback offset, headers and color scheme.
386
407
387 Define how many frames to drop from the tracebacks. Calling it with
408 Define how many frames to drop from the tracebacks. Calling it with
388 tb_offset=1 allows use of this handler in interpreters which will have
409 tb_offset=1 allows use of this handler in interpreters which will have
389 their own code at the top of the traceback (VerboseTB will first
410 their own code at the top of the traceback (VerboseTB will first
390 remove that frame before printing the traceback info)."""
411 remove that frame before printing the traceback info)."""
391 TBTools.__init__(self,color_scheme=color_scheme,call_pdb=call_pdb)
412 TBTools.__init__(self,color_scheme=color_scheme,call_pdb=call_pdb)
392 self.tb_offset = tb_offset
413 self.tb_offset = tb_offset
393 self.long_header = long_header
414 self.long_header = long_header
394 self.include_vars = include_vars
415 self.include_vars = include_vars
395
416
396 def text(self, etype, evalue, etb, context=5):
417 def text(self, etype, evalue, etb, context=5):
397 """Return a nice text document describing the traceback."""
418 """Return a nice text document describing the traceback."""
398
419
399 # some locals
420 # some locals
400 Colors = self.Colors # just a shorthand + quicker name lookup
421 Colors = self.Colors # just a shorthand + quicker name lookup
401 ColorsNormal = Colors.Normal # used a lot
422 ColorsNormal = Colors.Normal # used a lot
402 indent = ' '*INDENT_SIZE
423 indent = ' '*INDENT_SIZE
403 exc = '%s%s%s' % (Colors.excName, str(etype), ColorsNormal)
424 exc = '%s%s%s' % (Colors.excName, str(etype), ColorsNormal)
404 em_normal = '%s\n%s%s' % (Colors.valEm, indent,ColorsNormal)
425 em_normal = '%s\n%s%s' % (Colors.valEm, indent,ColorsNormal)
405 undefined = '%sundefined%s' % (Colors.em, ColorsNormal)
426 undefined = '%sundefined%s' % (Colors.em, ColorsNormal)
406
427
407 # some internal-use functions
428 # some internal-use functions
408 def text_repr(value):
429 def text_repr(value):
409 """Hopefully pretty robust repr equivalent."""
430 """Hopefully pretty robust repr equivalent."""
410 # this is pretty horrible but should always return *something*
431 # this is pretty horrible but should always return *something*
411 try:
432 try:
412 return pydoc.text.repr(value)
433 return pydoc.text.repr(value)
413 except KeyboardInterrupt:
434 except KeyboardInterrupt:
414 raise
435 raise
415 except:
436 except:
416 try:
437 try:
417 return repr(value)
438 return repr(value)
418 except KeyboardInterrupt:
439 except KeyboardInterrupt:
419 raise
440 raise
420 except:
441 except:
421 try:
442 try:
422 # all still in an except block so we catch
443 # all still in an except block so we catch
423 # getattr raising
444 # getattr raising
424 name = getattr(value, '__name__', None)
445 name = getattr(value, '__name__', None)
425 if name:
446 if name:
426 # ick, recursion
447 # ick, recursion
427 return text_repr(name)
448 return text_repr(name)
428 klass = getattr(value, '__class__', None)
449 klass = getattr(value, '__class__', None)
429 if klass:
450 if klass:
430 return '%s instance' % text_repr(klass)
451 return '%s instance' % text_repr(klass)
431 except KeyboardInterrupt:
452 except KeyboardInterrupt:
432 raise
453 raise
433 except:
454 except:
434 return 'UNRECOVERABLE REPR FAILURE'
455 return 'UNRECOVERABLE REPR FAILURE'
435 def eqrepr(value, repr=text_repr): return '=%s' % repr(value)
456 def eqrepr(value, repr=text_repr): return '=%s' % repr(value)
436 def nullrepr(value, repr=text_repr): return ''
457 def nullrepr(value, repr=text_repr): return ''
437
458
438 # meat of the code begins
459 # meat of the code begins
439 if type(etype) is types.ClassType:
460 if type(etype) is types.ClassType:
440 etype = etype.__name__
461 etype = etype.__name__
441
462
442 if self.long_header:
463 if self.long_header:
443 # Header with the exception type, python version, and date
464 # Header with the exception type, python version, and date
444 pyver = 'Python ' + string.split(sys.version)[0] + ': ' + sys.executable
465 pyver = 'Python ' + string.split(sys.version)[0] + ': ' + sys.executable
445 date = time.ctime(time.time())
466 date = time.ctime(time.time())
446
467
447 head = '%s%s%s\n%s%s%s\n%s' % (Colors.topline, '-'*75, ColorsNormal,
468 head = '%s%s%s\n%s%s%s\n%s' % (Colors.topline, '-'*75, ColorsNormal,
448 exc, ' '*(75-len(str(etype))-len(pyver)),
469 exc, ' '*(75-len(str(etype))-len(pyver)),
449 pyver, string.rjust(date, 75) )
470 pyver, string.rjust(date, 75) )
450 head += "\nA problem occured executing Python code. Here is the sequence of function"\
471 head += "\nA problem occured executing Python code. Here is the sequence of function"\
451 "\ncalls leading up to the error, with the most recent (innermost) call last."
472 "\ncalls leading up to the error, with the most recent (innermost) call last."
452 else:
473 else:
453 # Simplified header
474 # Simplified header
454 head = '%s%s%s\n%s%s' % (Colors.topline, '-'*75, ColorsNormal,exc,
475 head = '%s%s%s\n%s%s' % (Colors.topline, '-'*75, ColorsNormal,exc,
455 string.rjust('Traceback (most recent call last)',
476 string.rjust('Traceback (most recent call last)',
456 75 - len(str(etype)) ) )
477 75 - len(str(etype)) ) )
457 frames = []
478 frames = []
458 # Flush cache before calling inspect. This helps alleviate some of the
479 # Flush cache before calling inspect. This helps alleviate some of the
459 # problems with python 2.3's inspect.py.
480 # problems with python 2.3's inspect.py.
460 linecache.checkcache()
481 linecache.checkcache()
461 # Drop topmost frames if requested
482 # Drop topmost frames if requested
462 try:
483 try:
463 # Try the default getinnerframes and Alex's: Alex's fixes some
484 # Try the default getinnerframes and Alex's: Alex's fixes some
464 # problems, but it generates empty tracebacks for console errors
485 # problems, but it generates empty tracebacks for console errors
465 # (5 blanks lines) where none should be returned.
486 # (5 blanks lines) where none should be returned.
466 #records = inspect.getinnerframes(etb, context)[self.tb_offset:]
487 #records = inspect.getinnerframes(etb, context)[self.tb_offset:]
467 #print 'python records:', records # dbg
488 #print 'python records:', records # dbg
468 records = _fixed_getinnerframes(etb, context,self.tb_offset)
489 records = _fixed_getinnerframes(etb, context,self.tb_offset)
469 #print 'alex records:', records # dbg
490 #print 'alex records:', records # dbg
470 except:
491 except:
471
492
472 # FIXME: I've been getting many crash reports from python 2.3
493 # FIXME: I've been getting many crash reports from python 2.3
473 # users, traceable to inspect.py. If I can find a small test-case
494 # users, traceable to inspect.py. If I can find a small test-case
474 # to reproduce this, I should either write a better workaround or
495 # to reproduce this, I should either write a better workaround or
475 # file a bug report against inspect (if that's the real problem).
496 # file a bug report against inspect (if that's the real problem).
476 # So far, I haven't been able to find an isolated example to
497 # So far, I haven't been able to find an isolated example to
477 # reproduce the problem.
498 # reproduce the problem.
478 inspect_error()
499 inspect_error()
479 traceback.print_exc(file=Term.cerr)
500 traceback.print_exc(file=Term.cerr)
480 info('\nUnfortunately, your original traceback can not be constructed.\n')
501 info('\nUnfortunately, your original traceback can not be constructed.\n')
481 return ''
502 return ''
482
503
483 # build some color string templates outside these nested loops
504 # build some color string templates outside these nested loops
484 tpl_link = '%s%%s%s' % (Colors.filenameEm,ColorsNormal)
505 tpl_link = '%s%%s%s' % (Colors.filenameEm,ColorsNormal)
485 tpl_call = 'in %s%%s%s%%s%s' % (Colors.vName, Colors.valEm,
506 tpl_call = 'in %s%%s%s%%s%s' % (Colors.vName, Colors.valEm,
486 ColorsNormal)
507 ColorsNormal)
487 tpl_call_fail = 'in %s%%s%s(***failed resolving arguments***)%s' % \
508 tpl_call_fail = 'in %s%%s%s(***failed resolving arguments***)%s' % \
488 (Colors.vName, Colors.valEm, ColorsNormal)
509 (Colors.vName, Colors.valEm, ColorsNormal)
489 tpl_local_var = '%s%%s%s' % (Colors.vName, ColorsNormal)
510 tpl_local_var = '%s%%s%s' % (Colors.vName, ColorsNormal)
490 tpl_global_var = '%sglobal%s %s%%s%s' % (Colors.em, ColorsNormal,
511 tpl_global_var = '%sglobal%s %s%%s%s' % (Colors.em, ColorsNormal,
491 Colors.vName, ColorsNormal)
512 Colors.vName, ColorsNormal)
492 tpl_name_val = '%%s %s= %%s%s' % (Colors.valEm, ColorsNormal)
513 tpl_name_val = '%%s %s= %%s%s' % (Colors.valEm, ColorsNormal)
493 tpl_line = '%s%%s%s %%s' % (Colors.lineno, ColorsNormal)
514 tpl_line = '%s%%s%s %%s' % (Colors.lineno, ColorsNormal)
494 tpl_line_em = '%s%%s%s %%s%s' % (Colors.linenoEm,Colors.line,
515 tpl_line_em = '%s%%s%s %%s%s' % (Colors.linenoEm,Colors.line,
495 ColorsNormal)
516 ColorsNormal)
496
517
497 # now, loop over all records printing context and info
518 # now, loop over all records printing context and info
498 abspath = os.path.abspath
519 abspath = os.path.abspath
499 for frame, file, lnum, func, lines, index in records:
520 for frame, file, lnum, func, lines, index in records:
500 #print '*** record:',file,lnum,func,lines,index # dbg
521 #print '*** record:',file,lnum,func,lines,index # dbg
501 try:
522 try:
502 file = file and abspath(file) or '?'
523 file = file and abspath(file) or '?'
503 except OSError:
524 except OSError:
504 # if file is '<console>' or something not in the filesystem,
525 # if file is '<console>' or something not in the filesystem,
505 # the abspath call will throw an OSError. Just ignore it and
526 # the abspath call will throw an OSError. Just ignore it and
506 # keep the original file string.
527 # keep the original file string.
507 pass
528 pass
508 link = tpl_link % file
529 link = tpl_link % file
509 try:
530 try:
510 args, varargs, varkw, locals = inspect.getargvalues(frame)
531 args, varargs, varkw, locals = inspect.getargvalues(frame)
511 except:
532 except:
512 # This can happen due to a bug in python2.3. We should be
533 # This can happen due to a bug in python2.3. We should be
513 # able to remove this try/except when 2.4 becomes a
534 # able to remove this try/except when 2.4 becomes a
514 # requirement. Bug details at http://python.org/sf/1005466
535 # requirement. Bug details at http://python.org/sf/1005466
515 inspect_error()
536 inspect_error()
516 traceback.print_exc(file=Term.cerr)
537 traceback.print_exc(file=Term.cerr)
517 info("\nIPython's exception reporting continues...\n")
538 info("\nIPython's exception reporting continues...\n")
518
539
519 if func == '?':
540 if func == '?':
520 call = ''
541 call = ''
521 else:
542 else:
522 # Decide whether to include variable details or not
543 # Decide whether to include variable details or not
523 var_repr = self.include_vars and eqrepr or nullrepr
544 var_repr = self.include_vars and eqrepr or nullrepr
524 try:
545 try:
525 call = tpl_call % (func,inspect.formatargvalues(args,
546 call = tpl_call % (func,inspect.formatargvalues(args,
526 varargs, varkw,
547 varargs, varkw,
527 locals,formatvalue=var_repr))
548 locals,formatvalue=var_repr))
528 except KeyError:
549 except KeyError:
529 # Very odd crash from inspect.formatargvalues(). The
550 # Very odd crash from inspect.formatargvalues(). The
530 # scenario under which it appeared was a call to
551 # scenario under which it appeared was a call to
531 # view(array,scale) in NumTut.view.view(), where scale had
552 # view(array,scale) in NumTut.view.view(), where scale had
532 # been defined as a scalar (it should be a tuple). Somehow
553 # been defined as a scalar (it should be a tuple). Somehow
533 # inspect messes up resolving the argument list of view()
554 # inspect messes up resolving the argument list of view()
534 # and barfs out. At some point I should dig into this one
555 # and barfs out. At some point I should dig into this one
535 # and file a bug report about it.
556 # and file a bug report about it.
536 inspect_error()
557 inspect_error()
537 traceback.print_exc(file=Term.cerr)
558 traceback.print_exc(file=Term.cerr)
538 info("\nIPython's exception reporting continues...\n")
559 info("\nIPython's exception reporting continues...\n")
539 call = tpl_call_fail % func
560 call = tpl_call_fail % func
540
561
541 # Initialize a list of names on the current line, which the
562 # Initialize a list of names on the current line, which the
542 # tokenizer below will populate.
563 # tokenizer below will populate.
543 names = []
564 names = []
544
565
545 def tokeneater(token_type, token, start, end, line):
566 def tokeneater(token_type, token, start, end, line):
546 """Stateful tokeneater which builds dotted names.
567 """Stateful tokeneater which builds dotted names.
547
568
548 The list of names it appends to (from the enclosing scope) can
569 The list of names it appends to (from the enclosing scope) can
549 contain repeated composite names. This is unavoidable, since
570 contain repeated composite names. This is unavoidable, since
550 there is no way to disambguate partial dotted structures until
571 there is no way to disambguate partial dotted structures until
551 the full list is known. The caller is responsible for pruning
572 the full list is known. The caller is responsible for pruning
552 the final list of duplicates before using it."""
573 the final list of duplicates before using it."""
553
574
554 # build composite names
575 # build composite names
555 if token == '.':
576 if token == '.':
556 try:
577 try:
557 names[-1] += '.'
578 names[-1] += '.'
558 # store state so the next token is added for x.y.z names
579 # store state so the next token is added for x.y.z names
559 tokeneater.name_cont = True
580 tokeneater.name_cont = True
560 return
581 return
561 except IndexError:
582 except IndexError:
562 pass
583 pass
563 if token_type == tokenize.NAME and token not in keyword.kwlist:
584 if token_type == tokenize.NAME and token not in keyword.kwlist:
564 if tokeneater.name_cont:
585 if tokeneater.name_cont:
565 # Dotted names
586 # Dotted names
566 names[-1] += token
587 names[-1] += token
567 tokeneater.name_cont = False
588 tokeneater.name_cont = False
568 else:
589 else:
569 # Regular new names. We append everything, the caller
590 # Regular new names. We append everything, the caller
570 # will be responsible for pruning the list later. It's
591 # will be responsible for pruning the list later. It's
571 # very tricky to try to prune as we go, b/c composite
592 # very tricky to try to prune as we go, b/c composite
572 # names can fool us. The pruning at the end is easy
593 # names can fool us. The pruning at the end is easy
573 # to do (or the caller can print a list with repeated
594 # to do (or the caller can print a list with repeated
574 # names if so desired.
595 # names if so desired.
575 names.append(token)
596 names.append(token)
576 elif token_type == tokenize.NEWLINE:
597 elif token_type == tokenize.NEWLINE:
577 raise IndexError
598 raise IndexError
578 # we need to store a bit of state in the tokenizer to build
599 # we need to store a bit of state in the tokenizer to build
579 # dotted names
600 # dotted names
580 tokeneater.name_cont = False
601 tokeneater.name_cont = False
581
602
582 def linereader(file=file, lnum=[lnum], getline=linecache.getline):
603 def linereader(file=file, lnum=[lnum], getline=linecache.getline):
583 line = getline(file, lnum[0])
604 line = getline(file, lnum[0])
584 lnum[0] += 1
605 lnum[0] += 1
585 return line
606 return line
586
607
587 # Build the list of names on this line of code where the exception
608 # Build the list of names on this line of code where the exception
588 # occurred.
609 # occurred.
589 try:
610 try:
590 # This builds the names list in-place by capturing it from the
611 # This builds the names list in-place by capturing it from the
591 # enclosing scope.
612 # enclosing scope.
592 tokenize.tokenize(linereader, tokeneater)
613 tokenize.tokenize(linereader, tokeneater)
593 except IndexError:
614 except IndexError:
594 # signals exit of tokenizer
615 # signals exit of tokenizer
595 pass
616 pass
596 except tokenize.TokenError,msg:
617 except tokenize.TokenError,msg:
597 _m = ("An unexpected error occurred while tokenizing input\n"
618 _m = ("An unexpected error occurred while tokenizing input\n"
598 "The following traceback may be corrupted or invalid\n"
619 "The following traceback may be corrupted or invalid\n"
599 "The error message is: %s\n" % msg)
620 "The error message is: %s\n" % msg)
600 error(_m)
621 error(_m)
601
622
602 # prune names list of duplicates, but keep the right order
623 # prune names list of duplicates, but keep the right order
603 unique_names = uniq_stable(names)
624 unique_names = uniq_stable(names)
604
625
605 # Start loop over vars
626 # Start loop over vars
606 lvals = []
627 lvals = []
607 if self.include_vars:
628 if self.include_vars:
608 for name_full in unique_names:
629 for name_full in unique_names:
609 name_base = name_full.split('.',1)[0]
630 name_base = name_full.split('.',1)[0]
610 if name_base in frame.f_code.co_varnames:
631 if name_base in frame.f_code.co_varnames:
611 if locals.has_key(name_base):
632 if locals.has_key(name_base):
612 try:
633 try:
613 value = repr(eval(name_full,locals))
634 value = repr(eval(name_full,locals))
614 except:
635 except:
615 value = undefined
636 value = undefined
616 else:
637 else:
617 value = undefined
638 value = undefined
618 name = tpl_local_var % name_full
639 name = tpl_local_var % name_full
619 else:
640 else:
620 if frame.f_globals.has_key(name_base):
641 if frame.f_globals.has_key(name_base):
621 try:
642 try:
622 value = repr(eval(name_full,frame.f_globals))
643 value = repr(eval(name_full,frame.f_globals))
623 except:
644 except:
624 value = undefined
645 value = undefined
625 else:
646 else:
626 value = undefined
647 value = undefined
627 name = tpl_global_var % name_full
648 name = tpl_global_var % name_full
628 lvals.append(tpl_name_val % (name,value))
649 lvals.append(tpl_name_val % (name,value))
629 if lvals:
650 if lvals:
630 lvals = '%s%s' % (indent,em_normal.join(lvals))
651 lvals = '%s%s' % (indent,em_normal.join(lvals))
631 else:
652 else:
632 lvals = ''
653 lvals = ''
633
654
634 level = '%s %s\n' % (link,call)
655 level = '%s %s\n' % (link,call)
635
656
636 if index is None:
657 if index is None:
637 frames.append(level)
658 frames.append(level)
638 else:
659 else:
639 frames.append('%s%s' % (level,''.join(
660 frames.append('%s%s' % (level,''.join(
640 _formatTracebackLines(lnum,index,lines,self.Colors,lvals))))
661 _formatTracebackLines(lnum,index,lines,self.Colors,lvals))))
641
662
642 # Get (safely) a string form of the exception info
663 # Get (safely) a string form of the exception info
643 try:
664 try:
644 etype_str,evalue_str = map(str,(etype,evalue))
665 etype_str,evalue_str = map(str,(etype,evalue))
645 except:
666 except:
646 # User exception is improperly defined.
667 # User exception is improperly defined.
647 etype,evalue = str,sys.exc_info()[:2]
668 etype,evalue = str,sys.exc_info()[:2]
648 etype_str,evalue_str = map(str,(etype,evalue))
669 etype_str,evalue_str = map(str,(etype,evalue))
649 # ... and format it
670 # ... and format it
650 exception = ['%s%s%s: %s' % (Colors.excName, etype_str,
671 exception = ['%s%s%s: %s' % (Colors.excName, etype_str,
651 ColorsNormal, evalue_str)]
672 ColorsNormal, evalue_str)]
652 if type(evalue) is types.InstanceType:
673 if type(evalue) is types.InstanceType:
653 try:
674 try:
654 names = [w for w in dir(evalue) if isinstance(w, basestring)]
675 names = [w for w in dir(evalue) if isinstance(w, basestring)]
655 except:
676 except:
656 # Every now and then, an object with funny inernals blows up
677 # Every now and then, an object with funny inernals blows up
657 # when dir() is called on it. We do the best we can to report
678 # when dir() is called on it. We do the best we can to report
658 # the problem and continue
679 # the problem and continue
659 _m = '%sException reporting error (object with broken dir())%s:'
680 _m = '%sException reporting error (object with broken dir())%s:'
660 exception.append(_m % (Colors.excName,ColorsNormal))
681 exception.append(_m % (Colors.excName,ColorsNormal))
661 etype_str,evalue_str = map(str,sys.exc_info()[:2])
682 etype_str,evalue_str = map(str,sys.exc_info()[:2])
662 exception.append('%s%s%s: %s' % (Colors.excName,etype_str,
683 exception.append('%s%s%s: %s' % (Colors.excName,etype_str,
663 ColorsNormal, evalue_str))
684 ColorsNormal, evalue_str))
664 names = []
685 names = []
665 for name in names:
686 for name in names:
666 value = text_repr(getattr(evalue, name))
687 value = text_repr(getattr(evalue, name))
667 exception.append('\n%s%s = %s' % (indent, name, value))
688 exception.append('\n%s%s = %s' % (indent, name, value))
668 # return all our info assembled as a single string
689 # return all our info assembled as a single string
669 return '%s\n\n%s\n%s' % (head,'\n'.join(frames),''.join(exception[0]) )
690 return '%s\n\n%s\n%s' % (head,'\n'.join(frames),''.join(exception[0]) )
670
691
671 def debugger(self,force=False):
692 def debugger(self,force=False):
672 """Call up the pdb debugger if desired, always clean up the tb
693 """Call up the pdb debugger if desired, always clean up the tb
673 reference.
694 reference.
674
695
675 Keywords:
696 Keywords:
676
697
677 - force(False): by default, this routine checks the instance call_pdb
698 - force(False): by default, this routine checks the instance call_pdb
678 flag and does not actually invoke the debugger if the flag is false.
699 flag and does not actually invoke the debugger if the flag is false.
679 The 'force' option forces the debugger to activate even if the flag
700 The 'force' option forces the debugger to activate even if the flag
680 is false.
701 is false.
681
702
682 If the call_pdb flag is set, the pdb interactive debugger is
703 If the call_pdb flag is set, the pdb interactive debugger is
683 invoked. In all cases, the self.tb reference to the current traceback
704 invoked. In all cases, the self.tb reference to the current traceback
684 is deleted to prevent lingering references which hamper memory
705 is deleted to prevent lingering references which hamper memory
685 management.
706 management.
686
707
687 Note that each call to pdb() does an 'import readline', so if your app
708 Note that each call to pdb() does an 'import readline', so if your app
688 requires a special setup for the readline completers, you'll have to
709 requires a special setup for the readline completers, you'll have to
689 fix that by hand after invoking the exception handler."""
710 fix that by hand after invoking the exception handler."""
690
711
691 if force or self.call_pdb:
712 if force or self.call_pdb:
692 if self.pdb is None:
713 if self.pdb is None:
693 self.pdb = Debugger.Pdb(
714 self.pdb = Debugger.Pdb(
694 self.color_scheme_table.active_scheme_name)
715 self.color_scheme_table.active_scheme_name)
695 # the system displayhook may have changed, restore the original
716 # the system displayhook may have changed, restore the original
696 # for pdb
717 # for pdb
697 dhook = sys.displayhook
718 dhook = sys.displayhook
698 sys.displayhook = sys.__displayhook__
719 sys.displayhook = sys.__displayhook__
699 self.pdb.reset()
720 self.pdb.reset()
700 # Find the right frame so we don't pop up inside ipython itself
721 # Find the right frame so we don't pop up inside ipython itself
701 if hasattr(self,'tb'):
722 if hasattr(self,'tb'):
702 etb = self.tb
723 etb = self.tb
703 else:
724 else:
704 etb = self.tb = sys.last_traceback
725 etb = self.tb = sys.last_traceback
705 while self.tb.tb_next is not None:
726 while self.tb.tb_next is not None:
706 self.tb = self.tb.tb_next
727 self.tb = self.tb.tb_next
707 try:
728 try:
708 if etb and etb.tb_next:
729 if etb and etb.tb_next:
709 etb = etb.tb_next
730 etb = etb.tb_next
710 self.pdb.botframe = etb.tb_frame
731 self.pdb.botframe = etb.tb_frame
711 self.pdb.interaction(self.tb.tb_frame, self.tb)
732 self.pdb.interaction(self.tb.tb_frame, self.tb)
712 finally:
733 finally:
713 sys.displayhook = dhook
734 sys.displayhook = dhook
714
735
715 if hasattr(self,'tb'):
736 if hasattr(self,'tb'):
716 del self.tb
737 del self.tb
717
738
718 def handler(self, info=None):
739 def handler(self, info=None):
719 (etype, evalue, etb) = info or sys.exc_info()
740 (etype, evalue, etb) = info or sys.exc_info()
720 self.tb = etb
741 self.tb = etb
721 Term.cout.flush()
742 Term.cout.flush()
722 Term.cerr.flush()
743 Term.cerr.flush()
723 print >> Term.cerr, self.text(etype, evalue, etb)
744 print >> Term.cerr, self.text(etype, evalue, etb)
724
745
725 # Changed so an instance can just be called as VerboseTB_inst() and print
746 # Changed so an instance can just be called as VerboseTB_inst() and print
726 # out the right info on its own.
747 # out the right info on its own.
727 def __call__(self, etype=None, evalue=None, etb=None):
748 def __call__(self, etype=None, evalue=None, etb=None):
728 """This hook can replace sys.excepthook (for Python 2.1 or higher)."""
749 """This hook can replace sys.excepthook (for Python 2.1 or higher)."""
729 if etb is None:
750 if etb is None:
730 self.handler()
751 self.handler()
731 else:
752 else:
732 self.handler((etype, evalue, etb))
753 self.handler((etype, evalue, etb))
733 self.debugger()
754 self.debugger()
734
755
735 #----------------------------------------------------------------------------
756 #----------------------------------------------------------------------------
736 class FormattedTB(VerboseTB,ListTB):
757 class FormattedTB(VerboseTB,ListTB):
737 """Subclass ListTB but allow calling with a traceback.
758 """Subclass ListTB but allow calling with a traceback.
738
759
739 It can thus be used as a sys.excepthook for Python > 2.1.
760 It can thus be used as a sys.excepthook for Python > 2.1.
740
761
741 Also adds 'Context' and 'Verbose' modes, not available in ListTB.
762 Also adds 'Context' and 'Verbose' modes, not available in ListTB.
742
763
743 Allows a tb_offset to be specified. This is useful for situations where
764 Allows a tb_offset to be specified. This is useful for situations where
744 one needs to remove a number of topmost frames from the traceback (such as
765 one needs to remove a number of topmost frames from the traceback (such as
745 occurs with python programs that themselves execute other python code,
766 occurs with python programs that themselves execute other python code,
746 like Python shells). """
767 like Python shells). """
747
768
748 def __init__(self, mode = 'Plain', color_scheme='Linux',
769 def __init__(self, mode = 'Plain', color_scheme='Linux',
749 tb_offset = 0,long_header=0,call_pdb=0,include_vars=0):
770 tb_offset = 0,long_header=0,call_pdb=0,include_vars=0):
750
771
751 # NEVER change the order of this list. Put new modes at the end:
772 # NEVER change the order of this list. Put new modes at the end:
752 self.valid_modes = ['Plain','Context','Verbose']
773 self.valid_modes = ['Plain','Context','Verbose']
753 self.verbose_modes = self.valid_modes[1:3]
774 self.verbose_modes = self.valid_modes[1:3]
754
775
755 VerboseTB.__init__(self,color_scheme,tb_offset,long_header,
776 VerboseTB.__init__(self,color_scheme,tb_offset,long_header,
756 call_pdb=call_pdb,include_vars=include_vars)
777 call_pdb=call_pdb,include_vars=include_vars)
757 self.set_mode(mode)
778 self.set_mode(mode)
758
779
759 def _extract_tb(self,tb):
780 def _extract_tb(self,tb):
760 if tb:
781 if tb:
761 return traceback.extract_tb(tb)
782 return traceback.extract_tb(tb)
762 else:
783 else:
763 return None
784 return None
764
785
765 def text(self, etype, value, tb,context=5,mode=None):
786 def text(self, etype, value, tb,context=5,mode=None):
766 """Return formatted traceback.
787 """Return formatted traceback.
767
788
768 If the optional mode parameter is given, it overrides the current
789 If the optional mode parameter is given, it overrides the current
769 mode."""
790 mode."""
770
791
771 if mode is None:
792 if mode is None:
772 mode = self.mode
793 mode = self.mode
773 if mode in self.verbose_modes:
794 if mode in self.verbose_modes:
774 # verbose modes need a full traceback
795 # verbose modes need a full traceback
775 return VerboseTB.text(self,etype, value, tb,context=5)
796 return VerboseTB.text(self,etype, value, tb,context=5)
776 else:
797 else:
777 # We must check the source cache because otherwise we can print
798 # We must check the source cache because otherwise we can print
778 # out-of-date source code.
799 # out-of-date source code.
779 linecache.checkcache()
800 linecache.checkcache()
780 # Now we can extract and format the exception
801 # Now we can extract and format the exception
781 elist = self._extract_tb(tb)
802 elist = self._extract_tb(tb)
782 if len(elist) > self.tb_offset:
803 if len(elist) > self.tb_offset:
783 del elist[:self.tb_offset]
804 del elist[:self.tb_offset]
784 return ListTB.text(self,etype,value,elist)
805 return ListTB.text(self,etype,value,elist)
785
806
786 def set_mode(self,mode=None):
807 def set_mode(self,mode=None):
787 """Switch to the desired mode.
808 """Switch to the desired mode.
788
809
789 If mode is not specified, cycles through the available modes."""
810 If mode is not specified, cycles through the available modes."""
790
811
791 if not mode:
812 if not mode:
792 new_idx = ( self.valid_modes.index(self.mode) + 1 ) % \
813 new_idx = ( self.valid_modes.index(self.mode) + 1 ) % \
793 len(self.valid_modes)
814 len(self.valid_modes)
794 self.mode = self.valid_modes[new_idx]
815 self.mode = self.valid_modes[new_idx]
795 elif mode not in self.valid_modes:
816 elif mode not in self.valid_modes:
796 raise ValueError, 'Unrecognized mode in FormattedTB: <'+mode+'>\n'\
817 raise ValueError, 'Unrecognized mode in FormattedTB: <'+mode+'>\n'\
797 'Valid modes: '+str(self.valid_modes)
818 'Valid modes: '+str(self.valid_modes)
798 else:
819 else:
799 self.mode = mode
820 self.mode = mode
800 # include variable details only in 'Verbose' mode
821 # include variable details only in 'Verbose' mode
801 self.include_vars = (self.mode == self.valid_modes[2])
822 self.include_vars = (self.mode == self.valid_modes[2])
802
823
803 # some convenient shorcuts
824 # some convenient shorcuts
804 def plain(self):
825 def plain(self):
805 self.set_mode(self.valid_modes[0])
826 self.set_mode(self.valid_modes[0])
806
827
807 def context(self):
828 def context(self):
808 self.set_mode(self.valid_modes[1])
829 self.set_mode(self.valid_modes[1])
809
830
810 def verbose(self):
831 def verbose(self):
811 self.set_mode(self.valid_modes[2])
832 self.set_mode(self.valid_modes[2])
812
833
813 #----------------------------------------------------------------------------
834 #----------------------------------------------------------------------------
814 class AutoFormattedTB(FormattedTB):
835 class AutoFormattedTB(FormattedTB):
815 """A traceback printer which can be called on the fly.
836 """A traceback printer which can be called on the fly.
816
837
817 It will find out about exceptions by itself.
838 It will find out about exceptions by itself.
818
839
819 A brief example:
840 A brief example:
820
841
821 AutoTB = AutoFormattedTB(mode = 'Verbose',color_scheme='Linux')
842 AutoTB = AutoFormattedTB(mode = 'Verbose',color_scheme='Linux')
822 try:
843 try:
823 ...
844 ...
824 except:
845 except:
825 AutoTB() # or AutoTB(out=logfile) where logfile is an open file object
846 AutoTB() # or AutoTB(out=logfile) where logfile is an open file object
826 """
847 """
827 def __call__(self,etype=None,evalue=None,etb=None,
848 def __call__(self,etype=None,evalue=None,etb=None,
828 out=None,tb_offset=None):
849 out=None,tb_offset=None):
829 """Print out a formatted exception traceback.
850 """Print out a formatted exception traceback.
830
851
831 Optional arguments:
852 Optional arguments:
832 - out: an open file-like object to direct output to.
853 - out: an open file-like object to direct output to.
833
854
834 - tb_offset: the number of frames to skip over in the stack, on a
855 - tb_offset: the number of frames to skip over in the stack, on a
835 per-call basis (this overrides temporarily the instance's tb_offset
856 per-call basis (this overrides temporarily the instance's tb_offset
836 given at initialization time. """
857 given at initialization time. """
837
858
838 if out is None:
859 if out is None:
839 out = Term.cerr
860 out = Term.cerr
840 Term.cout.flush()
861 Term.cout.flush()
841 out.flush()
862 out.flush()
842 if tb_offset is not None:
863 if tb_offset is not None:
843 tb_offset, self.tb_offset = self.tb_offset, tb_offset
864 tb_offset, self.tb_offset = self.tb_offset, tb_offset
844 print >> out, self.text(etype, evalue, etb)
865 print >> out, self.text(etype, evalue, etb)
845 self.tb_offset = tb_offset
866 self.tb_offset = tb_offset
846 else:
867 else:
847 print >> out, self.text(etype, evalue, etb)
868 print >> out, self.text(etype, evalue, etb)
848 self.debugger()
869 self.debugger()
849
870
850 def text(self,etype=None,value=None,tb=None,context=5,mode=None):
871 def text(self,etype=None,value=None,tb=None,context=5,mode=None):
851 if etype is None:
872 if etype is None:
852 etype,value,tb = sys.exc_info()
873 etype,value,tb = sys.exc_info()
853 self.tb = tb
874 self.tb = tb
854 return FormattedTB.text(self,etype,value,tb,context=5,mode=mode)
875 return FormattedTB.text(self,etype,value,tb,context=5,mode=mode)
855
876
856 #---------------------------------------------------------------------------
877 #---------------------------------------------------------------------------
857 # A simple class to preserve Nathan's original functionality.
878 # A simple class to preserve Nathan's original functionality.
858 class ColorTB(FormattedTB):
879 class ColorTB(FormattedTB):
859 """Shorthand to initialize a FormattedTB in Linux colors mode."""
880 """Shorthand to initialize a FormattedTB in Linux colors mode."""
860 def __init__(self,color_scheme='Linux',call_pdb=0):
881 def __init__(self,color_scheme='Linux',call_pdb=0):
861 FormattedTB.__init__(self,color_scheme=color_scheme,
882 FormattedTB.__init__(self,color_scheme=color_scheme,
862 call_pdb=call_pdb)
883 call_pdb=call_pdb)
863
884
864 #----------------------------------------------------------------------------
885 #----------------------------------------------------------------------------
865 # module testing (minimal)
886 # module testing (minimal)
866 if __name__ == "__main__":
887 if __name__ == "__main__":
867 def spam(c, (d, e)):
888 def spam(c, (d, e)):
868 x = c + d
889 x = c + d
869 y = c * d
890 y = c * d
870 foo(x, y)
891 foo(x, y)
871
892
872 def foo(a, b, bar=1):
893 def foo(a, b, bar=1):
873 eggs(a, b + bar)
894 eggs(a, b + bar)
874
895
875 def eggs(f, g, z=globals()):
896 def eggs(f, g, z=globals()):
876 h = f + g
897 h = f + g
877 i = f - g
898 i = f - g
878 return h / i
899 return h / i
879
900
880 print ''
901 print ''
881 print '*** Before ***'
902 print '*** Before ***'
882 try:
903 try:
883 print spam(1, (2, 3))
904 print spam(1, (2, 3))
884 except:
905 except:
885 traceback.print_exc()
906 traceback.print_exc()
886 print ''
907 print ''
887
908
888 handler = ColorTB()
909 handler = ColorTB()
889 print '*** ColorTB ***'
910 print '*** ColorTB ***'
890 try:
911 try:
891 print spam(1, (2, 3))
912 print spam(1, (2, 3))
892 except:
913 except:
893 apply(handler, sys.exc_info() )
914 apply(handler, sys.exc_info() )
894 print ''
915 print ''
895
916
896 handler = VerboseTB()
917 handler = VerboseTB()
897 print '*** VerboseTB ***'
918 print '*** VerboseTB ***'
898 try:
919 try:
899 print spam(1, (2, 3))
920 print spam(1, (2, 3))
900 except:
921 except:
901 apply(handler, sys.exc_info() )
922 apply(handler, sys.exc_info() )
902 print ''
923 print ''
903
924
@@ -1,6343 +1,6351 b''
1 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
1 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
2
2
3 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
4 modified) R. Bernstein's patch for fully syntax highlighted
5 tracebacks. The functionality is also available under ultraTB for
6 non-ipython users (someone using ultraTB but outside an ipython
7 session). They can select the color scheme by setting the
8 module-level global DEFAULT_SCHEME. The highlight functionality
9 also works when debugging.
10
3 * IPython/genutils.py (IOStream.close): small patch by
11 * IPython/genutils.py (IOStream.close): small patch by
4 R. Bernstein for improved pydb support.
12 R. Bernstein for improved pydb support.
5
13
6 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
14 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
7 DaveS <davls@telus.net> to improve support of debugging under
15 DaveS <davls@telus.net> to improve support of debugging under
8 NTEmacs, including improved pydb behavior.
16 NTEmacs, including improved pydb behavior.
9
17
10 * IPython/Magic.py (magic_prun): Fix saving of profile info for
18 * IPython/Magic.py (magic_prun): Fix saving of profile info for
11 Python 2.5, where the stats object API changed a little. Thanks
19 Python 2.5, where the stats object API changed a little. Thanks
12 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
20 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
13
21
14 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
22 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
15 Pernetty's patch to improve support for (X)Emacs under Win32.
23 Pernetty's patch to improve support for (X)Emacs under Win32.
16
24
17 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
25 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
18
26
19 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
27 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
20 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
28 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
21 a report by Nik Tautenhahn.
29 a report by Nik Tautenhahn.
22
30
23 2007-03-16 Walter Doerwald <walter@livinglogic.de>
31 2007-03-16 Walter Doerwald <walter@livinglogic.de>
24
32
25 * setup.py: Add the igrid help files to the list of data files
33 * setup.py: Add the igrid help files to the list of data files
26 to be installed alongside igrid.
34 to be installed alongside igrid.
27 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
35 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
28 Show the input object of the igrid browser as the window tile.
36 Show the input object of the igrid browser as the window tile.
29 Show the object the cursor is on in the statusbar.
37 Show the object the cursor is on in the statusbar.
30
38
31 2007-03-15 Ville Vainio <vivainio@gmail.com>
39 2007-03-15 Ville Vainio <vivainio@gmail.com>
32
40
33 * Extensions/ipy_stock_completers.py: Fixed exception
41 * Extensions/ipy_stock_completers.py: Fixed exception
34 on mismatching quotes in %run completer. Patch by
42 on mismatching quotes in %run completer. Patch by
35 JοΏ½rgen Stenarson. Closes #127.
43 JοΏ½rgen Stenarson. Closes #127.
36
44
37 2007-03-14 Ville Vainio <vivainio@gmail.com>
45 2007-03-14 Ville Vainio <vivainio@gmail.com>
38
46
39 * Extensions/ext_rehashdir.py: Do not do auto_alias
47 * Extensions/ext_rehashdir.py: Do not do auto_alias
40 in %rehashdir, it clobbers %store'd aliases.
48 in %rehashdir, it clobbers %store'd aliases.
41
49
42 * UserConfig/ipy_profile_sh.py: envpersist.py extension
50 * UserConfig/ipy_profile_sh.py: envpersist.py extension
43 (beefed up %env) imported for sh profile.
51 (beefed up %env) imported for sh profile.
44
52
45 2007-03-10 Walter Doerwald <walter@livinglogic.de>
53 2007-03-10 Walter Doerwald <walter@livinglogic.de>
46
54
47 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
55 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
48 as the default browser.
56 as the default browser.
49 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
57 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
50 As igrid displays all attributes it ever encounters, fetch() (which has
58 As igrid displays all attributes it ever encounters, fetch() (which has
51 been renamed to _fetch()) doesn't have to recalculate the display attributes
59 been renamed to _fetch()) doesn't have to recalculate the display attributes
52 every time a new item is fetched. This should speed up scrolling.
60 every time a new item is fetched. This should speed up scrolling.
53
61
54 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
62 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
55
63
56 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
64 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
57 Schmolck's recently reported tab-completion bug (my previous one
65 Schmolck's recently reported tab-completion bug (my previous one
58 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
66 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
59
67
60 2007-03-09 Walter Doerwald <walter@livinglogic.de>
68 2007-03-09 Walter Doerwald <walter@livinglogic.de>
61
69
62 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
70 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
63 Close help window if exiting igrid.
71 Close help window if exiting igrid.
64
72
65 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
73 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
66
74
67 * IPython/Extensions/ipy_defaults.py: Check if readline is available
75 * IPython/Extensions/ipy_defaults.py: Check if readline is available
68 before calling functions from readline.
76 before calling functions from readline.
69
77
70 2007-03-02 Walter Doerwald <walter@livinglogic.de>
78 2007-03-02 Walter Doerwald <walter@livinglogic.de>
71
79
72 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
80 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
73 igrid is a wxPython-based display object for ipipe. If your system has
81 igrid is a wxPython-based display object for ipipe. If your system has
74 wx installed igrid will be the default display. Without wx ipipe falls
82 wx installed igrid will be the default display. Without wx ipipe falls
75 back to ibrowse (which needs curses). If no curses is installed ipipe
83 back to ibrowse (which needs curses). If no curses is installed ipipe
76 falls back to idump.
84 falls back to idump.
77
85
78 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
86 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
79
87
80 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
88 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
81 my changes from yesterday, they introduced bugs. Will reactivate
89 my changes from yesterday, they introduced bugs. Will reactivate
82 once I get a correct solution, which will be much easier thanks to
90 once I get a correct solution, which will be much easier thanks to
83 Dan Milstein's new prefilter test suite.
91 Dan Milstein's new prefilter test suite.
84
92
85 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
93 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
86
94
87 * IPython/iplib.py (split_user_input): fix input splitting so we
95 * IPython/iplib.py (split_user_input): fix input splitting so we
88 don't attempt attribute accesses on things that can't possibly be
96 don't attempt attribute accesses on things that can't possibly be
89 valid Python attributes. After a bug report by Alex Schmolck.
97 valid Python attributes. After a bug report by Alex Schmolck.
90 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
98 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
91 %magic with explicit % prefix.
99 %magic with explicit % prefix.
92
100
93 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
101 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
94
102
95 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
103 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
96 avoid a DeprecationWarning from GTK.
104 avoid a DeprecationWarning from GTK.
97
105
98 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
106 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
99
107
100 * IPython/genutils.py (clock): I modified clock() to return total
108 * IPython/genutils.py (clock): I modified clock() to return total
101 time, user+system. This is a more commonly needed metric. I also
109 time, user+system. This is a more commonly needed metric. I also
102 introduced the new clocku/clocks to get only user/system time if
110 introduced the new clocku/clocks to get only user/system time if
103 one wants those instead.
111 one wants those instead.
104
112
105 ***WARNING: API CHANGE*** clock() used to return only user time,
113 ***WARNING: API CHANGE*** clock() used to return only user time,
106 so if you want exactly the same results as before, use clocku
114 so if you want exactly the same results as before, use clocku
107 instead.
115 instead.
108
116
109 2007-02-22 Ville Vainio <vivainio@gmail.com>
117 2007-02-22 Ville Vainio <vivainio@gmail.com>
110
118
111 * IPython/Extensions/ipy_p4.py: Extension for improved
119 * IPython/Extensions/ipy_p4.py: Extension for improved
112 p4 (perforce version control system) experience.
120 p4 (perforce version control system) experience.
113 Adds %p4 magic with p4 command completion and
121 Adds %p4 magic with p4 command completion and
114 automatic -G argument (marshall output as python dict)
122 automatic -G argument (marshall output as python dict)
115
123
116 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
124 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
117
125
118 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
126 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
119 stop marks.
127 stop marks.
120 (ClearingMixin): a simple mixin to easily make a Demo class clear
128 (ClearingMixin): a simple mixin to easily make a Demo class clear
121 the screen in between blocks and have empty marquees. The
129 the screen in between blocks and have empty marquees. The
122 ClearDemo and ClearIPDemo classes that use it are included.
130 ClearDemo and ClearIPDemo classes that use it are included.
123
131
124 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
132 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
125
133
126 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
134 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
127 protect against exceptions at Python shutdown time. Patch
135 protect against exceptions at Python shutdown time. Patch
128 sumbmitted to upstream.
136 sumbmitted to upstream.
129
137
130 2007-02-14 Walter Doerwald <walter@livinglogic.de>
138 2007-02-14 Walter Doerwald <walter@livinglogic.de>
131
139
132 * IPython/Extensions/ibrowse.py: If entering the first object level
140 * IPython/Extensions/ibrowse.py: If entering the first object level
133 (i.e. the object for which the browser has been started) fails,
141 (i.e. the object for which the browser has been started) fails,
134 now the error is raised directly (aborting the browser) instead of
142 now the error is raised directly (aborting the browser) instead of
135 running into an empty levels list later.
143 running into an empty levels list later.
136
144
137 2007-02-03 Walter Doerwald <walter@livinglogic.de>
145 2007-02-03 Walter Doerwald <walter@livinglogic.de>
138
146
139 * IPython/Extensions/ipipe.py: Add an xrepr implementation
147 * IPython/Extensions/ipipe.py: Add an xrepr implementation
140 for the noitem object.
148 for the noitem object.
141
149
142 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
150 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
143
151
144 * IPython/completer.py (Completer.attr_matches): Fix small
152 * IPython/completer.py (Completer.attr_matches): Fix small
145 tab-completion bug with Enthought Traits objects with units.
153 tab-completion bug with Enthought Traits objects with units.
146 Thanks to a bug report by Tom Denniston
154 Thanks to a bug report by Tom Denniston
147 <tom.denniston-AT-alum.dartmouth.org>.
155 <tom.denniston-AT-alum.dartmouth.org>.
148
156
149 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
157 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
150
158
151 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
159 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
152 bug where only .ipy or .py would be completed. Once the first
160 bug where only .ipy or .py would be completed. Once the first
153 argument to %run has been given, all completions are valid because
161 argument to %run has been given, all completions are valid because
154 they are the arguments to the script, which may well be non-python
162 they are the arguments to the script, which may well be non-python
155 filenames.
163 filenames.
156
164
157 * IPython/irunner.py (InteractiveRunner.run_source): major updates
165 * IPython/irunner.py (InteractiveRunner.run_source): major updates
158 to irunner to allow it to correctly support real doctesting of
166 to irunner to allow it to correctly support real doctesting of
159 out-of-process ipython code.
167 out-of-process ipython code.
160
168
161 * IPython/Magic.py (magic_cd): Make the setting of the terminal
169 * IPython/Magic.py (magic_cd): Make the setting of the terminal
162 title an option (-noterm_title) because it completely breaks
170 title an option (-noterm_title) because it completely breaks
163 doctesting.
171 doctesting.
164
172
165 * IPython/demo.py: fix IPythonDemo class that was not actually working.
173 * IPython/demo.py: fix IPythonDemo class that was not actually working.
166
174
167 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
175 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
168
176
169 * IPython/irunner.py (main): fix small bug where extensions were
177 * IPython/irunner.py (main): fix small bug where extensions were
170 not being correctly recognized.
178 not being correctly recognized.
171
179
172 2007-01-23 Walter Doerwald <walter@livinglogic.de>
180 2007-01-23 Walter Doerwald <walter@livinglogic.de>
173
181
174 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
182 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
175 a string containing a single line yields the string itself as the
183 a string containing a single line yields the string itself as the
176 only item.
184 only item.
177
185
178 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
186 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
179 object if it's the same as the one on the last level (This avoids
187 object if it's the same as the one on the last level (This avoids
180 infinite recursion for one line strings).
188 infinite recursion for one line strings).
181
189
182 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
190 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
183
191
184 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
192 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
185 all output streams before printing tracebacks. This ensures that
193 all output streams before printing tracebacks. This ensures that
186 user output doesn't end up interleaved with traceback output.
194 user output doesn't end up interleaved with traceback output.
187
195
188 2007-01-10 Ville Vainio <vivainio@gmail.com>
196 2007-01-10 Ville Vainio <vivainio@gmail.com>
189
197
190 * Extensions/envpersist.py: Turbocharged %env that remembers
198 * Extensions/envpersist.py: Turbocharged %env that remembers
191 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
199 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
192 "%env VISUAL=jed".
200 "%env VISUAL=jed".
193
201
194 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
202 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
195
203
196 * IPython/iplib.py (showtraceback): ensure that we correctly call
204 * IPython/iplib.py (showtraceback): ensure that we correctly call
197 custom handlers in all cases (some with pdb were slipping through,
205 custom handlers in all cases (some with pdb were slipping through,
198 but I'm not exactly sure why).
206 but I'm not exactly sure why).
199
207
200 * IPython/Debugger.py (Tracer.__init__): added new class to
208 * IPython/Debugger.py (Tracer.__init__): added new class to
201 support set_trace-like usage of IPython's enhanced debugger.
209 support set_trace-like usage of IPython's enhanced debugger.
202
210
203 2006-12-24 Ville Vainio <vivainio@gmail.com>
211 2006-12-24 Ville Vainio <vivainio@gmail.com>
204
212
205 * ipmaker.py: more informative message when ipy_user_conf
213 * ipmaker.py: more informative message when ipy_user_conf
206 import fails (suggest running %upgrade).
214 import fails (suggest running %upgrade).
207
215
208 * tools/run_ipy_in_profiler.py: Utility to see where
216 * tools/run_ipy_in_profiler.py: Utility to see where
209 the time during IPython startup is spent.
217 the time during IPython startup is spent.
210
218
211 2006-12-20 Ville Vainio <vivainio@gmail.com>
219 2006-12-20 Ville Vainio <vivainio@gmail.com>
212
220
213 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
221 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
214
222
215 * ipapi.py: Add new ipapi method, expand_alias.
223 * ipapi.py: Add new ipapi method, expand_alias.
216
224
217 * Release.py: Bump up version to 0.7.4.svn
225 * Release.py: Bump up version to 0.7.4.svn
218
226
219 2006-12-17 Ville Vainio <vivainio@gmail.com>
227 2006-12-17 Ville Vainio <vivainio@gmail.com>
220
228
221 * Extensions/jobctrl.py: Fixed &cmd arg arg...
229 * Extensions/jobctrl.py: Fixed &cmd arg arg...
222 to work properly on posix too
230 to work properly on posix too
223
231
224 * Release.py: Update revnum (version is still just 0.7.3).
232 * Release.py: Update revnum (version is still just 0.7.3).
225
233
226 2006-12-15 Ville Vainio <vivainio@gmail.com>
234 2006-12-15 Ville Vainio <vivainio@gmail.com>
227
235
228 * scripts/ipython_win_post_install: create ipython.py in
236 * scripts/ipython_win_post_install: create ipython.py in
229 prefix + "/scripts".
237 prefix + "/scripts".
230
238
231 * Release.py: Update version to 0.7.3.
239 * Release.py: Update version to 0.7.3.
232
240
233 2006-12-14 Ville Vainio <vivainio@gmail.com>
241 2006-12-14 Ville Vainio <vivainio@gmail.com>
234
242
235 * scripts/ipython_win_post_install: Overwrite old shortcuts
243 * scripts/ipython_win_post_install: Overwrite old shortcuts
236 if they already exist
244 if they already exist
237
245
238 * Release.py: release 0.7.3rc2
246 * Release.py: release 0.7.3rc2
239
247
240 2006-12-13 Ville Vainio <vivainio@gmail.com>
248 2006-12-13 Ville Vainio <vivainio@gmail.com>
241
249
242 * Branch and update Release.py for 0.7.3rc1
250 * Branch and update Release.py for 0.7.3rc1
243
251
244 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
252 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
245
253
246 * IPython/Shell.py (IPShellWX): update for current WX naming
254 * IPython/Shell.py (IPShellWX): update for current WX naming
247 conventions, to avoid a deprecation warning with current WX
255 conventions, to avoid a deprecation warning with current WX
248 versions. Thanks to a report by Danny Shevitz.
256 versions. Thanks to a report by Danny Shevitz.
249
257
250 2006-12-12 Ville Vainio <vivainio@gmail.com>
258 2006-12-12 Ville Vainio <vivainio@gmail.com>
251
259
252 * ipmaker.py: apply david cournapeau's patch to make
260 * ipmaker.py: apply david cournapeau's patch to make
253 import_some work properly even when ipythonrc does
261 import_some work properly even when ipythonrc does
254 import_some on empty list (it was an old bug!).
262 import_some on empty list (it was an old bug!).
255
263
256 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
264 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
257 Add deprecation note to ipythonrc and a url to wiki
265 Add deprecation note to ipythonrc and a url to wiki
258 in ipy_user_conf.py
266 in ipy_user_conf.py
259
267
260
268
261 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
269 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
262 as if it was typed on IPython command prompt, i.e.
270 as if it was typed on IPython command prompt, i.e.
263 as IPython script.
271 as IPython script.
264
272
265 * example-magic.py, magic_grepl.py: remove outdated examples
273 * example-magic.py, magic_grepl.py: remove outdated examples
266
274
267 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
275 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
268
276
269 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
277 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
270 is called before any exception has occurred.
278 is called before any exception has occurred.
271
279
272 2006-12-08 Ville Vainio <vivainio@gmail.com>
280 2006-12-08 Ville Vainio <vivainio@gmail.com>
273
281
274 * Extensions/ipy_stock_completers.py: fix cd completer
282 * Extensions/ipy_stock_completers.py: fix cd completer
275 to translate /'s to \'s again.
283 to translate /'s to \'s again.
276
284
277 * completer.py: prevent traceback on file completions w/
285 * completer.py: prevent traceback on file completions w/
278 backslash.
286 backslash.
279
287
280 * Release.py: Update release number to 0.7.3b3 for release
288 * Release.py: Update release number to 0.7.3b3 for release
281
289
282 2006-12-07 Ville Vainio <vivainio@gmail.com>
290 2006-12-07 Ville Vainio <vivainio@gmail.com>
283
291
284 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
292 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
285 while executing external code. Provides more shell-like behaviour
293 while executing external code. Provides more shell-like behaviour
286 and overall better response to ctrl + C / ctrl + break.
294 and overall better response to ctrl + C / ctrl + break.
287
295
288 * tools/make_tarball.py: new script to create tarball straight from svn
296 * tools/make_tarball.py: new script to create tarball straight from svn
289 (setup.py sdist doesn't work on win32).
297 (setup.py sdist doesn't work on win32).
290
298
291 * Extensions/ipy_stock_completers.py: fix cd completer to give up
299 * Extensions/ipy_stock_completers.py: fix cd completer to give up
292 on dirnames with spaces and use the default completer instead.
300 on dirnames with spaces and use the default completer instead.
293
301
294 * Revision.py: Change version to 0.7.3b2 for release.
302 * Revision.py: Change version to 0.7.3b2 for release.
295
303
296 2006-12-05 Ville Vainio <vivainio@gmail.com>
304 2006-12-05 Ville Vainio <vivainio@gmail.com>
297
305
298 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
306 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
299 pydb patch 4 (rm debug printing, py 2.5 checking)
307 pydb patch 4 (rm debug printing, py 2.5 checking)
300
308
301 2006-11-30 Walter Doerwald <walter@livinglogic.de>
309 2006-11-30 Walter Doerwald <walter@livinglogic.de>
302 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
310 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
303 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
311 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
304 "refreshfind" (mapped to "R") does the same but tries to go back to the same
312 "refreshfind" (mapped to "R") does the same but tries to go back to the same
305 object the cursor was on before the refresh. The command "markrange" is
313 object the cursor was on before the refresh. The command "markrange" is
306 mapped to "%" now.
314 mapped to "%" now.
307 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
315 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
308
316
309 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
317 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
310
318
311 * IPython/Magic.py (magic_debug): new %debug magic to activate the
319 * IPython/Magic.py (magic_debug): new %debug magic to activate the
312 interactive debugger on the last traceback, without having to call
320 interactive debugger on the last traceback, without having to call
313 %pdb and rerun your code. Made minor changes in various modules,
321 %pdb and rerun your code. Made minor changes in various modules,
314 should automatically recognize pydb if available.
322 should automatically recognize pydb if available.
315
323
316 2006-11-28 Ville Vainio <vivainio@gmail.com>
324 2006-11-28 Ville Vainio <vivainio@gmail.com>
317
325
318 * completer.py: If the text start with !, show file completions
326 * completer.py: If the text start with !, show file completions
319 properly. This helps when trying to complete command name
327 properly. This helps when trying to complete command name
320 for shell escapes.
328 for shell escapes.
321
329
322 2006-11-27 Ville Vainio <vivainio@gmail.com>
330 2006-11-27 Ville Vainio <vivainio@gmail.com>
323
331
324 * ipy_stock_completers.py: bzr completer submitted by Stefan van
332 * ipy_stock_completers.py: bzr completer submitted by Stefan van
325 der Walt. Clean up svn and hg completers by using a common
333 der Walt. Clean up svn and hg completers by using a common
326 vcs_completer.
334 vcs_completer.
327
335
328 2006-11-26 Ville Vainio <vivainio@gmail.com>
336 2006-11-26 Ville Vainio <vivainio@gmail.com>
329
337
330 * Remove ipconfig and %config; you should use _ip.options structure
338 * Remove ipconfig and %config; you should use _ip.options structure
331 directly instead!
339 directly instead!
332
340
333 * genutils.py: add wrap_deprecated function for deprecating callables
341 * genutils.py: add wrap_deprecated function for deprecating callables
334
342
335 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
343 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
336 _ip.system instead. ipalias is redundant.
344 _ip.system instead. ipalias is redundant.
337
345
338 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
346 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
339 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
347 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
340 explicit.
348 explicit.
341
349
342 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
350 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
343 completer. Try it by entering 'hg ' and pressing tab.
351 completer. Try it by entering 'hg ' and pressing tab.
344
352
345 * macro.py: Give Macro a useful __repr__ method
353 * macro.py: Give Macro a useful __repr__ method
346
354
347 * Magic.py: %whos abbreviates the typename of Macro for brevity.
355 * Magic.py: %whos abbreviates the typename of Macro for brevity.
348
356
349 2006-11-24 Walter Doerwald <walter@livinglogic.de>
357 2006-11-24 Walter Doerwald <walter@livinglogic.de>
350 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
358 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
351 we don't get a duplicate ipipe module, where registration of the xrepr
359 we don't get a duplicate ipipe module, where registration of the xrepr
352 implementation for Text is useless.
360 implementation for Text is useless.
353
361
354 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
362 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
355
363
356 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
364 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
357
365
358 2006-11-24 Ville Vainio <vivainio@gmail.com>
366 2006-11-24 Ville Vainio <vivainio@gmail.com>
359
367
360 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
368 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
361 try to use "cProfile" instead of the slower pure python
369 try to use "cProfile" instead of the slower pure python
362 "profile"
370 "profile"
363
371
364 2006-11-23 Ville Vainio <vivainio@gmail.com>
372 2006-11-23 Ville Vainio <vivainio@gmail.com>
365
373
366 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
374 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
367 Qt+IPython+Designer link in documentation.
375 Qt+IPython+Designer link in documentation.
368
376
369 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
377 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
370 correct Pdb object to %pydb.
378 correct Pdb object to %pydb.
371
379
372
380
373 2006-11-22 Walter Doerwald <walter@livinglogic.de>
381 2006-11-22 Walter Doerwald <walter@livinglogic.de>
374 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
382 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
375 generic xrepr(), otherwise the list implementation would kick in.
383 generic xrepr(), otherwise the list implementation would kick in.
376
384
377 2006-11-21 Ville Vainio <vivainio@gmail.com>
385 2006-11-21 Ville Vainio <vivainio@gmail.com>
378
386
379 * upgrade_dir.py: Now actually overwrites a nonmodified user file
387 * upgrade_dir.py: Now actually overwrites a nonmodified user file
380 with one from UserConfig.
388 with one from UserConfig.
381
389
382 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
390 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
383 it was missing which broke the sh profile.
391 it was missing which broke the sh profile.
384
392
385 * completer.py: file completer now uses explicit '/' instead
393 * completer.py: file completer now uses explicit '/' instead
386 of os.path.join, expansion of 'foo' was broken on win32
394 of os.path.join, expansion of 'foo' was broken on win32
387 if there was one directory with name 'foobar'.
395 if there was one directory with name 'foobar'.
388
396
389 * A bunch of patches from Kirill Smelkov:
397 * A bunch of patches from Kirill Smelkov:
390
398
391 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
399 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
392
400
393 * [patch 7/9] Implement %page -r (page in raw mode) -
401 * [patch 7/9] Implement %page -r (page in raw mode) -
394
402
395 * [patch 5/9] ScientificPython webpage has moved
403 * [patch 5/9] ScientificPython webpage has moved
396
404
397 * [patch 4/9] The manual mentions %ds, should be %dhist
405 * [patch 4/9] The manual mentions %ds, should be %dhist
398
406
399 * [patch 3/9] Kill old bits from %prun doc.
407 * [patch 3/9] Kill old bits from %prun doc.
400
408
401 * [patch 1/9] Fix typos here and there.
409 * [patch 1/9] Fix typos here and there.
402
410
403 2006-11-08 Ville Vainio <vivainio@gmail.com>
411 2006-11-08 Ville Vainio <vivainio@gmail.com>
404
412
405 * completer.py (attr_matches): catch all exceptions raised
413 * completer.py (attr_matches): catch all exceptions raised
406 by eval of expr with dots.
414 by eval of expr with dots.
407
415
408 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
416 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
409
417
410 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
418 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
411 input if it starts with whitespace. This allows you to paste
419 input if it starts with whitespace. This allows you to paste
412 indented input from any editor without manually having to type in
420 indented input from any editor without manually having to type in
413 the 'if 1:', which is convenient when working interactively.
421 the 'if 1:', which is convenient when working interactively.
414 Slightly modifed version of a patch by Bo Peng
422 Slightly modifed version of a patch by Bo Peng
415 <bpeng-AT-rice.edu>.
423 <bpeng-AT-rice.edu>.
416
424
417 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
425 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
418
426
419 * IPython/irunner.py (main): modified irunner so it automatically
427 * IPython/irunner.py (main): modified irunner so it automatically
420 recognizes the right runner to use based on the extension (.py for
428 recognizes the right runner to use based on the extension (.py for
421 python, .ipy for ipython and .sage for sage).
429 python, .ipy for ipython and .sage for sage).
422
430
423 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
431 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
424 visible in ipapi as ip.config(), to programatically control the
432 visible in ipapi as ip.config(), to programatically control the
425 internal rc object. There's an accompanying %config magic for
433 internal rc object. There's an accompanying %config magic for
426 interactive use, which has been enhanced to match the
434 interactive use, which has been enhanced to match the
427 funtionality in ipconfig.
435 funtionality in ipconfig.
428
436
429 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
437 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
430 so it's not just a toggle, it now takes an argument. Add support
438 so it's not just a toggle, it now takes an argument. Add support
431 for a customizable header when making system calls, as the new
439 for a customizable header when making system calls, as the new
432 system_header variable in the ipythonrc file.
440 system_header variable in the ipythonrc file.
433
441
434 2006-11-03 Walter Doerwald <walter@livinglogic.de>
442 2006-11-03 Walter Doerwald <walter@livinglogic.de>
435
443
436 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
444 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
437 generic functions (using Philip J. Eby's simplegeneric package).
445 generic functions (using Philip J. Eby's simplegeneric package).
438 This makes it possible to customize the display of third-party classes
446 This makes it possible to customize the display of third-party classes
439 without having to monkeypatch them. xiter() no longer supports a mode
447 without having to monkeypatch them. xiter() no longer supports a mode
440 argument and the XMode class has been removed. The same functionality can
448 argument and the XMode class has been removed. The same functionality can
441 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
449 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
442 One consequence of the switch to generic functions is that xrepr() and
450 One consequence of the switch to generic functions is that xrepr() and
443 xattrs() implementation must define the default value for the mode
451 xattrs() implementation must define the default value for the mode
444 argument themselves and xattrs() implementations must return real
452 argument themselves and xattrs() implementations must return real
445 descriptors.
453 descriptors.
446
454
447 * IPython/external: This new subpackage will contain all third-party
455 * IPython/external: This new subpackage will contain all third-party
448 packages that are bundled with IPython. (The first one is simplegeneric).
456 packages that are bundled with IPython. (The first one is simplegeneric).
449
457
450 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
458 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
451 directory which as been dropped in r1703.
459 directory which as been dropped in r1703.
452
460
453 * IPython/Extensions/ipipe.py (iless): Fixed.
461 * IPython/Extensions/ipipe.py (iless): Fixed.
454
462
455 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
463 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
456
464
457 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
465 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
458
466
459 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
467 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
460 handling in variable expansion so that shells and magics recognize
468 handling in variable expansion so that shells and magics recognize
461 function local scopes correctly. Bug reported by Brian.
469 function local scopes correctly. Bug reported by Brian.
462
470
463 * scripts/ipython: remove the very first entry in sys.path which
471 * scripts/ipython: remove the very first entry in sys.path which
464 Python auto-inserts for scripts, so that sys.path under IPython is
472 Python auto-inserts for scripts, so that sys.path under IPython is
465 as similar as possible to that under plain Python.
473 as similar as possible to that under plain Python.
466
474
467 * IPython/completer.py (IPCompleter.file_matches): Fix
475 * IPython/completer.py (IPCompleter.file_matches): Fix
468 tab-completion so that quotes are not closed unless the completion
476 tab-completion so that quotes are not closed unless the completion
469 is unambiguous. After a request by Stefan. Minor cleanups in
477 is unambiguous. After a request by Stefan. Minor cleanups in
470 ipy_stock_completers.
478 ipy_stock_completers.
471
479
472 2006-11-02 Ville Vainio <vivainio@gmail.com>
480 2006-11-02 Ville Vainio <vivainio@gmail.com>
473
481
474 * ipy_stock_completers.py: Add %run and %cd completers.
482 * ipy_stock_completers.py: Add %run and %cd completers.
475
483
476 * completer.py: Try running custom completer for both
484 * completer.py: Try running custom completer for both
477 "foo" and "%foo" if the command is just "foo". Ignore case
485 "foo" and "%foo" if the command is just "foo". Ignore case
478 when filtering possible completions.
486 when filtering possible completions.
479
487
480 * UserConfig/ipy_user_conf.py: install stock completers as default
488 * UserConfig/ipy_user_conf.py: install stock completers as default
481
489
482 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
490 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
483 simplified readline history save / restore through a wrapper
491 simplified readline history save / restore through a wrapper
484 function
492 function
485
493
486
494
487 2006-10-31 Ville Vainio <vivainio@gmail.com>
495 2006-10-31 Ville Vainio <vivainio@gmail.com>
488
496
489 * strdispatch.py, completer.py, ipy_stock_completers.py:
497 * strdispatch.py, completer.py, ipy_stock_completers.py:
490 Allow str_key ("command") in completer hooks. Implement
498 Allow str_key ("command") in completer hooks. Implement
491 trivial completer for 'import' (stdlib modules only). Rename
499 trivial completer for 'import' (stdlib modules only). Rename
492 ipy_linux_package_managers.py to ipy_stock_completers.py.
500 ipy_linux_package_managers.py to ipy_stock_completers.py.
493 SVN completer.
501 SVN completer.
494
502
495 * Extensions/ledit.py: %magic line editor for easily and
503 * Extensions/ledit.py: %magic line editor for easily and
496 incrementally manipulating lists of strings. The magic command
504 incrementally manipulating lists of strings. The magic command
497 name is %led.
505 name is %led.
498
506
499 2006-10-30 Ville Vainio <vivainio@gmail.com>
507 2006-10-30 Ville Vainio <vivainio@gmail.com>
500
508
501 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
509 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
502 Bernsteins's patches for pydb integration.
510 Bernsteins's patches for pydb integration.
503 http://bashdb.sourceforge.net/pydb/
511 http://bashdb.sourceforge.net/pydb/
504
512
505 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
513 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
506 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
514 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
507 custom completer hook to allow the users to implement their own
515 custom completer hook to allow the users to implement their own
508 completers. See ipy_linux_package_managers.py for example. The
516 completers. See ipy_linux_package_managers.py for example. The
509 hook name is 'complete_command'.
517 hook name is 'complete_command'.
510
518
511 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
519 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
512
520
513 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
521 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
514 Numeric leftovers.
522 Numeric leftovers.
515
523
516 * ipython.el (py-execute-region): apply Stefan's patch to fix
524 * ipython.el (py-execute-region): apply Stefan's patch to fix
517 garbled results if the python shell hasn't been previously started.
525 garbled results if the python shell hasn't been previously started.
518
526
519 * IPython/genutils.py (arg_split): moved to genutils, since it's a
527 * IPython/genutils.py (arg_split): moved to genutils, since it's a
520 pretty generic function and useful for other things.
528 pretty generic function and useful for other things.
521
529
522 * IPython/OInspect.py (getsource): Add customizable source
530 * IPython/OInspect.py (getsource): Add customizable source
523 extractor. After a request/patch form W. Stein (SAGE).
531 extractor. After a request/patch form W. Stein (SAGE).
524
532
525 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
533 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
526 window size to a more reasonable value from what pexpect does,
534 window size to a more reasonable value from what pexpect does,
527 since their choice causes wrapping bugs with long input lines.
535 since their choice causes wrapping bugs with long input lines.
528
536
529 2006-10-28 Ville Vainio <vivainio@gmail.com>
537 2006-10-28 Ville Vainio <vivainio@gmail.com>
530
538
531 * Magic.py (%run): Save and restore the readline history from
539 * Magic.py (%run): Save and restore the readline history from
532 file around %run commands to prevent side effects from
540 file around %run commands to prevent side effects from
533 %runned programs that might use readline (e.g. pydb).
541 %runned programs that might use readline (e.g. pydb).
534
542
535 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
543 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
536 invoking the pydb enhanced debugger.
544 invoking the pydb enhanced debugger.
537
545
538 2006-10-23 Walter Doerwald <walter@livinglogic.de>
546 2006-10-23 Walter Doerwald <walter@livinglogic.de>
539
547
540 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
548 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
541 call the base class method and propagate the return value to
549 call the base class method and propagate the return value to
542 ifile. This is now done by path itself.
550 ifile. This is now done by path itself.
543
551
544 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
552 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
545
553
546 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
554 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
547 api: set_crash_handler(), to expose the ability to change the
555 api: set_crash_handler(), to expose the ability to change the
548 internal crash handler.
556 internal crash handler.
549
557
550 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
558 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
551 the various parameters of the crash handler so that apps using
559 the various parameters of the crash handler so that apps using
552 IPython as their engine can customize crash handling. Ipmlemented
560 IPython as their engine can customize crash handling. Ipmlemented
553 at the request of SAGE.
561 at the request of SAGE.
554
562
555 2006-10-14 Ville Vainio <vivainio@gmail.com>
563 2006-10-14 Ville Vainio <vivainio@gmail.com>
556
564
557 * Magic.py, ipython.el: applied first "safe" part of Rocky
565 * Magic.py, ipython.el: applied first "safe" part of Rocky
558 Bernstein's patch set for pydb integration.
566 Bernstein's patch set for pydb integration.
559
567
560 * Magic.py (%unalias, %alias): %store'd aliases can now be
568 * Magic.py (%unalias, %alias): %store'd aliases can now be
561 removed with '%unalias'. %alias w/o args now shows most
569 removed with '%unalias'. %alias w/o args now shows most
562 interesting (stored / manually defined) aliases last
570 interesting (stored / manually defined) aliases last
563 where they catch the eye w/o scrolling.
571 where they catch the eye w/o scrolling.
564
572
565 * Magic.py (%rehashx), ext_rehashdir.py: files with
573 * Magic.py (%rehashx), ext_rehashdir.py: files with
566 'py' extension are always considered executable, even
574 'py' extension are always considered executable, even
567 when not in PATHEXT environment variable.
575 when not in PATHEXT environment variable.
568
576
569 2006-10-12 Ville Vainio <vivainio@gmail.com>
577 2006-10-12 Ville Vainio <vivainio@gmail.com>
570
578
571 * jobctrl.py: Add new "jobctrl" extension for spawning background
579 * jobctrl.py: Add new "jobctrl" extension for spawning background
572 processes with "&find /". 'import jobctrl' to try it out. Requires
580 processes with "&find /". 'import jobctrl' to try it out. Requires
573 'subprocess' module, standard in python 2.4+.
581 'subprocess' module, standard in python 2.4+.
574
582
575 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
583 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
576 so if foo -> bar and bar -> baz, then foo -> baz.
584 so if foo -> bar and bar -> baz, then foo -> baz.
577
585
578 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
586 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
579
587
580 * IPython/Magic.py (Magic.parse_options): add a new posix option
588 * IPython/Magic.py (Magic.parse_options): add a new posix option
581 to allow parsing of input args in magics that doesn't strip quotes
589 to allow parsing of input args in magics that doesn't strip quotes
582 (if posix=False). This also closes %timeit bug reported by
590 (if posix=False). This also closes %timeit bug reported by
583 Stefan.
591 Stefan.
584
592
585 2006-10-03 Ville Vainio <vivainio@gmail.com>
593 2006-10-03 Ville Vainio <vivainio@gmail.com>
586
594
587 * iplib.py (raw_input, interact): Return ValueError catching for
595 * iplib.py (raw_input, interact): Return ValueError catching for
588 raw_input. Fixes infinite loop for sys.stdin.close() or
596 raw_input. Fixes infinite loop for sys.stdin.close() or
589 sys.stdout.close().
597 sys.stdout.close().
590
598
591 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
599 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
592
600
593 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
601 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
594 to help in handling doctests. irunner is now pretty useful for
602 to help in handling doctests. irunner is now pretty useful for
595 running standalone scripts and simulate a full interactive session
603 running standalone scripts and simulate a full interactive session
596 in a format that can be then pasted as a doctest.
604 in a format that can be then pasted as a doctest.
597
605
598 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
606 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
599 on top of the default (useless) ones. This also fixes the nasty
607 on top of the default (useless) ones. This also fixes the nasty
600 way in which 2.5's Quitter() exits (reverted [1785]).
608 way in which 2.5's Quitter() exits (reverted [1785]).
601
609
602 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
610 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
603 2.5.
611 2.5.
604
612
605 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
613 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
606 color scheme is updated as well when color scheme is changed
614 color scheme is updated as well when color scheme is changed
607 interactively.
615 interactively.
608
616
609 2006-09-27 Ville Vainio <vivainio@gmail.com>
617 2006-09-27 Ville Vainio <vivainio@gmail.com>
610
618
611 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
619 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
612 infinite loop and just exit. It's a hack, but will do for a while.
620 infinite loop and just exit. It's a hack, but will do for a while.
613
621
614 2006-08-25 Walter Doerwald <walter@livinglogic.de>
622 2006-08-25 Walter Doerwald <walter@livinglogic.de>
615
623
616 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
624 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
617 the constructor, this makes it possible to get a list of only directories
625 the constructor, this makes it possible to get a list of only directories
618 or only files.
626 or only files.
619
627
620 2006-08-12 Ville Vainio <vivainio@gmail.com>
628 2006-08-12 Ville Vainio <vivainio@gmail.com>
621
629
622 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
630 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
623 they broke unittest
631 they broke unittest
624
632
625 2006-08-11 Ville Vainio <vivainio@gmail.com>
633 2006-08-11 Ville Vainio <vivainio@gmail.com>
626
634
627 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
635 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
628 by resolving issue properly, i.e. by inheriting FakeModule
636 by resolving issue properly, i.e. by inheriting FakeModule
629 from types.ModuleType. Pickling ipython interactive data
637 from types.ModuleType. Pickling ipython interactive data
630 should still work as usual (testing appreciated).
638 should still work as usual (testing appreciated).
631
639
632 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
640 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
633
641
634 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
642 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
635 running under python 2.3 with code from 2.4 to fix a bug with
643 running under python 2.3 with code from 2.4 to fix a bug with
636 help(). Reported by the Debian maintainers, Norbert Tretkowski
644 help(). Reported by the Debian maintainers, Norbert Tretkowski
637 <norbert-AT-tretkowski.de> and Alexandre Fayolle
645 <norbert-AT-tretkowski.de> and Alexandre Fayolle
638 <afayolle-AT-debian.org>.
646 <afayolle-AT-debian.org>.
639
647
640 2006-08-04 Walter Doerwald <walter@livinglogic.de>
648 2006-08-04 Walter Doerwald <walter@livinglogic.de>
641
649
642 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
650 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
643 (which was displaying "quit" twice).
651 (which was displaying "quit" twice).
644
652
645 2006-07-28 Walter Doerwald <walter@livinglogic.de>
653 2006-07-28 Walter Doerwald <walter@livinglogic.de>
646
654
647 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
655 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
648 the mode argument).
656 the mode argument).
649
657
650 2006-07-27 Walter Doerwald <walter@livinglogic.de>
658 2006-07-27 Walter Doerwald <walter@livinglogic.de>
651
659
652 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
660 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
653 not running under IPython.
661 not running under IPython.
654
662
655 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
663 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
656 and make it iterable (iterating over the attribute itself). Add two new
664 and make it iterable (iterating over the attribute itself). Add two new
657 magic strings for __xattrs__(): If the string starts with "-", the attribute
665 magic strings for __xattrs__(): If the string starts with "-", the attribute
658 will not be displayed in ibrowse's detail view (but it can still be
666 will not be displayed in ibrowse's detail view (but it can still be
659 iterated over). This makes it possible to add attributes that are large
667 iterated over). This makes it possible to add attributes that are large
660 lists or generator methods to the detail view. Replace magic attribute names
668 lists or generator methods to the detail view. Replace magic attribute names
661 and _attrname() and _getattr() with "descriptors": For each type of magic
669 and _attrname() and _getattr() with "descriptors": For each type of magic
662 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
670 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
663 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
671 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
664 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
672 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
665 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
673 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
666 are still supported.
674 are still supported.
667
675
668 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
676 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
669 fails in ibrowse.fetch(), the exception object is added as the last item
677 fails in ibrowse.fetch(), the exception object is added as the last item
670 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
678 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
671 a generator throws an exception midway through execution.
679 a generator throws an exception midway through execution.
672
680
673 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
681 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
674 encoding into methods.
682 encoding into methods.
675
683
676 2006-07-26 Ville Vainio <vivainio@gmail.com>
684 2006-07-26 Ville Vainio <vivainio@gmail.com>
677
685
678 * iplib.py: history now stores multiline input as single
686 * iplib.py: history now stores multiline input as single
679 history entries. Patch by Jorgen Cederlof.
687 history entries. Patch by Jorgen Cederlof.
680
688
681 2006-07-18 Walter Doerwald <walter@livinglogic.de>
689 2006-07-18 Walter Doerwald <walter@livinglogic.de>
682
690
683 * IPython/Extensions/ibrowse.py: Make cursor visible over
691 * IPython/Extensions/ibrowse.py: Make cursor visible over
684 non existing attributes.
692 non existing attributes.
685
693
686 2006-07-14 Walter Doerwald <walter@livinglogic.de>
694 2006-07-14 Walter Doerwald <walter@livinglogic.de>
687
695
688 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
696 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
689 error output of the running command doesn't mess up the screen.
697 error output of the running command doesn't mess up the screen.
690
698
691 2006-07-13 Walter Doerwald <walter@livinglogic.de>
699 2006-07-13 Walter Doerwald <walter@livinglogic.de>
692
700
693 * IPython/Extensions/ipipe.py (isort): Make isort usable without
701 * IPython/Extensions/ipipe.py (isort): Make isort usable without
694 argument. This sorts the items themselves.
702 argument. This sorts the items themselves.
695
703
696 2006-07-12 Walter Doerwald <walter@livinglogic.de>
704 2006-07-12 Walter Doerwald <walter@livinglogic.de>
697
705
698 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
706 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
699 Compile expression strings into code objects. This should speed
707 Compile expression strings into code objects. This should speed
700 up ifilter and friends somewhat.
708 up ifilter and friends somewhat.
701
709
702 2006-07-08 Ville Vainio <vivainio@gmail.com>
710 2006-07-08 Ville Vainio <vivainio@gmail.com>
703
711
704 * Magic.py: %cpaste now strips > from the beginning of lines
712 * Magic.py: %cpaste now strips > from the beginning of lines
705 to ease pasting quoted code from emails. Contributed by
713 to ease pasting quoted code from emails. Contributed by
706 Stefan van der Walt.
714 Stefan van der Walt.
707
715
708 2006-06-29 Ville Vainio <vivainio@gmail.com>
716 2006-06-29 Ville Vainio <vivainio@gmail.com>
709
717
710 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
718 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
711 mode, patch contributed by Darren Dale. NEEDS TESTING!
719 mode, patch contributed by Darren Dale. NEEDS TESTING!
712
720
713 2006-06-28 Walter Doerwald <walter@livinglogic.de>
721 2006-06-28 Walter Doerwald <walter@livinglogic.de>
714
722
715 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
723 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
716 a blue background. Fix fetching new display rows when the browser
724 a blue background. Fix fetching new display rows when the browser
717 scrolls more than a screenful (e.g. by using the goto command).
725 scrolls more than a screenful (e.g. by using the goto command).
718
726
719 2006-06-27 Ville Vainio <vivainio@gmail.com>
727 2006-06-27 Ville Vainio <vivainio@gmail.com>
720
728
721 * Magic.py (_inspect, _ofind) Apply David Huard's
729 * Magic.py (_inspect, _ofind) Apply David Huard's
722 patch for displaying the correct docstring for 'property'
730 patch for displaying the correct docstring for 'property'
723 attributes.
731 attributes.
724
732
725 2006-06-23 Walter Doerwald <walter@livinglogic.de>
733 2006-06-23 Walter Doerwald <walter@livinglogic.de>
726
734
727 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
735 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
728 commands into the methods implementing them.
736 commands into the methods implementing them.
729
737
730 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
738 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
731
739
732 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
740 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
733 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
741 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
734 autoindent support was authored by Jin Liu.
742 autoindent support was authored by Jin Liu.
735
743
736 2006-06-22 Walter Doerwald <walter@livinglogic.de>
744 2006-06-22 Walter Doerwald <walter@livinglogic.de>
737
745
738 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
746 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
739 for keymaps with a custom class that simplifies handling.
747 for keymaps with a custom class that simplifies handling.
740
748
741 2006-06-19 Walter Doerwald <walter@livinglogic.de>
749 2006-06-19 Walter Doerwald <walter@livinglogic.de>
742
750
743 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
751 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
744 resizing. This requires Python 2.5 to work.
752 resizing. This requires Python 2.5 to work.
745
753
746 2006-06-16 Walter Doerwald <walter@livinglogic.de>
754 2006-06-16 Walter Doerwald <walter@livinglogic.de>
747
755
748 * IPython/Extensions/ibrowse.py: Add two new commands to
756 * IPython/Extensions/ibrowse.py: Add two new commands to
749 ibrowse: "hideattr" (mapped to "h") hides the attribute under
757 ibrowse: "hideattr" (mapped to "h") hides the attribute under
750 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
758 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
751 attributes again. Remapped the help command to "?". Display
759 attributes again. Remapped the help command to "?". Display
752 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
760 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
753 as keys for the "home" and "end" commands. Add three new commands
761 as keys for the "home" and "end" commands. Add three new commands
754 to the input mode for "find" and friends: "delend" (CTRL-K)
762 to the input mode for "find" and friends: "delend" (CTRL-K)
755 deletes to the end of line. "incsearchup" searches upwards in the
763 deletes to the end of line. "incsearchup" searches upwards in the
756 command history for an input that starts with the text before the cursor.
764 command history for an input that starts with the text before the cursor.
757 "incsearchdown" does the same downwards. Removed a bogus mapping of
765 "incsearchdown" does the same downwards. Removed a bogus mapping of
758 the x key to "delete".
766 the x key to "delete".
759
767
760 2006-06-15 Ville Vainio <vivainio@gmail.com>
768 2006-06-15 Ville Vainio <vivainio@gmail.com>
761
769
762 * iplib.py, hooks.py: Added new generate_prompt hook that can be
770 * iplib.py, hooks.py: Added new generate_prompt hook that can be
763 used to create prompts dynamically, instead of the "old" way of
771 used to create prompts dynamically, instead of the "old" way of
764 assigning "magic" strings to prompt_in1 and prompt_in2. The old
772 assigning "magic" strings to prompt_in1 and prompt_in2. The old
765 way still works (it's invoked by the default hook), of course.
773 way still works (it's invoked by the default hook), of course.
766
774
767 * Prompts.py: added generate_output_prompt hook for altering output
775 * Prompts.py: added generate_output_prompt hook for altering output
768 prompt
776 prompt
769
777
770 * Release.py: Changed version string to 0.7.3.svn.
778 * Release.py: Changed version string to 0.7.3.svn.
771
779
772 2006-06-15 Walter Doerwald <walter@livinglogic.de>
780 2006-06-15 Walter Doerwald <walter@livinglogic.de>
773
781
774 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
782 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
775 the call to fetch() always tries to fetch enough data for at least one
783 the call to fetch() always tries to fetch enough data for at least one
776 full screen. This makes it possible to simply call moveto(0,0,True) in
784 full screen. This makes it possible to simply call moveto(0,0,True) in
777 the constructor. Fix typos and removed the obsolete goto attribute.
785 the constructor. Fix typos and removed the obsolete goto attribute.
778
786
779 2006-06-12 Ville Vainio <vivainio@gmail.com>
787 2006-06-12 Ville Vainio <vivainio@gmail.com>
780
788
781 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
789 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
782 allowing $variable interpolation within multiline statements,
790 allowing $variable interpolation within multiline statements,
783 though so far only with "sh" profile for a testing period.
791 though so far only with "sh" profile for a testing period.
784 The patch also enables splitting long commands with \ but it
792 The patch also enables splitting long commands with \ but it
785 doesn't work properly yet.
793 doesn't work properly yet.
786
794
787 2006-06-12 Walter Doerwald <walter@livinglogic.de>
795 2006-06-12 Walter Doerwald <walter@livinglogic.de>
788
796
789 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
797 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
790 input history and the position of the cursor in the input history for
798 input history and the position of the cursor in the input history for
791 the find, findbackwards and goto command.
799 the find, findbackwards and goto command.
792
800
793 2006-06-10 Walter Doerwald <walter@livinglogic.de>
801 2006-06-10 Walter Doerwald <walter@livinglogic.de>
794
802
795 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
803 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
796 implements the basic functionality of browser commands that require
804 implements the basic functionality of browser commands that require
797 input. Reimplement the goto, find and findbackwards commands as
805 input. Reimplement the goto, find and findbackwards commands as
798 subclasses of _CommandInput. Add an input history and keymaps to those
806 subclasses of _CommandInput. Add an input history and keymaps to those
799 commands. Add "\r" as a keyboard shortcut for the enterdefault and
807 commands. Add "\r" as a keyboard shortcut for the enterdefault and
800 execute commands.
808 execute commands.
801
809
802 2006-06-07 Ville Vainio <vivainio@gmail.com>
810 2006-06-07 Ville Vainio <vivainio@gmail.com>
803
811
804 * iplib.py: ipython mybatch.ipy exits ipython immediately after
812 * iplib.py: ipython mybatch.ipy exits ipython immediately after
805 running the batch files instead of leaving the session open.
813 running the batch files instead of leaving the session open.
806
814
807 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
815 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
808
816
809 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
817 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
810 the original fix was incomplete. Patch submitted by W. Maier.
818 the original fix was incomplete. Patch submitted by W. Maier.
811
819
812 2006-06-07 Ville Vainio <vivainio@gmail.com>
820 2006-06-07 Ville Vainio <vivainio@gmail.com>
813
821
814 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
822 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
815 Confirmation prompts can be supressed by 'quiet' option.
823 Confirmation prompts can be supressed by 'quiet' option.
816 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
824 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
817
825
818 2006-06-06 *** Released version 0.7.2
826 2006-06-06 *** Released version 0.7.2
819
827
820 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
828 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
821
829
822 * IPython/Release.py (version): Made 0.7.2 final for release.
830 * IPython/Release.py (version): Made 0.7.2 final for release.
823 Repo tagged and release cut.
831 Repo tagged and release cut.
824
832
825 2006-06-05 Ville Vainio <vivainio@gmail.com>
833 2006-06-05 Ville Vainio <vivainio@gmail.com>
826
834
827 * Magic.py (magic_rehashx): Honor no_alias list earlier in
835 * Magic.py (magic_rehashx): Honor no_alias list earlier in
828 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
836 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
829
837
830 * upgrade_dir.py: try import 'path' module a bit harder
838 * upgrade_dir.py: try import 'path' module a bit harder
831 (for %upgrade)
839 (for %upgrade)
832
840
833 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
841 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
834
842
835 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
843 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
836 instead of looping 20 times.
844 instead of looping 20 times.
837
845
838 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
846 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
839 correctly at initialization time. Bug reported by Krishna Mohan
847 correctly at initialization time. Bug reported by Krishna Mohan
840 Gundu <gkmohan-AT-gmail.com> on the user list.
848 Gundu <gkmohan-AT-gmail.com> on the user list.
841
849
842 * IPython/Release.py (version): Mark 0.7.2 version to start
850 * IPython/Release.py (version): Mark 0.7.2 version to start
843 testing for release on 06/06.
851 testing for release on 06/06.
844
852
845 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
853 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
846
854
847 * scripts/irunner: thin script interface so users don't have to
855 * scripts/irunner: thin script interface so users don't have to
848 find the module and call it as an executable, since modules rarely
856 find the module and call it as an executable, since modules rarely
849 live in people's PATH.
857 live in people's PATH.
850
858
851 * IPython/irunner.py (InteractiveRunner.__init__): added
859 * IPython/irunner.py (InteractiveRunner.__init__): added
852 delaybeforesend attribute to control delays with newer versions of
860 delaybeforesend attribute to control delays with newer versions of
853 pexpect. Thanks to detailed help from pexpect's author, Noah
861 pexpect. Thanks to detailed help from pexpect's author, Noah
854 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
862 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
855 correctly (it works in NoColor mode).
863 correctly (it works in NoColor mode).
856
864
857 * IPython/iplib.py (handle_normal): fix nasty crash reported on
865 * IPython/iplib.py (handle_normal): fix nasty crash reported on
858 SAGE list, from improper log() calls.
866 SAGE list, from improper log() calls.
859
867
860 2006-05-31 Ville Vainio <vivainio@gmail.com>
868 2006-05-31 Ville Vainio <vivainio@gmail.com>
861
869
862 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
870 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
863 with args in parens to work correctly with dirs that have spaces.
871 with args in parens to work correctly with dirs that have spaces.
864
872
865 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
873 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
866
874
867 * IPython/Logger.py (Logger.logstart): add option to log raw input
875 * IPython/Logger.py (Logger.logstart): add option to log raw input
868 instead of the processed one. A -r flag was added to the
876 instead of the processed one. A -r flag was added to the
869 %logstart magic used for controlling logging.
877 %logstart magic used for controlling logging.
870
878
871 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
879 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
872
880
873 * IPython/iplib.py (InteractiveShell.__init__): add check for the
881 * IPython/iplib.py (InteractiveShell.__init__): add check for the
874 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
882 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
875 recognize the option. After a bug report by Will Maier. This
883 recognize the option. After a bug report by Will Maier. This
876 closes #64 (will do it after confirmation from W. Maier).
884 closes #64 (will do it after confirmation from W. Maier).
877
885
878 * IPython/irunner.py: New module to run scripts as if manually
886 * IPython/irunner.py: New module to run scripts as if manually
879 typed into an interactive environment, based on pexpect. After a
887 typed into an interactive environment, based on pexpect. After a
880 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
888 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
881 ipython-user list. Simple unittests in the tests/ directory.
889 ipython-user list. Simple unittests in the tests/ directory.
882
890
883 * tools/release: add Will Maier, OpenBSD port maintainer, to
891 * tools/release: add Will Maier, OpenBSD port maintainer, to
884 recepients list. We are now officially part of the OpenBSD ports:
892 recepients list. We are now officially part of the OpenBSD ports:
885 http://www.openbsd.org/ports.html ! Many thanks to Will for the
893 http://www.openbsd.org/ports.html ! Many thanks to Will for the
886 work.
894 work.
887
895
888 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
896 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
889
897
890 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
898 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
891 so that it doesn't break tkinter apps.
899 so that it doesn't break tkinter apps.
892
900
893 * IPython/iplib.py (_prefilter): fix bug where aliases would
901 * IPython/iplib.py (_prefilter): fix bug where aliases would
894 shadow variables when autocall was fully off. Reported by SAGE
902 shadow variables when autocall was fully off. Reported by SAGE
895 author William Stein.
903 author William Stein.
896
904
897 * IPython/OInspect.py (Inspector.__init__): add a flag to control
905 * IPython/OInspect.py (Inspector.__init__): add a flag to control
898 at what detail level strings are computed when foo? is requested.
906 at what detail level strings are computed when foo? is requested.
899 This allows users to ask for example that the string form of an
907 This allows users to ask for example that the string form of an
900 object is only computed when foo?? is called, or even never, by
908 object is only computed when foo?? is called, or even never, by
901 setting the object_info_string_level >= 2 in the configuration
909 setting the object_info_string_level >= 2 in the configuration
902 file. This new option has been added and documented. After a
910 file. This new option has been added and documented. After a
903 request by SAGE to be able to control the printing of very large
911 request by SAGE to be able to control the printing of very large
904 objects more easily.
912 objects more easily.
905
913
906 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
914 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
907
915
908 * IPython/ipmaker.py (make_IPython): remove the ipython call path
916 * IPython/ipmaker.py (make_IPython): remove the ipython call path
909 from sys.argv, to be 100% consistent with how Python itself works
917 from sys.argv, to be 100% consistent with how Python itself works
910 (as seen for example with python -i file.py). After a bug report
918 (as seen for example with python -i file.py). After a bug report
911 by Jeffrey Collins.
919 by Jeffrey Collins.
912
920
913 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
921 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
914 nasty bug which was preventing custom namespaces with -pylab,
922 nasty bug which was preventing custom namespaces with -pylab,
915 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
923 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
916 compatibility (long gone from mpl).
924 compatibility (long gone from mpl).
917
925
918 * IPython/ipapi.py (make_session): name change: create->make. We
926 * IPython/ipapi.py (make_session): name change: create->make. We
919 use make in other places (ipmaker,...), it's shorter and easier to
927 use make in other places (ipmaker,...), it's shorter and easier to
920 type and say, etc. I'm trying to clean things before 0.7.2 so
928 type and say, etc. I'm trying to clean things before 0.7.2 so
921 that I can keep things stable wrt to ipapi in the chainsaw branch.
929 that I can keep things stable wrt to ipapi in the chainsaw branch.
922
930
923 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
931 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
924 python-mode recognizes our debugger mode. Add support for
932 python-mode recognizes our debugger mode. Add support for
925 autoindent inside (X)emacs. After a patch sent in by Jin Liu
933 autoindent inside (X)emacs. After a patch sent in by Jin Liu
926 <m.liu.jin-AT-gmail.com> originally written by
934 <m.liu.jin-AT-gmail.com> originally written by
927 doxgen-AT-newsmth.net (with minor modifications for xemacs
935 doxgen-AT-newsmth.net (with minor modifications for xemacs
928 compatibility)
936 compatibility)
929
937
930 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
938 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
931 tracebacks when walking the stack so that the stack tracking system
939 tracebacks when walking the stack so that the stack tracking system
932 in emacs' python-mode can identify the frames correctly.
940 in emacs' python-mode can identify the frames correctly.
933
941
934 * IPython/ipmaker.py (make_IPython): make the internal (and
942 * IPython/ipmaker.py (make_IPython): make the internal (and
935 default config) autoedit_syntax value false by default. Too many
943 default config) autoedit_syntax value false by default. Too many
936 users have complained to me (both on and off-list) about problems
944 users have complained to me (both on and off-list) about problems
937 with this option being on by default, so I'm making it default to
945 with this option being on by default, so I'm making it default to
938 off. It can still be enabled by anyone via the usual mechanisms.
946 off. It can still be enabled by anyone via the usual mechanisms.
939
947
940 * IPython/completer.py (Completer.attr_matches): add support for
948 * IPython/completer.py (Completer.attr_matches): add support for
941 PyCrust-style _getAttributeNames magic method. Patch contributed
949 PyCrust-style _getAttributeNames magic method. Patch contributed
942 by <mscott-AT-goldenspud.com>. Closes #50.
950 by <mscott-AT-goldenspud.com>. Closes #50.
943
951
944 * IPython/iplib.py (InteractiveShell.__init__): remove the
952 * IPython/iplib.py (InteractiveShell.__init__): remove the
945 deletion of exit/quit from __builtin__, which can break
953 deletion of exit/quit from __builtin__, which can break
946 third-party tools like the Zope debugging console. The
954 third-party tools like the Zope debugging console. The
947 %exit/%quit magics remain. In general, it's probably a good idea
955 %exit/%quit magics remain. In general, it's probably a good idea
948 not to delete anything from __builtin__, since we never know what
956 not to delete anything from __builtin__, since we never know what
949 that will break. In any case, python now (for 2.5) will support
957 that will break. In any case, python now (for 2.5) will support
950 'real' exit/quit, so this issue is moot. Closes #55.
958 'real' exit/quit, so this issue is moot. Closes #55.
951
959
952 * IPython/genutils.py (with_obj): rename the 'with' function to
960 * IPython/genutils.py (with_obj): rename the 'with' function to
953 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
961 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
954 becomes a language keyword. Closes #53.
962 becomes a language keyword. Closes #53.
955
963
956 * IPython/FakeModule.py (FakeModule.__init__): add a proper
964 * IPython/FakeModule.py (FakeModule.__init__): add a proper
957 __file__ attribute to this so it fools more things into thinking
965 __file__ attribute to this so it fools more things into thinking
958 it is a real module. Closes #59.
966 it is a real module. Closes #59.
959
967
960 * IPython/Magic.py (magic_edit): add -n option to open the editor
968 * IPython/Magic.py (magic_edit): add -n option to open the editor
961 at a specific line number. After a patch by Stefan van der Walt.
969 at a specific line number. After a patch by Stefan van der Walt.
962
970
963 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
971 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
964
972
965 * IPython/iplib.py (edit_syntax_error): fix crash when for some
973 * IPython/iplib.py (edit_syntax_error): fix crash when for some
966 reason the file could not be opened. After automatic crash
974 reason the file could not be opened. After automatic crash
967 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
975 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
968 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
976 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
969 (_should_recompile): Don't fire editor if using %bg, since there
977 (_should_recompile): Don't fire editor if using %bg, since there
970 is no file in the first place. From the same report as above.
978 is no file in the first place. From the same report as above.
971 (raw_input): protect against faulty third-party prefilters. After
979 (raw_input): protect against faulty third-party prefilters. After
972 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
980 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
973 while running under SAGE.
981 while running under SAGE.
974
982
975 2006-05-23 Ville Vainio <vivainio@gmail.com>
983 2006-05-23 Ville Vainio <vivainio@gmail.com>
976
984
977 * ipapi.py: Stripped down ip.to_user_ns() to work only as
985 * ipapi.py: Stripped down ip.to_user_ns() to work only as
978 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
986 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
979 now returns None (again), unless dummy is specifically allowed by
987 now returns None (again), unless dummy is specifically allowed by
980 ipapi.get(allow_dummy=True).
988 ipapi.get(allow_dummy=True).
981
989
982 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
990 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
983
991
984 * IPython: remove all 2.2-compatibility objects and hacks from
992 * IPython: remove all 2.2-compatibility objects and hacks from
985 everywhere, since we only support 2.3 at this point. Docs
993 everywhere, since we only support 2.3 at this point. Docs
986 updated.
994 updated.
987
995
988 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
996 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
989 Anything requiring extra validation can be turned into a Python
997 Anything requiring extra validation can be turned into a Python
990 property in the future. I used a property for the db one b/c
998 property in the future. I used a property for the db one b/c
991 there was a nasty circularity problem with the initialization
999 there was a nasty circularity problem with the initialization
992 order, which right now I don't have time to clean up.
1000 order, which right now I don't have time to clean up.
993
1001
994 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1002 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
995 another locking bug reported by Jorgen. I'm not 100% sure though,
1003 another locking bug reported by Jorgen. I'm not 100% sure though,
996 so more testing is needed...
1004 so more testing is needed...
997
1005
998 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1006 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
999
1007
1000 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1008 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1001 local variables from any routine in user code (typically executed
1009 local variables from any routine in user code (typically executed
1002 with %run) directly into the interactive namespace. Very useful
1010 with %run) directly into the interactive namespace. Very useful
1003 when doing complex debugging.
1011 when doing complex debugging.
1004 (IPythonNotRunning): Changed the default None object to a dummy
1012 (IPythonNotRunning): Changed the default None object to a dummy
1005 whose attributes can be queried as well as called without
1013 whose attributes can be queried as well as called without
1006 exploding, to ease writing code which works transparently both in
1014 exploding, to ease writing code which works transparently both in
1007 and out of ipython and uses some of this API.
1015 and out of ipython and uses some of this API.
1008
1016
1009 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1017 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1010
1018
1011 * IPython/hooks.py (result_display): Fix the fact that our display
1019 * IPython/hooks.py (result_display): Fix the fact that our display
1012 hook was using str() instead of repr(), as the default python
1020 hook was using str() instead of repr(), as the default python
1013 console does. This had gone unnoticed b/c it only happened if
1021 console does. This had gone unnoticed b/c it only happened if
1014 %Pprint was off, but the inconsistency was there.
1022 %Pprint was off, but the inconsistency was there.
1015
1023
1016 2006-05-15 Ville Vainio <vivainio@gmail.com>
1024 2006-05-15 Ville Vainio <vivainio@gmail.com>
1017
1025
1018 * Oinspect.py: Only show docstring for nonexisting/binary files
1026 * Oinspect.py: Only show docstring for nonexisting/binary files
1019 when doing object??, closing ticket #62
1027 when doing object??, closing ticket #62
1020
1028
1021 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1029 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1022
1030
1023 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1031 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1024 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1032 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1025 was being released in a routine which hadn't checked if it had
1033 was being released in a routine which hadn't checked if it had
1026 been the one to acquire it.
1034 been the one to acquire it.
1027
1035
1028 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1036 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1029
1037
1030 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1038 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1031
1039
1032 2006-04-11 Ville Vainio <vivainio@gmail.com>
1040 2006-04-11 Ville Vainio <vivainio@gmail.com>
1033
1041
1034 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1042 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1035 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1043 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1036 prefilters, allowing stuff like magics and aliases in the file.
1044 prefilters, allowing stuff like magics and aliases in the file.
1037
1045
1038 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1046 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1039 added. Supported now are "%clear in" and "%clear out" (clear input and
1047 added. Supported now are "%clear in" and "%clear out" (clear input and
1040 output history, respectively). Also fixed CachedOutput.flush to
1048 output history, respectively). Also fixed CachedOutput.flush to
1041 properly flush the output cache.
1049 properly flush the output cache.
1042
1050
1043 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1051 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1044 half-success (and fail explicitly).
1052 half-success (and fail explicitly).
1045
1053
1046 2006-03-28 Ville Vainio <vivainio@gmail.com>
1054 2006-03-28 Ville Vainio <vivainio@gmail.com>
1047
1055
1048 * iplib.py: Fix quoting of aliases so that only argless ones
1056 * iplib.py: Fix quoting of aliases so that only argless ones
1049 are quoted
1057 are quoted
1050
1058
1051 2006-03-28 Ville Vainio <vivainio@gmail.com>
1059 2006-03-28 Ville Vainio <vivainio@gmail.com>
1052
1060
1053 * iplib.py: Quote aliases with spaces in the name.
1061 * iplib.py: Quote aliases with spaces in the name.
1054 "c:\program files\blah\bin" is now legal alias target.
1062 "c:\program files\blah\bin" is now legal alias target.
1055
1063
1056 * ext_rehashdir.py: Space no longer allowed as arg
1064 * ext_rehashdir.py: Space no longer allowed as arg
1057 separator, since space is legal in path names.
1065 separator, since space is legal in path names.
1058
1066
1059 2006-03-16 Ville Vainio <vivainio@gmail.com>
1067 2006-03-16 Ville Vainio <vivainio@gmail.com>
1060
1068
1061 * upgrade_dir.py: Take path.py from Extensions, correcting
1069 * upgrade_dir.py: Take path.py from Extensions, correcting
1062 %upgrade magic
1070 %upgrade magic
1063
1071
1064 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1072 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1065
1073
1066 * hooks.py: Only enclose editor binary in quotes if legal and
1074 * hooks.py: Only enclose editor binary in quotes if legal and
1067 necessary (space in the name, and is an existing file). Fixes a bug
1075 necessary (space in the name, and is an existing file). Fixes a bug
1068 reported by Zachary Pincus.
1076 reported by Zachary Pincus.
1069
1077
1070 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1078 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1071
1079
1072 * Manual: thanks to a tip on proper color handling for Emacs, by
1080 * Manual: thanks to a tip on proper color handling for Emacs, by
1073 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1081 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1074
1082
1075 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1083 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1076 by applying the provided patch. Thanks to Liu Jin
1084 by applying the provided patch. Thanks to Liu Jin
1077 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1085 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1078 XEmacs/Linux, I'm trusting the submitter that it actually helps
1086 XEmacs/Linux, I'm trusting the submitter that it actually helps
1079 under win32/GNU Emacs. Will revisit if any problems are reported.
1087 under win32/GNU Emacs. Will revisit if any problems are reported.
1080
1088
1081 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1089 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1082
1090
1083 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1091 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1084 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1092 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1085
1093
1086 2006-03-12 Ville Vainio <vivainio@gmail.com>
1094 2006-03-12 Ville Vainio <vivainio@gmail.com>
1087
1095
1088 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1096 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1089 Torsten Marek.
1097 Torsten Marek.
1090
1098
1091 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1099 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1092
1100
1093 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1101 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1094 line ranges works again.
1102 line ranges works again.
1095
1103
1096 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1104 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1097
1105
1098 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1106 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1099 and friends, after a discussion with Zach Pincus on ipython-user.
1107 and friends, after a discussion with Zach Pincus on ipython-user.
1100 I'm not 100% sure, but after thinking about it quite a bit, it may
1108 I'm not 100% sure, but after thinking about it quite a bit, it may
1101 be OK. Testing with the multithreaded shells didn't reveal any
1109 be OK. Testing with the multithreaded shells didn't reveal any
1102 problems, but let's keep an eye out.
1110 problems, but let's keep an eye out.
1103
1111
1104 In the process, I fixed a few things which were calling
1112 In the process, I fixed a few things which were calling
1105 self.InteractiveTB() directly (like safe_execfile), which is a
1113 self.InteractiveTB() directly (like safe_execfile), which is a
1106 mistake: ALL exception reporting should be done by calling
1114 mistake: ALL exception reporting should be done by calling
1107 self.showtraceback(), which handles state and tab-completion and
1115 self.showtraceback(), which handles state and tab-completion and
1108 more.
1116 more.
1109
1117
1110 2006-03-01 Ville Vainio <vivainio@gmail.com>
1118 2006-03-01 Ville Vainio <vivainio@gmail.com>
1111
1119
1112 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1120 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1113 To use, do "from ipipe import *".
1121 To use, do "from ipipe import *".
1114
1122
1115 2006-02-24 Ville Vainio <vivainio@gmail.com>
1123 2006-02-24 Ville Vainio <vivainio@gmail.com>
1116
1124
1117 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1125 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1118 "cleanly" and safely than the older upgrade mechanism.
1126 "cleanly" and safely than the older upgrade mechanism.
1119
1127
1120 2006-02-21 Ville Vainio <vivainio@gmail.com>
1128 2006-02-21 Ville Vainio <vivainio@gmail.com>
1121
1129
1122 * Magic.py: %save works again.
1130 * Magic.py: %save works again.
1123
1131
1124 2006-02-15 Ville Vainio <vivainio@gmail.com>
1132 2006-02-15 Ville Vainio <vivainio@gmail.com>
1125
1133
1126 * Magic.py: %Pprint works again
1134 * Magic.py: %Pprint works again
1127
1135
1128 * Extensions/ipy_sane_defaults.py: Provide everything provided
1136 * Extensions/ipy_sane_defaults.py: Provide everything provided
1129 in default ipythonrc, to make it possible to have a completely empty
1137 in default ipythonrc, to make it possible to have a completely empty
1130 ipythonrc (and thus completely rc-file free configuration)
1138 ipythonrc (and thus completely rc-file free configuration)
1131
1139
1132 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1140 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1133
1141
1134 * IPython/hooks.py (editor): quote the call to the editor command,
1142 * IPython/hooks.py (editor): quote the call to the editor command,
1135 to allow commands with spaces in them. Problem noted by watching
1143 to allow commands with spaces in them. Problem noted by watching
1136 Ian Oswald's video about textpad under win32 at
1144 Ian Oswald's video about textpad under win32 at
1137 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1145 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1138
1146
1139 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1147 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1140 describing magics (we haven't used @ for a loong time).
1148 describing magics (we haven't used @ for a loong time).
1141
1149
1142 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1150 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1143 contributed by marienz to close
1151 contributed by marienz to close
1144 http://www.scipy.net/roundup/ipython/issue53.
1152 http://www.scipy.net/roundup/ipython/issue53.
1145
1153
1146 2006-02-10 Ville Vainio <vivainio@gmail.com>
1154 2006-02-10 Ville Vainio <vivainio@gmail.com>
1147
1155
1148 * genutils.py: getoutput now works in win32 too
1156 * genutils.py: getoutput now works in win32 too
1149
1157
1150 * completer.py: alias and magic completion only invoked
1158 * completer.py: alias and magic completion only invoked
1151 at the first "item" in the line, to avoid "cd %store"
1159 at the first "item" in the line, to avoid "cd %store"
1152 nonsense.
1160 nonsense.
1153
1161
1154 2006-02-09 Ville Vainio <vivainio@gmail.com>
1162 2006-02-09 Ville Vainio <vivainio@gmail.com>
1155
1163
1156 * test/*: Added a unit testing framework (finally).
1164 * test/*: Added a unit testing framework (finally).
1157 '%run runtests.py' to run test_*.
1165 '%run runtests.py' to run test_*.
1158
1166
1159 * ipapi.py: Exposed runlines and set_custom_exc
1167 * ipapi.py: Exposed runlines and set_custom_exc
1160
1168
1161 2006-02-07 Ville Vainio <vivainio@gmail.com>
1169 2006-02-07 Ville Vainio <vivainio@gmail.com>
1162
1170
1163 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1171 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1164 instead use "f(1 2)" as before.
1172 instead use "f(1 2)" as before.
1165
1173
1166 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1174 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1167
1175
1168 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1176 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1169 facilities, for demos processed by the IPython input filter
1177 facilities, for demos processed by the IPython input filter
1170 (IPythonDemo), and for running a script one-line-at-a-time as a
1178 (IPythonDemo), and for running a script one-line-at-a-time as a
1171 demo, both for pure Python (LineDemo) and for IPython-processed
1179 demo, both for pure Python (LineDemo) and for IPython-processed
1172 input (IPythonLineDemo). After a request by Dave Kohel, from the
1180 input (IPythonLineDemo). After a request by Dave Kohel, from the
1173 SAGE team.
1181 SAGE team.
1174 (Demo.edit): added an edit() method to the demo objects, to edit
1182 (Demo.edit): added an edit() method to the demo objects, to edit
1175 the in-memory copy of the last executed block.
1183 the in-memory copy of the last executed block.
1176
1184
1177 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1185 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1178 processing to %edit, %macro and %save. These commands can now be
1186 processing to %edit, %macro and %save. These commands can now be
1179 invoked on the unprocessed input as it was typed by the user
1187 invoked on the unprocessed input as it was typed by the user
1180 (without any prefilters applied). After requests by the SAGE team
1188 (without any prefilters applied). After requests by the SAGE team
1181 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1189 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1182
1190
1183 2006-02-01 Ville Vainio <vivainio@gmail.com>
1191 2006-02-01 Ville Vainio <vivainio@gmail.com>
1184
1192
1185 * setup.py, eggsetup.py: easy_install ipython==dev works
1193 * setup.py, eggsetup.py: easy_install ipython==dev works
1186 correctly now (on Linux)
1194 correctly now (on Linux)
1187
1195
1188 * ipy_user_conf,ipmaker: user config changes, removed spurious
1196 * ipy_user_conf,ipmaker: user config changes, removed spurious
1189 warnings
1197 warnings
1190
1198
1191 * iplib: if rc.banner is string, use it as is.
1199 * iplib: if rc.banner is string, use it as is.
1192
1200
1193 * Magic: %pycat accepts a string argument and pages it's contents.
1201 * Magic: %pycat accepts a string argument and pages it's contents.
1194
1202
1195
1203
1196 2006-01-30 Ville Vainio <vivainio@gmail.com>
1204 2006-01-30 Ville Vainio <vivainio@gmail.com>
1197
1205
1198 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1206 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1199 Now %store and bookmarks work through PickleShare, meaning that
1207 Now %store and bookmarks work through PickleShare, meaning that
1200 concurrent access is possible and all ipython sessions see the
1208 concurrent access is possible and all ipython sessions see the
1201 same database situation all the time, instead of snapshot of
1209 same database situation all the time, instead of snapshot of
1202 the situation when the session was started. Hence, %bookmark
1210 the situation when the session was started. Hence, %bookmark
1203 results are immediately accessible from othes sessions. The database
1211 results are immediately accessible from othes sessions. The database
1204 is also available for use by user extensions. See:
1212 is also available for use by user extensions. See:
1205 http://www.python.org/pypi/pickleshare
1213 http://www.python.org/pypi/pickleshare
1206
1214
1207 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1215 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1208
1216
1209 * aliases can now be %store'd
1217 * aliases can now be %store'd
1210
1218
1211 * path.py moved to Extensions so that pickleshare does not need
1219 * path.py moved to Extensions so that pickleshare does not need
1212 IPython-specific import. Extensions added to pythonpath right
1220 IPython-specific import. Extensions added to pythonpath right
1213 at __init__.
1221 at __init__.
1214
1222
1215 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1223 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1216 called with _ip.system and the pre-transformed command string.
1224 called with _ip.system and the pre-transformed command string.
1217
1225
1218 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1226 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1219
1227
1220 * IPython/iplib.py (interact): Fix that we were not catching
1228 * IPython/iplib.py (interact): Fix that we were not catching
1221 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1229 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1222 logic here had to change, but it's fixed now.
1230 logic here had to change, but it's fixed now.
1223
1231
1224 2006-01-29 Ville Vainio <vivainio@gmail.com>
1232 2006-01-29 Ville Vainio <vivainio@gmail.com>
1225
1233
1226 * iplib.py: Try to import pyreadline on Windows.
1234 * iplib.py: Try to import pyreadline on Windows.
1227
1235
1228 2006-01-27 Ville Vainio <vivainio@gmail.com>
1236 2006-01-27 Ville Vainio <vivainio@gmail.com>
1229
1237
1230 * iplib.py: Expose ipapi as _ip in builtin namespace.
1238 * iplib.py: Expose ipapi as _ip in builtin namespace.
1231 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1239 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1232 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1240 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1233 syntax now produce _ip.* variant of the commands.
1241 syntax now produce _ip.* variant of the commands.
1234
1242
1235 * "_ip.options().autoedit_syntax = 2" automatically throws
1243 * "_ip.options().autoedit_syntax = 2" automatically throws
1236 user to editor for syntax error correction without prompting.
1244 user to editor for syntax error correction without prompting.
1237
1245
1238 2006-01-27 Ville Vainio <vivainio@gmail.com>
1246 2006-01-27 Ville Vainio <vivainio@gmail.com>
1239
1247
1240 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1248 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1241 'ipython' at argv[0]) executed through command line.
1249 'ipython' at argv[0]) executed through command line.
1242 NOTE: this DEPRECATES calling ipython with multiple scripts
1250 NOTE: this DEPRECATES calling ipython with multiple scripts
1243 ("ipython a.py b.py c.py")
1251 ("ipython a.py b.py c.py")
1244
1252
1245 * iplib.py, hooks.py: Added configurable input prefilter,
1253 * iplib.py, hooks.py: Added configurable input prefilter,
1246 named 'input_prefilter'. See ext_rescapture.py for example
1254 named 'input_prefilter'. See ext_rescapture.py for example
1247 usage.
1255 usage.
1248
1256
1249 * ext_rescapture.py, Magic.py: Better system command output capture
1257 * ext_rescapture.py, Magic.py: Better system command output capture
1250 through 'var = !ls' (deprecates user-visible %sc). Same notation
1258 through 'var = !ls' (deprecates user-visible %sc). Same notation
1251 applies for magics, 'var = %alias' assigns alias list to var.
1259 applies for magics, 'var = %alias' assigns alias list to var.
1252
1260
1253 * ipapi.py: added meta() for accessing extension-usable data store.
1261 * ipapi.py: added meta() for accessing extension-usable data store.
1254
1262
1255 * iplib.py: added InteractiveShell.getapi(). New magics should be
1263 * iplib.py: added InteractiveShell.getapi(). New magics should be
1256 written doing self.getapi() instead of using the shell directly.
1264 written doing self.getapi() instead of using the shell directly.
1257
1265
1258 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1266 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1259 %store foo >> ~/myfoo.txt to store variables to files (in clean
1267 %store foo >> ~/myfoo.txt to store variables to files (in clean
1260 textual form, not a restorable pickle).
1268 textual form, not a restorable pickle).
1261
1269
1262 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
1270 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
1263
1271
1264 * usage.py, Magic.py: added %quickref
1272 * usage.py, Magic.py: added %quickref
1265
1273
1266 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
1274 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
1267
1275
1268 * GetoptErrors when invoking magics etc. with wrong args
1276 * GetoptErrors when invoking magics etc. with wrong args
1269 are now more helpful:
1277 are now more helpful:
1270 GetoptError: option -l not recognized (allowed: "qb" )
1278 GetoptError: option -l not recognized (allowed: "qb" )
1271
1279
1272 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
1280 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
1273
1281
1274 * IPython/demo.py (Demo.show): Flush stdout after each block, so
1282 * IPython/demo.py (Demo.show): Flush stdout after each block, so
1275 computationally intensive blocks don't appear to stall the demo.
1283 computationally intensive blocks don't appear to stall the demo.
1276
1284
1277 2006-01-24 Ville Vainio <vivainio@gmail.com>
1285 2006-01-24 Ville Vainio <vivainio@gmail.com>
1278
1286
1279 * iplib.py, hooks.py: 'result_display' hook can return a non-None
1287 * iplib.py, hooks.py: 'result_display' hook can return a non-None
1280 value to manipulate resulting history entry.
1288 value to manipulate resulting history entry.
1281
1289
1282 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
1290 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
1283 to instance methods of IPApi class, to make extending an embedded
1291 to instance methods of IPApi class, to make extending an embedded
1284 IPython feasible. See ext_rehashdir.py for example usage.
1292 IPython feasible. See ext_rehashdir.py for example usage.
1285
1293
1286 * Merged 1071-1076 from branches/0.7.1
1294 * Merged 1071-1076 from branches/0.7.1
1287
1295
1288
1296
1289 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
1297 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
1290
1298
1291 * tools/release (daystamp): Fix build tools to use the new
1299 * tools/release (daystamp): Fix build tools to use the new
1292 eggsetup.py script to build lightweight eggs.
1300 eggsetup.py script to build lightweight eggs.
1293
1301
1294 * Applied changesets 1062 and 1064 before 0.7.1 release.
1302 * Applied changesets 1062 and 1064 before 0.7.1 release.
1295
1303
1296 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
1304 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
1297 see the raw input history (without conversions like %ls ->
1305 see the raw input history (without conversions like %ls ->
1298 ipmagic("ls")). After a request from W. Stein, SAGE
1306 ipmagic("ls")). After a request from W. Stein, SAGE
1299 (http://modular.ucsd.edu/sage) developer. This information is
1307 (http://modular.ucsd.edu/sage) developer. This information is
1300 stored in the input_hist_raw attribute of the IPython instance, so
1308 stored in the input_hist_raw attribute of the IPython instance, so
1301 developers can access it if needed (it's an InputList instance).
1309 developers can access it if needed (it's an InputList instance).
1302
1310
1303 * Versionstring = 0.7.2.svn
1311 * Versionstring = 0.7.2.svn
1304
1312
1305 * eggsetup.py: A separate script for constructing eggs, creates
1313 * eggsetup.py: A separate script for constructing eggs, creates
1306 proper launch scripts even on Windows (an .exe file in
1314 proper launch scripts even on Windows (an .exe file in
1307 \python24\scripts).
1315 \python24\scripts).
1308
1316
1309 * ipapi.py: launch_new_instance, launch entry point needed for the
1317 * ipapi.py: launch_new_instance, launch entry point needed for the
1310 egg.
1318 egg.
1311
1319
1312 2006-01-23 Ville Vainio <vivainio@gmail.com>
1320 2006-01-23 Ville Vainio <vivainio@gmail.com>
1313
1321
1314 * Added %cpaste magic for pasting python code
1322 * Added %cpaste magic for pasting python code
1315
1323
1316 2006-01-22 Ville Vainio <vivainio@gmail.com>
1324 2006-01-22 Ville Vainio <vivainio@gmail.com>
1317
1325
1318 * Merge from branches/0.7.1 into trunk, revs 1052-1057
1326 * Merge from branches/0.7.1 into trunk, revs 1052-1057
1319
1327
1320 * Versionstring = 0.7.2.svn
1328 * Versionstring = 0.7.2.svn
1321
1329
1322 * eggsetup.py: A separate script for constructing eggs, creates
1330 * eggsetup.py: A separate script for constructing eggs, creates
1323 proper launch scripts even on Windows (an .exe file in
1331 proper launch scripts even on Windows (an .exe file in
1324 \python24\scripts).
1332 \python24\scripts).
1325
1333
1326 * ipapi.py: launch_new_instance, launch entry point needed for the
1334 * ipapi.py: launch_new_instance, launch entry point needed for the
1327 egg.
1335 egg.
1328
1336
1329 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
1337 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
1330
1338
1331 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
1339 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
1332 %pfile foo would print the file for foo even if it was a binary.
1340 %pfile foo would print the file for foo even if it was a binary.
1333 Now, extensions '.so' and '.dll' are skipped.
1341 Now, extensions '.so' and '.dll' are skipped.
1334
1342
1335 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
1343 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
1336 bug, where macros would fail in all threaded modes. I'm not 100%
1344 bug, where macros would fail in all threaded modes. I'm not 100%
1337 sure, so I'm going to put out an rc instead of making a release
1345 sure, so I'm going to put out an rc instead of making a release
1338 today, and wait for feedback for at least a few days.
1346 today, and wait for feedback for at least a few days.
1339
1347
1340 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
1348 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
1341 it...) the handling of pasting external code with autoindent on.
1349 it...) the handling of pasting external code with autoindent on.
1342 To get out of a multiline input, the rule will appear for most
1350 To get out of a multiline input, the rule will appear for most
1343 users unchanged: two blank lines or change the indent level
1351 users unchanged: two blank lines or change the indent level
1344 proposed by IPython. But there is a twist now: you can
1352 proposed by IPython. But there is a twist now: you can
1345 add/subtract only *one or two spaces*. If you add/subtract three
1353 add/subtract only *one or two spaces*. If you add/subtract three
1346 or more (unless you completely delete the line), IPython will
1354 or more (unless you completely delete the line), IPython will
1347 accept that line, and you'll need to enter a second one of pure
1355 accept that line, and you'll need to enter a second one of pure
1348 whitespace. I know it sounds complicated, but I can't find a
1356 whitespace. I know it sounds complicated, but I can't find a
1349 different solution that covers all the cases, with the right
1357 different solution that covers all the cases, with the right
1350 heuristics. Hopefully in actual use, nobody will really notice
1358 heuristics. Hopefully in actual use, nobody will really notice
1351 all these strange rules and things will 'just work'.
1359 all these strange rules and things will 'just work'.
1352
1360
1353 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
1361 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
1354
1362
1355 * IPython/iplib.py (interact): catch exceptions which can be
1363 * IPython/iplib.py (interact): catch exceptions which can be
1356 triggered asynchronously by signal handlers. Thanks to an
1364 triggered asynchronously by signal handlers. Thanks to an
1357 automatic crash report, submitted by Colin Kingsley
1365 automatic crash report, submitted by Colin Kingsley
1358 <tercel-AT-gentoo.org>.
1366 <tercel-AT-gentoo.org>.
1359
1367
1360 2006-01-20 Ville Vainio <vivainio@gmail.com>
1368 2006-01-20 Ville Vainio <vivainio@gmail.com>
1361
1369
1362 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
1370 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
1363 (%rehashdir, very useful, try it out) of how to extend ipython
1371 (%rehashdir, very useful, try it out) of how to extend ipython
1364 with new magics. Also added Extensions dir to pythonpath to make
1372 with new magics. Also added Extensions dir to pythonpath to make
1365 importing extensions easy.
1373 importing extensions easy.
1366
1374
1367 * %store now complains when trying to store interactively declared
1375 * %store now complains when trying to store interactively declared
1368 classes / instances of those classes.
1376 classes / instances of those classes.
1369
1377
1370 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
1378 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
1371 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
1379 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
1372 if they exist, and ipy_user_conf.py with some defaults is created for
1380 if they exist, and ipy_user_conf.py with some defaults is created for
1373 the user.
1381 the user.
1374
1382
1375 * Startup rehashing done by the config file, not InterpreterExec.
1383 * Startup rehashing done by the config file, not InterpreterExec.
1376 This means system commands are available even without selecting the
1384 This means system commands are available even without selecting the
1377 pysh profile. It's the sensible default after all.
1385 pysh profile. It's the sensible default after all.
1378
1386
1379 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
1387 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
1380
1388
1381 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
1389 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
1382 multiline code with autoindent on working. But I am really not
1390 multiline code with autoindent on working. But I am really not
1383 sure, so this needs more testing. Will commit a debug-enabled
1391 sure, so this needs more testing. Will commit a debug-enabled
1384 version for now, while I test it some more, so that Ville and
1392 version for now, while I test it some more, so that Ville and
1385 others may also catch any problems. Also made
1393 others may also catch any problems. Also made
1386 self.indent_current_str() a method, to ensure that there's no
1394 self.indent_current_str() a method, to ensure that there's no
1387 chance of the indent space count and the corresponding string
1395 chance of the indent space count and the corresponding string
1388 falling out of sync. All code needing the string should just call
1396 falling out of sync. All code needing the string should just call
1389 the method.
1397 the method.
1390
1398
1391 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
1399 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
1392
1400
1393 * IPython/Magic.py (magic_edit): fix check for when users don't
1401 * IPython/Magic.py (magic_edit): fix check for when users don't
1394 save their output files, the try/except was in the wrong section.
1402 save their output files, the try/except was in the wrong section.
1395
1403
1396 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1404 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1397
1405
1398 * IPython/Magic.py (magic_run): fix __file__ global missing from
1406 * IPython/Magic.py (magic_run): fix __file__ global missing from
1399 script's namespace when executed via %run. After a report by
1407 script's namespace when executed via %run. After a report by
1400 Vivian.
1408 Vivian.
1401
1409
1402 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
1410 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
1403 when using python 2.4. The parent constructor changed in 2.4, and
1411 when using python 2.4. The parent constructor changed in 2.4, and
1404 we need to track it directly (we can't call it, as it messes up
1412 we need to track it directly (we can't call it, as it messes up
1405 readline and tab-completion inside our pdb would stop working).
1413 readline and tab-completion inside our pdb would stop working).
1406 After a bug report by R. Bernstein <rocky-AT-panix.com>.
1414 After a bug report by R. Bernstein <rocky-AT-panix.com>.
1407
1415
1408 2006-01-16 Ville Vainio <vivainio@gmail.com>
1416 2006-01-16 Ville Vainio <vivainio@gmail.com>
1409
1417
1410 * Ipython/magic.py: Reverted back to old %edit functionality
1418 * Ipython/magic.py: Reverted back to old %edit functionality
1411 that returns file contents on exit.
1419 that returns file contents on exit.
1412
1420
1413 * IPython/path.py: Added Jason Orendorff's "path" module to
1421 * IPython/path.py: Added Jason Orendorff's "path" module to
1414 IPython tree, http://www.jorendorff.com/articles/python/path/.
1422 IPython tree, http://www.jorendorff.com/articles/python/path/.
1415 You can get path objects conveniently through %sc, and !!, e.g.:
1423 You can get path objects conveniently through %sc, and !!, e.g.:
1416 sc files=ls
1424 sc files=ls
1417 for p in files.paths: # or files.p
1425 for p in files.paths: # or files.p
1418 print p,p.mtime
1426 print p,p.mtime
1419
1427
1420 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
1428 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
1421 now work again without considering the exclusion regexp -
1429 now work again without considering the exclusion regexp -
1422 hence, things like ',foo my/path' turn to 'foo("my/path")'
1430 hence, things like ',foo my/path' turn to 'foo("my/path")'
1423 instead of syntax error.
1431 instead of syntax error.
1424
1432
1425
1433
1426 2006-01-14 Ville Vainio <vivainio@gmail.com>
1434 2006-01-14 Ville Vainio <vivainio@gmail.com>
1427
1435
1428 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
1436 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
1429 ipapi decorators for python 2.4 users, options() provides access to rc
1437 ipapi decorators for python 2.4 users, options() provides access to rc
1430 data.
1438 data.
1431
1439
1432 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
1440 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
1433 as path separators (even on Linux ;-). Space character after
1441 as path separators (even on Linux ;-). Space character after
1434 backslash (as yielded by tab completer) is still space;
1442 backslash (as yielded by tab completer) is still space;
1435 "%cd long\ name" works as expected.
1443 "%cd long\ name" works as expected.
1436
1444
1437 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
1445 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
1438 as "chain of command", with priority. API stays the same,
1446 as "chain of command", with priority. API stays the same,
1439 TryNext exception raised by a hook function signals that
1447 TryNext exception raised by a hook function signals that
1440 current hook failed and next hook should try handling it, as
1448 current hook failed and next hook should try handling it, as
1441 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
1449 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
1442 requested configurable display hook, which is now implemented.
1450 requested configurable display hook, which is now implemented.
1443
1451
1444 2006-01-13 Ville Vainio <vivainio@gmail.com>
1452 2006-01-13 Ville Vainio <vivainio@gmail.com>
1445
1453
1446 * IPython/platutils*.py: platform specific utility functions,
1454 * IPython/platutils*.py: platform specific utility functions,
1447 so far only set_term_title is implemented (change terminal
1455 so far only set_term_title is implemented (change terminal
1448 label in windowing systems). %cd now changes the title to
1456 label in windowing systems). %cd now changes the title to
1449 current dir.
1457 current dir.
1450
1458
1451 * IPython/Release.py: Added myself to "authors" list,
1459 * IPython/Release.py: Added myself to "authors" list,
1452 had to create new files.
1460 had to create new files.
1453
1461
1454 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
1462 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
1455 shell escape; not a known bug but had potential to be one in the
1463 shell escape; not a known bug but had potential to be one in the
1456 future.
1464 future.
1457
1465
1458 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
1466 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
1459 extension API for IPython! See the module for usage example. Fix
1467 extension API for IPython! See the module for usage example. Fix
1460 OInspect for docstring-less magic functions.
1468 OInspect for docstring-less magic functions.
1461
1469
1462
1470
1463 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
1471 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
1464
1472
1465 * IPython/iplib.py (raw_input): temporarily deactivate all
1473 * IPython/iplib.py (raw_input): temporarily deactivate all
1466 attempts at allowing pasting of code with autoindent on. It
1474 attempts at allowing pasting of code with autoindent on. It
1467 introduced bugs (reported by Prabhu) and I can't seem to find a
1475 introduced bugs (reported by Prabhu) and I can't seem to find a
1468 robust combination which works in all cases. Will have to revisit
1476 robust combination which works in all cases. Will have to revisit
1469 later.
1477 later.
1470
1478
1471 * IPython/genutils.py: remove isspace() function. We've dropped
1479 * IPython/genutils.py: remove isspace() function. We've dropped
1472 2.2 compatibility, so it's OK to use the string method.
1480 2.2 compatibility, so it's OK to use the string method.
1473
1481
1474 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1482 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1475
1483
1476 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
1484 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
1477 matching what NOT to autocall on, to include all python binary
1485 matching what NOT to autocall on, to include all python binary
1478 operators (including things like 'and', 'or', 'is' and 'in').
1486 operators (including things like 'and', 'or', 'is' and 'in').
1479 Prompted by a bug report on 'foo & bar', but I realized we had
1487 Prompted by a bug report on 'foo & bar', but I realized we had
1480 many more potential bug cases with other operators. The regexp is
1488 many more potential bug cases with other operators. The regexp is
1481 self.re_exclude_auto, it's fairly commented.
1489 self.re_exclude_auto, it's fairly commented.
1482
1490
1483 2006-01-12 Ville Vainio <vivainio@gmail.com>
1491 2006-01-12 Ville Vainio <vivainio@gmail.com>
1484
1492
1485 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
1493 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
1486 Prettified and hardened string/backslash quoting with ipsystem(),
1494 Prettified and hardened string/backslash quoting with ipsystem(),
1487 ipalias() and ipmagic(). Now even \ characters are passed to
1495 ipalias() and ipmagic(). Now even \ characters are passed to
1488 %magics, !shell escapes and aliases exactly as they are in the
1496 %magics, !shell escapes and aliases exactly as they are in the
1489 ipython command line. Should improve backslash experience,
1497 ipython command line. Should improve backslash experience,
1490 particularly in Windows (path delimiter for some commands that
1498 particularly in Windows (path delimiter for some commands that
1491 won't understand '/'), but Unix benefits as well (regexps). %cd
1499 won't understand '/'), but Unix benefits as well (regexps). %cd
1492 magic still doesn't support backslash path delimiters, though. Also
1500 magic still doesn't support backslash path delimiters, though. Also
1493 deleted all pretense of supporting multiline command strings in
1501 deleted all pretense of supporting multiline command strings in
1494 !system or %magic commands. Thanks to Jerry McRae for suggestions.
1502 !system or %magic commands. Thanks to Jerry McRae for suggestions.
1495
1503
1496 * doc/build_doc_instructions.txt added. Documentation on how to
1504 * doc/build_doc_instructions.txt added. Documentation on how to
1497 use doc/update_manual.py, added yesterday. Both files contributed
1505 use doc/update_manual.py, added yesterday. Both files contributed
1498 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
1506 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
1499 doc/*.sh for deprecation at a later date.
1507 doc/*.sh for deprecation at a later date.
1500
1508
1501 * /ipython.py Added ipython.py to root directory for
1509 * /ipython.py Added ipython.py to root directory for
1502 zero-installation (tar xzvf ipython.tgz; cd ipython; python
1510 zero-installation (tar xzvf ipython.tgz; cd ipython; python
1503 ipython.py) and development convenience (no need to keep doing
1511 ipython.py) and development convenience (no need to keep doing
1504 "setup.py install" between changes).
1512 "setup.py install" between changes).
1505
1513
1506 * Made ! and !! shell escapes work (again) in multiline expressions:
1514 * Made ! and !! shell escapes work (again) in multiline expressions:
1507 if 1:
1515 if 1:
1508 !ls
1516 !ls
1509 !!ls
1517 !!ls
1510
1518
1511 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1519 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1512
1520
1513 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
1521 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
1514 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
1522 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
1515 module in case-insensitive installation. Was causing crashes
1523 module in case-insensitive installation. Was causing crashes
1516 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
1524 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
1517
1525
1518 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
1526 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
1519 <marienz-AT-gentoo.org>, closes
1527 <marienz-AT-gentoo.org>, closes
1520 http://www.scipy.net/roundup/ipython/issue51.
1528 http://www.scipy.net/roundup/ipython/issue51.
1521
1529
1522 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
1530 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
1523
1531
1524 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
1532 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
1525 problem of excessive CPU usage under *nix and keyboard lag under
1533 problem of excessive CPU usage under *nix and keyboard lag under
1526 win32.
1534 win32.
1527
1535
1528 2006-01-10 *** Released version 0.7.0
1536 2006-01-10 *** Released version 0.7.0
1529
1537
1530 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
1538 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
1531
1539
1532 * IPython/Release.py (revision): tag version number to 0.7.0,
1540 * IPython/Release.py (revision): tag version number to 0.7.0,
1533 ready for release.
1541 ready for release.
1534
1542
1535 * IPython/Magic.py (magic_edit): Add print statement to %edit so
1543 * IPython/Magic.py (magic_edit): Add print statement to %edit so
1536 it informs the user of the name of the temp. file used. This can
1544 it informs the user of the name of the temp. file used. This can
1537 help if you decide later to reuse that same file, so you know
1545 help if you decide later to reuse that same file, so you know
1538 where to copy the info from.
1546 where to copy the info from.
1539
1547
1540 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
1548 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
1541
1549
1542 * setup_bdist_egg.py: little script to build an egg. Added
1550 * setup_bdist_egg.py: little script to build an egg. Added
1543 support in the release tools as well.
1551 support in the release tools as well.
1544
1552
1545 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
1553 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
1546
1554
1547 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
1555 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
1548 version selection (new -wxversion command line and ipythonrc
1556 version selection (new -wxversion command line and ipythonrc
1549 parameter). Patch contributed by Arnd Baecker
1557 parameter). Patch contributed by Arnd Baecker
1550 <arnd.baecker-AT-web.de>.
1558 <arnd.baecker-AT-web.de>.
1551
1559
1552 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1560 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1553 embedded instances, for variables defined at the interactive
1561 embedded instances, for variables defined at the interactive
1554 prompt of the embedded ipython. Reported by Arnd.
1562 prompt of the embedded ipython. Reported by Arnd.
1555
1563
1556 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
1564 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
1557 it can be used as a (stateful) toggle, or with a direct parameter.
1565 it can be used as a (stateful) toggle, or with a direct parameter.
1558
1566
1559 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
1567 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
1560 could be triggered in certain cases and cause the traceback
1568 could be triggered in certain cases and cause the traceback
1561 printer not to work.
1569 printer not to work.
1562
1570
1563 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
1571 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
1564
1572
1565 * IPython/iplib.py (_should_recompile): Small fix, closes
1573 * IPython/iplib.py (_should_recompile): Small fix, closes
1566 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
1574 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
1567
1575
1568 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
1576 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
1569
1577
1570 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
1578 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
1571 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
1579 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
1572 Moad for help with tracking it down.
1580 Moad for help with tracking it down.
1573
1581
1574 * IPython/iplib.py (handle_auto): fix autocall handling for
1582 * IPython/iplib.py (handle_auto): fix autocall handling for
1575 objects which support BOTH __getitem__ and __call__ (so that f [x]
1583 objects which support BOTH __getitem__ and __call__ (so that f [x]
1576 is left alone, instead of becoming f([x]) automatically).
1584 is left alone, instead of becoming f([x]) automatically).
1577
1585
1578 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
1586 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
1579 Ville's patch.
1587 Ville's patch.
1580
1588
1581 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
1589 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
1582
1590
1583 * IPython/iplib.py (handle_auto): changed autocall semantics to
1591 * IPython/iplib.py (handle_auto): changed autocall semantics to
1584 include 'smart' mode, where the autocall transformation is NOT
1592 include 'smart' mode, where the autocall transformation is NOT
1585 applied if there are no arguments on the line. This allows you to
1593 applied if there are no arguments on the line. This allows you to
1586 just type 'foo' if foo is a callable to see its internal form,
1594 just type 'foo' if foo is a callable to see its internal form,
1587 instead of having it called with no arguments (typically a
1595 instead of having it called with no arguments (typically a
1588 mistake). The old 'full' autocall still exists: for that, you
1596 mistake). The old 'full' autocall still exists: for that, you
1589 need to set the 'autocall' parameter to 2 in your ipythonrc file.
1597 need to set the 'autocall' parameter to 2 in your ipythonrc file.
1590
1598
1591 * IPython/completer.py (Completer.attr_matches): add
1599 * IPython/completer.py (Completer.attr_matches): add
1592 tab-completion support for Enthoughts' traits. After a report by
1600 tab-completion support for Enthoughts' traits. After a report by
1593 Arnd and a patch by Prabhu.
1601 Arnd and a patch by Prabhu.
1594
1602
1595 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
1603 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
1596
1604
1597 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
1605 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
1598 Schmolck's patch to fix inspect.getinnerframes().
1606 Schmolck's patch to fix inspect.getinnerframes().
1599
1607
1600 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
1608 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
1601 for embedded instances, regarding handling of namespaces and items
1609 for embedded instances, regarding handling of namespaces and items
1602 added to the __builtin__ one. Multiple embedded instances and
1610 added to the __builtin__ one. Multiple embedded instances and
1603 recursive embeddings should work better now (though I'm not sure
1611 recursive embeddings should work better now (though I'm not sure
1604 I've got all the corner cases fixed, that code is a bit of a brain
1612 I've got all the corner cases fixed, that code is a bit of a brain
1605 twister).
1613 twister).
1606
1614
1607 * IPython/Magic.py (magic_edit): added support to edit in-memory
1615 * IPython/Magic.py (magic_edit): added support to edit in-memory
1608 macros (automatically creates the necessary temp files). %edit
1616 macros (automatically creates the necessary temp files). %edit
1609 also doesn't return the file contents anymore, it's just noise.
1617 also doesn't return the file contents anymore, it's just noise.
1610
1618
1611 * IPython/completer.py (Completer.attr_matches): revert change to
1619 * IPython/completer.py (Completer.attr_matches): revert change to
1612 complete only on attributes listed in __all__. I realized it
1620 complete only on attributes listed in __all__. I realized it
1613 cripples the tab-completion system as a tool for exploring the
1621 cripples the tab-completion system as a tool for exploring the
1614 internals of unknown libraries (it renders any non-__all__
1622 internals of unknown libraries (it renders any non-__all__
1615 attribute off-limits). I got bit by this when trying to see
1623 attribute off-limits). I got bit by this when trying to see
1616 something inside the dis module.
1624 something inside the dis module.
1617
1625
1618 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
1626 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
1619
1627
1620 * IPython/iplib.py (InteractiveShell.__init__): add .meta
1628 * IPython/iplib.py (InteractiveShell.__init__): add .meta
1621 namespace for users and extension writers to hold data in. This
1629 namespace for users and extension writers to hold data in. This
1622 follows the discussion in
1630 follows the discussion in
1623 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
1631 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
1624
1632
1625 * IPython/completer.py (IPCompleter.complete): small patch to help
1633 * IPython/completer.py (IPCompleter.complete): small patch to help
1626 tab-completion under Emacs, after a suggestion by John Barnard
1634 tab-completion under Emacs, after a suggestion by John Barnard
1627 <barnarj-AT-ccf.org>.
1635 <barnarj-AT-ccf.org>.
1628
1636
1629 * IPython/Magic.py (Magic.extract_input_slices): added support for
1637 * IPython/Magic.py (Magic.extract_input_slices): added support for
1630 the slice notation in magics to use N-M to represent numbers N...M
1638 the slice notation in magics to use N-M to represent numbers N...M
1631 (closed endpoints). This is used by %macro and %save.
1639 (closed endpoints). This is used by %macro and %save.
1632
1640
1633 * IPython/completer.py (Completer.attr_matches): for modules which
1641 * IPython/completer.py (Completer.attr_matches): for modules which
1634 define __all__, complete only on those. After a patch by Jeffrey
1642 define __all__, complete only on those. After a patch by Jeffrey
1635 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
1643 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
1636 speed up this routine.
1644 speed up this routine.
1637
1645
1638 * IPython/Logger.py (Logger.log): fix a history handling bug. I
1646 * IPython/Logger.py (Logger.log): fix a history handling bug. I
1639 don't know if this is the end of it, but the behavior now is
1647 don't know if this is the end of it, but the behavior now is
1640 certainly much more correct. Note that coupled with macros,
1648 certainly much more correct. Note that coupled with macros,
1641 slightly surprising (at first) behavior may occur: a macro will in
1649 slightly surprising (at first) behavior may occur: a macro will in
1642 general expand to multiple lines of input, so upon exiting, the
1650 general expand to multiple lines of input, so upon exiting, the
1643 in/out counters will both be bumped by the corresponding amount
1651 in/out counters will both be bumped by the corresponding amount
1644 (as if the macro's contents had been typed interactively). Typing
1652 (as if the macro's contents had been typed interactively). Typing
1645 %hist will reveal the intermediate (silently processed) lines.
1653 %hist will reveal the intermediate (silently processed) lines.
1646
1654
1647 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
1655 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
1648 pickle to fail (%run was overwriting __main__ and not restoring
1656 pickle to fail (%run was overwriting __main__ and not restoring
1649 it, but pickle relies on __main__ to operate).
1657 it, but pickle relies on __main__ to operate).
1650
1658
1651 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
1659 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
1652 using properties, but forgot to make the main InteractiveShell
1660 using properties, but forgot to make the main InteractiveShell
1653 class a new-style class. Properties fail silently, and
1661 class a new-style class. Properties fail silently, and
1654 mysteriously, with old-style class (getters work, but
1662 mysteriously, with old-style class (getters work, but
1655 setters don't do anything).
1663 setters don't do anything).
1656
1664
1657 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
1665 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
1658
1666
1659 * IPython/Magic.py (magic_history): fix history reporting bug (I
1667 * IPython/Magic.py (magic_history): fix history reporting bug (I
1660 know some nasties are still there, I just can't seem to find a
1668 know some nasties are still there, I just can't seem to find a
1661 reproducible test case to track them down; the input history is
1669 reproducible test case to track them down; the input history is
1662 falling out of sync...)
1670 falling out of sync...)
1663
1671
1664 * IPython/iplib.py (handle_shell_escape): fix bug where both
1672 * IPython/iplib.py (handle_shell_escape): fix bug where both
1665 aliases and system accesses where broken for indented code (such
1673 aliases and system accesses where broken for indented code (such
1666 as loops).
1674 as loops).
1667
1675
1668 * IPython/genutils.py (shell): fix small but critical bug for
1676 * IPython/genutils.py (shell): fix small but critical bug for
1669 win32 system access.
1677 win32 system access.
1670
1678
1671 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
1679 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
1672
1680
1673 * IPython/iplib.py (showtraceback): remove use of the
1681 * IPython/iplib.py (showtraceback): remove use of the
1674 sys.last_{type/value/traceback} structures, which are non
1682 sys.last_{type/value/traceback} structures, which are non
1675 thread-safe.
1683 thread-safe.
1676 (_prefilter): change control flow to ensure that we NEVER
1684 (_prefilter): change control flow to ensure that we NEVER
1677 introspect objects when autocall is off. This will guarantee that
1685 introspect objects when autocall is off. This will guarantee that
1678 having an input line of the form 'x.y', where access to attribute
1686 having an input line of the form 'x.y', where access to attribute
1679 'y' has side effects, doesn't trigger the side effect TWICE. It
1687 'y' has side effects, doesn't trigger the side effect TWICE. It
1680 is important to note that, with autocall on, these side effects
1688 is important to note that, with autocall on, these side effects
1681 can still happen.
1689 can still happen.
1682 (ipsystem): new builtin, to complete the ip{magic/alias/system}
1690 (ipsystem): new builtin, to complete the ip{magic/alias/system}
1683 trio. IPython offers these three kinds of special calls which are
1691 trio. IPython offers these three kinds of special calls which are
1684 not python code, and it's a good thing to have their call method
1692 not python code, and it's a good thing to have their call method
1685 be accessible as pure python functions (not just special syntax at
1693 be accessible as pure python functions (not just special syntax at
1686 the command line). It gives us a better internal implementation
1694 the command line). It gives us a better internal implementation
1687 structure, as well as exposing these for user scripting more
1695 structure, as well as exposing these for user scripting more
1688 cleanly.
1696 cleanly.
1689
1697
1690 * IPython/macro.py (Macro.__init__): moved macros to a standalone
1698 * IPython/macro.py (Macro.__init__): moved macros to a standalone
1691 file. Now that they'll be more likely to be used with the
1699 file. Now that they'll be more likely to be used with the
1692 persistance system (%store), I want to make sure their module path
1700 persistance system (%store), I want to make sure their module path
1693 doesn't change in the future, so that we don't break things for
1701 doesn't change in the future, so that we don't break things for
1694 users' persisted data.
1702 users' persisted data.
1695
1703
1696 * IPython/iplib.py (autoindent_update): move indentation
1704 * IPython/iplib.py (autoindent_update): move indentation
1697 management into the _text_ processing loop, not the keyboard
1705 management into the _text_ processing loop, not the keyboard
1698 interactive one. This is necessary to correctly process non-typed
1706 interactive one. This is necessary to correctly process non-typed
1699 multiline input (such as macros).
1707 multiline input (such as macros).
1700
1708
1701 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
1709 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
1702 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
1710 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
1703 which was producing problems in the resulting manual.
1711 which was producing problems in the resulting manual.
1704 (magic_whos): improve reporting of instances (show their class,
1712 (magic_whos): improve reporting of instances (show their class,
1705 instead of simply printing 'instance' which isn't terribly
1713 instead of simply printing 'instance' which isn't terribly
1706 informative).
1714 informative).
1707
1715
1708 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
1716 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
1709 (minor mods) to support network shares under win32.
1717 (minor mods) to support network shares under win32.
1710
1718
1711 * IPython/winconsole.py (get_console_size): add new winconsole
1719 * IPython/winconsole.py (get_console_size): add new winconsole
1712 module and fixes to page_dumb() to improve its behavior under
1720 module and fixes to page_dumb() to improve its behavior under
1713 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
1721 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
1714
1722
1715 * IPython/Magic.py (Macro): simplified Macro class to just
1723 * IPython/Magic.py (Macro): simplified Macro class to just
1716 subclass list. We've had only 2.2 compatibility for a very long
1724 subclass list. We've had only 2.2 compatibility for a very long
1717 time, yet I was still avoiding subclassing the builtin types. No
1725 time, yet I was still avoiding subclassing the builtin types. No
1718 more (I'm also starting to use properties, though I won't shift to
1726 more (I'm also starting to use properties, though I won't shift to
1719 2.3-specific features quite yet).
1727 2.3-specific features quite yet).
1720 (magic_store): added Ville's patch for lightweight variable
1728 (magic_store): added Ville's patch for lightweight variable
1721 persistence, after a request on the user list by Matt Wilkie
1729 persistence, after a request on the user list by Matt Wilkie
1722 <maphew-AT-gmail.com>. The new %store magic's docstring has full
1730 <maphew-AT-gmail.com>. The new %store magic's docstring has full
1723 details.
1731 details.
1724
1732
1725 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1733 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1726 changed the default logfile name from 'ipython.log' to
1734 changed the default logfile name from 'ipython.log' to
1727 'ipython_log.py'. These logs are real python files, and now that
1735 'ipython_log.py'. These logs are real python files, and now that
1728 we have much better multiline support, people are more likely to
1736 we have much better multiline support, people are more likely to
1729 want to use them as such. Might as well name them correctly.
1737 want to use them as such. Might as well name them correctly.
1730
1738
1731 * IPython/Magic.py: substantial cleanup. While we can't stop
1739 * IPython/Magic.py: substantial cleanup. While we can't stop
1732 using magics as mixins, due to the existing customizations 'out
1740 using magics as mixins, due to the existing customizations 'out
1733 there' which rely on the mixin naming conventions, at least I
1741 there' which rely on the mixin naming conventions, at least I
1734 cleaned out all cross-class name usage. So once we are OK with
1742 cleaned out all cross-class name usage. So once we are OK with
1735 breaking compatibility, the two systems can be separated.
1743 breaking compatibility, the two systems can be separated.
1736
1744
1737 * IPython/Logger.py: major cleanup. This one is NOT a mixin
1745 * IPython/Logger.py: major cleanup. This one is NOT a mixin
1738 anymore, and the class is a fair bit less hideous as well. New
1746 anymore, and the class is a fair bit less hideous as well. New
1739 features were also introduced: timestamping of input, and logging
1747 features were also introduced: timestamping of input, and logging
1740 of output results. These are user-visible with the -t and -o
1748 of output results. These are user-visible with the -t and -o
1741 options to %logstart. Closes
1749 options to %logstart. Closes
1742 http://www.scipy.net/roundup/ipython/issue11 and a request by
1750 http://www.scipy.net/roundup/ipython/issue11 and a request by
1743 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
1751 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
1744
1752
1745 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
1753 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
1746
1754
1747 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
1755 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
1748 better handle backslashes in paths. See the thread 'More Windows
1756 better handle backslashes in paths. See the thread 'More Windows
1749 questions part 2 - \/ characters revisited' on the iypthon user
1757 questions part 2 - \/ characters revisited' on the iypthon user
1750 list:
1758 list:
1751 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
1759 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
1752
1760
1753 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
1761 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
1754
1762
1755 (InteractiveShell.__init__): change threaded shells to not use the
1763 (InteractiveShell.__init__): change threaded shells to not use the
1756 ipython crash handler. This was causing more problems than not,
1764 ipython crash handler. This was causing more problems than not,
1757 as exceptions in the main thread (GUI code, typically) would
1765 as exceptions in the main thread (GUI code, typically) would
1758 always show up as a 'crash', when they really weren't.
1766 always show up as a 'crash', when they really weren't.
1759
1767
1760 The colors and exception mode commands (%colors/%xmode) have been
1768 The colors and exception mode commands (%colors/%xmode) have been
1761 synchronized to also take this into account, so users can get
1769 synchronized to also take this into account, so users can get
1762 verbose exceptions for their threaded code as well. I also added
1770 verbose exceptions for their threaded code as well. I also added
1763 support for activating pdb inside this exception handler as well,
1771 support for activating pdb inside this exception handler as well,
1764 so now GUI authors can use IPython's enhanced pdb at runtime.
1772 so now GUI authors can use IPython's enhanced pdb at runtime.
1765
1773
1766 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
1774 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
1767 true by default, and add it to the shipped ipythonrc file. Since
1775 true by default, and add it to the shipped ipythonrc file. Since
1768 this asks the user before proceeding, I think it's OK to make it
1776 this asks the user before proceeding, I think it's OK to make it
1769 true by default.
1777 true by default.
1770
1778
1771 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
1779 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
1772 of the previous special-casing of input in the eval loop. I think
1780 of the previous special-casing of input in the eval loop. I think
1773 this is cleaner, as they really are commands and shouldn't have
1781 this is cleaner, as they really are commands and shouldn't have
1774 a special role in the middle of the core code.
1782 a special role in the middle of the core code.
1775
1783
1776 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
1784 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
1777
1785
1778 * IPython/iplib.py (edit_syntax_error): added support for
1786 * IPython/iplib.py (edit_syntax_error): added support for
1779 automatically reopening the editor if the file had a syntax error
1787 automatically reopening the editor if the file had a syntax error
1780 in it. Thanks to scottt who provided the patch at:
1788 in it. Thanks to scottt who provided the patch at:
1781 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
1789 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
1782 version committed).
1790 version committed).
1783
1791
1784 * IPython/iplib.py (handle_normal): add suport for multi-line
1792 * IPython/iplib.py (handle_normal): add suport for multi-line
1785 input with emtpy lines. This fixes
1793 input with emtpy lines. This fixes
1786 http://www.scipy.net/roundup/ipython/issue43 and a similar
1794 http://www.scipy.net/roundup/ipython/issue43 and a similar
1787 discussion on the user list.
1795 discussion on the user list.
1788
1796
1789 WARNING: a behavior change is necessarily introduced to support
1797 WARNING: a behavior change is necessarily introduced to support
1790 blank lines: now a single blank line with whitespace does NOT
1798 blank lines: now a single blank line with whitespace does NOT
1791 break the input loop, which means that when autoindent is on, by
1799 break the input loop, which means that when autoindent is on, by
1792 default hitting return on the next (indented) line does NOT exit.
1800 default hitting return on the next (indented) line does NOT exit.
1793
1801
1794 Instead, to exit a multiline input you can either have:
1802 Instead, to exit a multiline input you can either have:
1795
1803
1796 - TWO whitespace lines (just hit return again), or
1804 - TWO whitespace lines (just hit return again), or
1797 - a single whitespace line of a different length than provided
1805 - a single whitespace line of a different length than provided
1798 by the autoindent (add or remove a space).
1806 by the autoindent (add or remove a space).
1799
1807
1800 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
1808 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
1801 module to better organize all readline-related functionality.
1809 module to better organize all readline-related functionality.
1802 I've deleted FlexCompleter and put all completion clases here.
1810 I've deleted FlexCompleter and put all completion clases here.
1803
1811
1804 * IPython/iplib.py (raw_input): improve indentation management.
1812 * IPython/iplib.py (raw_input): improve indentation management.
1805 It is now possible to paste indented code with autoindent on, and
1813 It is now possible to paste indented code with autoindent on, and
1806 the code is interpreted correctly (though it still looks bad on
1814 the code is interpreted correctly (though it still looks bad on
1807 screen, due to the line-oriented nature of ipython).
1815 screen, due to the line-oriented nature of ipython).
1808 (MagicCompleter.complete): change behavior so that a TAB key on an
1816 (MagicCompleter.complete): change behavior so that a TAB key on an
1809 otherwise empty line actually inserts a tab, instead of completing
1817 otherwise empty line actually inserts a tab, instead of completing
1810 on the entire global namespace. This makes it easier to use the
1818 on the entire global namespace. This makes it easier to use the
1811 TAB key for indentation. After a request by Hans Meine
1819 TAB key for indentation. After a request by Hans Meine
1812 <hans_meine-AT-gmx.net>
1820 <hans_meine-AT-gmx.net>
1813 (_prefilter): add support so that typing plain 'exit' or 'quit'
1821 (_prefilter): add support so that typing plain 'exit' or 'quit'
1814 does a sensible thing. Originally I tried to deviate as little as
1822 does a sensible thing. Originally I tried to deviate as little as
1815 possible from the default python behavior, but even that one may
1823 possible from the default python behavior, but even that one may
1816 change in this direction (thread on python-dev to that effect).
1824 change in this direction (thread on python-dev to that effect).
1817 Regardless, ipython should do the right thing even if CPython's
1825 Regardless, ipython should do the right thing even if CPython's
1818 '>>>' prompt doesn't.
1826 '>>>' prompt doesn't.
1819 (InteractiveShell): removed subclassing code.InteractiveConsole
1827 (InteractiveShell): removed subclassing code.InteractiveConsole
1820 class. By now we'd overridden just about all of its methods: I've
1828 class. By now we'd overridden just about all of its methods: I've
1821 copied the remaining two over, and now ipython is a standalone
1829 copied the remaining two over, and now ipython is a standalone
1822 class. This will provide a clearer picture for the chainsaw
1830 class. This will provide a clearer picture for the chainsaw
1823 branch refactoring.
1831 branch refactoring.
1824
1832
1825 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
1833 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
1826
1834
1827 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
1835 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
1828 failures for objects which break when dir() is called on them.
1836 failures for objects which break when dir() is called on them.
1829
1837
1830 * IPython/FlexCompleter.py (Completer.__init__): Added support for
1838 * IPython/FlexCompleter.py (Completer.__init__): Added support for
1831 distinct local and global namespaces in the completer API. This
1839 distinct local and global namespaces in the completer API. This
1832 change allows us to properly handle completion with distinct
1840 change allows us to properly handle completion with distinct
1833 scopes, including in embedded instances (this had never really
1841 scopes, including in embedded instances (this had never really
1834 worked correctly).
1842 worked correctly).
1835
1843
1836 Note: this introduces a change in the constructor for
1844 Note: this introduces a change in the constructor for
1837 MagicCompleter, as a new global_namespace parameter is now the
1845 MagicCompleter, as a new global_namespace parameter is now the
1838 second argument (the others were bumped one position).
1846 second argument (the others were bumped one position).
1839
1847
1840 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
1848 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
1841
1849
1842 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1850 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1843 embedded instances (which can be done now thanks to Vivian's
1851 embedded instances (which can be done now thanks to Vivian's
1844 frame-handling fixes for pdb).
1852 frame-handling fixes for pdb).
1845 (InteractiveShell.__init__): Fix namespace handling problem in
1853 (InteractiveShell.__init__): Fix namespace handling problem in
1846 embedded instances. We were overwriting __main__ unconditionally,
1854 embedded instances. We were overwriting __main__ unconditionally,
1847 and this should only be done for 'full' (non-embedded) IPython;
1855 and this should only be done for 'full' (non-embedded) IPython;
1848 embedded instances must respect the caller's __main__. Thanks to
1856 embedded instances must respect the caller's __main__. Thanks to
1849 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
1857 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
1850
1858
1851 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
1859 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
1852
1860
1853 * setup.py: added download_url to setup(). This registers the
1861 * setup.py: added download_url to setup(). This registers the
1854 download address at PyPI, which is not only useful to humans
1862 download address at PyPI, which is not only useful to humans
1855 browsing the site, but is also picked up by setuptools (the Eggs
1863 browsing the site, but is also picked up by setuptools (the Eggs
1856 machinery). Thanks to Ville and R. Kern for the info/discussion
1864 machinery). Thanks to Ville and R. Kern for the info/discussion
1857 on this.
1865 on this.
1858
1866
1859 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
1867 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
1860
1868
1861 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
1869 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
1862 This brings a lot of nice functionality to the pdb mode, which now
1870 This brings a lot of nice functionality to the pdb mode, which now
1863 has tab-completion, syntax highlighting, and better stack handling
1871 has tab-completion, syntax highlighting, and better stack handling
1864 than before. Many thanks to Vivian De Smedt
1872 than before. Many thanks to Vivian De Smedt
1865 <vivian-AT-vdesmedt.com> for the original patches.
1873 <vivian-AT-vdesmedt.com> for the original patches.
1866
1874
1867 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
1875 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
1868
1876
1869 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
1877 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
1870 sequence to consistently accept the banner argument. The
1878 sequence to consistently accept the banner argument. The
1871 inconsistency was tripping SAGE, thanks to Gary Zablackis
1879 inconsistency was tripping SAGE, thanks to Gary Zablackis
1872 <gzabl-AT-yahoo.com> for the report.
1880 <gzabl-AT-yahoo.com> for the report.
1873
1881
1874 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1882 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1875
1883
1876 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1884 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1877 Fix bug where a naked 'alias' call in the ipythonrc file would
1885 Fix bug where a naked 'alias' call in the ipythonrc file would
1878 cause a crash. Bug reported by Jorgen Stenarson.
1886 cause a crash. Bug reported by Jorgen Stenarson.
1879
1887
1880 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1888 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1881
1889
1882 * IPython/ipmaker.py (make_IPython): cleanups which should improve
1890 * IPython/ipmaker.py (make_IPython): cleanups which should improve
1883 startup time.
1891 startup time.
1884
1892
1885 * IPython/iplib.py (runcode): my globals 'fix' for embedded
1893 * IPython/iplib.py (runcode): my globals 'fix' for embedded
1886 instances had introduced a bug with globals in normal code. Now
1894 instances had introduced a bug with globals in normal code. Now
1887 it's working in all cases.
1895 it's working in all cases.
1888
1896
1889 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
1897 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
1890 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
1898 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
1891 has been introduced to set the default case sensitivity of the
1899 has been introduced to set the default case sensitivity of the
1892 searches. Users can still select either mode at runtime on a
1900 searches. Users can still select either mode at runtime on a
1893 per-search basis.
1901 per-search basis.
1894
1902
1895 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
1903 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
1896
1904
1897 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
1905 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
1898 attributes in wildcard searches for subclasses. Modified version
1906 attributes in wildcard searches for subclasses. Modified version
1899 of a patch by Jorgen.
1907 of a patch by Jorgen.
1900
1908
1901 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
1909 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
1902
1910
1903 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
1911 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
1904 embedded instances. I added a user_global_ns attribute to the
1912 embedded instances. I added a user_global_ns attribute to the
1905 InteractiveShell class to handle this.
1913 InteractiveShell class to handle this.
1906
1914
1907 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
1915 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
1908
1916
1909 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
1917 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
1910 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
1918 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
1911 (reported under win32, but may happen also in other platforms).
1919 (reported under win32, but may happen also in other platforms).
1912 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
1920 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
1913
1921
1914 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1922 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1915
1923
1916 * IPython/Magic.py (magic_psearch): new support for wildcard
1924 * IPython/Magic.py (magic_psearch): new support for wildcard
1917 patterns. Now, typing ?a*b will list all names which begin with a
1925 patterns. Now, typing ?a*b will list all names which begin with a
1918 and end in b, for example. The %psearch magic has full
1926 and end in b, for example. The %psearch magic has full
1919 docstrings. Many thanks to JΓΆrgen Stenarson
1927 docstrings. Many thanks to JΓΆrgen Stenarson
1920 <jorgen.stenarson-AT-bostream.nu>, author of the patches
1928 <jorgen.stenarson-AT-bostream.nu>, author of the patches
1921 implementing this functionality.
1929 implementing this functionality.
1922
1930
1923 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1931 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1924
1932
1925 * Manual: fixed long-standing annoyance of double-dashes (as in
1933 * Manual: fixed long-standing annoyance of double-dashes (as in
1926 --prefix=~, for example) being stripped in the HTML version. This
1934 --prefix=~, for example) being stripped in the HTML version. This
1927 is a latex2html bug, but a workaround was provided. Many thanks
1935 is a latex2html bug, but a workaround was provided. Many thanks
1928 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
1936 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
1929 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
1937 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
1930 rolling. This seemingly small issue had tripped a number of users
1938 rolling. This seemingly small issue had tripped a number of users
1931 when first installing, so I'm glad to see it gone.
1939 when first installing, so I'm glad to see it gone.
1932
1940
1933 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1941 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1934
1942
1935 * IPython/Extensions/numeric_formats.py: fix missing import,
1943 * IPython/Extensions/numeric_formats.py: fix missing import,
1936 reported by Stephen Walton.
1944 reported by Stephen Walton.
1937
1945
1938 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
1946 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
1939
1947
1940 * IPython/demo.py: finish demo module, fully documented now.
1948 * IPython/demo.py: finish demo module, fully documented now.
1941
1949
1942 * IPython/genutils.py (file_read): simple little utility to read a
1950 * IPython/genutils.py (file_read): simple little utility to read a
1943 file and ensure it's closed afterwards.
1951 file and ensure it's closed afterwards.
1944
1952
1945 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
1953 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
1946
1954
1947 * IPython/demo.py (Demo.__init__): added support for individually
1955 * IPython/demo.py (Demo.__init__): added support for individually
1948 tagging blocks for automatic execution.
1956 tagging blocks for automatic execution.
1949
1957
1950 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
1958 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
1951 syntax-highlighted python sources, requested by John.
1959 syntax-highlighted python sources, requested by John.
1952
1960
1953 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
1961 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
1954
1962
1955 * IPython/demo.py (Demo.again): fix bug where again() blocks after
1963 * IPython/demo.py (Demo.again): fix bug where again() blocks after
1956 finishing.
1964 finishing.
1957
1965
1958 * IPython/genutils.py (shlex_split): moved from Magic to here,
1966 * IPython/genutils.py (shlex_split): moved from Magic to here,
1959 where all 2.2 compatibility stuff lives. I needed it for demo.py.
1967 where all 2.2 compatibility stuff lives. I needed it for demo.py.
1960
1968
1961 * IPython/demo.py (Demo.__init__): added support for silent
1969 * IPython/demo.py (Demo.__init__): added support for silent
1962 blocks, improved marks as regexps, docstrings written.
1970 blocks, improved marks as regexps, docstrings written.
1963 (Demo.__init__): better docstring, added support for sys.argv.
1971 (Demo.__init__): better docstring, added support for sys.argv.
1964
1972
1965 * IPython/genutils.py (marquee): little utility used by the demo
1973 * IPython/genutils.py (marquee): little utility used by the demo
1966 code, handy in general.
1974 code, handy in general.
1967
1975
1968 * IPython/demo.py (Demo.__init__): new class for interactive
1976 * IPython/demo.py (Demo.__init__): new class for interactive
1969 demos. Not documented yet, I just wrote it in a hurry for
1977 demos. Not documented yet, I just wrote it in a hurry for
1970 scipy'05. Will docstring later.
1978 scipy'05. Will docstring later.
1971
1979
1972 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
1980 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
1973
1981
1974 * IPython/Shell.py (sigint_handler): Drastic simplification which
1982 * IPython/Shell.py (sigint_handler): Drastic simplification which
1975 also seems to make Ctrl-C work correctly across threads! This is
1983 also seems to make Ctrl-C work correctly across threads! This is
1976 so simple, that I can't beleive I'd missed it before. Needs more
1984 so simple, that I can't beleive I'd missed it before. Needs more
1977 testing, though.
1985 testing, though.
1978 (KBINT): Never mind, revert changes. I'm sure I'd tried something
1986 (KBINT): Never mind, revert changes. I'm sure I'd tried something
1979 like this before...
1987 like this before...
1980
1988
1981 * IPython/genutils.py (get_home_dir): add protection against
1989 * IPython/genutils.py (get_home_dir): add protection against
1982 non-dirs in win32 registry.
1990 non-dirs in win32 registry.
1983
1991
1984 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
1992 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
1985 bug where dict was mutated while iterating (pysh crash).
1993 bug where dict was mutated while iterating (pysh crash).
1986
1994
1987 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
1995 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
1988
1996
1989 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
1997 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
1990 spurious newlines added by this routine. After a report by
1998 spurious newlines added by this routine. After a report by
1991 F. Mantegazza.
1999 F. Mantegazza.
1992
2000
1993 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2001 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
1994
2002
1995 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2003 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
1996 calls. These were a leftover from the GTK 1.x days, and can cause
2004 calls. These were a leftover from the GTK 1.x days, and can cause
1997 problems in certain cases (after a report by John Hunter).
2005 problems in certain cases (after a report by John Hunter).
1998
2006
1999 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2007 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2000 os.getcwd() fails at init time. Thanks to patch from David Remahl
2008 os.getcwd() fails at init time. Thanks to patch from David Remahl
2001 <chmod007-AT-mac.com>.
2009 <chmod007-AT-mac.com>.
2002 (InteractiveShell.__init__): prevent certain special magics from
2010 (InteractiveShell.__init__): prevent certain special magics from
2003 being shadowed by aliases. Closes
2011 being shadowed by aliases. Closes
2004 http://www.scipy.net/roundup/ipython/issue41.
2012 http://www.scipy.net/roundup/ipython/issue41.
2005
2013
2006 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2014 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2007
2015
2008 * IPython/iplib.py (InteractiveShell.complete): Added new
2016 * IPython/iplib.py (InteractiveShell.complete): Added new
2009 top-level completion method to expose the completion mechanism
2017 top-level completion method to expose the completion mechanism
2010 beyond readline-based environments.
2018 beyond readline-based environments.
2011
2019
2012 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2020 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2013
2021
2014 * tools/ipsvnc (svnversion): fix svnversion capture.
2022 * tools/ipsvnc (svnversion): fix svnversion capture.
2015
2023
2016 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2024 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2017 attribute to self, which was missing. Before, it was set by a
2025 attribute to self, which was missing. Before, it was set by a
2018 routine which in certain cases wasn't being called, so the
2026 routine which in certain cases wasn't being called, so the
2019 instance could end up missing the attribute. This caused a crash.
2027 instance could end up missing the attribute. This caused a crash.
2020 Closes http://www.scipy.net/roundup/ipython/issue40.
2028 Closes http://www.scipy.net/roundup/ipython/issue40.
2021
2029
2022 2005-08-16 Fernando Perez <fperez@colorado.edu>
2030 2005-08-16 Fernando Perez <fperez@colorado.edu>
2023
2031
2024 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2032 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2025 contains non-string attribute. Closes
2033 contains non-string attribute. Closes
2026 http://www.scipy.net/roundup/ipython/issue38.
2034 http://www.scipy.net/roundup/ipython/issue38.
2027
2035
2028 2005-08-14 Fernando Perez <fperez@colorado.edu>
2036 2005-08-14 Fernando Perez <fperez@colorado.edu>
2029
2037
2030 * tools/ipsvnc: Minor improvements, to add changeset info.
2038 * tools/ipsvnc: Minor improvements, to add changeset info.
2031
2039
2032 2005-08-12 Fernando Perez <fperez@colorado.edu>
2040 2005-08-12 Fernando Perez <fperez@colorado.edu>
2033
2041
2034 * IPython/iplib.py (runsource): remove self.code_to_run_src
2042 * IPython/iplib.py (runsource): remove self.code_to_run_src
2035 attribute. I realized this is nothing more than
2043 attribute. I realized this is nothing more than
2036 '\n'.join(self.buffer), and having the same data in two different
2044 '\n'.join(self.buffer), and having the same data in two different
2037 places is just asking for synchronization bugs. This may impact
2045 places is just asking for synchronization bugs. This may impact
2038 people who have custom exception handlers, so I need to warn
2046 people who have custom exception handlers, so I need to warn
2039 ipython-dev about it (F. Mantegazza may use them).
2047 ipython-dev about it (F. Mantegazza may use them).
2040
2048
2041 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2049 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2042
2050
2043 * IPython/genutils.py: fix 2.2 compatibility (generators)
2051 * IPython/genutils.py: fix 2.2 compatibility (generators)
2044
2052
2045 2005-07-18 Fernando Perez <fperez@colorado.edu>
2053 2005-07-18 Fernando Perez <fperez@colorado.edu>
2046
2054
2047 * IPython/genutils.py (get_home_dir): fix to help users with
2055 * IPython/genutils.py (get_home_dir): fix to help users with
2048 invalid $HOME under win32.
2056 invalid $HOME under win32.
2049
2057
2050 2005-07-17 Fernando Perez <fperez@colorado.edu>
2058 2005-07-17 Fernando Perez <fperez@colorado.edu>
2051
2059
2052 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2060 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2053 some old hacks and clean up a bit other routines; code should be
2061 some old hacks and clean up a bit other routines; code should be
2054 simpler and a bit faster.
2062 simpler and a bit faster.
2055
2063
2056 * IPython/iplib.py (interact): removed some last-resort attempts
2064 * IPython/iplib.py (interact): removed some last-resort attempts
2057 to survive broken stdout/stderr. That code was only making it
2065 to survive broken stdout/stderr. That code was only making it
2058 harder to abstract out the i/o (necessary for gui integration),
2066 harder to abstract out the i/o (necessary for gui integration),
2059 and the crashes it could prevent were extremely rare in practice
2067 and the crashes it could prevent were extremely rare in practice
2060 (besides being fully user-induced in a pretty violent manner).
2068 (besides being fully user-induced in a pretty violent manner).
2061
2069
2062 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2070 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2063 Nothing major yet, but the code is simpler to read; this should
2071 Nothing major yet, but the code is simpler to read; this should
2064 make it easier to do more serious modifications in the future.
2072 make it easier to do more serious modifications in the future.
2065
2073
2066 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2074 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2067 which broke in .15 (thanks to a report by Ville).
2075 which broke in .15 (thanks to a report by Ville).
2068
2076
2069 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2077 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2070 be quite correct, I know next to nothing about unicode). This
2078 be quite correct, I know next to nothing about unicode). This
2071 will allow unicode strings to be used in prompts, amongst other
2079 will allow unicode strings to be used in prompts, amongst other
2072 cases. It also will prevent ipython from crashing when unicode
2080 cases. It also will prevent ipython from crashing when unicode
2073 shows up unexpectedly in many places. If ascii encoding fails, we
2081 shows up unexpectedly in many places. If ascii encoding fails, we
2074 assume utf_8. Currently the encoding is not a user-visible
2082 assume utf_8. Currently the encoding is not a user-visible
2075 setting, though it could be made so if there is demand for it.
2083 setting, though it could be made so if there is demand for it.
2076
2084
2077 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2085 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2078
2086
2079 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2087 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2080
2088
2081 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2089 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2082
2090
2083 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2091 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2084 code can work transparently for 2.2/2.3.
2092 code can work transparently for 2.2/2.3.
2085
2093
2086 2005-07-16 Fernando Perez <fperez@colorado.edu>
2094 2005-07-16 Fernando Perez <fperez@colorado.edu>
2087
2095
2088 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2096 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2089 out of the color scheme table used for coloring exception
2097 out of the color scheme table used for coloring exception
2090 tracebacks. This allows user code to add new schemes at runtime.
2098 tracebacks. This allows user code to add new schemes at runtime.
2091 This is a minimally modified version of the patch at
2099 This is a minimally modified version of the patch at
2092 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2100 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2093 for the contribution.
2101 for the contribution.
2094
2102
2095 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2103 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2096 slightly modified version of the patch in
2104 slightly modified version of the patch in
2097 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2105 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2098 to remove the previous try/except solution (which was costlier).
2106 to remove the previous try/except solution (which was costlier).
2099 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2107 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2100
2108
2101 2005-06-08 Fernando Perez <fperez@colorado.edu>
2109 2005-06-08 Fernando Perez <fperez@colorado.edu>
2102
2110
2103 * IPython/iplib.py (write/write_err): Add methods to abstract all
2111 * IPython/iplib.py (write/write_err): Add methods to abstract all
2104 I/O a bit more.
2112 I/O a bit more.
2105
2113
2106 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2114 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2107 warning, reported by Aric Hagberg, fix by JD Hunter.
2115 warning, reported by Aric Hagberg, fix by JD Hunter.
2108
2116
2109 2005-06-02 *** Released version 0.6.15
2117 2005-06-02 *** Released version 0.6.15
2110
2118
2111 2005-06-01 Fernando Perez <fperez@colorado.edu>
2119 2005-06-01 Fernando Perez <fperez@colorado.edu>
2112
2120
2113 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2121 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2114 tab-completion of filenames within open-quoted strings. Note that
2122 tab-completion of filenames within open-quoted strings. Note that
2115 this requires that in ~/.ipython/ipythonrc, users change the
2123 this requires that in ~/.ipython/ipythonrc, users change the
2116 readline delimiters configuration to read:
2124 readline delimiters configuration to read:
2117
2125
2118 readline_remove_delims -/~
2126 readline_remove_delims -/~
2119
2127
2120
2128
2121 2005-05-31 *** Released version 0.6.14
2129 2005-05-31 *** Released version 0.6.14
2122
2130
2123 2005-05-29 Fernando Perez <fperez@colorado.edu>
2131 2005-05-29 Fernando Perez <fperez@colorado.edu>
2124
2132
2125 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2133 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2126 with files not on the filesystem. Reported by Eliyahu Sandler
2134 with files not on the filesystem. Reported by Eliyahu Sandler
2127 <eli@gondolin.net>
2135 <eli@gondolin.net>
2128
2136
2129 2005-05-22 Fernando Perez <fperez@colorado.edu>
2137 2005-05-22 Fernando Perez <fperez@colorado.edu>
2130
2138
2131 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2139 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2132 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2140 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2133
2141
2134 2005-05-19 Fernando Perez <fperez@colorado.edu>
2142 2005-05-19 Fernando Perez <fperez@colorado.edu>
2135
2143
2136 * IPython/iplib.py (safe_execfile): close a file which could be
2144 * IPython/iplib.py (safe_execfile): close a file which could be
2137 left open (causing problems in win32, which locks open files).
2145 left open (causing problems in win32, which locks open files).
2138 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2146 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2139
2147
2140 2005-05-18 Fernando Perez <fperez@colorado.edu>
2148 2005-05-18 Fernando Perez <fperez@colorado.edu>
2141
2149
2142 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2150 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2143 keyword arguments correctly to safe_execfile().
2151 keyword arguments correctly to safe_execfile().
2144
2152
2145 2005-05-13 Fernando Perez <fperez@colorado.edu>
2153 2005-05-13 Fernando Perez <fperez@colorado.edu>
2146
2154
2147 * ipython.1: Added info about Qt to manpage, and threads warning
2155 * ipython.1: Added info about Qt to manpage, and threads warning
2148 to usage page (invoked with --help).
2156 to usage page (invoked with --help).
2149
2157
2150 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2158 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2151 new matcher (it goes at the end of the priority list) to do
2159 new matcher (it goes at the end of the priority list) to do
2152 tab-completion on named function arguments. Submitted by George
2160 tab-completion on named function arguments. Submitted by George
2153 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2161 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2154 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2162 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2155 for more details.
2163 for more details.
2156
2164
2157 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2165 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2158 SystemExit exceptions in the script being run. Thanks to a report
2166 SystemExit exceptions in the script being run. Thanks to a report
2159 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2167 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2160 producing very annoying behavior when running unit tests.
2168 producing very annoying behavior when running unit tests.
2161
2169
2162 2005-05-12 Fernando Perez <fperez@colorado.edu>
2170 2005-05-12 Fernando Perez <fperez@colorado.edu>
2163
2171
2164 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2172 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2165 which I'd broken (again) due to a changed regexp. In the process,
2173 which I'd broken (again) due to a changed regexp. In the process,
2166 added ';' as an escape to auto-quote the whole line without
2174 added ';' as an escape to auto-quote the whole line without
2167 splitting its arguments. Thanks to a report by Jerry McRae
2175 splitting its arguments. Thanks to a report by Jerry McRae
2168 <qrs0xyc02-AT-sneakemail.com>.
2176 <qrs0xyc02-AT-sneakemail.com>.
2169
2177
2170 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2178 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2171 possible crashes caused by a TokenError. Reported by Ed Schofield
2179 possible crashes caused by a TokenError. Reported by Ed Schofield
2172 <schofield-AT-ftw.at>.
2180 <schofield-AT-ftw.at>.
2173
2181
2174 2005-05-06 Fernando Perez <fperez@colorado.edu>
2182 2005-05-06 Fernando Perez <fperez@colorado.edu>
2175
2183
2176 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2184 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2177
2185
2178 2005-04-29 Fernando Perez <fperez@colorado.edu>
2186 2005-04-29 Fernando Perez <fperez@colorado.edu>
2179
2187
2180 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2188 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2181 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2189 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2182 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2190 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2183 which provides support for Qt interactive usage (similar to the
2191 which provides support for Qt interactive usage (similar to the
2184 existing one for WX and GTK). This had been often requested.
2192 existing one for WX and GTK). This had been often requested.
2185
2193
2186 2005-04-14 *** Released version 0.6.13
2194 2005-04-14 *** Released version 0.6.13
2187
2195
2188 2005-04-08 Fernando Perez <fperez@colorado.edu>
2196 2005-04-08 Fernando Perez <fperez@colorado.edu>
2189
2197
2190 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2198 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2191 from _ofind, which gets called on almost every input line. Now,
2199 from _ofind, which gets called on almost every input line. Now,
2192 we only try to get docstrings if they are actually going to be
2200 we only try to get docstrings if they are actually going to be
2193 used (the overhead of fetching unnecessary docstrings can be
2201 used (the overhead of fetching unnecessary docstrings can be
2194 noticeable for certain objects, such as Pyro proxies).
2202 noticeable for certain objects, such as Pyro proxies).
2195
2203
2196 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2204 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2197 for completers. For some reason I had been passing them the state
2205 for completers. For some reason I had been passing them the state
2198 variable, which completers never actually need, and was in
2206 variable, which completers never actually need, and was in
2199 conflict with the rlcompleter API. Custom completers ONLY need to
2207 conflict with the rlcompleter API. Custom completers ONLY need to
2200 take the text parameter.
2208 take the text parameter.
2201
2209
2202 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2210 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2203 work correctly in pysh. I've also moved all the logic which used
2211 work correctly in pysh. I've also moved all the logic which used
2204 to be in pysh.py here, which will prevent problems with future
2212 to be in pysh.py here, which will prevent problems with future
2205 upgrades. However, this time I must warn users to update their
2213 upgrades. However, this time I must warn users to update their
2206 pysh profile to include the line
2214 pysh profile to include the line
2207
2215
2208 import_all IPython.Extensions.InterpreterExec
2216 import_all IPython.Extensions.InterpreterExec
2209
2217
2210 because otherwise things won't work for them. They MUST also
2218 because otherwise things won't work for them. They MUST also
2211 delete pysh.py and the line
2219 delete pysh.py and the line
2212
2220
2213 execfile pysh.py
2221 execfile pysh.py
2214
2222
2215 from their ipythonrc-pysh.
2223 from their ipythonrc-pysh.
2216
2224
2217 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2225 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2218 robust in the face of objects whose dir() returns non-strings
2226 robust in the face of objects whose dir() returns non-strings
2219 (which it shouldn't, but some broken libs like ITK do). Thanks to
2227 (which it shouldn't, but some broken libs like ITK do). Thanks to
2220 a patch by John Hunter (implemented differently, though). Also
2228 a patch by John Hunter (implemented differently, though). Also
2221 minor improvements by using .extend instead of + on lists.
2229 minor improvements by using .extend instead of + on lists.
2222
2230
2223 * pysh.py:
2231 * pysh.py:
2224
2232
2225 2005-04-06 Fernando Perez <fperez@colorado.edu>
2233 2005-04-06 Fernando Perez <fperez@colorado.edu>
2226
2234
2227 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2235 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2228 by default, so that all users benefit from it. Those who don't
2236 by default, so that all users benefit from it. Those who don't
2229 want it can still turn it off.
2237 want it can still turn it off.
2230
2238
2231 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2239 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2232 config file, I'd forgotten about this, so users were getting it
2240 config file, I'd forgotten about this, so users were getting it
2233 off by default.
2241 off by default.
2234
2242
2235 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2243 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2236 consistency. Now magics can be called in multiline statements,
2244 consistency. Now magics can be called in multiline statements,
2237 and python variables can be expanded in magic calls via $var.
2245 and python variables can be expanded in magic calls via $var.
2238 This makes the magic system behave just like aliases or !system
2246 This makes the magic system behave just like aliases or !system
2239 calls.
2247 calls.
2240
2248
2241 2005-03-28 Fernando Perez <fperez@colorado.edu>
2249 2005-03-28 Fernando Perez <fperez@colorado.edu>
2242
2250
2243 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2251 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2244 expensive string additions for building command. Add support for
2252 expensive string additions for building command. Add support for
2245 trailing ';' when autocall is used.
2253 trailing ';' when autocall is used.
2246
2254
2247 2005-03-26 Fernando Perez <fperez@colorado.edu>
2255 2005-03-26 Fernando Perez <fperez@colorado.edu>
2248
2256
2249 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2257 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2250 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2258 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2251 ipython.el robust against prompts with any number of spaces
2259 ipython.el robust against prompts with any number of spaces
2252 (including 0) after the ':' character.
2260 (including 0) after the ':' character.
2253
2261
2254 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2262 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2255 continuation prompt, which misled users to think the line was
2263 continuation prompt, which misled users to think the line was
2256 already indented. Closes debian Bug#300847, reported to me by
2264 already indented. Closes debian Bug#300847, reported to me by
2257 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2265 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2258
2266
2259 2005-03-23 Fernando Perez <fperez@colorado.edu>
2267 2005-03-23 Fernando Perez <fperez@colorado.edu>
2260
2268
2261 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
2269 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
2262 properly aligned if they have embedded newlines.
2270 properly aligned if they have embedded newlines.
2263
2271
2264 * IPython/iplib.py (runlines): Add a public method to expose
2272 * IPython/iplib.py (runlines): Add a public method to expose
2265 IPython's code execution machinery, so that users can run strings
2273 IPython's code execution machinery, so that users can run strings
2266 as if they had been typed at the prompt interactively.
2274 as if they had been typed at the prompt interactively.
2267 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
2275 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
2268 methods which can call the system shell, but with python variable
2276 methods which can call the system shell, but with python variable
2269 expansion. The three such methods are: __IPYTHON__.system,
2277 expansion. The three such methods are: __IPYTHON__.system,
2270 .getoutput and .getoutputerror. These need to be documented in a
2278 .getoutput and .getoutputerror. These need to be documented in a
2271 'public API' section (to be written) of the manual.
2279 'public API' section (to be written) of the manual.
2272
2280
2273 2005-03-20 Fernando Perez <fperez@colorado.edu>
2281 2005-03-20 Fernando Perez <fperez@colorado.edu>
2274
2282
2275 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
2283 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
2276 for custom exception handling. This is quite powerful, and it
2284 for custom exception handling. This is quite powerful, and it
2277 allows for user-installable exception handlers which can trap
2285 allows for user-installable exception handlers which can trap
2278 custom exceptions at runtime and treat them separately from
2286 custom exceptions at runtime and treat them separately from
2279 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
2287 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
2280 Mantegazza <mantegazza-AT-ill.fr>.
2288 Mantegazza <mantegazza-AT-ill.fr>.
2281 (InteractiveShell.set_custom_completer): public API function to
2289 (InteractiveShell.set_custom_completer): public API function to
2282 add new completers at runtime.
2290 add new completers at runtime.
2283
2291
2284 2005-03-19 Fernando Perez <fperez@colorado.edu>
2292 2005-03-19 Fernando Perez <fperez@colorado.edu>
2285
2293
2286 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
2294 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
2287 allow objects which provide their docstrings via non-standard
2295 allow objects which provide their docstrings via non-standard
2288 mechanisms (like Pyro proxies) to still be inspected by ipython's
2296 mechanisms (like Pyro proxies) to still be inspected by ipython's
2289 ? system.
2297 ? system.
2290
2298
2291 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
2299 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
2292 automatic capture system. I tried quite hard to make it work
2300 automatic capture system. I tried quite hard to make it work
2293 reliably, and simply failed. I tried many combinations with the
2301 reliably, and simply failed. I tried many combinations with the
2294 subprocess module, but eventually nothing worked in all needed
2302 subprocess module, but eventually nothing worked in all needed
2295 cases (not blocking stdin for the child, duplicating stdout
2303 cases (not blocking stdin for the child, duplicating stdout
2296 without blocking, etc). The new %sc/%sx still do capture to these
2304 without blocking, etc). The new %sc/%sx still do capture to these
2297 magical list/string objects which make shell use much more
2305 magical list/string objects which make shell use much more
2298 conveninent, so not all is lost.
2306 conveninent, so not all is lost.
2299
2307
2300 XXX - FIX MANUAL for the change above!
2308 XXX - FIX MANUAL for the change above!
2301
2309
2302 (runsource): I copied code.py's runsource() into ipython to modify
2310 (runsource): I copied code.py's runsource() into ipython to modify
2303 it a bit. Now the code object and source to be executed are
2311 it a bit. Now the code object and source to be executed are
2304 stored in ipython. This makes this info accessible to third-party
2312 stored in ipython. This makes this info accessible to third-party
2305 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
2313 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
2306 Mantegazza <mantegazza-AT-ill.fr>.
2314 Mantegazza <mantegazza-AT-ill.fr>.
2307
2315
2308 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
2316 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
2309 history-search via readline (like C-p/C-n). I'd wanted this for a
2317 history-search via readline (like C-p/C-n). I'd wanted this for a
2310 long time, but only recently found out how to do it. For users
2318 long time, but only recently found out how to do it. For users
2311 who already have their ipythonrc files made and want this, just
2319 who already have their ipythonrc files made and want this, just
2312 add:
2320 add:
2313
2321
2314 readline_parse_and_bind "\e[A": history-search-backward
2322 readline_parse_and_bind "\e[A": history-search-backward
2315 readline_parse_and_bind "\e[B": history-search-forward
2323 readline_parse_and_bind "\e[B": history-search-forward
2316
2324
2317 2005-03-18 Fernando Perez <fperez@colorado.edu>
2325 2005-03-18 Fernando Perez <fperez@colorado.edu>
2318
2326
2319 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
2327 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
2320 LSString and SList classes which allow transparent conversions
2328 LSString and SList classes which allow transparent conversions
2321 between list mode and whitespace-separated string.
2329 between list mode and whitespace-separated string.
2322 (magic_r): Fix recursion problem in %r.
2330 (magic_r): Fix recursion problem in %r.
2323
2331
2324 * IPython/genutils.py (LSString): New class to be used for
2332 * IPython/genutils.py (LSString): New class to be used for
2325 automatic storage of the results of all alias/system calls in _o
2333 automatic storage of the results of all alias/system calls in _o
2326 and _e (stdout/err). These provide a .l/.list attribute which
2334 and _e (stdout/err). These provide a .l/.list attribute which
2327 does automatic splitting on newlines. This means that for most
2335 does automatic splitting on newlines. This means that for most
2328 uses, you'll never need to do capturing of output with %sc/%sx
2336 uses, you'll never need to do capturing of output with %sc/%sx
2329 anymore, since ipython keeps this always done for you. Note that
2337 anymore, since ipython keeps this always done for you. Note that
2330 only the LAST results are stored, the _o/e variables are
2338 only the LAST results are stored, the _o/e variables are
2331 overwritten on each call. If you need to save their contents
2339 overwritten on each call. If you need to save their contents
2332 further, simply bind them to any other name.
2340 further, simply bind them to any other name.
2333
2341
2334 2005-03-17 Fernando Perez <fperez@colorado.edu>
2342 2005-03-17 Fernando Perez <fperez@colorado.edu>
2335
2343
2336 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
2344 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
2337 prompt namespace handling.
2345 prompt namespace handling.
2338
2346
2339 2005-03-16 Fernando Perez <fperez@colorado.edu>
2347 2005-03-16 Fernando Perez <fperez@colorado.edu>
2340
2348
2341 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
2349 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
2342 classic prompts to be '>>> ' (final space was missing, and it
2350 classic prompts to be '>>> ' (final space was missing, and it
2343 trips the emacs python mode).
2351 trips the emacs python mode).
2344 (BasePrompt.__str__): Added safe support for dynamic prompt
2352 (BasePrompt.__str__): Added safe support for dynamic prompt
2345 strings. Now you can set your prompt string to be '$x', and the
2353 strings. Now you can set your prompt string to be '$x', and the
2346 value of x will be printed from your interactive namespace. The
2354 value of x will be printed from your interactive namespace. The
2347 interpolation syntax includes the full Itpl support, so
2355 interpolation syntax includes the full Itpl support, so
2348 ${foo()+x+bar()} is a valid prompt string now, and the function
2356 ${foo()+x+bar()} is a valid prompt string now, and the function
2349 calls will be made at runtime.
2357 calls will be made at runtime.
2350
2358
2351 2005-03-15 Fernando Perez <fperez@colorado.edu>
2359 2005-03-15 Fernando Perez <fperez@colorado.edu>
2352
2360
2353 * IPython/Magic.py (magic_history): renamed %hist to %history, to
2361 * IPython/Magic.py (magic_history): renamed %hist to %history, to
2354 avoid name clashes in pylab. %hist still works, it just forwards
2362 avoid name clashes in pylab. %hist still works, it just forwards
2355 the call to %history.
2363 the call to %history.
2356
2364
2357 2005-03-02 *** Released version 0.6.12
2365 2005-03-02 *** Released version 0.6.12
2358
2366
2359 2005-03-02 Fernando Perez <fperez@colorado.edu>
2367 2005-03-02 Fernando Perez <fperez@colorado.edu>
2360
2368
2361 * IPython/iplib.py (handle_magic): log magic calls properly as
2369 * IPython/iplib.py (handle_magic): log magic calls properly as
2362 ipmagic() function calls.
2370 ipmagic() function calls.
2363
2371
2364 * IPython/Magic.py (magic_time): Improved %time to support
2372 * IPython/Magic.py (magic_time): Improved %time to support
2365 statements and provide wall-clock as well as CPU time.
2373 statements and provide wall-clock as well as CPU time.
2366
2374
2367 2005-02-27 Fernando Perez <fperez@colorado.edu>
2375 2005-02-27 Fernando Perez <fperez@colorado.edu>
2368
2376
2369 * IPython/hooks.py: New hooks module, to expose user-modifiable
2377 * IPython/hooks.py: New hooks module, to expose user-modifiable
2370 IPython functionality in a clean manner. For now only the editor
2378 IPython functionality in a clean manner. For now only the editor
2371 hook is actually written, and other thigns which I intend to turn
2379 hook is actually written, and other thigns which I intend to turn
2372 into proper hooks aren't yet there. The display and prefilter
2380 into proper hooks aren't yet there. The display and prefilter
2373 stuff, for example, should be hooks. But at least now the
2381 stuff, for example, should be hooks. But at least now the
2374 framework is in place, and the rest can be moved here with more
2382 framework is in place, and the rest can be moved here with more
2375 time later. IPython had had a .hooks variable for a long time for
2383 time later. IPython had had a .hooks variable for a long time for
2376 this purpose, but I'd never actually used it for anything.
2384 this purpose, but I'd never actually used it for anything.
2377
2385
2378 2005-02-26 Fernando Perez <fperez@colorado.edu>
2386 2005-02-26 Fernando Perez <fperez@colorado.edu>
2379
2387
2380 * IPython/ipmaker.py (make_IPython): make the default ipython
2388 * IPython/ipmaker.py (make_IPython): make the default ipython
2381 directory be called _ipython under win32, to follow more the
2389 directory be called _ipython under win32, to follow more the
2382 naming peculiarities of that platform (where buggy software like
2390 naming peculiarities of that platform (where buggy software like
2383 Visual Sourcesafe breaks with .named directories). Reported by
2391 Visual Sourcesafe breaks with .named directories). Reported by
2384 Ville Vainio.
2392 Ville Vainio.
2385
2393
2386 2005-02-23 Fernando Perez <fperez@colorado.edu>
2394 2005-02-23 Fernando Perez <fperez@colorado.edu>
2387
2395
2388 * IPython/iplib.py (InteractiveShell.__init__): removed a few
2396 * IPython/iplib.py (InteractiveShell.__init__): removed a few
2389 auto_aliases for win32 which were causing problems. Users can
2397 auto_aliases for win32 which were causing problems. Users can
2390 define the ones they personally like.
2398 define the ones they personally like.
2391
2399
2392 2005-02-21 Fernando Perez <fperez@colorado.edu>
2400 2005-02-21 Fernando Perez <fperez@colorado.edu>
2393
2401
2394 * IPython/Magic.py (magic_time): new magic to time execution of
2402 * IPython/Magic.py (magic_time): new magic to time execution of
2395 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
2403 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
2396
2404
2397 2005-02-19 Fernando Perez <fperez@colorado.edu>
2405 2005-02-19 Fernando Perez <fperez@colorado.edu>
2398
2406
2399 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
2407 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
2400 into keys (for prompts, for example).
2408 into keys (for prompts, for example).
2401
2409
2402 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
2410 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
2403 prompts in case users want them. This introduces a small behavior
2411 prompts in case users want them. This introduces a small behavior
2404 change: ipython does not automatically add a space to all prompts
2412 change: ipython does not automatically add a space to all prompts
2405 anymore. To get the old prompts with a space, users should add it
2413 anymore. To get the old prompts with a space, users should add it
2406 manually to their ipythonrc file, so for example prompt_in1 should
2414 manually to their ipythonrc file, so for example prompt_in1 should
2407 now read 'In [\#]: ' instead of 'In [\#]:'.
2415 now read 'In [\#]: ' instead of 'In [\#]:'.
2408 (BasePrompt.__init__): New option prompts_pad_left (only in rc
2416 (BasePrompt.__init__): New option prompts_pad_left (only in rc
2409 file) to control left-padding of secondary prompts.
2417 file) to control left-padding of secondary prompts.
2410
2418
2411 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
2419 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
2412 the profiler can't be imported. Fix for Debian, which removed
2420 the profiler can't be imported. Fix for Debian, which removed
2413 profile.py because of License issues. I applied a slightly
2421 profile.py because of License issues. I applied a slightly
2414 modified version of the original Debian patch at
2422 modified version of the original Debian patch at
2415 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
2423 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
2416
2424
2417 2005-02-17 Fernando Perez <fperez@colorado.edu>
2425 2005-02-17 Fernando Perez <fperez@colorado.edu>
2418
2426
2419 * IPython/genutils.py (native_line_ends): Fix bug which would
2427 * IPython/genutils.py (native_line_ends): Fix bug which would
2420 cause improper line-ends under win32 b/c I was not opening files
2428 cause improper line-ends under win32 b/c I was not opening files
2421 in binary mode. Bug report and fix thanks to Ville.
2429 in binary mode. Bug report and fix thanks to Ville.
2422
2430
2423 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
2431 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
2424 trying to catch spurious foo[1] autocalls. My fix actually broke
2432 trying to catch spurious foo[1] autocalls. My fix actually broke
2425 ',/' autoquote/call with explicit escape (bad regexp).
2433 ',/' autoquote/call with explicit escape (bad regexp).
2426
2434
2427 2005-02-15 *** Released version 0.6.11
2435 2005-02-15 *** Released version 0.6.11
2428
2436
2429 2005-02-14 Fernando Perez <fperez@colorado.edu>
2437 2005-02-14 Fernando Perez <fperez@colorado.edu>
2430
2438
2431 * IPython/background_jobs.py: New background job management
2439 * IPython/background_jobs.py: New background job management
2432 subsystem. This is implemented via a new set of classes, and
2440 subsystem. This is implemented via a new set of classes, and
2433 IPython now provides a builtin 'jobs' object for background job
2441 IPython now provides a builtin 'jobs' object for background job
2434 execution. A convenience %bg magic serves as a lightweight
2442 execution. A convenience %bg magic serves as a lightweight
2435 frontend for starting the more common type of calls. This was
2443 frontend for starting the more common type of calls. This was
2436 inspired by discussions with B. Granger and the BackgroundCommand
2444 inspired by discussions with B. Granger and the BackgroundCommand
2437 class described in the book Python Scripting for Computational
2445 class described in the book Python Scripting for Computational
2438 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
2446 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
2439 (although ultimately no code from this text was used, as IPython's
2447 (although ultimately no code from this text was used, as IPython's
2440 system is a separate implementation).
2448 system is a separate implementation).
2441
2449
2442 * IPython/iplib.py (MagicCompleter.python_matches): add new option
2450 * IPython/iplib.py (MagicCompleter.python_matches): add new option
2443 to control the completion of single/double underscore names
2451 to control the completion of single/double underscore names
2444 separately. As documented in the example ipytonrc file, the
2452 separately. As documented in the example ipytonrc file, the
2445 readline_omit__names variable can now be set to 2, to omit even
2453 readline_omit__names variable can now be set to 2, to omit even
2446 single underscore names. Thanks to a patch by Brian Wong
2454 single underscore names. Thanks to a patch by Brian Wong
2447 <BrianWong-AT-AirgoNetworks.Com>.
2455 <BrianWong-AT-AirgoNetworks.Com>.
2448 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
2456 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
2449 be autocalled as foo([1]) if foo were callable. A problem for
2457 be autocalled as foo([1]) if foo were callable. A problem for
2450 things which are both callable and implement __getitem__.
2458 things which are both callable and implement __getitem__.
2451 (init_readline): Fix autoindentation for win32. Thanks to a patch
2459 (init_readline): Fix autoindentation for win32. Thanks to a patch
2452 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
2460 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
2453
2461
2454 2005-02-12 Fernando Perez <fperez@colorado.edu>
2462 2005-02-12 Fernando Perez <fperez@colorado.edu>
2455
2463
2456 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
2464 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
2457 which I had written long ago to sort out user error messages which
2465 which I had written long ago to sort out user error messages which
2458 may occur during startup. This seemed like a good idea initially,
2466 may occur during startup. This seemed like a good idea initially,
2459 but it has proven a disaster in retrospect. I don't want to
2467 but it has proven a disaster in retrospect. I don't want to
2460 change much code for now, so my fix is to set the internal 'debug'
2468 change much code for now, so my fix is to set the internal 'debug'
2461 flag to true everywhere, whose only job was precisely to control
2469 flag to true everywhere, whose only job was precisely to control
2462 this subsystem. This closes issue 28 (as well as avoiding all
2470 this subsystem. This closes issue 28 (as well as avoiding all
2463 sorts of strange hangups which occur from time to time).
2471 sorts of strange hangups which occur from time to time).
2464
2472
2465 2005-02-07 Fernando Perez <fperez@colorado.edu>
2473 2005-02-07 Fernando Perez <fperez@colorado.edu>
2466
2474
2467 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
2475 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
2468 previous call produced a syntax error.
2476 previous call produced a syntax error.
2469
2477
2470 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2478 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2471 classes without constructor.
2479 classes without constructor.
2472
2480
2473 2005-02-06 Fernando Perez <fperez@colorado.edu>
2481 2005-02-06 Fernando Perez <fperez@colorado.edu>
2474
2482
2475 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
2483 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
2476 completions with the results of each matcher, so we return results
2484 completions with the results of each matcher, so we return results
2477 to the user from all namespaces. This breaks with ipython
2485 to the user from all namespaces. This breaks with ipython
2478 tradition, but I think it's a nicer behavior. Now you get all
2486 tradition, but I think it's a nicer behavior. Now you get all
2479 possible completions listed, from all possible namespaces (python,
2487 possible completions listed, from all possible namespaces (python,
2480 filesystem, magics...) After a request by John Hunter
2488 filesystem, magics...) After a request by John Hunter
2481 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2489 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2482
2490
2483 2005-02-05 Fernando Perez <fperez@colorado.edu>
2491 2005-02-05 Fernando Perez <fperez@colorado.edu>
2484
2492
2485 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
2493 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
2486 the call had quote characters in it (the quotes were stripped).
2494 the call had quote characters in it (the quotes were stripped).
2487
2495
2488 2005-01-31 Fernando Perez <fperez@colorado.edu>
2496 2005-01-31 Fernando Perez <fperez@colorado.edu>
2489
2497
2490 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
2498 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
2491 Itpl.itpl() to make the code more robust against psyco
2499 Itpl.itpl() to make the code more robust against psyco
2492 optimizations.
2500 optimizations.
2493
2501
2494 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
2502 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
2495 of causing an exception. Quicker, cleaner.
2503 of causing an exception. Quicker, cleaner.
2496
2504
2497 2005-01-28 Fernando Perez <fperez@colorado.edu>
2505 2005-01-28 Fernando Perez <fperez@colorado.edu>
2498
2506
2499 * scripts/ipython_win_post_install.py (install): hardcode
2507 * scripts/ipython_win_post_install.py (install): hardcode
2500 sys.prefix+'python.exe' as the executable path. It turns out that
2508 sys.prefix+'python.exe' as the executable path. It turns out that
2501 during the post-installation run, sys.executable resolves to the
2509 during the post-installation run, sys.executable resolves to the
2502 name of the binary installer! I should report this as a distutils
2510 name of the binary installer! I should report this as a distutils
2503 bug, I think. I updated the .10 release with this tiny fix, to
2511 bug, I think. I updated the .10 release with this tiny fix, to
2504 avoid annoying the lists further.
2512 avoid annoying the lists further.
2505
2513
2506 2005-01-27 *** Released version 0.6.10
2514 2005-01-27 *** Released version 0.6.10
2507
2515
2508 2005-01-27 Fernando Perez <fperez@colorado.edu>
2516 2005-01-27 Fernando Perez <fperez@colorado.edu>
2509
2517
2510 * IPython/numutils.py (norm): Added 'inf' as optional name for
2518 * IPython/numutils.py (norm): Added 'inf' as optional name for
2511 L-infinity norm, included references to mathworld.com for vector
2519 L-infinity norm, included references to mathworld.com for vector
2512 norm definitions.
2520 norm definitions.
2513 (amin/amax): added amin/amax for array min/max. Similar to what
2521 (amin/amax): added amin/amax for array min/max. Similar to what
2514 pylab ships with after the recent reorganization of names.
2522 pylab ships with after the recent reorganization of names.
2515 (spike/spike_odd): removed deprecated spike/spike_odd functions.
2523 (spike/spike_odd): removed deprecated spike/spike_odd functions.
2516
2524
2517 * ipython.el: committed Alex's recent fixes and improvements.
2525 * ipython.el: committed Alex's recent fixes and improvements.
2518 Tested with python-mode from CVS, and it looks excellent. Since
2526 Tested with python-mode from CVS, and it looks excellent. Since
2519 python-mode hasn't released anything in a while, I'm temporarily
2527 python-mode hasn't released anything in a while, I'm temporarily
2520 putting a copy of today's CVS (v 4.70) of python-mode in:
2528 putting a copy of today's CVS (v 4.70) of python-mode in:
2521 http://ipython.scipy.org/tmp/python-mode.el
2529 http://ipython.scipy.org/tmp/python-mode.el
2522
2530
2523 * scripts/ipython_win_post_install.py (install): Win32 fix to use
2531 * scripts/ipython_win_post_install.py (install): Win32 fix to use
2524 sys.executable for the executable name, instead of assuming it's
2532 sys.executable for the executable name, instead of assuming it's
2525 called 'python.exe' (the post-installer would have produced broken
2533 called 'python.exe' (the post-installer would have produced broken
2526 setups on systems with a differently named python binary).
2534 setups on systems with a differently named python binary).
2527
2535
2528 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
2536 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
2529 references to os.linesep, to make the code more
2537 references to os.linesep, to make the code more
2530 platform-independent. This is also part of the win32 coloring
2538 platform-independent. This is also part of the win32 coloring
2531 fixes.
2539 fixes.
2532
2540
2533 * IPython/genutils.py (page_dumb): Remove attempts to chop long
2541 * IPython/genutils.py (page_dumb): Remove attempts to chop long
2534 lines, which actually cause coloring bugs because the length of
2542 lines, which actually cause coloring bugs because the length of
2535 the line is very difficult to correctly compute with embedded
2543 the line is very difficult to correctly compute with embedded
2536 escapes. This was the source of all the coloring problems under
2544 escapes. This was the source of all the coloring problems under
2537 Win32. I think that _finally_, Win32 users have a properly
2545 Win32. I think that _finally_, Win32 users have a properly
2538 working ipython in all respects. This would never have happened
2546 working ipython in all respects. This would never have happened
2539 if not for Gary Bishop and Viktor Ransmayr's great help and work.
2547 if not for Gary Bishop and Viktor Ransmayr's great help and work.
2540
2548
2541 2005-01-26 *** Released version 0.6.9
2549 2005-01-26 *** Released version 0.6.9
2542
2550
2543 2005-01-25 Fernando Perez <fperez@colorado.edu>
2551 2005-01-25 Fernando Perez <fperez@colorado.edu>
2544
2552
2545 * setup.py: finally, we have a true Windows installer, thanks to
2553 * setup.py: finally, we have a true Windows installer, thanks to
2546 the excellent work of Viktor Ransmayr
2554 the excellent work of Viktor Ransmayr
2547 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
2555 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
2548 Windows users. The setup routine is quite a bit cleaner thanks to
2556 Windows users. The setup routine is quite a bit cleaner thanks to
2549 this, and the post-install script uses the proper functions to
2557 this, and the post-install script uses the proper functions to
2550 allow a clean de-installation using the standard Windows Control
2558 allow a clean de-installation using the standard Windows Control
2551 Panel.
2559 Panel.
2552
2560
2553 * IPython/genutils.py (get_home_dir): changed to use the $HOME
2561 * IPython/genutils.py (get_home_dir): changed to use the $HOME
2554 environment variable under all OSes (including win32) if
2562 environment variable under all OSes (including win32) if
2555 available. This will give consistency to win32 users who have set
2563 available. This will give consistency to win32 users who have set
2556 this variable for any reason. If os.environ['HOME'] fails, the
2564 this variable for any reason. If os.environ['HOME'] fails, the
2557 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
2565 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
2558
2566
2559 2005-01-24 Fernando Perez <fperez@colorado.edu>
2567 2005-01-24 Fernando Perez <fperez@colorado.edu>
2560
2568
2561 * IPython/numutils.py (empty_like): add empty_like(), similar to
2569 * IPython/numutils.py (empty_like): add empty_like(), similar to
2562 zeros_like() but taking advantage of the new empty() Numeric routine.
2570 zeros_like() but taking advantage of the new empty() Numeric routine.
2563
2571
2564 2005-01-23 *** Released version 0.6.8
2572 2005-01-23 *** Released version 0.6.8
2565
2573
2566 2005-01-22 Fernando Perez <fperez@colorado.edu>
2574 2005-01-22 Fernando Perez <fperez@colorado.edu>
2567
2575
2568 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
2576 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
2569 automatic show() calls. After discussing things with JDH, it
2577 automatic show() calls. After discussing things with JDH, it
2570 turns out there are too many corner cases where this can go wrong.
2578 turns out there are too many corner cases where this can go wrong.
2571 It's best not to try to be 'too smart', and simply have ipython
2579 It's best not to try to be 'too smart', and simply have ipython
2572 reproduce as much as possible the default behavior of a normal
2580 reproduce as much as possible the default behavior of a normal
2573 python shell.
2581 python shell.
2574
2582
2575 * IPython/iplib.py (InteractiveShell.__init__): Modified the
2583 * IPython/iplib.py (InteractiveShell.__init__): Modified the
2576 line-splitting regexp and _prefilter() to avoid calling getattr()
2584 line-splitting regexp and _prefilter() to avoid calling getattr()
2577 on assignments. This closes
2585 on assignments. This closes
2578 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
2586 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
2579 readline uses getattr(), so a simple <TAB> keypress is still
2587 readline uses getattr(), so a simple <TAB> keypress is still
2580 enough to trigger getattr() calls on an object.
2588 enough to trigger getattr() calls on an object.
2581
2589
2582 2005-01-21 Fernando Perez <fperez@colorado.edu>
2590 2005-01-21 Fernando Perez <fperez@colorado.edu>
2583
2591
2584 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
2592 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
2585 docstring under pylab so it doesn't mask the original.
2593 docstring under pylab so it doesn't mask the original.
2586
2594
2587 2005-01-21 *** Released version 0.6.7
2595 2005-01-21 *** Released version 0.6.7
2588
2596
2589 2005-01-21 Fernando Perez <fperez@colorado.edu>
2597 2005-01-21 Fernando Perez <fperez@colorado.edu>
2590
2598
2591 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
2599 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
2592 signal handling for win32 users in multithreaded mode.
2600 signal handling for win32 users in multithreaded mode.
2593
2601
2594 2005-01-17 Fernando Perez <fperez@colorado.edu>
2602 2005-01-17 Fernando Perez <fperez@colorado.edu>
2595
2603
2596 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2604 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2597 instances with no __init__. After a crash report by Norbert Nemec
2605 instances with no __init__. After a crash report by Norbert Nemec
2598 <Norbert-AT-nemec-online.de>.
2606 <Norbert-AT-nemec-online.de>.
2599
2607
2600 2005-01-14 Fernando Perez <fperez@colorado.edu>
2608 2005-01-14 Fernando Perez <fperez@colorado.edu>
2601
2609
2602 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
2610 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
2603 names for verbose exceptions, when multiple dotted names and the
2611 names for verbose exceptions, when multiple dotted names and the
2604 'parent' object were present on the same line.
2612 'parent' object were present on the same line.
2605
2613
2606 2005-01-11 Fernando Perez <fperez@colorado.edu>
2614 2005-01-11 Fernando Perez <fperez@colorado.edu>
2607
2615
2608 * IPython/genutils.py (flag_calls): new utility to trap and flag
2616 * IPython/genutils.py (flag_calls): new utility to trap and flag
2609 calls in functions. I need it to clean up matplotlib support.
2617 calls in functions. I need it to clean up matplotlib support.
2610 Also removed some deprecated code in genutils.
2618 Also removed some deprecated code in genutils.
2611
2619
2612 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
2620 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
2613 that matplotlib scripts called with %run, which don't call show()
2621 that matplotlib scripts called with %run, which don't call show()
2614 themselves, still have their plotting windows open.
2622 themselves, still have their plotting windows open.
2615
2623
2616 2005-01-05 Fernando Perez <fperez@colorado.edu>
2624 2005-01-05 Fernando Perez <fperez@colorado.edu>
2617
2625
2618 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
2626 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
2619 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
2627 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
2620
2628
2621 2004-12-19 Fernando Perez <fperez@colorado.edu>
2629 2004-12-19 Fernando Perez <fperez@colorado.edu>
2622
2630
2623 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
2631 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
2624 parent_runcode, which was an eyesore. The same result can be
2632 parent_runcode, which was an eyesore. The same result can be
2625 obtained with Python's regular superclass mechanisms.
2633 obtained with Python's regular superclass mechanisms.
2626
2634
2627 2004-12-17 Fernando Perez <fperez@colorado.edu>
2635 2004-12-17 Fernando Perez <fperez@colorado.edu>
2628
2636
2629 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
2637 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
2630 reported by Prabhu.
2638 reported by Prabhu.
2631 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
2639 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
2632 sys.stderr) instead of explicitly calling sys.stderr. This helps
2640 sys.stderr) instead of explicitly calling sys.stderr. This helps
2633 maintain our I/O abstractions clean, for future GUI embeddings.
2641 maintain our I/O abstractions clean, for future GUI embeddings.
2634
2642
2635 * IPython/genutils.py (info): added new utility for sys.stderr
2643 * IPython/genutils.py (info): added new utility for sys.stderr
2636 unified info message handling (thin wrapper around warn()).
2644 unified info message handling (thin wrapper around warn()).
2637
2645
2638 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
2646 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
2639 composite (dotted) names on verbose exceptions.
2647 composite (dotted) names on verbose exceptions.
2640 (VerboseTB.nullrepr): harden against another kind of errors which
2648 (VerboseTB.nullrepr): harden against another kind of errors which
2641 Python's inspect module can trigger, and which were crashing
2649 Python's inspect module can trigger, and which were crashing
2642 IPython. Thanks to a report by Marco Lombardi
2650 IPython. Thanks to a report by Marco Lombardi
2643 <mlombard-AT-ma010192.hq.eso.org>.
2651 <mlombard-AT-ma010192.hq.eso.org>.
2644
2652
2645 2004-12-13 *** Released version 0.6.6
2653 2004-12-13 *** Released version 0.6.6
2646
2654
2647 2004-12-12 Fernando Perez <fperez@colorado.edu>
2655 2004-12-12 Fernando Perez <fperez@colorado.edu>
2648
2656
2649 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
2657 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
2650 generated by pygtk upon initialization if it was built without
2658 generated by pygtk upon initialization if it was built without
2651 threads (for matplotlib users). After a crash reported by
2659 threads (for matplotlib users). After a crash reported by
2652 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
2660 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
2653
2661
2654 * IPython/ipmaker.py (make_IPython): fix small bug in the
2662 * IPython/ipmaker.py (make_IPython): fix small bug in the
2655 import_some parameter for multiple imports.
2663 import_some parameter for multiple imports.
2656
2664
2657 * IPython/iplib.py (ipmagic): simplified the interface of
2665 * IPython/iplib.py (ipmagic): simplified the interface of
2658 ipmagic() to take a single string argument, just as it would be
2666 ipmagic() to take a single string argument, just as it would be
2659 typed at the IPython cmd line.
2667 typed at the IPython cmd line.
2660 (ipalias): Added new ipalias() with an interface identical to
2668 (ipalias): Added new ipalias() with an interface identical to
2661 ipmagic(). This completes exposing a pure python interface to the
2669 ipmagic(). This completes exposing a pure python interface to the
2662 alias and magic system, which can be used in loops or more complex
2670 alias and magic system, which can be used in loops or more complex
2663 code where IPython's automatic line mangling is not active.
2671 code where IPython's automatic line mangling is not active.
2664
2672
2665 * IPython/genutils.py (timing): changed interface of timing to
2673 * IPython/genutils.py (timing): changed interface of timing to
2666 simply run code once, which is the most common case. timings()
2674 simply run code once, which is the most common case. timings()
2667 remains unchanged, for the cases where you want multiple runs.
2675 remains unchanged, for the cases where you want multiple runs.
2668
2676
2669 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
2677 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
2670 bug where Python2.2 crashes with exec'ing code which does not end
2678 bug where Python2.2 crashes with exec'ing code which does not end
2671 in a single newline. Python 2.3 is OK, so I hadn't noticed this
2679 in a single newline. Python 2.3 is OK, so I hadn't noticed this
2672 before.
2680 before.
2673
2681
2674 2004-12-10 Fernando Perez <fperez@colorado.edu>
2682 2004-12-10 Fernando Perez <fperez@colorado.edu>
2675
2683
2676 * IPython/Magic.py (Magic.magic_prun): changed name of option from
2684 * IPython/Magic.py (Magic.magic_prun): changed name of option from
2677 -t to -T, to accomodate the new -t flag in %run (the %run and
2685 -t to -T, to accomodate the new -t flag in %run (the %run and
2678 %prun options are kind of intermixed, and it's not easy to change
2686 %prun options are kind of intermixed, and it's not easy to change
2679 this with the limitations of python's getopt).
2687 this with the limitations of python's getopt).
2680
2688
2681 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
2689 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
2682 the execution of scripts. It's not as fine-tuned as timeit.py,
2690 the execution of scripts. It's not as fine-tuned as timeit.py,
2683 but it works from inside ipython (and under 2.2, which lacks
2691 but it works from inside ipython (and under 2.2, which lacks
2684 timeit.py). Optionally a number of runs > 1 can be given for
2692 timeit.py). Optionally a number of runs > 1 can be given for
2685 timing very short-running code.
2693 timing very short-running code.
2686
2694
2687 * IPython/genutils.py (uniq_stable): new routine which returns a
2695 * IPython/genutils.py (uniq_stable): new routine which returns a
2688 list of unique elements in any iterable, but in stable order of
2696 list of unique elements in any iterable, but in stable order of
2689 appearance. I needed this for the ultraTB fixes, and it's a handy
2697 appearance. I needed this for the ultraTB fixes, and it's a handy
2690 utility.
2698 utility.
2691
2699
2692 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
2700 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
2693 dotted names in Verbose exceptions. This had been broken since
2701 dotted names in Verbose exceptions. This had been broken since
2694 the very start, now x.y will properly be printed in a Verbose
2702 the very start, now x.y will properly be printed in a Verbose
2695 traceback, instead of x being shown and y appearing always as an
2703 traceback, instead of x being shown and y appearing always as an
2696 'undefined global'. Getting this to work was a bit tricky,
2704 'undefined global'. Getting this to work was a bit tricky,
2697 because by default python tokenizers are stateless. Saved by
2705 because by default python tokenizers are stateless. Saved by
2698 python's ability to easily add a bit of state to an arbitrary
2706 python's ability to easily add a bit of state to an arbitrary
2699 function (without needing to build a full-blown callable object).
2707 function (without needing to build a full-blown callable object).
2700
2708
2701 Also big cleanup of this code, which had horrendous runtime
2709 Also big cleanup of this code, which had horrendous runtime
2702 lookups of zillions of attributes for colorization. Moved all
2710 lookups of zillions of attributes for colorization. Moved all
2703 this code into a few templates, which make it cleaner and quicker.
2711 this code into a few templates, which make it cleaner and quicker.
2704
2712
2705 Printout quality was also improved for Verbose exceptions: one
2713 Printout quality was also improved for Verbose exceptions: one
2706 variable per line, and memory addresses are printed (this can be
2714 variable per line, and memory addresses are printed (this can be
2707 quite handy in nasty debugging situations, which is what Verbose
2715 quite handy in nasty debugging situations, which is what Verbose
2708 is for).
2716 is for).
2709
2717
2710 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
2718 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
2711 the command line as scripts to be loaded by embedded instances.
2719 the command line as scripts to be loaded by embedded instances.
2712 Doing so has the potential for an infinite recursion if there are
2720 Doing so has the potential for an infinite recursion if there are
2713 exceptions thrown in the process. This fixes a strange crash
2721 exceptions thrown in the process. This fixes a strange crash
2714 reported by Philippe MULLER <muller-AT-irit.fr>.
2722 reported by Philippe MULLER <muller-AT-irit.fr>.
2715
2723
2716 2004-12-09 Fernando Perez <fperez@colorado.edu>
2724 2004-12-09 Fernando Perez <fperez@colorado.edu>
2717
2725
2718 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
2726 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
2719 to reflect new names in matplotlib, which now expose the
2727 to reflect new names in matplotlib, which now expose the
2720 matlab-compatible interface via a pylab module instead of the
2728 matlab-compatible interface via a pylab module instead of the
2721 'matlab' name. The new code is backwards compatible, so users of
2729 'matlab' name. The new code is backwards compatible, so users of
2722 all matplotlib versions are OK. Patch by J. Hunter.
2730 all matplotlib versions are OK. Patch by J. Hunter.
2723
2731
2724 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
2732 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
2725 of __init__ docstrings for instances (class docstrings are already
2733 of __init__ docstrings for instances (class docstrings are already
2726 automatically printed). Instances with customized docstrings
2734 automatically printed). Instances with customized docstrings
2727 (indep. of the class) are also recognized and all 3 separate
2735 (indep. of the class) are also recognized and all 3 separate
2728 docstrings are printed (instance, class, constructor). After some
2736 docstrings are printed (instance, class, constructor). After some
2729 comments/suggestions by J. Hunter.
2737 comments/suggestions by J. Hunter.
2730
2738
2731 2004-12-05 Fernando Perez <fperez@colorado.edu>
2739 2004-12-05 Fernando Perez <fperez@colorado.edu>
2732
2740
2733 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
2741 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
2734 warnings when tab-completion fails and triggers an exception.
2742 warnings when tab-completion fails and triggers an exception.
2735
2743
2736 2004-12-03 Fernando Perez <fperez@colorado.edu>
2744 2004-12-03 Fernando Perez <fperez@colorado.edu>
2737
2745
2738 * IPython/Magic.py (magic_prun): Fix bug where an exception would
2746 * IPython/Magic.py (magic_prun): Fix bug where an exception would
2739 be triggered when using 'run -p'. An incorrect option flag was
2747 be triggered when using 'run -p'. An incorrect option flag was
2740 being set ('d' instead of 'D').
2748 being set ('d' instead of 'D').
2741 (manpage): fix missing escaped \- sign.
2749 (manpage): fix missing escaped \- sign.
2742
2750
2743 2004-11-30 *** Released version 0.6.5
2751 2004-11-30 *** Released version 0.6.5
2744
2752
2745 2004-11-30 Fernando Perez <fperez@colorado.edu>
2753 2004-11-30 Fernando Perez <fperez@colorado.edu>
2746
2754
2747 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
2755 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
2748 setting with -d option.
2756 setting with -d option.
2749
2757
2750 * setup.py (docfiles): Fix problem where the doc glob I was using
2758 * setup.py (docfiles): Fix problem where the doc glob I was using
2751 was COMPLETELY BROKEN. It was giving the right files by pure
2759 was COMPLETELY BROKEN. It was giving the right files by pure
2752 accident, but failed once I tried to include ipython.el. Note:
2760 accident, but failed once I tried to include ipython.el. Note:
2753 glob() does NOT allow you to do exclusion on multiple endings!
2761 glob() does NOT allow you to do exclusion on multiple endings!
2754
2762
2755 2004-11-29 Fernando Perez <fperez@colorado.edu>
2763 2004-11-29 Fernando Perez <fperez@colorado.edu>
2756
2764
2757 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
2765 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
2758 the manpage as the source. Better formatting & consistency.
2766 the manpage as the source. Better formatting & consistency.
2759
2767
2760 * IPython/Magic.py (magic_run): Added new -d option, to run
2768 * IPython/Magic.py (magic_run): Added new -d option, to run
2761 scripts under the control of the python pdb debugger. Note that
2769 scripts under the control of the python pdb debugger. Note that
2762 this required changing the %prun option -d to -D, to avoid a clash
2770 this required changing the %prun option -d to -D, to avoid a clash
2763 (since %run must pass options to %prun, and getopt is too dumb to
2771 (since %run must pass options to %prun, and getopt is too dumb to
2764 handle options with string values with embedded spaces). Thanks
2772 handle options with string values with embedded spaces). Thanks
2765 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
2773 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
2766 (magic_who_ls): added type matching to %who and %whos, so that one
2774 (magic_who_ls): added type matching to %who and %whos, so that one
2767 can filter their output to only include variables of certain
2775 can filter their output to only include variables of certain
2768 types. Another suggestion by Matthew.
2776 types. Another suggestion by Matthew.
2769 (magic_whos): Added memory summaries in kb and Mb for arrays.
2777 (magic_whos): Added memory summaries in kb and Mb for arrays.
2770 (magic_who): Improve formatting (break lines every 9 vars).
2778 (magic_who): Improve formatting (break lines every 9 vars).
2771
2779
2772 2004-11-28 Fernando Perez <fperez@colorado.edu>
2780 2004-11-28 Fernando Perez <fperez@colorado.edu>
2773
2781
2774 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
2782 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
2775 cache when empty lines were present.
2783 cache when empty lines were present.
2776
2784
2777 2004-11-24 Fernando Perez <fperez@colorado.edu>
2785 2004-11-24 Fernando Perez <fperez@colorado.edu>
2778
2786
2779 * IPython/usage.py (__doc__): document the re-activated threading
2787 * IPython/usage.py (__doc__): document the re-activated threading
2780 options for WX and GTK.
2788 options for WX and GTK.
2781
2789
2782 2004-11-23 Fernando Perez <fperez@colorado.edu>
2790 2004-11-23 Fernando Perez <fperez@colorado.edu>
2783
2791
2784 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
2792 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
2785 the -wthread and -gthread options, along with a new -tk one to try
2793 the -wthread and -gthread options, along with a new -tk one to try
2786 and coordinate Tk threading with wx/gtk. The tk support is very
2794 and coordinate Tk threading with wx/gtk. The tk support is very
2787 platform dependent, since it seems to require Tcl and Tk to be
2795 platform dependent, since it seems to require Tcl and Tk to be
2788 built with threads (Fedora1/2 appears NOT to have it, but in
2796 built with threads (Fedora1/2 appears NOT to have it, but in
2789 Prabhu's Debian boxes it works OK). But even with some Tk
2797 Prabhu's Debian boxes it works OK). But even with some Tk
2790 limitations, this is a great improvement.
2798 limitations, this is a great improvement.
2791
2799
2792 * IPython/Prompts.py (prompt_specials_color): Added \t for time
2800 * IPython/Prompts.py (prompt_specials_color): Added \t for time
2793 info in user prompts. Patch by Prabhu.
2801 info in user prompts. Patch by Prabhu.
2794
2802
2795 2004-11-18 Fernando Perez <fperez@colorado.edu>
2803 2004-11-18 Fernando Perez <fperez@colorado.edu>
2796
2804
2797 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
2805 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
2798 EOFErrors and bail, to avoid infinite loops if a non-terminating
2806 EOFErrors and bail, to avoid infinite loops if a non-terminating
2799 file is fed into ipython. Patch submitted in issue 19 by user,
2807 file is fed into ipython. Patch submitted in issue 19 by user,
2800 many thanks.
2808 many thanks.
2801
2809
2802 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
2810 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
2803 autoquote/parens in continuation prompts, which can cause lots of
2811 autoquote/parens in continuation prompts, which can cause lots of
2804 problems. Closes roundup issue 20.
2812 problems. Closes roundup issue 20.
2805
2813
2806 2004-11-17 Fernando Perez <fperez@colorado.edu>
2814 2004-11-17 Fernando Perez <fperez@colorado.edu>
2807
2815
2808 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
2816 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
2809 reported as debian bug #280505. I'm not sure my local changelog
2817 reported as debian bug #280505. I'm not sure my local changelog
2810 entry has the proper debian format (Jack?).
2818 entry has the proper debian format (Jack?).
2811
2819
2812 2004-11-08 *** Released version 0.6.4
2820 2004-11-08 *** Released version 0.6.4
2813
2821
2814 2004-11-08 Fernando Perez <fperez@colorado.edu>
2822 2004-11-08 Fernando Perez <fperez@colorado.edu>
2815
2823
2816 * IPython/iplib.py (init_readline): Fix exit message for Windows
2824 * IPython/iplib.py (init_readline): Fix exit message for Windows
2817 when readline is active. Thanks to a report by Eric Jones
2825 when readline is active. Thanks to a report by Eric Jones
2818 <eric-AT-enthought.com>.
2826 <eric-AT-enthought.com>.
2819
2827
2820 2004-11-07 Fernando Perez <fperez@colorado.edu>
2828 2004-11-07 Fernando Perez <fperez@colorado.edu>
2821
2829
2822 * IPython/genutils.py (page): Add a trap for OSError exceptions,
2830 * IPython/genutils.py (page): Add a trap for OSError exceptions,
2823 sometimes seen by win2k/cygwin users.
2831 sometimes seen by win2k/cygwin users.
2824
2832
2825 2004-11-06 Fernando Perez <fperez@colorado.edu>
2833 2004-11-06 Fernando Perez <fperez@colorado.edu>
2826
2834
2827 * IPython/iplib.py (interact): Change the handling of %Exit from
2835 * IPython/iplib.py (interact): Change the handling of %Exit from
2828 trying to propagate a SystemExit to an internal ipython flag.
2836 trying to propagate a SystemExit to an internal ipython flag.
2829 This is less elegant than using Python's exception mechanism, but
2837 This is less elegant than using Python's exception mechanism, but
2830 I can't get that to work reliably with threads, so under -pylab
2838 I can't get that to work reliably with threads, so under -pylab
2831 %Exit was hanging IPython. Cross-thread exception handling is
2839 %Exit was hanging IPython. Cross-thread exception handling is
2832 really a bitch. Thaks to a bug report by Stephen Walton
2840 really a bitch. Thaks to a bug report by Stephen Walton
2833 <stephen.walton-AT-csun.edu>.
2841 <stephen.walton-AT-csun.edu>.
2834
2842
2835 2004-11-04 Fernando Perez <fperez@colorado.edu>
2843 2004-11-04 Fernando Perez <fperez@colorado.edu>
2836
2844
2837 * IPython/iplib.py (raw_input_original): store a pointer to the
2845 * IPython/iplib.py (raw_input_original): store a pointer to the
2838 true raw_input to harden against code which can modify it
2846 true raw_input to harden against code which can modify it
2839 (wx.py.PyShell does this and would otherwise crash ipython).
2847 (wx.py.PyShell does this and would otherwise crash ipython).
2840 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
2848 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
2841
2849
2842 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
2850 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
2843 Ctrl-C problem, which does not mess up the input line.
2851 Ctrl-C problem, which does not mess up the input line.
2844
2852
2845 2004-11-03 Fernando Perez <fperez@colorado.edu>
2853 2004-11-03 Fernando Perez <fperez@colorado.edu>
2846
2854
2847 * IPython/Release.py: Changed licensing to BSD, in all files.
2855 * IPython/Release.py: Changed licensing to BSD, in all files.
2848 (name): lowercase name for tarball/RPM release.
2856 (name): lowercase name for tarball/RPM release.
2849
2857
2850 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
2858 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
2851 use throughout ipython.
2859 use throughout ipython.
2852
2860
2853 * IPython/Magic.py (Magic._ofind): Switch to using the new
2861 * IPython/Magic.py (Magic._ofind): Switch to using the new
2854 OInspect.getdoc() function.
2862 OInspect.getdoc() function.
2855
2863
2856 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
2864 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
2857 of the line currently being canceled via Ctrl-C. It's extremely
2865 of the line currently being canceled via Ctrl-C. It's extremely
2858 ugly, but I don't know how to do it better (the problem is one of
2866 ugly, but I don't know how to do it better (the problem is one of
2859 handling cross-thread exceptions).
2867 handling cross-thread exceptions).
2860
2868
2861 2004-10-28 Fernando Perez <fperez@colorado.edu>
2869 2004-10-28 Fernando Perez <fperez@colorado.edu>
2862
2870
2863 * IPython/Shell.py (signal_handler): add signal handlers to trap
2871 * IPython/Shell.py (signal_handler): add signal handlers to trap
2864 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
2872 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
2865 report by Francesc Alted.
2873 report by Francesc Alted.
2866
2874
2867 2004-10-21 Fernando Perez <fperez@colorado.edu>
2875 2004-10-21 Fernando Perez <fperez@colorado.edu>
2868
2876
2869 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
2877 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
2870 to % for pysh syntax extensions.
2878 to % for pysh syntax extensions.
2871
2879
2872 2004-10-09 Fernando Perez <fperez@colorado.edu>
2880 2004-10-09 Fernando Perez <fperez@colorado.edu>
2873
2881
2874 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
2882 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
2875 arrays to print a more useful summary, without calling str(arr).
2883 arrays to print a more useful summary, without calling str(arr).
2876 This avoids the problem of extremely lengthy computations which
2884 This avoids the problem of extremely lengthy computations which
2877 occur if arr is large, and appear to the user as a system lockup
2885 occur if arr is large, and appear to the user as a system lockup
2878 with 100% cpu activity. After a suggestion by Kristian Sandberg
2886 with 100% cpu activity. After a suggestion by Kristian Sandberg
2879 <Kristian.Sandberg@colorado.edu>.
2887 <Kristian.Sandberg@colorado.edu>.
2880 (Magic.__init__): fix bug in global magic escapes not being
2888 (Magic.__init__): fix bug in global magic escapes not being
2881 correctly set.
2889 correctly set.
2882
2890
2883 2004-10-08 Fernando Perez <fperez@colorado.edu>
2891 2004-10-08 Fernando Perez <fperez@colorado.edu>
2884
2892
2885 * IPython/Magic.py (__license__): change to absolute imports of
2893 * IPython/Magic.py (__license__): change to absolute imports of
2886 ipython's own internal packages, to start adapting to the absolute
2894 ipython's own internal packages, to start adapting to the absolute
2887 import requirement of PEP-328.
2895 import requirement of PEP-328.
2888
2896
2889 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
2897 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
2890 files, and standardize author/license marks through the Release
2898 files, and standardize author/license marks through the Release
2891 module instead of having per/file stuff (except for files with
2899 module instead of having per/file stuff (except for files with
2892 particular licenses, like the MIT/PSF-licensed codes).
2900 particular licenses, like the MIT/PSF-licensed codes).
2893
2901
2894 * IPython/Debugger.py: remove dead code for python 2.1
2902 * IPython/Debugger.py: remove dead code for python 2.1
2895
2903
2896 2004-10-04 Fernando Perez <fperez@colorado.edu>
2904 2004-10-04 Fernando Perez <fperez@colorado.edu>
2897
2905
2898 * IPython/iplib.py (ipmagic): New function for accessing magics
2906 * IPython/iplib.py (ipmagic): New function for accessing magics
2899 via a normal python function call.
2907 via a normal python function call.
2900
2908
2901 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
2909 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
2902 from '@' to '%', to accomodate the new @decorator syntax of python
2910 from '@' to '%', to accomodate the new @decorator syntax of python
2903 2.4.
2911 2.4.
2904
2912
2905 2004-09-29 Fernando Perez <fperez@colorado.edu>
2913 2004-09-29 Fernando Perez <fperez@colorado.edu>
2906
2914
2907 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
2915 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
2908 matplotlib.use to prevent running scripts which try to switch
2916 matplotlib.use to prevent running scripts which try to switch
2909 interactive backends from within ipython. This will just crash
2917 interactive backends from within ipython. This will just crash
2910 the python interpreter, so we can't allow it (but a detailed error
2918 the python interpreter, so we can't allow it (but a detailed error
2911 is given to the user).
2919 is given to the user).
2912
2920
2913 2004-09-28 Fernando Perez <fperez@colorado.edu>
2921 2004-09-28 Fernando Perez <fperez@colorado.edu>
2914
2922
2915 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
2923 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
2916 matplotlib-related fixes so that using @run with non-matplotlib
2924 matplotlib-related fixes so that using @run with non-matplotlib
2917 scripts doesn't pop up spurious plot windows. This requires
2925 scripts doesn't pop up spurious plot windows. This requires
2918 matplotlib >= 0.63, where I had to make some changes as well.
2926 matplotlib >= 0.63, where I had to make some changes as well.
2919
2927
2920 * IPython/ipmaker.py (make_IPython): update version requirement to
2928 * IPython/ipmaker.py (make_IPython): update version requirement to
2921 python 2.2.
2929 python 2.2.
2922
2930
2923 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
2931 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
2924 banner arg for embedded customization.
2932 banner arg for embedded customization.
2925
2933
2926 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
2934 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
2927 explicit uses of __IP as the IPython's instance name. Now things
2935 explicit uses of __IP as the IPython's instance name. Now things
2928 are properly handled via the shell.name value. The actual code
2936 are properly handled via the shell.name value. The actual code
2929 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
2937 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
2930 is much better than before. I'll clean things completely when the
2938 is much better than before. I'll clean things completely when the
2931 magic stuff gets a real overhaul.
2939 magic stuff gets a real overhaul.
2932
2940
2933 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
2941 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
2934 minor changes to debian dir.
2942 minor changes to debian dir.
2935
2943
2936 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
2944 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
2937 pointer to the shell itself in the interactive namespace even when
2945 pointer to the shell itself in the interactive namespace even when
2938 a user-supplied dict is provided. This is needed for embedding
2946 a user-supplied dict is provided. This is needed for embedding
2939 purposes (found by tests with Michel Sanner).
2947 purposes (found by tests with Michel Sanner).
2940
2948
2941 2004-09-27 Fernando Perez <fperez@colorado.edu>
2949 2004-09-27 Fernando Perez <fperez@colorado.edu>
2942
2950
2943 * IPython/UserConfig/ipythonrc: remove []{} from
2951 * IPython/UserConfig/ipythonrc: remove []{} from
2944 readline_remove_delims, so that things like [modname.<TAB> do
2952 readline_remove_delims, so that things like [modname.<TAB> do
2945 proper completion. This disables [].TAB, but that's a less common
2953 proper completion. This disables [].TAB, but that's a less common
2946 case than module names in list comprehensions, for example.
2954 case than module names in list comprehensions, for example.
2947 Thanks to a report by Andrea Riciputi.
2955 Thanks to a report by Andrea Riciputi.
2948
2956
2949 2004-09-09 Fernando Perez <fperez@colorado.edu>
2957 2004-09-09 Fernando Perez <fperez@colorado.edu>
2950
2958
2951 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
2959 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
2952 blocking problems in win32 and osx. Fix by John.
2960 blocking problems in win32 and osx. Fix by John.
2953
2961
2954 2004-09-08 Fernando Perez <fperez@colorado.edu>
2962 2004-09-08 Fernando Perez <fperez@colorado.edu>
2955
2963
2956 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
2964 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
2957 for Win32 and OSX. Fix by John Hunter.
2965 for Win32 and OSX. Fix by John Hunter.
2958
2966
2959 2004-08-30 *** Released version 0.6.3
2967 2004-08-30 *** Released version 0.6.3
2960
2968
2961 2004-08-30 Fernando Perez <fperez@colorado.edu>
2969 2004-08-30 Fernando Perez <fperez@colorado.edu>
2962
2970
2963 * setup.py (isfile): Add manpages to list of dependent files to be
2971 * setup.py (isfile): Add manpages to list of dependent files to be
2964 updated.
2972 updated.
2965
2973
2966 2004-08-27 Fernando Perez <fperez@colorado.edu>
2974 2004-08-27 Fernando Perez <fperez@colorado.edu>
2967
2975
2968 * IPython/Shell.py (start): I've disabled -wthread and -gthread
2976 * IPython/Shell.py (start): I've disabled -wthread and -gthread
2969 for now. They don't really work with standalone WX/GTK code
2977 for now. They don't really work with standalone WX/GTK code
2970 (though matplotlib IS working fine with both of those backends).
2978 (though matplotlib IS working fine with both of those backends).
2971 This will neeed much more testing. I disabled most things with
2979 This will neeed much more testing. I disabled most things with
2972 comments, so turning it back on later should be pretty easy.
2980 comments, so turning it back on later should be pretty easy.
2973
2981
2974 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
2982 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
2975 autocalling of expressions like r'foo', by modifying the line
2983 autocalling of expressions like r'foo', by modifying the line
2976 split regexp. Closes
2984 split regexp. Closes
2977 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
2985 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
2978 Riley <ipythonbugs-AT-sabi.net>.
2986 Riley <ipythonbugs-AT-sabi.net>.
2979 (InteractiveShell.mainloop): honor --nobanner with banner
2987 (InteractiveShell.mainloop): honor --nobanner with banner
2980 extensions.
2988 extensions.
2981
2989
2982 * IPython/Shell.py: Significant refactoring of all classes, so
2990 * IPython/Shell.py: Significant refactoring of all classes, so
2983 that we can really support ALL matplotlib backends and threading
2991 that we can really support ALL matplotlib backends and threading
2984 models (John spotted a bug with Tk which required this). Now we
2992 models (John spotted a bug with Tk which required this). Now we
2985 should support single-threaded, WX-threads and GTK-threads, both
2993 should support single-threaded, WX-threads and GTK-threads, both
2986 for generic code and for matplotlib.
2994 for generic code and for matplotlib.
2987
2995
2988 * IPython/ipmaker.py (__call__): Changed -mpthread option to
2996 * IPython/ipmaker.py (__call__): Changed -mpthread option to
2989 -pylab, to simplify things for users. Will also remove the pylab
2997 -pylab, to simplify things for users. Will also remove the pylab
2990 profile, since now all of matplotlib configuration is directly
2998 profile, since now all of matplotlib configuration is directly
2991 handled here. This also reduces startup time.
2999 handled here. This also reduces startup time.
2992
3000
2993 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3001 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
2994 shell wasn't being correctly called. Also in IPShellWX.
3002 shell wasn't being correctly called. Also in IPShellWX.
2995
3003
2996 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3004 * IPython/iplib.py (InteractiveShell.__init__): Added option to
2997 fine-tune banner.
3005 fine-tune banner.
2998
3006
2999 * IPython/numutils.py (spike): Deprecate these spike functions,
3007 * IPython/numutils.py (spike): Deprecate these spike functions,
3000 delete (long deprecated) gnuplot_exec handler.
3008 delete (long deprecated) gnuplot_exec handler.
3001
3009
3002 2004-08-26 Fernando Perez <fperez@colorado.edu>
3010 2004-08-26 Fernando Perez <fperez@colorado.edu>
3003
3011
3004 * ipython.1: Update for threading options, plus some others which
3012 * ipython.1: Update for threading options, plus some others which
3005 were missing.
3013 were missing.
3006
3014
3007 * IPython/ipmaker.py (__call__): Added -wthread option for
3015 * IPython/ipmaker.py (__call__): Added -wthread option for
3008 wxpython thread handling. Make sure threading options are only
3016 wxpython thread handling. Make sure threading options are only
3009 valid at the command line.
3017 valid at the command line.
3010
3018
3011 * scripts/ipython: moved shell selection into a factory function
3019 * scripts/ipython: moved shell selection into a factory function
3012 in Shell.py, to keep the starter script to a minimum.
3020 in Shell.py, to keep the starter script to a minimum.
3013
3021
3014 2004-08-25 Fernando Perez <fperez@colorado.edu>
3022 2004-08-25 Fernando Perez <fperez@colorado.edu>
3015
3023
3016 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3024 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3017 John. Along with some recent changes he made to matplotlib, the
3025 John. Along with some recent changes he made to matplotlib, the
3018 next versions of both systems should work very well together.
3026 next versions of both systems should work very well together.
3019
3027
3020 2004-08-24 Fernando Perez <fperez@colorado.edu>
3028 2004-08-24 Fernando Perez <fperez@colorado.edu>
3021
3029
3022 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3030 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3023 tried to switch the profiling to using hotshot, but I'm getting
3031 tried to switch the profiling to using hotshot, but I'm getting
3024 strange errors from prof.runctx() there. I may be misreading the
3032 strange errors from prof.runctx() there. I may be misreading the
3025 docs, but it looks weird. For now the profiling code will
3033 docs, but it looks weird. For now the profiling code will
3026 continue to use the standard profiler.
3034 continue to use the standard profiler.
3027
3035
3028 2004-08-23 Fernando Perez <fperez@colorado.edu>
3036 2004-08-23 Fernando Perez <fperez@colorado.edu>
3029
3037
3030 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3038 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3031 threaded shell, by John Hunter. It's not quite ready yet, but
3039 threaded shell, by John Hunter. It's not quite ready yet, but
3032 close.
3040 close.
3033
3041
3034 2004-08-22 Fernando Perez <fperez@colorado.edu>
3042 2004-08-22 Fernando Perez <fperez@colorado.edu>
3035
3043
3036 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3044 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3037 in Magic and ultraTB.
3045 in Magic and ultraTB.
3038
3046
3039 * ipython.1: document threading options in manpage.
3047 * ipython.1: document threading options in manpage.
3040
3048
3041 * scripts/ipython: Changed name of -thread option to -gthread,
3049 * scripts/ipython: Changed name of -thread option to -gthread,
3042 since this is GTK specific. I want to leave the door open for a
3050 since this is GTK specific. I want to leave the door open for a
3043 -wthread option for WX, which will most likely be necessary. This
3051 -wthread option for WX, which will most likely be necessary. This
3044 change affects usage and ipmaker as well.
3052 change affects usage and ipmaker as well.
3045
3053
3046 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3054 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3047 handle the matplotlib shell issues. Code by John Hunter
3055 handle the matplotlib shell issues. Code by John Hunter
3048 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3056 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3049 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3057 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3050 broken (and disabled for end users) for now, but it puts the
3058 broken (and disabled for end users) for now, but it puts the
3051 infrastructure in place.
3059 infrastructure in place.
3052
3060
3053 2004-08-21 Fernando Perez <fperez@colorado.edu>
3061 2004-08-21 Fernando Perez <fperez@colorado.edu>
3054
3062
3055 * ipythonrc-pylab: Add matplotlib support.
3063 * ipythonrc-pylab: Add matplotlib support.
3056
3064
3057 * matplotlib_config.py: new files for matplotlib support, part of
3065 * matplotlib_config.py: new files for matplotlib support, part of
3058 the pylab profile.
3066 the pylab profile.
3059
3067
3060 * IPython/usage.py (__doc__): documented the threading options.
3068 * IPython/usage.py (__doc__): documented the threading options.
3061
3069
3062 2004-08-20 Fernando Perez <fperez@colorado.edu>
3070 2004-08-20 Fernando Perez <fperez@colorado.edu>
3063
3071
3064 * ipython: Modified the main calling routine to handle the -thread
3072 * ipython: Modified the main calling routine to handle the -thread
3065 and -mpthread options. This needs to be done as a top-level hack,
3073 and -mpthread options. This needs to be done as a top-level hack,
3066 because it determines which class to instantiate for IPython
3074 because it determines which class to instantiate for IPython
3067 itself.
3075 itself.
3068
3076
3069 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3077 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3070 classes to support multithreaded GTK operation without blocking,
3078 classes to support multithreaded GTK operation without blocking,
3071 and matplotlib with all backends. This is a lot of still very
3079 and matplotlib with all backends. This is a lot of still very
3072 experimental code, and threads are tricky. So it may still have a
3080 experimental code, and threads are tricky. So it may still have a
3073 few rough edges... This code owes a lot to
3081 few rough edges... This code owes a lot to
3074 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3082 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3075 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3083 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3076 to John Hunter for all the matplotlib work.
3084 to John Hunter for all the matplotlib work.
3077
3085
3078 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3086 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3079 options for gtk thread and matplotlib support.
3087 options for gtk thread and matplotlib support.
3080
3088
3081 2004-08-16 Fernando Perez <fperez@colorado.edu>
3089 2004-08-16 Fernando Perez <fperez@colorado.edu>
3082
3090
3083 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3091 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3084 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3092 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3085 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3093 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3086
3094
3087 2004-08-11 Fernando Perez <fperez@colorado.edu>
3095 2004-08-11 Fernando Perez <fperez@colorado.edu>
3088
3096
3089 * setup.py (isfile): Fix build so documentation gets updated for
3097 * setup.py (isfile): Fix build so documentation gets updated for
3090 rpms (it was only done for .tgz builds).
3098 rpms (it was only done for .tgz builds).
3091
3099
3092 2004-08-10 Fernando Perez <fperez@colorado.edu>
3100 2004-08-10 Fernando Perez <fperez@colorado.edu>
3093
3101
3094 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3102 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3095
3103
3096 * iplib.py : Silence syntax error exceptions in tab-completion.
3104 * iplib.py : Silence syntax error exceptions in tab-completion.
3097
3105
3098 2004-08-05 Fernando Perez <fperez@colorado.edu>
3106 2004-08-05 Fernando Perez <fperez@colorado.edu>
3099
3107
3100 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3108 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3101 'color off' mark for continuation prompts. This was causing long
3109 'color off' mark for continuation prompts. This was causing long
3102 continuation lines to mis-wrap.
3110 continuation lines to mis-wrap.
3103
3111
3104 2004-08-01 Fernando Perez <fperez@colorado.edu>
3112 2004-08-01 Fernando Perez <fperez@colorado.edu>
3105
3113
3106 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3114 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3107 for building ipython to be a parameter. All this is necessary
3115 for building ipython to be a parameter. All this is necessary
3108 right now to have a multithreaded version, but this insane
3116 right now to have a multithreaded version, but this insane
3109 non-design will be cleaned up soon. For now, it's a hack that
3117 non-design will be cleaned up soon. For now, it's a hack that
3110 works.
3118 works.
3111
3119
3112 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3120 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3113 args in various places. No bugs so far, but it's a dangerous
3121 args in various places. No bugs so far, but it's a dangerous
3114 practice.
3122 practice.
3115
3123
3116 2004-07-31 Fernando Perez <fperez@colorado.edu>
3124 2004-07-31 Fernando Perez <fperez@colorado.edu>
3117
3125
3118 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3126 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3119 fix completion of files with dots in their names under most
3127 fix completion of files with dots in their names under most
3120 profiles (pysh was OK because the completion order is different).
3128 profiles (pysh was OK because the completion order is different).
3121
3129
3122 2004-07-27 Fernando Perez <fperez@colorado.edu>
3130 2004-07-27 Fernando Perez <fperez@colorado.edu>
3123
3131
3124 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3132 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3125 keywords manually, b/c the one in keyword.py was removed in python
3133 keywords manually, b/c the one in keyword.py was removed in python
3126 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3134 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3127 This is NOT a bug under python 2.3 and earlier.
3135 This is NOT a bug under python 2.3 and earlier.
3128
3136
3129 2004-07-26 Fernando Perez <fperez@colorado.edu>
3137 2004-07-26 Fernando Perez <fperez@colorado.edu>
3130
3138
3131 * IPython/ultraTB.py (VerboseTB.text): Add another
3139 * IPython/ultraTB.py (VerboseTB.text): Add another
3132 linecache.checkcache() call to try to prevent inspect.py from
3140 linecache.checkcache() call to try to prevent inspect.py from
3133 crashing under python 2.3. I think this fixes
3141 crashing under python 2.3. I think this fixes
3134 http://www.scipy.net/roundup/ipython/issue17.
3142 http://www.scipy.net/roundup/ipython/issue17.
3135
3143
3136 2004-07-26 *** Released version 0.6.2
3144 2004-07-26 *** Released version 0.6.2
3137
3145
3138 2004-07-26 Fernando Perez <fperez@colorado.edu>
3146 2004-07-26 Fernando Perez <fperez@colorado.edu>
3139
3147
3140 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3148 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3141 fail for any number.
3149 fail for any number.
3142 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3150 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3143 empty bookmarks.
3151 empty bookmarks.
3144
3152
3145 2004-07-26 *** Released version 0.6.1
3153 2004-07-26 *** Released version 0.6.1
3146
3154
3147 2004-07-26 Fernando Perez <fperez@colorado.edu>
3155 2004-07-26 Fernando Perez <fperez@colorado.edu>
3148
3156
3149 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3157 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3150
3158
3151 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3159 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3152 escaping '()[]{}' in filenames.
3160 escaping '()[]{}' in filenames.
3153
3161
3154 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3162 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3155 Python 2.2 users who lack a proper shlex.split.
3163 Python 2.2 users who lack a proper shlex.split.
3156
3164
3157 2004-07-19 Fernando Perez <fperez@colorado.edu>
3165 2004-07-19 Fernando Perez <fperez@colorado.edu>
3158
3166
3159 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3167 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3160 for reading readline's init file. I follow the normal chain:
3168 for reading readline's init file. I follow the normal chain:
3161 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3169 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3162 report by Mike Heeter. This closes
3170 report by Mike Heeter. This closes
3163 http://www.scipy.net/roundup/ipython/issue16.
3171 http://www.scipy.net/roundup/ipython/issue16.
3164
3172
3165 2004-07-18 Fernando Perez <fperez@colorado.edu>
3173 2004-07-18 Fernando Perez <fperez@colorado.edu>
3166
3174
3167 * IPython/iplib.py (__init__): Add better handling of '\' under
3175 * IPython/iplib.py (__init__): Add better handling of '\' under
3168 Win32 for filenames. After a patch by Ville.
3176 Win32 for filenames. After a patch by Ville.
3169
3177
3170 2004-07-17 Fernando Perez <fperez@colorado.edu>
3178 2004-07-17 Fernando Perez <fperez@colorado.edu>
3171
3179
3172 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3180 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3173 autocalling would be triggered for 'foo is bar' if foo is
3181 autocalling would be triggered for 'foo is bar' if foo is
3174 callable. I also cleaned up the autocall detection code to use a
3182 callable. I also cleaned up the autocall detection code to use a
3175 regexp, which is faster. Bug reported by Alexander Schmolck.
3183 regexp, which is faster. Bug reported by Alexander Schmolck.
3176
3184
3177 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3185 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3178 '?' in them would confuse the help system. Reported by Alex
3186 '?' in them would confuse the help system. Reported by Alex
3179 Schmolck.
3187 Schmolck.
3180
3188
3181 2004-07-16 Fernando Perez <fperez@colorado.edu>
3189 2004-07-16 Fernando Perez <fperez@colorado.edu>
3182
3190
3183 * IPython/GnuplotInteractive.py (__all__): added plot2.
3191 * IPython/GnuplotInteractive.py (__all__): added plot2.
3184
3192
3185 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3193 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3186 plotting dictionaries, lists or tuples of 1d arrays.
3194 plotting dictionaries, lists or tuples of 1d arrays.
3187
3195
3188 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3196 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3189 optimizations.
3197 optimizations.
3190
3198
3191 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3199 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3192 the information which was there from Janko's original IPP code:
3200 the information which was there from Janko's original IPP code:
3193
3201
3194 03.05.99 20:53 porto.ifm.uni-kiel.de
3202 03.05.99 20:53 porto.ifm.uni-kiel.de
3195 --Started changelog.
3203 --Started changelog.
3196 --make clear do what it say it does
3204 --make clear do what it say it does
3197 --added pretty output of lines from inputcache
3205 --added pretty output of lines from inputcache
3198 --Made Logger a mixin class, simplifies handling of switches
3206 --Made Logger a mixin class, simplifies handling of switches
3199 --Added own completer class. .string<TAB> expands to last history
3207 --Added own completer class. .string<TAB> expands to last history
3200 line which starts with string. The new expansion is also present
3208 line which starts with string. The new expansion is also present
3201 with Ctrl-r from the readline library. But this shows, who this
3209 with Ctrl-r from the readline library. But this shows, who this
3202 can be done for other cases.
3210 can be done for other cases.
3203 --Added convention that all shell functions should accept a
3211 --Added convention that all shell functions should accept a
3204 parameter_string This opens the door for different behaviour for
3212 parameter_string This opens the door for different behaviour for
3205 each function. @cd is a good example of this.
3213 each function. @cd is a good example of this.
3206
3214
3207 04.05.99 12:12 porto.ifm.uni-kiel.de
3215 04.05.99 12:12 porto.ifm.uni-kiel.de
3208 --added logfile rotation
3216 --added logfile rotation
3209 --added new mainloop method which freezes first the namespace
3217 --added new mainloop method which freezes first the namespace
3210
3218
3211 07.05.99 21:24 porto.ifm.uni-kiel.de
3219 07.05.99 21:24 porto.ifm.uni-kiel.de
3212 --added the docreader classes. Now there is a help system.
3220 --added the docreader classes. Now there is a help system.
3213 -This is only a first try. Currently it's not easy to put new
3221 -This is only a first try. Currently it's not easy to put new
3214 stuff in the indices. But this is the way to go. Info would be
3222 stuff in the indices. But this is the way to go. Info would be
3215 better, but HTML is every where and not everybody has an info
3223 better, but HTML is every where and not everybody has an info
3216 system installed and it's not so easy to change html-docs to info.
3224 system installed and it's not so easy to change html-docs to info.
3217 --added global logfile option
3225 --added global logfile option
3218 --there is now a hook for object inspection method pinfo needs to
3226 --there is now a hook for object inspection method pinfo needs to
3219 be provided for this. Can be reached by two '??'.
3227 be provided for this. Can be reached by two '??'.
3220
3228
3221 08.05.99 20:51 porto.ifm.uni-kiel.de
3229 08.05.99 20:51 porto.ifm.uni-kiel.de
3222 --added a README
3230 --added a README
3223 --bug in rc file. Something has changed so functions in the rc
3231 --bug in rc file. Something has changed so functions in the rc
3224 file need to reference the shell and not self. Not clear if it's a
3232 file need to reference the shell and not self. Not clear if it's a
3225 bug or feature.
3233 bug or feature.
3226 --changed rc file for new behavior
3234 --changed rc file for new behavior
3227
3235
3228 2004-07-15 Fernando Perez <fperez@colorado.edu>
3236 2004-07-15 Fernando Perez <fperez@colorado.edu>
3229
3237
3230 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3238 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3231 cache was falling out of sync in bizarre manners when multi-line
3239 cache was falling out of sync in bizarre manners when multi-line
3232 input was present. Minor optimizations and cleanup.
3240 input was present. Minor optimizations and cleanup.
3233
3241
3234 (Logger): Remove old Changelog info for cleanup. This is the
3242 (Logger): Remove old Changelog info for cleanup. This is the
3235 information which was there from Janko's original code:
3243 information which was there from Janko's original code:
3236
3244
3237 Changes to Logger: - made the default log filename a parameter
3245 Changes to Logger: - made the default log filename a parameter
3238
3246
3239 - put a check for lines beginning with !@? in log(). Needed
3247 - put a check for lines beginning with !@? in log(). Needed
3240 (even if the handlers properly log their lines) for mid-session
3248 (even if the handlers properly log their lines) for mid-session
3241 logging activation to work properly. Without this, lines logged
3249 logging activation to work properly. Without this, lines logged
3242 in mid session, which get read from the cache, would end up
3250 in mid session, which get read from the cache, would end up
3243 'bare' (with !@? in the open) in the log. Now they are caught
3251 'bare' (with !@? in the open) in the log. Now they are caught
3244 and prepended with a #.
3252 and prepended with a #.
3245
3253
3246 * IPython/iplib.py (InteractiveShell.init_readline): added check
3254 * IPython/iplib.py (InteractiveShell.init_readline): added check
3247 in case MagicCompleter fails to be defined, so we don't crash.
3255 in case MagicCompleter fails to be defined, so we don't crash.
3248
3256
3249 2004-07-13 Fernando Perez <fperez@colorado.edu>
3257 2004-07-13 Fernando Perez <fperez@colorado.edu>
3250
3258
3251 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3259 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3252 of EPS if the requested filename ends in '.eps'.
3260 of EPS if the requested filename ends in '.eps'.
3253
3261
3254 2004-07-04 Fernando Perez <fperez@colorado.edu>
3262 2004-07-04 Fernando Perez <fperez@colorado.edu>
3255
3263
3256 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3264 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3257 escaping of quotes when calling the shell.
3265 escaping of quotes when calling the shell.
3258
3266
3259 2004-07-02 Fernando Perez <fperez@colorado.edu>
3267 2004-07-02 Fernando Perez <fperez@colorado.edu>
3260
3268
3261 * IPython/Prompts.py (CachedOutput.update): Fix problem with
3269 * IPython/Prompts.py (CachedOutput.update): Fix problem with
3262 gettext not working because we were clobbering '_'. Fixes
3270 gettext not working because we were clobbering '_'. Fixes
3263 http://www.scipy.net/roundup/ipython/issue6.
3271 http://www.scipy.net/roundup/ipython/issue6.
3264
3272
3265 2004-07-01 Fernando Perez <fperez@colorado.edu>
3273 2004-07-01 Fernando Perez <fperez@colorado.edu>
3266
3274
3267 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
3275 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
3268 into @cd. Patch by Ville.
3276 into @cd. Patch by Ville.
3269
3277
3270 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3278 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3271 new function to store things after ipmaker runs. Patch by Ville.
3279 new function to store things after ipmaker runs. Patch by Ville.
3272 Eventually this will go away once ipmaker is removed and the class
3280 Eventually this will go away once ipmaker is removed and the class
3273 gets cleaned up, but for now it's ok. Key functionality here is
3281 gets cleaned up, but for now it's ok. Key functionality here is
3274 the addition of the persistent storage mechanism, a dict for
3282 the addition of the persistent storage mechanism, a dict for
3275 keeping data across sessions (for now just bookmarks, but more can
3283 keeping data across sessions (for now just bookmarks, but more can
3276 be implemented later).
3284 be implemented later).
3277
3285
3278 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
3286 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
3279 persistent across sections. Patch by Ville, I modified it
3287 persistent across sections. Patch by Ville, I modified it
3280 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
3288 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
3281 added a '-l' option to list all bookmarks.
3289 added a '-l' option to list all bookmarks.
3282
3290
3283 * IPython/iplib.py (InteractiveShell.atexit_operations): new
3291 * IPython/iplib.py (InteractiveShell.atexit_operations): new
3284 center for cleanup. Registered with atexit.register(). I moved
3292 center for cleanup. Registered with atexit.register(). I moved
3285 here the old exit_cleanup(). After a patch by Ville.
3293 here the old exit_cleanup(). After a patch by Ville.
3286
3294
3287 * IPython/Magic.py (get_py_filename): added '~' to the accepted
3295 * IPython/Magic.py (get_py_filename): added '~' to the accepted
3288 characters in the hacked shlex_split for python 2.2.
3296 characters in the hacked shlex_split for python 2.2.
3289
3297
3290 * IPython/iplib.py (file_matches): more fixes to filenames with
3298 * IPython/iplib.py (file_matches): more fixes to filenames with
3291 whitespace in them. It's not perfect, but limitations in python's
3299 whitespace in them. It's not perfect, but limitations in python's
3292 readline make it impossible to go further.
3300 readline make it impossible to go further.
3293
3301
3294 2004-06-29 Fernando Perez <fperez@colorado.edu>
3302 2004-06-29 Fernando Perez <fperez@colorado.edu>
3295
3303
3296 * IPython/iplib.py (file_matches): escape whitespace correctly in
3304 * IPython/iplib.py (file_matches): escape whitespace correctly in
3297 filename completions. Bug reported by Ville.
3305 filename completions. Bug reported by Ville.
3298
3306
3299 2004-06-28 Fernando Perez <fperez@colorado.edu>
3307 2004-06-28 Fernando Perez <fperez@colorado.edu>
3300
3308
3301 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
3309 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
3302 the history file will be called 'history-PROFNAME' (or just
3310 the history file will be called 'history-PROFNAME' (or just
3303 'history' if no profile is loaded). I was getting annoyed at
3311 'history' if no profile is loaded). I was getting annoyed at
3304 getting my Numerical work history clobbered by pysh sessions.
3312 getting my Numerical work history clobbered by pysh sessions.
3305
3313
3306 * IPython/iplib.py (InteractiveShell.__init__): Internal
3314 * IPython/iplib.py (InteractiveShell.__init__): Internal
3307 getoutputerror() function so that we can honor the system_verbose
3315 getoutputerror() function so that we can honor the system_verbose
3308 flag for _all_ system calls. I also added escaping of #
3316 flag for _all_ system calls. I also added escaping of #
3309 characters here to avoid confusing Itpl.
3317 characters here to avoid confusing Itpl.
3310
3318
3311 * IPython/Magic.py (shlex_split): removed call to shell in
3319 * IPython/Magic.py (shlex_split): removed call to shell in
3312 parse_options and replaced it with shlex.split(). The annoying
3320 parse_options and replaced it with shlex.split(). The annoying
3313 part was that in Python 2.2, shlex.split() doesn't exist, so I had
3321 part was that in Python 2.2, shlex.split() doesn't exist, so I had
3314 to backport it from 2.3, with several frail hacks (the shlex
3322 to backport it from 2.3, with several frail hacks (the shlex
3315 module is rather limited in 2.2). Thanks to a suggestion by Ville
3323 module is rather limited in 2.2). Thanks to a suggestion by Ville
3316 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
3324 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
3317 problem.
3325 problem.
3318
3326
3319 (Magic.magic_system_verbose): new toggle to print the actual
3327 (Magic.magic_system_verbose): new toggle to print the actual
3320 system calls made by ipython. Mainly for debugging purposes.
3328 system calls made by ipython. Mainly for debugging purposes.
3321
3329
3322 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
3330 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
3323 doesn't support persistence. Reported (and fix suggested) by
3331 doesn't support persistence. Reported (and fix suggested) by
3324 Travis Caldwell <travis_caldwell2000@yahoo.com>.
3332 Travis Caldwell <travis_caldwell2000@yahoo.com>.
3325
3333
3326 2004-06-26 Fernando Perez <fperez@colorado.edu>
3334 2004-06-26 Fernando Perez <fperez@colorado.edu>
3327
3335
3328 * IPython/Logger.py (Logger.log): fix to handle correctly empty
3336 * IPython/Logger.py (Logger.log): fix to handle correctly empty
3329 continue prompts.
3337 continue prompts.
3330
3338
3331 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
3339 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
3332 function (basically a big docstring) and a few more things here to
3340 function (basically a big docstring) and a few more things here to
3333 speedup startup. pysh.py is now very lightweight. We want because
3341 speedup startup. pysh.py is now very lightweight. We want because
3334 it gets execfile'd, while InterpreterExec gets imported, so
3342 it gets execfile'd, while InterpreterExec gets imported, so
3335 byte-compilation saves time.
3343 byte-compilation saves time.
3336
3344
3337 2004-06-25 Fernando Perez <fperez@colorado.edu>
3345 2004-06-25 Fernando Perez <fperez@colorado.edu>
3338
3346
3339 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
3347 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
3340 -NUM', which was recently broken.
3348 -NUM', which was recently broken.
3341
3349
3342 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
3350 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
3343 in multi-line input (but not !!, which doesn't make sense there).
3351 in multi-line input (but not !!, which doesn't make sense there).
3344
3352
3345 * IPython/UserConfig/ipythonrc: made autoindent on by default.
3353 * IPython/UserConfig/ipythonrc: made autoindent on by default.
3346 It's just too useful, and people can turn it off in the less
3354 It's just too useful, and people can turn it off in the less
3347 common cases where it's a problem.
3355 common cases where it's a problem.
3348
3356
3349 2004-06-24 Fernando Perez <fperez@colorado.edu>
3357 2004-06-24 Fernando Perez <fperez@colorado.edu>
3350
3358
3351 * IPython/iplib.py (InteractiveShell._prefilter): big change -
3359 * IPython/iplib.py (InteractiveShell._prefilter): big change -
3352 special syntaxes (like alias calling) is now allied in multi-line
3360 special syntaxes (like alias calling) is now allied in multi-line
3353 input. This is still _very_ experimental, but it's necessary for
3361 input. This is still _very_ experimental, but it's necessary for
3354 efficient shell usage combining python looping syntax with system
3362 efficient shell usage combining python looping syntax with system
3355 calls. For now it's restricted to aliases, I don't think it
3363 calls. For now it's restricted to aliases, I don't think it
3356 really even makes sense to have this for magics.
3364 really even makes sense to have this for magics.
3357
3365
3358 2004-06-23 Fernando Perez <fperez@colorado.edu>
3366 2004-06-23 Fernando Perez <fperez@colorado.edu>
3359
3367
3360 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
3368 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
3361 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
3369 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
3362
3370
3363 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
3371 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
3364 extensions under Windows (after code sent by Gary Bishop). The
3372 extensions under Windows (after code sent by Gary Bishop). The
3365 extensions considered 'executable' are stored in IPython's rc
3373 extensions considered 'executable' are stored in IPython's rc
3366 structure as win_exec_ext.
3374 structure as win_exec_ext.
3367
3375
3368 * IPython/genutils.py (shell): new function, like system() but
3376 * IPython/genutils.py (shell): new function, like system() but
3369 without return value. Very useful for interactive shell work.
3377 without return value. Very useful for interactive shell work.
3370
3378
3371 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
3379 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
3372 delete aliases.
3380 delete aliases.
3373
3381
3374 * IPython/iplib.py (InteractiveShell.alias_table_update): make
3382 * IPython/iplib.py (InteractiveShell.alias_table_update): make
3375 sure that the alias table doesn't contain python keywords.
3383 sure that the alias table doesn't contain python keywords.
3376
3384
3377 2004-06-21 Fernando Perez <fperez@colorado.edu>
3385 2004-06-21 Fernando Perez <fperez@colorado.edu>
3378
3386
3379 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
3387 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
3380 non-existent items are found in $PATH. Reported by Thorsten.
3388 non-existent items are found in $PATH. Reported by Thorsten.
3381
3389
3382 2004-06-20 Fernando Perez <fperez@colorado.edu>
3390 2004-06-20 Fernando Perez <fperez@colorado.edu>
3383
3391
3384 * IPython/iplib.py (complete): modified the completer so that the
3392 * IPython/iplib.py (complete): modified the completer so that the
3385 order of priorities can be easily changed at runtime.
3393 order of priorities can be easily changed at runtime.
3386
3394
3387 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
3395 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
3388 Modified to auto-execute all lines beginning with '~', '/' or '.'.
3396 Modified to auto-execute all lines beginning with '~', '/' or '.'.
3389
3397
3390 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
3398 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
3391 expand Python variables prepended with $ in all system calls. The
3399 expand Python variables prepended with $ in all system calls. The
3392 same was done to InteractiveShell.handle_shell_escape. Now all
3400 same was done to InteractiveShell.handle_shell_escape. Now all
3393 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
3401 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
3394 expansion of python variables and expressions according to the
3402 expansion of python variables and expressions according to the
3395 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
3403 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
3396
3404
3397 Though PEP-215 has been rejected, a similar (but simpler) one
3405 Though PEP-215 has been rejected, a similar (but simpler) one
3398 seems like it will go into Python 2.4, PEP-292 -
3406 seems like it will go into Python 2.4, PEP-292 -
3399 http://www.python.org/peps/pep-0292.html.
3407 http://www.python.org/peps/pep-0292.html.
3400
3408
3401 I'll keep the full syntax of PEP-215, since IPython has since the
3409 I'll keep the full syntax of PEP-215, since IPython has since the
3402 start used Ka-Ping Yee's reference implementation discussed there
3410 start used Ka-Ping Yee's reference implementation discussed there
3403 (Itpl), and I actually like the powerful semantics it offers.
3411 (Itpl), and I actually like the powerful semantics it offers.
3404
3412
3405 In order to access normal shell variables, the $ has to be escaped
3413 In order to access normal shell variables, the $ has to be escaped
3406 via an extra $. For example:
3414 via an extra $. For example:
3407
3415
3408 In [7]: PATH='a python variable'
3416 In [7]: PATH='a python variable'
3409
3417
3410 In [8]: !echo $PATH
3418 In [8]: !echo $PATH
3411 a python variable
3419 a python variable
3412
3420
3413 In [9]: !echo $$PATH
3421 In [9]: !echo $$PATH
3414 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
3422 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
3415
3423
3416 (Magic.parse_options): escape $ so the shell doesn't evaluate
3424 (Magic.parse_options): escape $ so the shell doesn't evaluate
3417 things prematurely.
3425 things prematurely.
3418
3426
3419 * IPython/iplib.py (InteractiveShell.call_alias): added the
3427 * IPython/iplib.py (InteractiveShell.call_alias): added the
3420 ability for aliases to expand python variables via $.
3428 ability for aliases to expand python variables via $.
3421
3429
3422 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
3430 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
3423 system, now there's a @rehash/@rehashx pair of magics. These work
3431 system, now there's a @rehash/@rehashx pair of magics. These work
3424 like the csh rehash command, and can be invoked at any time. They
3432 like the csh rehash command, and can be invoked at any time. They
3425 build a table of aliases to everything in the user's $PATH
3433 build a table of aliases to everything in the user's $PATH
3426 (@rehash uses everything, @rehashx is slower but only adds
3434 (@rehash uses everything, @rehashx is slower but only adds
3427 executable files). With this, the pysh.py-based shell profile can
3435 executable files). With this, the pysh.py-based shell profile can
3428 now simply call rehash upon startup, and full access to all
3436 now simply call rehash upon startup, and full access to all
3429 programs in the user's path is obtained.
3437 programs in the user's path is obtained.
3430
3438
3431 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
3439 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
3432 functionality is now fully in place. I removed the old dynamic
3440 functionality is now fully in place. I removed the old dynamic
3433 code generation based approach, in favor of a much lighter one
3441 code generation based approach, in favor of a much lighter one
3434 based on a simple dict. The advantage is that this allows me to
3442 based on a simple dict. The advantage is that this allows me to
3435 now have thousands of aliases with negligible cost (unthinkable
3443 now have thousands of aliases with negligible cost (unthinkable
3436 with the old system).
3444 with the old system).
3437
3445
3438 2004-06-19 Fernando Perez <fperez@colorado.edu>
3446 2004-06-19 Fernando Perez <fperez@colorado.edu>
3439
3447
3440 * IPython/iplib.py (__init__): extended MagicCompleter class to
3448 * IPython/iplib.py (__init__): extended MagicCompleter class to
3441 also complete (last in priority) on user aliases.
3449 also complete (last in priority) on user aliases.
3442
3450
3443 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
3451 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
3444 call to eval.
3452 call to eval.
3445 (ItplNS.__init__): Added a new class which functions like Itpl,
3453 (ItplNS.__init__): Added a new class which functions like Itpl,
3446 but allows configuring the namespace for the evaluation to occur
3454 but allows configuring the namespace for the evaluation to occur
3447 in.
3455 in.
3448
3456
3449 2004-06-18 Fernando Perez <fperez@colorado.edu>
3457 2004-06-18 Fernando Perez <fperez@colorado.edu>
3450
3458
3451 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
3459 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
3452 better message when 'exit' or 'quit' are typed (a common newbie
3460 better message when 'exit' or 'quit' are typed (a common newbie
3453 confusion).
3461 confusion).
3454
3462
3455 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
3463 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
3456 check for Windows users.
3464 check for Windows users.
3457
3465
3458 * IPython/iplib.py (InteractiveShell.user_setup): removed
3466 * IPython/iplib.py (InteractiveShell.user_setup): removed
3459 disabling of colors for Windows. I'll test at runtime and issue a
3467 disabling of colors for Windows. I'll test at runtime and issue a
3460 warning if Gary's readline isn't found, as to nudge users to
3468 warning if Gary's readline isn't found, as to nudge users to
3461 download it.
3469 download it.
3462
3470
3463 2004-06-16 Fernando Perez <fperez@colorado.edu>
3471 2004-06-16 Fernando Perez <fperez@colorado.edu>
3464
3472
3465 * IPython/genutils.py (Stream.__init__): changed to print errors
3473 * IPython/genutils.py (Stream.__init__): changed to print errors
3466 to sys.stderr. I had a circular dependency here. Now it's
3474 to sys.stderr. I had a circular dependency here. Now it's
3467 possible to run ipython as IDLE's shell (consider this pre-alpha,
3475 possible to run ipython as IDLE's shell (consider this pre-alpha,
3468 since true stdout things end up in the starting terminal instead
3476 since true stdout things end up in the starting terminal instead
3469 of IDLE's out).
3477 of IDLE's out).
3470
3478
3471 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
3479 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
3472 users who haven't # updated their prompt_in2 definitions. Remove
3480 users who haven't # updated their prompt_in2 definitions. Remove
3473 eventually.
3481 eventually.
3474 (multiple_replace): added credit to original ASPN recipe.
3482 (multiple_replace): added credit to original ASPN recipe.
3475
3483
3476 2004-06-15 Fernando Perez <fperez@colorado.edu>
3484 2004-06-15 Fernando Perez <fperez@colorado.edu>
3477
3485
3478 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
3486 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
3479 list of auto-defined aliases.
3487 list of auto-defined aliases.
3480
3488
3481 2004-06-13 Fernando Perez <fperez@colorado.edu>
3489 2004-06-13 Fernando Perez <fperez@colorado.edu>
3482
3490
3483 * setup.py (scriptfiles): Don't trigger win_post_install unless an
3491 * setup.py (scriptfiles): Don't trigger win_post_install unless an
3484 install was really requested (so setup.py can be used for other
3492 install was really requested (so setup.py can be used for other
3485 things under Windows).
3493 things under Windows).
3486
3494
3487 2004-06-10 Fernando Perez <fperez@colorado.edu>
3495 2004-06-10 Fernando Perez <fperez@colorado.edu>
3488
3496
3489 * IPython/Logger.py (Logger.create_log): Manually remove any old
3497 * IPython/Logger.py (Logger.create_log): Manually remove any old
3490 backup, since os.remove may fail under Windows. Fixes bug
3498 backup, since os.remove may fail under Windows. Fixes bug
3491 reported by Thorsten.
3499 reported by Thorsten.
3492
3500
3493 2004-06-09 Fernando Perez <fperez@colorado.edu>
3501 2004-06-09 Fernando Perez <fperez@colorado.edu>
3494
3502
3495 * examples/example-embed.py: fixed all references to %n (replaced
3503 * examples/example-embed.py: fixed all references to %n (replaced
3496 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
3504 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
3497 for all examples and the manual as well.
3505 for all examples and the manual as well.
3498
3506
3499 2004-06-08 Fernando Perez <fperez@colorado.edu>
3507 2004-06-08 Fernando Perez <fperez@colorado.edu>
3500
3508
3501 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
3509 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
3502 alignment and color management. All 3 prompt subsystems now
3510 alignment and color management. All 3 prompt subsystems now
3503 inherit from BasePrompt.
3511 inherit from BasePrompt.
3504
3512
3505 * tools/release: updates for windows installer build and tag rpms
3513 * tools/release: updates for windows installer build and tag rpms
3506 with python version (since paths are fixed).
3514 with python version (since paths are fixed).
3507
3515
3508 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
3516 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
3509 which will become eventually obsolete. Also fixed the default
3517 which will become eventually obsolete. Also fixed the default
3510 prompt_in2 to use \D, so at least new users start with the correct
3518 prompt_in2 to use \D, so at least new users start with the correct
3511 defaults.
3519 defaults.
3512 WARNING: Users with existing ipythonrc files will need to apply
3520 WARNING: Users with existing ipythonrc files will need to apply
3513 this fix manually!
3521 this fix manually!
3514
3522
3515 * setup.py: make windows installer (.exe). This is finally the
3523 * setup.py: make windows installer (.exe). This is finally the
3516 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
3524 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
3517 which I hadn't included because it required Python 2.3 (or recent
3525 which I hadn't included because it required Python 2.3 (or recent
3518 distutils).
3526 distutils).
3519
3527
3520 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
3528 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
3521 usage of new '\D' escape.
3529 usage of new '\D' escape.
3522
3530
3523 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
3531 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
3524 lacks os.getuid())
3532 lacks os.getuid())
3525 (CachedOutput.set_colors): Added the ability to turn coloring
3533 (CachedOutput.set_colors): Added the ability to turn coloring
3526 on/off with @colors even for manually defined prompt colors. It
3534 on/off with @colors even for manually defined prompt colors. It
3527 uses a nasty global, but it works safely and via the generic color
3535 uses a nasty global, but it works safely and via the generic color
3528 handling mechanism.
3536 handling mechanism.
3529 (Prompt2.__init__): Introduced new escape '\D' for continuation
3537 (Prompt2.__init__): Introduced new escape '\D' for continuation
3530 prompts. It represents the counter ('\#') as dots.
3538 prompts. It represents the counter ('\#') as dots.
3531 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
3539 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
3532 need to update their ipythonrc files and replace '%n' with '\D' in
3540 need to update their ipythonrc files and replace '%n' with '\D' in
3533 their prompt_in2 settings everywhere. Sorry, but there's
3541 their prompt_in2 settings everywhere. Sorry, but there's
3534 otherwise no clean way to get all prompts to properly align. The
3542 otherwise no clean way to get all prompts to properly align. The
3535 ipythonrc shipped with IPython has been updated.
3543 ipythonrc shipped with IPython has been updated.
3536
3544
3537 2004-06-07 Fernando Perez <fperez@colorado.edu>
3545 2004-06-07 Fernando Perez <fperez@colorado.edu>
3538
3546
3539 * setup.py (isfile): Pass local_icons option to latex2html, so the
3547 * setup.py (isfile): Pass local_icons option to latex2html, so the
3540 resulting HTML file is self-contained. Thanks to
3548 resulting HTML file is self-contained. Thanks to
3541 dryice-AT-liu.com.cn for the tip.
3549 dryice-AT-liu.com.cn for the tip.
3542
3550
3543 * pysh.py: I created a new profile 'shell', which implements a
3551 * pysh.py: I created a new profile 'shell', which implements a
3544 _rudimentary_ IPython-based shell. This is in NO WAY a realy
3552 _rudimentary_ IPython-based shell. This is in NO WAY a realy
3545 system shell, nor will it become one anytime soon. It's mainly
3553 system shell, nor will it become one anytime soon. It's mainly
3546 meant to illustrate the use of the new flexible bash-like prompts.
3554 meant to illustrate the use of the new flexible bash-like prompts.
3547 I guess it could be used by hardy souls for true shell management,
3555 I guess it could be used by hardy souls for true shell management,
3548 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
3556 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
3549 profile. This uses the InterpreterExec extension provided by
3557 profile. This uses the InterpreterExec extension provided by
3550 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
3558 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
3551
3559
3552 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
3560 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
3553 auto-align itself with the length of the previous input prompt
3561 auto-align itself with the length of the previous input prompt
3554 (taking into account the invisible color escapes).
3562 (taking into account the invisible color escapes).
3555 (CachedOutput.__init__): Large restructuring of this class. Now
3563 (CachedOutput.__init__): Large restructuring of this class. Now
3556 all three prompts (primary1, primary2, output) are proper objects,
3564 all three prompts (primary1, primary2, output) are proper objects,
3557 managed by the 'parent' CachedOutput class. The code is still a
3565 managed by the 'parent' CachedOutput class. The code is still a
3558 bit hackish (all prompts share state via a pointer to the cache),
3566 bit hackish (all prompts share state via a pointer to the cache),
3559 but it's overall far cleaner than before.
3567 but it's overall far cleaner than before.
3560
3568
3561 * IPython/genutils.py (getoutputerror): modified to add verbose,
3569 * IPython/genutils.py (getoutputerror): modified to add verbose,
3562 debug and header options. This makes the interface of all getout*
3570 debug and header options. This makes the interface of all getout*
3563 functions uniform.
3571 functions uniform.
3564 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
3572 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
3565
3573
3566 * IPython/Magic.py (Magic.default_option): added a function to
3574 * IPython/Magic.py (Magic.default_option): added a function to
3567 allow registering default options for any magic command. This
3575 allow registering default options for any magic command. This
3568 makes it easy to have profiles which customize the magics globally
3576 makes it easy to have profiles which customize the magics globally
3569 for a certain use. The values set through this function are
3577 for a certain use. The values set through this function are
3570 picked up by the parse_options() method, which all magics should
3578 picked up by the parse_options() method, which all magics should
3571 use to parse their options.
3579 use to parse their options.
3572
3580
3573 * IPython/genutils.py (warn): modified the warnings framework to
3581 * IPython/genutils.py (warn): modified the warnings framework to
3574 use the Term I/O class. I'm trying to slowly unify all of
3582 use the Term I/O class. I'm trying to slowly unify all of
3575 IPython's I/O operations to pass through Term.
3583 IPython's I/O operations to pass through Term.
3576
3584
3577 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
3585 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
3578 the secondary prompt to correctly match the length of the primary
3586 the secondary prompt to correctly match the length of the primary
3579 one for any prompt. Now multi-line code will properly line up
3587 one for any prompt. Now multi-line code will properly line up
3580 even for path dependent prompts, such as the new ones available
3588 even for path dependent prompts, such as the new ones available
3581 via the prompt_specials.
3589 via the prompt_specials.
3582
3590
3583 2004-06-06 Fernando Perez <fperez@colorado.edu>
3591 2004-06-06 Fernando Perez <fperez@colorado.edu>
3584
3592
3585 * IPython/Prompts.py (prompt_specials): Added the ability to have
3593 * IPython/Prompts.py (prompt_specials): Added the ability to have
3586 bash-like special sequences in the prompts, which get
3594 bash-like special sequences in the prompts, which get
3587 automatically expanded. Things like hostname, current working
3595 automatically expanded. Things like hostname, current working
3588 directory and username are implemented already, but it's easy to
3596 directory and username are implemented already, but it's easy to
3589 add more in the future. Thanks to a patch by W.J. van der Laan
3597 add more in the future. Thanks to a patch by W.J. van der Laan
3590 <gnufnork-AT-hetdigitalegat.nl>
3598 <gnufnork-AT-hetdigitalegat.nl>
3591 (prompt_specials): Added color support for prompt strings, so
3599 (prompt_specials): Added color support for prompt strings, so
3592 users can define arbitrary color setups for their prompts.
3600 users can define arbitrary color setups for their prompts.
3593
3601
3594 2004-06-05 Fernando Perez <fperez@colorado.edu>
3602 2004-06-05 Fernando Perez <fperez@colorado.edu>
3595
3603
3596 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
3604 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
3597 code to load Gary Bishop's readline and configure it
3605 code to load Gary Bishop's readline and configure it
3598 automatically. Thanks to Gary for help on this.
3606 automatically. Thanks to Gary for help on this.
3599
3607
3600 2004-06-01 Fernando Perez <fperez@colorado.edu>
3608 2004-06-01 Fernando Perez <fperez@colorado.edu>
3601
3609
3602 * IPython/Logger.py (Logger.create_log): fix bug for logging
3610 * IPython/Logger.py (Logger.create_log): fix bug for logging
3603 with no filename (previous fix was incomplete).
3611 with no filename (previous fix was incomplete).
3604
3612
3605 2004-05-25 Fernando Perez <fperez@colorado.edu>
3613 2004-05-25 Fernando Perez <fperez@colorado.edu>
3606
3614
3607 * IPython/Magic.py (Magic.parse_options): fix bug where naked
3615 * IPython/Magic.py (Magic.parse_options): fix bug where naked
3608 parens would get passed to the shell.
3616 parens would get passed to the shell.
3609
3617
3610 2004-05-20 Fernando Perez <fperez@colorado.edu>
3618 2004-05-20 Fernando Perez <fperez@colorado.edu>
3611
3619
3612 * IPython/Magic.py (Magic.magic_prun): changed default profile
3620 * IPython/Magic.py (Magic.magic_prun): changed default profile
3613 sort order to 'time' (the more common profiling need).
3621 sort order to 'time' (the more common profiling need).
3614
3622
3615 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
3623 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
3616 so that source code shown is guaranteed in sync with the file on
3624 so that source code shown is guaranteed in sync with the file on
3617 disk (also changed in psource). Similar fix to the one for
3625 disk (also changed in psource). Similar fix to the one for
3618 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
3626 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
3619 <yann.ledu-AT-noos.fr>.
3627 <yann.ledu-AT-noos.fr>.
3620
3628
3621 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
3629 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
3622 with a single option would not be correctly parsed. Closes
3630 with a single option would not be correctly parsed. Closes
3623 http://www.scipy.net/roundup/ipython/issue14. This bug had been
3631 http://www.scipy.net/roundup/ipython/issue14. This bug had been
3624 introduced in 0.6.0 (on 2004-05-06).
3632 introduced in 0.6.0 (on 2004-05-06).
3625
3633
3626 2004-05-13 *** Released version 0.6.0
3634 2004-05-13 *** Released version 0.6.0
3627
3635
3628 2004-05-13 Fernando Perez <fperez@colorado.edu>
3636 2004-05-13 Fernando Perez <fperez@colorado.edu>
3629
3637
3630 * debian/: Added debian/ directory to CVS, so that debian support
3638 * debian/: Added debian/ directory to CVS, so that debian support
3631 is publicly accessible. The debian package is maintained by Jack
3639 is publicly accessible. The debian package is maintained by Jack
3632 Moffit <jack-AT-xiph.org>.
3640 Moffit <jack-AT-xiph.org>.
3633
3641
3634 * Documentation: included the notes about an ipython-based system
3642 * Documentation: included the notes about an ipython-based system
3635 shell (the hypothetical 'pysh') into the new_design.pdf document,
3643 shell (the hypothetical 'pysh') into the new_design.pdf document,
3636 so that these ideas get distributed to users along with the
3644 so that these ideas get distributed to users along with the
3637 official documentation.
3645 official documentation.
3638
3646
3639 2004-05-10 Fernando Perez <fperez@colorado.edu>
3647 2004-05-10 Fernando Perez <fperez@colorado.edu>
3640
3648
3641 * IPython/Logger.py (Logger.create_log): fix recently introduced
3649 * IPython/Logger.py (Logger.create_log): fix recently introduced
3642 bug (misindented line) where logstart would fail when not given an
3650 bug (misindented line) where logstart would fail when not given an
3643 explicit filename.
3651 explicit filename.
3644
3652
3645 2004-05-09 Fernando Perez <fperez@colorado.edu>
3653 2004-05-09 Fernando Perez <fperez@colorado.edu>
3646
3654
3647 * IPython/Magic.py (Magic.parse_options): skip system call when
3655 * IPython/Magic.py (Magic.parse_options): skip system call when
3648 there are no options to look for. Faster, cleaner for the common
3656 there are no options to look for. Faster, cleaner for the common
3649 case.
3657 case.
3650
3658
3651 * Documentation: many updates to the manual: describing Windows
3659 * Documentation: many updates to the manual: describing Windows
3652 support better, Gnuplot updates, credits, misc small stuff. Also
3660 support better, Gnuplot updates, credits, misc small stuff. Also
3653 updated the new_design doc a bit.
3661 updated the new_design doc a bit.
3654
3662
3655 2004-05-06 *** Released version 0.6.0.rc1
3663 2004-05-06 *** Released version 0.6.0.rc1
3656
3664
3657 2004-05-06 Fernando Perez <fperez@colorado.edu>
3665 2004-05-06 Fernando Perez <fperez@colorado.edu>
3658
3666
3659 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
3667 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
3660 operations to use the vastly more efficient list/''.join() method.
3668 operations to use the vastly more efficient list/''.join() method.
3661 (FormattedTB.text): Fix
3669 (FormattedTB.text): Fix
3662 http://www.scipy.net/roundup/ipython/issue12 - exception source
3670 http://www.scipy.net/roundup/ipython/issue12 - exception source
3663 extract not updated after reload. Thanks to Mike Salib
3671 extract not updated after reload. Thanks to Mike Salib
3664 <msalib-AT-mit.edu> for pinning the source of the problem.
3672 <msalib-AT-mit.edu> for pinning the source of the problem.
3665 Fortunately, the solution works inside ipython and doesn't require
3673 Fortunately, the solution works inside ipython and doesn't require
3666 any changes to python proper.
3674 any changes to python proper.
3667
3675
3668 * IPython/Magic.py (Magic.parse_options): Improved to process the
3676 * IPython/Magic.py (Magic.parse_options): Improved to process the
3669 argument list as a true shell would (by actually using the
3677 argument list as a true shell would (by actually using the
3670 underlying system shell). This way, all @magics automatically get
3678 underlying system shell). This way, all @magics automatically get
3671 shell expansion for variables. Thanks to a comment by Alex
3679 shell expansion for variables. Thanks to a comment by Alex
3672 Schmolck.
3680 Schmolck.
3673
3681
3674 2004-04-04 Fernando Perez <fperez@colorado.edu>
3682 2004-04-04 Fernando Perez <fperez@colorado.edu>
3675
3683
3676 * IPython/iplib.py (InteractiveShell.interact): Added a special
3684 * IPython/iplib.py (InteractiveShell.interact): Added a special
3677 trap for a debugger quit exception, which is basically impossible
3685 trap for a debugger quit exception, which is basically impossible
3678 to handle by normal mechanisms, given what pdb does to the stack.
3686 to handle by normal mechanisms, given what pdb does to the stack.
3679 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
3687 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
3680
3688
3681 2004-04-03 Fernando Perez <fperez@colorado.edu>
3689 2004-04-03 Fernando Perez <fperez@colorado.edu>
3682
3690
3683 * IPython/genutils.py (Term): Standardized the names of the Term
3691 * IPython/genutils.py (Term): Standardized the names of the Term
3684 class streams to cin/cout/cerr, following C++ naming conventions
3692 class streams to cin/cout/cerr, following C++ naming conventions
3685 (I can't use in/out/err because 'in' is not a valid attribute
3693 (I can't use in/out/err because 'in' is not a valid attribute
3686 name).
3694 name).
3687
3695
3688 * IPython/iplib.py (InteractiveShell.interact): don't increment
3696 * IPython/iplib.py (InteractiveShell.interact): don't increment
3689 the prompt if there's no user input. By Daniel 'Dang' Griffith
3697 the prompt if there's no user input. By Daniel 'Dang' Griffith
3690 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
3698 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
3691 Francois Pinard.
3699 Francois Pinard.
3692
3700
3693 2004-04-02 Fernando Perez <fperez@colorado.edu>
3701 2004-04-02 Fernando Perez <fperez@colorado.edu>
3694
3702
3695 * IPython/genutils.py (Stream.__init__): Modified to survive at
3703 * IPython/genutils.py (Stream.__init__): Modified to survive at
3696 least importing in contexts where stdin/out/err aren't true file
3704 least importing in contexts where stdin/out/err aren't true file
3697 objects, such as PyCrust (they lack fileno() and mode). However,
3705 objects, such as PyCrust (they lack fileno() and mode). However,
3698 the recovery facilities which rely on these things existing will
3706 the recovery facilities which rely on these things existing will
3699 not work.
3707 not work.
3700
3708
3701 2004-04-01 Fernando Perez <fperez@colorado.edu>
3709 2004-04-01 Fernando Perez <fperez@colorado.edu>
3702
3710
3703 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
3711 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
3704 use the new getoutputerror() function, so it properly
3712 use the new getoutputerror() function, so it properly
3705 distinguishes stdout/err.
3713 distinguishes stdout/err.
3706
3714
3707 * IPython/genutils.py (getoutputerror): added a function to
3715 * IPython/genutils.py (getoutputerror): added a function to
3708 capture separately the standard output and error of a command.
3716 capture separately the standard output and error of a command.
3709 After a comment from dang on the mailing lists. This code is
3717 After a comment from dang on the mailing lists. This code is
3710 basically a modified version of commands.getstatusoutput(), from
3718 basically a modified version of commands.getstatusoutput(), from
3711 the standard library.
3719 the standard library.
3712
3720
3713 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
3721 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
3714 '!!' as a special syntax (shorthand) to access @sx.
3722 '!!' as a special syntax (shorthand) to access @sx.
3715
3723
3716 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
3724 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
3717 command and return its output as a list split on '\n'.
3725 command and return its output as a list split on '\n'.
3718
3726
3719 2004-03-31 Fernando Perez <fperez@colorado.edu>
3727 2004-03-31 Fernando Perez <fperez@colorado.edu>
3720
3728
3721 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
3729 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
3722 method to dictionaries used as FakeModule instances if they lack
3730 method to dictionaries used as FakeModule instances if they lack
3723 it. At least pydoc in python2.3 breaks for runtime-defined
3731 it. At least pydoc in python2.3 breaks for runtime-defined
3724 functions without this hack. At some point I need to _really_
3732 functions without this hack. At some point I need to _really_
3725 understand what FakeModule is doing, because it's a gross hack.
3733 understand what FakeModule is doing, because it's a gross hack.
3726 But it solves Arnd's problem for now...
3734 But it solves Arnd's problem for now...
3727
3735
3728 2004-02-27 Fernando Perez <fperez@colorado.edu>
3736 2004-02-27 Fernando Perez <fperez@colorado.edu>
3729
3737
3730 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
3738 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
3731 mode would behave erratically. Also increased the number of
3739 mode would behave erratically. Also increased the number of
3732 possible logs in rotate mod to 999. Thanks to Rod Holland
3740 possible logs in rotate mod to 999. Thanks to Rod Holland
3733 <rhh@StructureLABS.com> for the report and fixes.
3741 <rhh@StructureLABS.com> for the report and fixes.
3734
3742
3735 2004-02-26 Fernando Perez <fperez@colorado.edu>
3743 2004-02-26 Fernando Perez <fperez@colorado.edu>
3736
3744
3737 * IPython/genutils.py (page): Check that the curses module really
3745 * IPython/genutils.py (page): Check that the curses module really
3738 has the initscr attribute before trying to use it. For some
3746 has the initscr attribute before trying to use it. For some
3739 reason, the Solaris curses module is missing this. I think this
3747 reason, the Solaris curses module is missing this. I think this
3740 should be considered a Solaris python bug, but I'm not sure.
3748 should be considered a Solaris python bug, but I'm not sure.
3741
3749
3742 2004-01-17 Fernando Perez <fperez@colorado.edu>
3750 2004-01-17 Fernando Perez <fperez@colorado.edu>
3743
3751
3744 * IPython/genutils.py (Stream.__init__): Changes to try to make
3752 * IPython/genutils.py (Stream.__init__): Changes to try to make
3745 ipython robust against stdin/out/err being closed by the user.
3753 ipython robust against stdin/out/err being closed by the user.
3746 This is 'user error' (and blocks a normal python session, at least
3754 This is 'user error' (and blocks a normal python session, at least
3747 the stdout case). However, Ipython should be able to survive such
3755 the stdout case). However, Ipython should be able to survive such
3748 instances of abuse as gracefully as possible. To simplify the
3756 instances of abuse as gracefully as possible. To simplify the
3749 coding and maintain compatibility with Gary Bishop's Term
3757 coding and maintain compatibility with Gary Bishop's Term
3750 contributions, I've made use of classmethods for this. I think
3758 contributions, I've made use of classmethods for this. I think
3751 this introduces a dependency on python 2.2.
3759 this introduces a dependency on python 2.2.
3752
3760
3753 2004-01-13 Fernando Perez <fperez@colorado.edu>
3761 2004-01-13 Fernando Perez <fperez@colorado.edu>
3754
3762
3755 * IPython/numutils.py (exp_safe): simplified the code a bit and
3763 * IPython/numutils.py (exp_safe): simplified the code a bit and
3756 removed the need for importing the kinds module altogether.
3764 removed the need for importing the kinds module altogether.
3757
3765
3758 2004-01-06 Fernando Perez <fperez@colorado.edu>
3766 2004-01-06 Fernando Perez <fperez@colorado.edu>
3759
3767
3760 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
3768 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
3761 a magic function instead, after some community feedback. No
3769 a magic function instead, after some community feedback. No
3762 special syntax will exist for it, but its name is deliberately
3770 special syntax will exist for it, but its name is deliberately
3763 very short.
3771 very short.
3764
3772
3765 2003-12-20 Fernando Perez <fperez@colorado.edu>
3773 2003-12-20 Fernando Perez <fperez@colorado.edu>
3766
3774
3767 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
3775 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
3768 new functionality, to automagically assign the result of a shell
3776 new functionality, to automagically assign the result of a shell
3769 command to a variable. I'll solicit some community feedback on
3777 command to a variable. I'll solicit some community feedback on
3770 this before making it permanent.
3778 this before making it permanent.
3771
3779
3772 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
3780 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
3773 requested about callables for which inspect couldn't obtain a
3781 requested about callables for which inspect couldn't obtain a
3774 proper argspec. Thanks to a crash report sent by Etienne
3782 proper argspec. Thanks to a crash report sent by Etienne
3775 Posthumus <etienne-AT-apple01.cs.vu.nl>.
3783 Posthumus <etienne-AT-apple01.cs.vu.nl>.
3776
3784
3777 2003-12-09 Fernando Perez <fperez@colorado.edu>
3785 2003-12-09 Fernando Perez <fperez@colorado.edu>
3778
3786
3779 * IPython/genutils.py (page): patch for the pager to work across
3787 * IPython/genutils.py (page): patch for the pager to work across
3780 various versions of Windows. By Gary Bishop.
3788 various versions of Windows. By Gary Bishop.
3781
3789
3782 2003-12-04 Fernando Perez <fperez@colorado.edu>
3790 2003-12-04 Fernando Perez <fperez@colorado.edu>
3783
3791
3784 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
3792 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
3785 Gnuplot.py version 1.7, whose internal names changed quite a bit.
3793 Gnuplot.py version 1.7, whose internal names changed quite a bit.
3786 While I tested this and it looks ok, there may still be corner
3794 While I tested this and it looks ok, there may still be corner
3787 cases I've missed.
3795 cases I've missed.
3788
3796
3789 2003-12-01 Fernando Perez <fperez@colorado.edu>
3797 2003-12-01 Fernando Perez <fperez@colorado.edu>
3790
3798
3791 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
3799 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
3792 where a line like 'p,q=1,2' would fail because the automagic
3800 where a line like 'p,q=1,2' would fail because the automagic
3793 system would be triggered for @p.
3801 system would be triggered for @p.
3794
3802
3795 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
3803 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
3796 cleanups, code unmodified.
3804 cleanups, code unmodified.
3797
3805
3798 * IPython/genutils.py (Term): added a class for IPython to handle
3806 * IPython/genutils.py (Term): added a class for IPython to handle
3799 output. In most cases it will just be a proxy for stdout/err, but
3807 output. In most cases it will just be a proxy for stdout/err, but
3800 having this allows modifications to be made for some platforms,
3808 having this allows modifications to be made for some platforms,
3801 such as handling color escapes under Windows. All of this code
3809 such as handling color escapes under Windows. All of this code
3802 was contributed by Gary Bishop, with minor modifications by me.
3810 was contributed by Gary Bishop, with minor modifications by me.
3803 The actual changes affect many files.
3811 The actual changes affect many files.
3804
3812
3805 2003-11-30 Fernando Perez <fperez@colorado.edu>
3813 2003-11-30 Fernando Perez <fperez@colorado.edu>
3806
3814
3807 * IPython/iplib.py (file_matches): new completion code, courtesy
3815 * IPython/iplib.py (file_matches): new completion code, courtesy
3808 of Jeff Collins. This enables filename completion again under
3816 of Jeff Collins. This enables filename completion again under
3809 python 2.3, which disabled it at the C level.
3817 python 2.3, which disabled it at the C level.
3810
3818
3811 2003-11-11 Fernando Perez <fperez@colorado.edu>
3819 2003-11-11 Fernando Perez <fperez@colorado.edu>
3812
3820
3813 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
3821 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
3814 for Numeric.array(map(...)), but often convenient.
3822 for Numeric.array(map(...)), but often convenient.
3815
3823
3816 2003-11-05 Fernando Perez <fperez@colorado.edu>
3824 2003-11-05 Fernando Perez <fperez@colorado.edu>
3817
3825
3818 * IPython/numutils.py (frange): Changed a call from int() to
3826 * IPython/numutils.py (frange): Changed a call from int() to
3819 int(round()) to prevent a problem reported with arange() in the
3827 int(round()) to prevent a problem reported with arange() in the
3820 numpy list.
3828 numpy list.
3821
3829
3822 2003-10-06 Fernando Perez <fperez@colorado.edu>
3830 2003-10-06 Fernando Perez <fperez@colorado.edu>
3823
3831
3824 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
3832 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
3825 prevent crashes if sys lacks an argv attribute (it happens with
3833 prevent crashes if sys lacks an argv attribute (it happens with
3826 embedded interpreters which build a bare-bones sys module).
3834 embedded interpreters which build a bare-bones sys module).
3827 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
3835 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
3828
3836
3829 2003-09-24 Fernando Perez <fperez@colorado.edu>
3837 2003-09-24 Fernando Perez <fperez@colorado.edu>
3830
3838
3831 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
3839 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
3832 to protect against poorly written user objects where __getattr__
3840 to protect against poorly written user objects where __getattr__
3833 raises exceptions other than AttributeError. Thanks to a bug
3841 raises exceptions other than AttributeError. Thanks to a bug
3834 report by Oliver Sander <osander-AT-gmx.de>.
3842 report by Oliver Sander <osander-AT-gmx.de>.
3835
3843
3836 * IPython/FakeModule.py (FakeModule.__repr__): this method was
3844 * IPython/FakeModule.py (FakeModule.__repr__): this method was
3837 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
3845 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
3838
3846
3839 2003-09-09 Fernando Perez <fperez@colorado.edu>
3847 2003-09-09 Fernando Perez <fperez@colorado.edu>
3840
3848
3841 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3849 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3842 unpacking a list whith a callable as first element would
3850 unpacking a list whith a callable as first element would
3843 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
3851 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
3844 Collins.
3852 Collins.
3845
3853
3846 2003-08-25 *** Released version 0.5.0
3854 2003-08-25 *** Released version 0.5.0
3847
3855
3848 2003-08-22 Fernando Perez <fperez@colorado.edu>
3856 2003-08-22 Fernando Perez <fperez@colorado.edu>
3849
3857
3850 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
3858 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
3851 improperly defined user exceptions. Thanks to feedback from Mark
3859 improperly defined user exceptions. Thanks to feedback from Mark
3852 Russell <mrussell-AT-verio.net>.
3860 Russell <mrussell-AT-verio.net>.
3853
3861
3854 2003-08-20 Fernando Perez <fperez@colorado.edu>
3862 2003-08-20 Fernando Perez <fperez@colorado.edu>
3855
3863
3856 * IPython/OInspect.py (Inspector.pinfo): changed String Form
3864 * IPython/OInspect.py (Inspector.pinfo): changed String Form
3857 printing so that it would print multi-line string forms starting
3865 printing so that it would print multi-line string forms starting
3858 with a new line. This way the formatting is better respected for
3866 with a new line. This way the formatting is better respected for
3859 objects which work hard to make nice string forms.
3867 objects which work hard to make nice string forms.
3860
3868
3861 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
3869 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
3862 autocall would overtake data access for objects with both
3870 autocall would overtake data access for objects with both
3863 __getitem__ and __call__.
3871 __getitem__ and __call__.
3864
3872
3865 2003-08-19 *** Released version 0.5.0-rc1
3873 2003-08-19 *** Released version 0.5.0-rc1
3866
3874
3867 2003-08-19 Fernando Perez <fperez@colorado.edu>
3875 2003-08-19 Fernando Perez <fperez@colorado.edu>
3868
3876
3869 * IPython/deep_reload.py (load_tail): single tiny change here
3877 * IPython/deep_reload.py (load_tail): single tiny change here
3870 seems to fix the long-standing bug of dreload() failing to work
3878 seems to fix the long-standing bug of dreload() failing to work
3871 for dotted names. But this module is pretty tricky, so I may have
3879 for dotted names. But this module is pretty tricky, so I may have
3872 missed some subtlety. Needs more testing!.
3880 missed some subtlety. Needs more testing!.
3873
3881
3874 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
3882 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
3875 exceptions which have badly implemented __str__ methods.
3883 exceptions which have badly implemented __str__ methods.
3876 (VerboseTB.text): harden against inspect.getinnerframes crashing,
3884 (VerboseTB.text): harden against inspect.getinnerframes crashing,
3877 which I've been getting reports about from Python 2.3 users. I
3885 which I've been getting reports about from Python 2.3 users. I
3878 wish I had a simple test case to reproduce the problem, so I could
3886 wish I had a simple test case to reproduce the problem, so I could
3879 either write a cleaner workaround or file a bug report if
3887 either write a cleaner workaround or file a bug report if
3880 necessary.
3888 necessary.
3881
3889
3882 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
3890 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
3883 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
3891 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
3884 a bug report by Tjabo Kloppenburg.
3892 a bug report by Tjabo Kloppenburg.
3885
3893
3886 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
3894 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
3887 crashes. Wrapped the pdb call in a blanket try/except, since pdb
3895 crashes. Wrapped the pdb call in a blanket try/except, since pdb
3888 seems rather unstable. Thanks to a bug report by Tjabo
3896 seems rather unstable. Thanks to a bug report by Tjabo
3889 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
3897 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
3890
3898
3891 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
3899 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
3892 this out soon because of the critical fixes in the inner loop for
3900 this out soon because of the critical fixes in the inner loop for
3893 generators.
3901 generators.
3894
3902
3895 * IPython/Magic.py (Magic.getargspec): removed. This (and
3903 * IPython/Magic.py (Magic.getargspec): removed. This (and
3896 _get_def) have been obsoleted by OInspect for a long time, I
3904 _get_def) have been obsoleted by OInspect for a long time, I
3897 hadn't noticed that they were dead code.
3905 hadn't noticed that they were dead code.
3898 (Magic._ofind): restored _ofind functionality for a few literals
3906 (Magic._ofind): restored _ofind functionality for a few literals
3899 (those in ["''",'""','[]','{}','()']). But it won't work anymore
3907 (those in ["''",'""','[]','{}','()']). But it won't work anymore
3900 for things like "hello".capitalize?, since that would require a
3908 for things like "hello".capitalize?, since that would require a
3901 potentially dangerous eval() again.
3909 potentially dangerous eval() again.
3902
3910
3903 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
3911 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
3904 logic a bit more to clean up the escapes handling and minimize the
3912 logic a bit more to clean up the escapes handling and minimize the
3905 use of _ofind to only necessary cases. The interactive 'feel' of
3913 use of _ofind to only necessary cases. The interactive 'feel' of
3906 IPython should have improved quite a bit with the changes in
3914 IPython should have improved quite a bit with the changes in
3907 _prefilter and _ofind (besides being far safer than before).
3915 _prefilter and _ofind (besides being far safer than before).
3908
3916
3909 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
3917 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
3910 obscure, never reported). Edit would fail to find the object to
3918 obscure, never reported). Edit would fail to find the object to
3911 edit under some circumstances.
3919 edit under some circumstances.
3912 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
3920 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
3913 which were causing double-calling of generators. Those eval calls
3921 which were causing double-calling of generators. Those eval calls
3914 were _very_ dangerous, since code with side effects could be
3922 were _very_ dangerous, since code with side effects could be
3915 triggered. As they say, 'eval is evil'... These were the
3923 triggered. As they say, 'eval is evil'... These were the
3916 nastiest evals in IPython. Besides, _ofind is now far simpler,
3924 nastiest evals in IPython. Besides, _ofind is now far simpler,
3917 and it should also be quite a bit faster. Its use of inspect is
3925 and it should also be quite a bit faster. Its use of inspect is
3918 also safer, so perhaps some of the inspect-related crashes I've
3926 also safer, so perhaps some of the inspect-related crashes I've
3919 seen lately with Python 2.3 might be taken care of. That will
3927 seen lately with Python 2.3 might be taken care of. That will
3920 need more testing.
3928 need more testing.
3921
3929
3922 2003-08-17 Fernando Perez <fperez@colorado.edu>
3930 2003-08-17 Fernando Perez <fperez@colorado.edu>
3923
3931
3924 * IPython/iplib.py (InteractiveShell._prefilter): significant
3932 * IPython/iplib.py (InteractiveShell._prefilter): significant
3925 simplifications to the logic for handling user escapes. Faster
3933 simplifications to the logic for handling user escapes. Faster
3926 and simpler code.
3934 and simpler code.
3927
3935
3928 2003-08-14 Fernando Perez <fperez@colorado.edu>
3936 2003-08-14 Fernando Perez <fperez@colorado.edu>
3929
3937
3930 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
3938 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
3931 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
3939 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
3932 but it should be quite a bit faster. And the recursive version
3940 but it should be quite a bit faster. And the recursive version
3933 generated O(log N) intermediate storage for all rank>1 arrays,
3941 generated O(log N) intermediate storage for all rank>1 arrays,
3934 even if they were contiguous.
3942 even if they were contiguous.
3935 (l1norm): Added this function.
3943 (l1norm): Added this function.
3936 (norm): Added this function for arbitrary norms (including
3944 (norm): Added this function for arbitrary norms (including
3937 l-infinity). l1 and l2 are still special cases for convenience
3945 l-infinity). l1 and l2 are still special cases for convenience
3938 and speed.
3946 and speed.
3939
3947
3940 2003-08-03 Fernando Perez <fperez@colorado.edu>
3948 2003-08-03 Fernando Perez <fperez@colorado.edu>
3941
3949
3942 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
3950 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
3943 exceptions, which now raise PendingDeprecationWarnings in Python
3951 exceptions, which now raise PendingDeprecationWarnings in Python
3944 2.3. There were some in Magic and some in Gnuplot2.
3952 2.3. There were some in Magic and some in Gnuplot2.
3945
3953
3946 2003-06-30 Fernando Perez <fperez@colorado.edu>
3954 2003-06-30 Fernando Perez <fperez@colorado.edu>
3947
3955
3948 * IPython/genutils.py (page): modified to call curses only for
3956 * IPython/genutils.py (page): modified to call curses only for
3949 terminals where TERM=='xterm'. After problems under many other
3957 terminals where TERM=='xterm'. After problems under many other
3950 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
3958 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
3951
3959
3952 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
3960 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
3953 would be triggered when readline was absent. This was just an old
3961 would be triggered when readline was absent. This was just an old
3954 debugging statement I'd forgotten to take out.
3962 debugging statement I'd forgotten to take out.
3955
3963
3956 2003-06-20 Fernando Perez <fperez@colorado.edu>
3964 2003-06-20 Fernando Perez <fperez@colorado.edu>
3957
3965
3958 * IPython/genutils.py (clock): modified to return only user time
3966 * IPython/genutils.py (clock): modified to return only user time
3959 (not counting system time), after a discussion on scipy. While
3967 (not counting system time), after a discussion on scipy. While
3960 system time may be a useful quantity occasionally, it may much
3968 system time may be a useful quantity occasionally, it may much
3961 more easily be skewed by occasional swapping or other similar
3969 more easily be skewed by occasional swapping or other similar
3962 activity.
3970 activity.
3963
3971
3964 2003-06-05 Fernando Perez <fperez@colorado.edu>
3972 2003-06-05 Fernando Perez <fperez@colorado.edu>
3965
3973
3966 * IPython/numutils.py (identity): new function, for building
3974 * IPython/numutils.py (identity): new function, for building
3967 arbitrary rank Kronecker deltas (mostly backwards compatible with
3975 arbitrary rank Kronecker deltas (mostly backwards compatible with
3968 Numeric.identity)
3976 Numeric.identity)
3969
3977
3970 2003-06-03 Fernando Perez <fperez@colorado.edu>
3978 2003-06-03 Fernando Perez <fperez@colorado.edu>
3971
3979
3972 * IPython/iplib.py (InteractiveShell.handle_magic): protect
3980 * IPython/iplib.py (InteractiveShell.handle_magic): protect
3973 arguments passed to magics with spaces, to allow trailing '\' to
3981 arguments passed to magics with spaces, to allow trailing '\' to
3974 work normally (mainly for Windows users).
3982 work normally (mainly for Windows users).
3975
3983
3976 2003-05-29 Fernando Perez <fperez@colorado.edu>
3984 2003-05-29 Fernando Perez <fperez@colorado.edu>
3977
3985
3978 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
3986 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
3979 instead of pydoc.help. This fixes a bizarre behavior where
3987 instead of pydoc.help. This fixes a bizarre behavior where
3980 printing '%s' % locals() would trigger the help system. Now
3988 printing '%s' % locals() would trigger the help system. Now
3981 ipython behaves like normal python does.
3989 ipython behaves like normal python does.
3982
3990
3983 Note that if one does 'from pydoc import help', the bizarre
3991 Note that if one does 'from pydoc import help', the bizarre
3984 behavior returns, but this will also happen in normal python, so
3992 behavior returns, but this will also happen in normal python, so
3985 it's not an ipython bug anymore (it has to do with how pydoc.help
3993 it's not an ipython bug anymore (it has to do with how pydoc.help
3986 is implemented).
3994 is implemented).
3987
3995
3988 2003-05-22 Fernando Perez <fperez@colorado.edu>
3996 2003-05-22 Fernando Perez <fperez@colorado.edu>
3989
3997
3990 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
3998 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
3991 return [] instead of None when nothing matches, also match to end
3999 return [] instead of None when nothing matches, also match to end
3992 of line. Patch by Gary Bishop.
4000 of line. Patch by Gary Bishop.
3993
4001
3994 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4002 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
3995 protection as before, for files passed on the command line. This
4003 protection as before, for files passed on the command line. This
3996 prevents the CrashHandler from kicking in if user files call into
4004 prevents the CrashHandler from kicking in if user files call into
3997 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4005 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
3998 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4006 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
3999
4007
4000 2003-05-20 *** Released version 0.4.0
4008 2003-05-20 *** Released version 0.4.0
4001
4009
4002 2003-05-20 Fernando Perez <fperez@colorado.edu>
4010 2003-05-20 Fernando Perez <fperez@colorado.edu>
4003
4011
4004 * setup.py: added support for manpages. It's a bit hackish b/c of
4012 * setup.py: added support for manpages. It's a bit hackish b/c of
4005 a bug in the way the bdist_rpm distutils target handles gzipped
4013 a bug in the way the bdist_rpm distutils target handles gzipped
4006 manpages, but it works. After a patch by Jack.
4014 manpages, but it works. After a patch by Jack.
4007
4015
4008 2003-05-19 Fernando Perez <fperez@colorado.edu>
4016 2003-05-19 Fernando Perez <fperez@colorado.edu>
4009
4017
4010 * IPython/numutils.py: added a mockup of the kinds module, since
4018 * IPython/numutils.py: added a mockup of the kinds module, since
4011 it was recently removed from Numeric. This way, numutils will
4019 it was recently removed from Numeric. This way, numutils will
4012 work for all users even if they are missing kinds.
4020 work for all users even if they are missing kinds.
4013
4021
4014 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4022 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4015 failure, which can occur with SWIG-wrapped extensions. After a
4023 failure, which can occur with SWIG-wrapped extensions. After a
4016 crash report from Prabhu.
4024 crash report from Prabhu.
4017
4025
4018 2003-05-16 Fernando Perez <fperez@colorado.edu>
4026 2003-05-16 Fernando Perez <fperez@colorado.edu>
4019
4027
4020 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4028 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4021 protect ipython from user code which may call directly
4029 protect ipython from user code which may call directly
4022 sys.excepthook (this looks like an ipython crash to the user, even
4030 sys.excepthook (this looks like an ipython crash to the user, even
4023 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4031 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4024 This is especially important to help users of WxWindows, but may
4032 This is especially important to help users of WxWindows, but may
4025 also be useful in other cases.
4033 also be useful in other cases.
4026
4034
4027 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4035 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4028 an optional tb_offset to be specified, and to preserve exception
4036 an optional tb_offset to be specified, and to preserve exception
4029 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4037 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4030
4038
4031 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4039 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4032
4040
4033 2003-05-15 Fernando Perez <fperez@colorado.edu>
4041 2003-05-15 Fernando Perez <fperez@colorado.edu>
4034
4042
4035 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4043 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4036 installing for a new user under Windows.
4044 installing for a new user under Windows.
4037
4045
4038 2003-05-12 Fernando Perez <fperez@colorado.edu>
4046 2003-05-12 Fernando Perez <fperez@colorado.edu>
4039
4047
4040 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4048 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4041 handler for Emacs comint-based lines. Currently it doesn't do
4049 handler for Emacs comint-based lines. Currently it doesn't do
4042 much (but importantly, it doesn't update the history cache). In
4050 much (but importantly, it doesn't update the history cache). In
4043 the future it may be expanded if Alex needs more functionality
4051 the future it may be expanded if Alex needs more functionality
4044 there.
4052 there.
4045
4053
4046 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4054 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4047 info to crash reports.
4055 info to crash reports.
4048
4056
4049 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4057 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4050 just like Python's -c. Also fixed crash with invalid -color
4058 just like Python's -c. Also fixed crash with invalid -color
4051 option value at startup. Thanks to Will French
4059 option value at startup. Thanks to Will French
4052 <wfrench-AT-bestweb.net> for the bug report.
4060 <wfrench-AT-bestweb.net> for the bug report.
4053
4061
4054 2003-05-09 Fernando Perez <fperez@colorado.edu>
4062 2003-05-09 Fernando Perez <fperez@colorado.edu>
4055
4063
4056 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4064 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4057 to EvalDict (it's a mapping, after all) and simplified its code
4065 to EvalDict (it's a mapping, after all) and simplified its code
4058 quite a bit, after a nice discussion on c.l.py where Gustavo
4066 quite a bit, after a nice discussion on c.l.py where Gustavo
4059 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4067 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4060
4068
4061 2003-04-30 Fernando Perez <fperez@colorado.edu>
4069 2003-04-30 Fernando Perez <fperez@colorado.edu>
4062
4070
4063 * IPython/genutils.py (timings_out): modified it to reduce its
4071 * IPython/genutils.py (timings_out): modified it to reduce its
4064 overhead in the common reps==1 case.
4072 overhead in the common reps==1 case.
4065
4073
4066 2003-04-29 Fernando Perez <fperez@colorado.edu>
4074 2003-04-29 Fernando Perez <fperez@colorado.edu>
4067
4075
4068 * IPython/genutils.py (timings_out): Modified to use the resource
4076 * IPython/genutils.py (timings_out): Modified to use the resource
4069 module, which avoids the wraparound problems of time.clock().
4077 module, which avoids the wraparound problems of time.clock().
4070
4078
4071 2003-04-17 *** Released version 0.2.15pre4
4079 2003-04-17 *** Released version 0.2.15pre4
4072
4080
4073 2003-04-17 Fernando Perez <fperez@colorado.edu>
4081 2003-04-17 Fernando Perez <fperez@colorado.edu>
4074
4082
4075 * setup.py (scriptfiles): Split windows-specific stuff over to a
4083 * setup.py (scriptfiles): Split windows-specific stuff over to a
4076 separate file, in an attempt to have a Windows GUI installer.
4084 separate file, in an attempt to have a Windows GUI installer.
4077 That didn't work, but part of the groundwork is done.
4085 That didn't work, but part of the groundwork is done.
4078
4086
4079 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4087 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4080 indent/unindent with 4 spaces. Particularly useful in combination
4088 indent/unindent with 4 spaces. Particularly useful in combination
4081 with the new auto-indent option.
4089 with the new auto-indent option.
4082
4090
4083 2003-04-16 Fernando Perez <fperez@colorado.edu>
4091 2003-04-16 Fernando Perez <fperez@colorado.edu>
4084
4092
4085 * IPython/Magic.py: various replacements of self.rc for
4093 * IPython/Magic.py: various replacements of self.rc for
4086 self.shell.rc. A lot more remains to be done to fully disentangle
4094 self.shell.rc. A lot more remains to be done to fully disentangle
4087 this class from the main Shell class.
4095 this class from the main Shell class.
4088
4096
4089 * IPython/GnuplotRuntime.py: added checks for mouse support so
4097 * IPython/GnuplotRuntime.py: added checks for mouse support so
4090 that we don't try to enable it if the current gnuplot doesn't
4098 that we don't try to enable it if the current gnuplot doesn't
4091 really support it. Also added checks so that we don't try to
4099 really support it. Also added checks so that we don't try to
4092 enable persist under Windows (where Gnuplot doesn't recognize the
4100 enable persist under Windows (where Gnuplot doesn't recognize the
4093 option).
4101 option).
4094
4102
4095 * IPython/iplib.py (InteractiveShell.interact): Added optional
4103 * IPython/iplib.py (InteractiveShell.interact): Added optional
4096 auto-indenting code, after a patch by King C. Shu
4104 auto-indenting code, after a patch by King C. Shu
4097 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4105 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4098 get along well with pasting indented code. If I ever figure out
4106 get along well with pasting indented code. If I ever figure out
4099 how to make that part go well, it will become on by default.
4107 how to make that part go well, it will become on by default.
4100
4108
4101 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4109 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4102 crash ipython if there was an unmatched '%' in the user's prompt
4110 crash ipython if there was an unmatched '%' in the user's prompt
4103 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4111 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4104
4112
4105 * IPython/iplib.py (InteractiveShell.interact): removed the
4113 * IPython/iplib.py (InteractiveShell.interact): removed the
4106 ability to ask the user whether he wants to crash or not at the
4114 ability to ask the user whether he wants to crash or not at the
4107 'last line' exception handler. Calling functions at that point
4115 'last line' exception handler. Calling functions at that point
4108 changes the stack, and the error reports would have incorrect
4116 changes the stack, and the error reports would have incorrect
4109 tracebacks.
4117 tracebacks.
4110
4118
4111 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4119 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4112 pass through a peger a pretty-printed form of any object. After a
4120 pass through a peger a pretty-printed form of any object. After a
4113 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4121 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4114
4122
4115 2003-04-14 Fernando Perez <fperez@colorado.edu>
4123 2003-04-14 Fernando Perez <fperez@colorado.edu>
4116
4124
4117 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4125 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4118 all files in ~ would be modified at first install (instead of
4126 all files in ~ would be modified at first install (instead of
4119 ~/.ipython). This could be potentially disastrous, as the
4127 ~/.ipython). This could be potentially disastrous, as the
4120 modification (make line-endings native) could damage binary files.
4128 modification (make line-endings native) could damage binary files.
4121
4129
4122 2003-04-10 Fernando Perez <fperez@colorado.edu>
4130 2003-04-10 Fernando Perez <fperez@colorado.edu>
4123
4131
4124 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4132 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4125 handle only lines which are invalid python. This now means that
4133 handle only lines which are invalid python. This now means that
4126 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4134 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4127 for the bug report.
4135 for the bug report.
4128
4136
4129 2003-04-01 Fernando Perez <fperez@colorado.edu>
4137 2003-04-01 Fernando Perez <fperez@colorado.edu>
4130
4138
4131 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4139 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4132 where failing to set sys.last_traceback would crash pdb.pm().
4140 where failing to set sys.last_traceback would crash pdb.pm().
4133 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4141 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4134 report.
4142 report.
4135
4143
4136 2003-03-25 Fernando Perez <fperez@colorado.edu>
4144 2003-03-25 Fernando Perez <fperez@colorado.edu>
4137
4145
4138 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4146 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4139 before printing it (it had a lot of spurious blank lines at the
4147 before printing it (it had a lot of spurious blank lines at the
4140 end).
4148 end).
4141
4149
4142 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4150 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4143 output would be sent 21 times! Obviously people don't use this
4151 output would be sent 21 times! Obviously people don't use this
4144 too often, or I would have heard about it.
4152 too often, or I would have heard about it.
4145
4153
4146 2003-03-24 Fernando Perez <fperez@colorado.edu>
4154 2003-03-24 Fernando Perez <fperez@colorado.edu>
4147
4155
4148 * setup.py (scriptfiles): renamed the data_files parameter from
4156 * setup.py (scriptfiles): renamed the data_files parameter from
4149 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4157 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4150 for the patch.
4158 for the patch.
4151
4159
4152 2003-03-20 Fernando Perez <fperez@colorado.edu>
4160 2003-03-20 Fernando Perez <fperez@colorado.edu>
4153
4161
4154 * IPython/genutils.py (error): added error() and fatal()
4162 * IPython/genutils.py (error): added error() and fatal()
4155 functions.
4163 functions.
4156
4164
4157 2003-03-18 *** Released version 0.2.15pre3
4165 2003-03-18 *** Released version 0.2.15pre3
4158
4166
4159 2003-03-18 Fernando Perez <fperez@colorado.edu>
4167 2003-03-18 Fernando Perez <fperez@colorado.edu>
4160
4168
4161 * setupext/install_data_ext.py
4169 * setupext/install_data_ext.py
4162 (install_data_ext.initialize_options): Class contributed by Jack
4170 (install_data_ext.initialize_options): Class contributed by Jack
4163 Moffit for fixing the old distutils hack. He is sending this to
4171 Moffit for fixing the old distutils hack. He is sending this to
4164 the distutils folks so in the future we may not need it as a
4172 the distutils folks so in the future we may not need it as a
4165 private fix.
4173 private fix.
4166
4174
4167 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4175 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4168 changes for Debian packaging. See his patch for full details.
4176 changes for Debian packaging. See his patch for full details.
4169 The old distutils hack of making the ipythonrc* files carry a
4177 The old distutils hack of making the ipythonrc* files carry a
4170 bogus .py extension is gone, at last. Examples were moved to a
4178 bogus .py extension is gone, at last. Examples were moved to a
4171 separate subdir under doc/, and the separate executable scripts
4179 separate subdir under doc/, and the separate executable scripts
4172 now live in their own directory. Overall a great cleanup. The
4180 now live in their own directory. Overall a great cleanup. The
4173 manual was updated to use the new files, and setup.py has been
4181 manual was updated to use the new files, and setup.py has been
4174 fixed for this setup.
4182 fixed for this setup.
4175
4183
4176 * IPython/PyColorize.py (Parser.usage): made non-executable and
4184 * IPython/PyColorize.py (Parser.usage): made non-executable and
4177 created a pycolor wrapper around it to be included as a script.
4185 created a pycolor wrapper around it to be included as a script.
4178
4186
4179 2003-03-12 *** Released version 0.2.15pre2
4187 2003-03-12 *** Released version 0.2.15pre2
4180
4188
4181 2003-03-12 Fernando Perez <fperez@colorado.edu>
4189 2003-03-12 Fernando Perez <fperez@colorado.edu>
4182
4190
4183 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4191 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4184 long-standing problem with garbage characters in some terminals.
4192 long-standing problem with garbage characters in some terminals.
4185 The issue was really that the \001 and \002 escapes must _only_ be
4193 The issue was really that the \001 and \002 escapes must _only_ be
4186 passed to input prompts (which call readline), but _never_ to
4194 passed to input prompts (which call readline), but _never_ to
4187 normal text to be printed on screen. I changed ColorANSI to have
4195 normal text to be printed on screen. I changed ColorANSI to have
4188 two classes: TermColors and InputTermColors, each with the
4196 two classes: TermColors and InputTermColors, each with the
4189 appropriate escapes for input prompts or normal text. The code in
4197 appropriate escapes for input prompts or normal text. The code in
4190 Prompts.py got slightly more complicated, but this very old and
4198 Prompts.py got slightly more complicated, but this very old and
4191 annoying bug is finally fixed.
4199 annoying bug is finally fixed.
4192
4200
4193 All the credit for nailing down the real origin of this problem
4201 All the credit for nailing down the real origin of this problem
4194 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4202 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4195 *Many* thanks to him for spending quite a bit of effort on this.
4203 *Many* thanks to him for spending quite a bit of effort on this.
4196
4204
4197 2003-03-05 *** Released version 0.2.15pre1
4205 2003-03-05 *** Released version 0.2.15pre1
4198
4206
4199 2003-03-03 Fernando Perez <fperez@colorado.edu>
4207 2003-03-03 Fernando Perez <fperez@colorado.edu>
4200
4208
4201 * IPython/FakeModule.py: Moved the former _FakeModule to a
4209 * IPython/FakeModule.py: Moved the former _FakeModule to a
4202 separate file, because it's also needed by Magic (to fix a similar
4210 separate file, because it's also needed by Magic (to fix a similar
4203 pickle-related issue in @run).
4211 pickle-related issue in @run).
4204
4212
4205 2003-03-02 Fernando Perez <fperez@colorado.edu>
4213 2003-03-02 Fernando Perez <fperez@colorado.edu>
4206
4214
4207 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4215 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4208 the autocall option at runtime.
4216 the autocall option at runtime.
4209 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4217 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4210 across Magic.py to start separating Magic from InteractiveShell.
4218 across Magic.py to start separating Magic from InteractiveShell.
4211 (Magic._ofind): Fixed to return proper namespace for dotted
4219 (Magic._ofind): Fixed to return proper namespace for dotted
4212 names. Before, a dotted name would always return 'not currently
4220 names. Before, a dotted name would always return 'not currently
4213 defined', because it would find the 'parent'. s.x would be found,
4221 defined', because it would find the 'parent'. s.x would be found,
4214 but since 'x' isn't defined by itself, it would get confused.
4222 but since 'x' isn't defined by itself, it would get confused.
4215 (Magic.magic_run): Fixed pickling problems reported by Ralf
4223 (Magic.magic_run): Fixed pickling problems reported by Ralf
4216 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4224 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4217 that I'd used when Mike Heeter reported similar issues at the
4225 that I'd used when Mike Heeter reported similar issues at the
4218 top-level, but now for @run. It boils down to injecting the
4226 top-level, but now for @run. It boils down to injecting the
4219 namespace where code is being executed with something that looks
4227 namespace where code is being executed with something that looks
4220 enough like a module to fool pickle.dump(). Since a pickle stores
4228 enough like a module to fool pickle.dump(). Since a pickle stores
4221 a named reference to the importing module, we need this for
4229 a named reference to the importing module, we need this for
4222 pickles to save something sensible.
4230 pickles to save something sensible.
4223
4231
4224 * IPython/ipmaker.py (make_IPython): added an autocall option.
4232 * IPython/ipmaker.py (make_IPython): added an autocall option.
4225
4233
4226 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4234 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4227 the auto-eval code. Now autocalling is an option, and the code is
4235 the auto-eval code. Now autocalling is an option, and the code is
4228 also vastly safer. There is no more eval() involved at all.
4236 also vastly safer. There is no more eval() involved at all.
4229
4237
4230 2003-03-01 Fernando Perez <fperez@colorado.edu>
4238 2003-03-01 Fernando Perez <fperez@colorado.edu>
4231
4239
4232 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4240 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4233 dict with named keys instead of a tuple.
4241 dict with named keys instead of a tuple.
4234
4242
4235 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4243 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4236
4244
4237 * setup.py (make_shortcut): Fixed message about directories
4245 * setup.py (make_shortcut): Fixed message about directories
4238 created during Windows installation (the directories were ok, just
4246 created during Windows installation (the directories were ok, just
4239 the printed message was misleading). Thanks to Chris Liechti
4247 the printed message was misleading). Thanks to Chris Liechti
4240 <cliechti-AT-gmx.net> for the heads up.
4248 <cliechti-AT-gmx.net> for the heads up.
4241
4249
4242 2003-02-21 Fernando Perez <fperez@colorado.edu>
4250 2003-02-21 Fernando Perez <fperez@colorado.edu>
4243
4251
4244 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4252 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4245 of ValueError exception when checking for auto-execution. This
4253 of ValueError exception when checking for auto-execution. This
4246 one is raised by things like Numeric arrays arr.flat when the
4254 one is raised by things like Numeric arrays arr.flat when the
4247 array is non-contiguous.
4255 array is non-contiguous.
4248
4256
4249 2003-01-31 Fernando Perez <fperez@colorado.edu>
4257 2003-01-31 Fernando Perez <fperez@colorado.edu>
4250
4258
4251 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4259 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4252 not return any value at all (even though the command would get
4260 not return any value at all (even though the command would get
4253 executed).
4261 executed).
4254 (xsys): Flush stdout right after printing the command to ensure
4262 (xsys): Flush stdout right after printing the command to ensure
4255 proper ordering of commands and command output in the total
4263 proper ordering of commands and command output in the total
4256 output.
4264 output.
4257 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4265 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4258 system/getoutput as defaults. The old ones are kept for
4266 system/getoutput as defaults. The old ones are kept for
4259 compatibility reasons, so no code which uses this library needs
4267 compatibility reasons, so no code which uses this library needs
4260 changing.
4268 changing.
4261
4269
4262 2003-01-27 *** Released version 0.2.14
4270 2003-01-27 *** Released version 0.2.14
4263
4271
4264 2003-01-25 Fernando Perez <fperez@colorado.edu>
4272 2003-01-25 Fernando Perez <fperez@colorado.edu>
4265
4273
4266 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
4274 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
4267 functions defined in previous edit sessions could not be re-edited
4275 functions defined in previous edit sessions could not be re-edited
4268 (because the temp files were immediately removed). Now temp files
4276 (because the temp files were immediately removed). Now temp files
4269 are removed only at IPython's exit.
4277 are removed only at IPython's exit.
4270 (Magic.magic_run): Improved @run to perform shell-like expansions
4278 (Magic.magic_run): Improved @run to perform shell-like expansions
4271 on its arguments (~users and $VARS). With this, @run becomes more
4279 on its arguments (~users and $VARS). With this, @run becomes more
4272 like a normal command-line.
4280 like a normal command-line.
4273
4281
4274 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
4282 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
4275 bugs related to embedding and cleaned up that code. A fairly
4283 bugs related to embedding and cleaned up that code. A fairly
4276 important one was the impossibility to access the global namespace
4284 important one was the impossibility to access the global namespace
4277 through the embedded IPython (only local variables were visible).
4285 through the embedded IPython (only local variables were visible).
4278
4286
4279 2003-01-14 Fernando Perez <fperez@colorado.edu>
4287 2003-01-14 Fernando Perez <fperez@colorado.edu>
4280
4288
4281 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
4289 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
4282 auto-calling to be a bit more conservative. Now it doesn't get
4290 auto-calling to be a bit more conservative. Now it doesn't get
4283 triggered if any of '!=()<>' are in the rest of the input line, to
4291 triggered if any of '!=()<>' are in the rest of the input line, to
4284 allow comparing callables. Thanks to Alex for the heads up.
4292 allow comparing callables. Thanks to Alex for the heads up.
4285
4293
4286 2003-01-07 Fernando Perez <fperez@colorado.edu>
4294 2003-01-07 Fernando Perez <fperez@colorado.edu>
4287
4295
4288 * IPython/genutils.py (page): fixed estimation of the number of
4296 * IPython/genutils.py (page): fixed estimation of the number of
4289 lines in a string to be paged to simply count newlines. This
4297 lines in a string to be paged to simply count newlines. This
4290 prevents over-guessing due to embedded escape sequences. A better
4298 prevents over-guessing due to embedded escape sequences. A better
4291 long-term solution would involve stripping out the control chars
4299 long-term solution would involve stripping out the control chars
4292 for the count, but it's potentially so expensive I just don't
4300 for the count, but it's potentially so expensive I just don't
4293 think it's worth doing.
4301 think it's worth doing.
4294
4302
4295 2002-12-19 *** Released version 0.2.14pre50
4303 2002-12-19 *** Released version 0.2.14pre50
4296
4304
4297 2002-12-19 Fernando Perez <fperez@colorado.edu>
4305 2002-12-19 Fernando Perez <fperez@colorado.edu>
4298
4306
4299 * tools/release (version): Changed release scripts to inform
4307 * tools/release (version): Changed release scripts to inform
4300 Andrea and build a NEWS file with a list of recent changes.
4308 Andrea and build a NEWS file with a list of recent changes.
4301
4309
4302 * IPython/ColorANSI.py (__all__): changed terminal detection
4310 * IPython/ColorANSI.py (__all__): changed terminal detection
4303 code. Seems to work better for xterms without breaking
4311 code. Seems to work better for xterms without breaking
4304 konsole. Will need more testing to determine if WinXP and Mac OSX
4312 konsole. Will need more testing to determine if WinXP and Mac OSX
4305 also work ok.
4313 also work ok.
4306
4314
4307 2002-12-18 *** Released version 0.2.14pre49
4315 2002-12-18 *** Released version 0.2.14pre49
4308
4316
4309 2002-12-18 Fernando Perez <fperez@colorado.edu>
4317 2002-12-18 Fernando Perez <fperez@colorado.edu>
4310
4318
4311 * Docs: added new info about Mac OSX, from Andrea.
4319 * Docs: added new info about Mac OSX, from Andrea.
4312
4320
4313 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
4321 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
4314 allow direct plotting of python strings whose format is the same
4322 allow direct plotting of python strings whose format is the same
4315 of gnuplot data files.
4323 of gnuplot data files.
4316
4324
4317 2002-12-16 Fernando Perez <fperez@colorado.edu>
4325 2002-12-16 Fernando Perez <fperez@colorado.edu>
4318
4326
4319 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
4327 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
4320 value of exit question to be acknowledged.
4328 value of exit question to be acknowledged.
4321
4329
4322 2002-12-03 Fernando Perez <fperez@colorado.edu>
4330 2002-12-03 Fernando Perez <fperez@colorado.edu>
4323
4331
4324 * IPython/ipmaker.py: removed generators, which had been added
4332 * IPython/ipmaker.py: removed generators, which had been added
4325 by mistake in an earlier debugging run. This was causing trouble
4333 by mistake in an earlier debugging run. This was causing trouble
4326 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
4334 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
4327 for pointing this out.
4335 for pointing this out.
4328
4336
4329 2002-11-17 Fernando Perez <fperez@colorado.edu>
4337 2002-11-17 Fernando Perez <fperez@colorado.edu>
4330
4338
4331 * Manual: updated the Gnuplot section.
4339 * Manual: updated the Gnuplot section.
4332
4340
4333 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
4341 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
4334 a much better split of what goes in Runtime and what goes in
4342 a much better split of what goes in Runtime and what goes in
4335 Interactive.
4343 Interactive.
4336
4344
4337 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
4345 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
4338 being imported from iplib.
4346 being imported from iplib.
4339
4347
4340 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
4348 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
4341 for command-passing. Now the global Gnuplot instance is called
4349 for command-passing. Now the global Gnuplot instance is called
4342 'gp' instead of 'g', which was really a far too fragile and
4350 'gp' instead of 'g', which was really a far too fragile and
4343 common name.
4351 common name.
4344
4352
4345 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
4353 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
4346 bounding boxes generated by Gnuplot for square plots.
4354 bounding boxes generated by Gnuplot for square plots.
4347
4355
4348 * IPython/genutils.py (popkey): new function added. I should
4356 * IPython/genutils.py (popkey): new function added. I should
4349 suggest this on c.l.py as a dict method, it seems useful.
4357 suggest this on c.l.py as a dict method, it seems useful.
4350
4358
4351 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
4359 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
4352 to transparently handle PostScript generation. MUCH better than
4360 to transparently handle PostScript generation. MUCH better than
4353 the previous plot_eps/replot_eps (which I removed now). The code
4361 the previous plot_eps/replot_eps (which I removed now). The code
4354 is also fairly clean and well documented now (including
4362 is also fairly clean and well documented now (including
4355 docstrings).
4363 docstrings).
4356
4364
4357 2002-11-13 Fernando Perez <fperez@colorado.edu>
4365 2002-11-13 Fernando Perez <fperez@colorado.edu>
4358
4366
4359 * IPython/Magic.py (Magic.magic_edit): fixed docstring
4367 * IPython/Magic.py (Magic.magic_edit): fixed docstring
4360 (inconsistent with options).
4368 (inconsistent with options).
4361
4369
4362 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
4370 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
4363 manually disabled, I don't know why. Fixed it.
4371 manually disabled, I don't know why. Fixed it.
4364 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
4372 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
4365 eps output.
4373 eps output.
4366
4374
4367 2002-11-12 Fernando Perez <fperez@colorado.edu>
4375 2002-11-12 Fernando Perez <fperez@colorado.edu>
4368
4376
4369 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
4377 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
4370 don't propagate up to caller. Fixes crash reported by François
4378 don't propagate up to caller. Fixes crash reported by François
4371 Pinard.
4379 Pinard.
4372
4380
4373 2002-11-09 Fernando Perez <fperez@colorado.edu>
4381 2002-11-09 Fernando Perez <fperez@colorado.edu>
4374
4382
4375 * IPython/ipmaker.py (make_IPython): fixed problem with writing
4383 * IPython/ipmaker.py (make_IPython): fixed problem with writing
4376 history file for new users.
4384 history file for new users.
4377 (make_IPython): fixed bug where initial install would leave the
4385 (make_IPython): fixed bug where initial install would leave the
4378 user running in the .ipython dir.
4386 user running in the .ipython dir.
4379 (make_IPython): fixed bug where config dir .ipython would be
4387 (make_IPython): fixed bug where config dir .ipython would be
4380 created regardless of the given -ipythondir option. Thanks to Cory
4388 created regardless of the given -ipythondir option. Thanks to Cory
4381 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
4389 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
4382
4390
4383 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
4391 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
4384 type confirmations. Will need to use it in all of IPython's code
4392 type confirmations. Will need to use it in all of IPython's code
4385 consistently.
4393 consistently.
4386
4394
4387 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
4395 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
4388 context to print 31 lines instead of the default 5. This will make
4396 context to print 31 lines instead of the default 5. This will make
4389 the crash reports extremely detailed in case the problem is in
4397 the crash reports extremely detailed in case the problem is in
4390 libraries I don't have access to.
4398 libraries I don't have access to.
4391
4399
4392 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
4400 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
4393 line of defense' code to still crash, but giving users fair
4401 line of defense' code to still crash, but giving users fair
4394 warning. I don't want internal errors to go unreported: if there's
4402 warning. I don't want internal errors to go unreported: if there's
4395 an internal problem, IPython should crash and generate a full
4403 an internal problem, IPython should crash and generate a full
4396 report.
4404 report.
4397
4405
4398 2002-11-08 Fernando Perez <fperez@colorado.edu>
4406 2002-11-08 Fernando Perez <fperez@colorado.edu>
4399
4407
4400 * IPython/iplib.py (InteractiveShell.interact): added code to trap
4408 * IPython/iplib.py (InteractiveShell.interact): added code to trap
4401 otherwise uncaught exceptions which can appear if people set
4409 otherwise uncaught exceptions which can appear if people set
4402 sys.stdout to something badly broken. Thanks to a crash report
4410 sys.stdout to something badly broken. Thanks to a crash report
4403 from henni-AT-mail.brainbot.com.
4411 from henni-AT-mail.brainbot.com.
4404
4412
4405 2002-11-04 Fernando Perez <fperez@colorado.edu>
4413 2002-11-04 Fernando Perez <fperez@colorado.edu>
4406
4414
4407 * IPython/iplib.py (InteractiveShell.interact): added
4415 * IPython/iplib.py (InteractiveShell.interact): added
4408 __IPYTHON__active to the builtins. It's a flag which goes on when
4416 __IPYTHON__active to the builtins. It's a flag which goes on when
4409 the interaction starts and goes off again when it stops. This
4417 the interaction starts and goes off again when it stops. This
4410 allows embedding code to detect being inside IPython. Before this
4418 allows embedding code to detect being inside IPython. Before this
4411 was done via __IPYTHON__, but that only shows that an IPython
4419 was done via __IPYTHON__, but that only shows that an IPython
4412 instance has been created.
4420 instance has been created.
4413
4421
4414 * IPython/Magic.py (Magic.magic_env): I realized that in a
4422 * IPython/Magic.py (Magic.magic_env): I realized that in a
4415 UserDict, instance.data holds the data as a normal dict. So I
4423 UserDict, instance.data holds the data as a normal dict. So I
4416 modified @env to return os.environ.data instead of rebuilding a
4424 modified @env to return os.environ.data instead of rebuilding a
4417 dict by hand.
4425 dict by hand.
4418
4426
4419 2002-11-02 Fernando Perez <fperez@colorado.edu>
4427 2002-11-02 Fernando Perez <fperez@colorado.edu>
4420
4428
4421 * IPython/genutils.py (warn): changed so that level 1 prints no
4429 * IPython/genutils.py (warn): changed so that level 1 prints no
4422 header. Level 2 is now the default (with 'WARNING' header, as
4430 header. Level 2 is now the default (with 'WARNING' header, as
4423 before). I think I tracked all places where changes were needed in
4431 before). I think I tracked all places where changes were needed in
4424 IPython, but outside code using the old level numbering may have
4432 IPython, but outside code using the old level numbering may have
4425 broken.
4433 broken.
4426
4434
4427 * IPython/iplib.py (InteractiveShell.runcode): added this to
4435 * IPython/iplib.py (InteractiveShell.runcode): added this to
4428 handle the tracebacks in SystemExit traps correctly. The previous
4436 handle the tracebacks in SystemExit traps correctly. The previous
4429 code (through interact) was printing more of the stack than
4437 code (through interact) was printing more of the stack than
4430 necessary, showing IPython internal code to the user.
4438 necessary, showing IPython internal code to the user.
4431
4439
4432 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
4440 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
4433 default. Now that the default at the confirmation prompt is yes,
4441 default. Now that the default at the confirmation prompt is yes,
4434 it's not so intrusive. François' argument that ipython sessions
4442 it's not so intrusive. François' argument that ipython sessions
4435 tend to be complex enough not to lose them from an accidental C-d,
4443 tend to be complex enough not to lose them from an accidental C-d,
4436 is a valid one.
4444 is a valid one.
4437
4445
4438 * IPython/iplib.py (InteractiveShell.interact): added a
4446 * IPython/iplib.py (InteractiveShell.interact): added a
4439 showtraceback() call to the SystemExit trap, and modified the exit
4447 showtraceback() call to the SystemExit trap, and modified the exit
4440 confirmation to have yes as the default.
4448 confirmation to have yes as the default.
4441
4449
4442 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
4450 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
4443 this file. It's been gone from the code for a long time, this was
4451 this file. It's been gone from the code for a long time, this was
4444 simply leftover junk.
4452 simply leftover junk.
4445
4453
4446 2002-11-01 Fernando Perez <fperez@colorado.edu>
4454 2002-11-01 Fernando Perez <fperez@colorado.edu>
4447
4455
4448 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
4456 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
4449 added. If set, IPython now traps EOF and asks for
4457 added. If set, IPython now traps EOF and asks for
4450 confirmation. After a request by François Pinard.
4458 confirmation. After a request by François Pinard.
4451
4459
4452 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
4460 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
4453 of @abort, and with a new (better) mechanism for handling the
4461 of @abort, and with a new (better) mechanism for handling the
4454 exceptions.
4462 exceptions.
4455
4463
4456 2002-10-27 Fernando Perez <fperez@colorado.edu>
4464 2002-10-27 Fernando Perez <fperez@colorado.edu>
4457
4465
4458 * IPython/usage.py (__doc__): updated the --help information and
4466 * IPython/usage.py (__doc__): updated the --help information and
4459 the ipythonrc file to indicate that -log generates
4467 the ipythonrc file to indicate that -log generates
4460 ./ipython.log. Also fixed the corresponding info in @logstart.
4468 ./ipython.log. Also fixed the corresponding info in @logstart.
4461 This and several other fixes in the manuals thanks to reports by
4469 This and several other fixes in the manuals thanks to reports by
4462 François Pinard <pinard-AT-iro.umontreal.ca>.
4470 François Pinard <pinard-AT-iro.umontreal.ca>.
4463
4471
4464 * IPython/Logger.py (Logger.switch_log): Fixed error message to
4472 * IPython/Logger.py (Logger.switch_log): Fixed error message to
4465 refer to @logstart (instead of @log, which doesn't exist).
4473 refer to @logstart (instead of @log, which doesn't exist).
4466
4474
4467 * IPython/iplib.py (InteractiveShell._prefilter): fixed
4475 * IPython/iplib.py (InteractiveShell._prefilter): fixed
4468 AttributeError crash. Thanks to Christopher Armstrong
4476 AttributeError crash. Thanks to Christopher Armstrong
4469 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
4477 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
4470 introduced recently (in 0.2.14pre37) with the fix to the eval
4478 introduced recently (in 0.2.14pre37) with the fix to the eval
4471 problem mentioned below.
4479 problem mentioned below.
4472
4480
4473 2002-10-17 Fernando Perez <fperez@colorado.edu>
4481 2002-10-17 Fernando Perez <fperez@colorado.edu>
4474
4482
4475 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
4483 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
4476 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
4484 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
4477
4485
4478 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
4486 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
4479 this function to fix a problem reported by Alex Schmolck. He saw
4487 this function to fix a problem reported by Alex Schmolck. He saw
4480 it with list comprehensions and generators, which were getting
4488 it with list comprehensions and generators, which were getting
4481 called twice. The real problem was an 'eval' call in testing for
4489 called twice. The real problem was an 'eval' call in testing for
4482 automagic which was evaluating the input line silently.
4490 automagic which was evaluating the input line silently.
4483
4491
4484 This is a potentially very nasty bug, if the input has side
4492 This is a potentially very nasty bug, if the input has side
4485 effects which must not be repeated. The code is much cleaner now,
4493 effects which must not be repeated. The code is much cleaner now,
4486 without any blanket 'except' left and with a regexp test for
4494 without any blanket 'except' left and with a regexp test for
4487 actual function names.
4495 actual function names.
4488
4496
4489 But an eval remains, which I'm not fully comfortable with. I just
4497 But an eval remains, which I'm not fully comfortable with. I just
4490 don't know how to find out if an expression could be a callable in
4498 don't know how to find out if an expression could be a callable in
4491 the user's namespace without doing an eval on the string. However
4499 the user's namespace without doing an eval on the string. However
4492 that string is now much more strictly checked so that no code
4500 that string is now much more strictly checked so that no code
4493 slips by, so the eval should only happen for things that can
4501 slips by, so the eval should only happen for things that can
4494 really be only function/method names.
4502 really be only function/method names.
4495
4503
4496 2002-10-15 Fernando Perez <fperez@colorado.edu>
4504 2002-10-15 Fernando Perez <fperez@colorado.edu>
4497
4505
4498 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
4506 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
4499 OSX information to main manual, removed README_Mac_OSX file from
4507 OSX information to main manual, removed README_Mac_OSX file from
4500 distribution. Also updated credits for recent additions.
4508 distribution. Also updated credits for recent additions.
4501
4509
4502 2002-10-10 Fernando Perez <fperez@colorado.edu>
4510 2002-10-10 Fernando Perez <fperez@colorado.edu>
4503
4511
4504 * README_Mac_OSX: Added a README for Mac OSX users for fixing
4512 * README_Mac_OSX: Added a README for Mac OSX users for fixing
4505 terminal-related issues. Many thanks to Andrea Riciputi
4513 terminal-related issues. Many thanks to Andrea Riciputi
4506 <andrea.riciputi-AT-libero.it> for writing it.
4514 <andrea.riciputi-AT-libero.it> for writing it.
4507
4515
4508 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
4516 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
4509 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4517 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4510
4518
4511 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
4519 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
4512 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
4520 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
4513 <syver-en-AT-online.no> who both submitted patches for this problem.
4521 <syver-en-AT-online.no> who both submitted patches for this problem.
4514
4522
4515 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
4523 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
4516 global embedding to make sure that things don't overwrite user
4524 global embedding to make sure that things don't overwrite user
4517 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
4525 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
4518
4526
4519 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
4527 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
4520 compatibility. Thanks to Hayden Callow
4528 compatibility. Thanks to Hayden Callow
4521 <h.callow-AT-elec.canterbury.ac.nz>
4529 <h.callow-AT-elec.canterbury.ac.nz>
4522
4530
4523 2002-10-04 Fernando Perez <fperez@colorado.edu>
4531 2002-10-04 Fernando Perez <fperez@colorado.edu>
4524
4532
4525 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
4533 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
4526 Gnuplot.File objects.
4534 Gnuplot.File objects.
4527
4535
4528 2002-07-23 Fernando Perez <fperez@colorado.edu>
4536 2002-07-23 Fernando Perez <fperez@colorado.edu>
4529
4537
4530 * IPython/genutils.py (timing): Added timings() and timing() for
4538 * IPython/genutils.py (timing): Added timings() and timing() for
4531 quick access to the most commonly needed data, the execution
4539 quick access to the most commonly needed data, the execution
4532 times. Old timing() renamed to timings_out().
4540 times. Old timing() renamed to timings_out().
4533
4541
4534 2002-07-18 Fernando Perez <fperez@colorado.edu>
4542 2002-07-18 Fernando Perez <fperez@colorado.edu>
4535
4543
4536 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
4544 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
4537 bug with nested instances disrupting the parent's tab completion.
4545 bug with nested instances disrupting the parent's tab completion.
4538
4546
4539 * IPython/iplib.py (all_completions): Added Alex Schmolck's
4547 * IPython/iplib.py (all_completions): Added Alex Schmolck's
4540 all_completions code to begin the emacs integration.
4548 all_completions code to begin the emacs integration.
4541
4549
4542 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
4550 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
4543 argument to allow titling individual arrays when plotting.
4551 argument to allow titling individual arrays when plotting.
4544
4552
4545 2002-07-15 Fernando Perez <fperez@colorado.edu>
4553 2002-07-15 Fernando Perez <fperez@colorado.edu>
4546
4554
4547 * setup.py (make_shortcut): changed to retrieve the value of
4555 * setup.py (make_shortcut): changed to retrieve the value of
4548 'Program Files' directory from the registry (this value changes in
4556 'Program Files' directory from the registry (this value changes in
4549 non-english versions of Windows). Thanks to Thomas Fanslau
4557 non-english versions of Windows). Thanks to Thomas Fanslau
4550 <tfanslau-AT-gmx.de> for the report.
4558 <tfanslau-AT-gmx.de> for the report.
4551
4559
4552 2002-07-10 Fernando Perez <fperez@colorado.edu>
4560 2002-07-10 Fernando Perez <fperez@colorado.edu>
4553
4561
4554 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
4562 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
4555 a bug in pdb, which crashes if a line with only whitespace is
4563 a bug in pdb, which crashes if a line with only whitespace is
4556 entered. Bug report submitted to sourceforge.
4564 entered. Bug report submitted to sourceforge.
4557
4565
4558 2002-07-09 Fernando Perez <fperez@colorado.edu>
4566 2002-07-09 Fernando Perez <fperez@colorado.edu>
4559
4567
4560 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
4568 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
4561 reporting exceptions (it's a bug in inspect.py, I just set a
4569 reporting exceptions (it's a bug in inspect.py, I just set a
4562 workaround).
4570 workaround).
4563
4571
4564 2002-07-08 Fernando Perez <fperez@colorado.edu>
4572 2002-07-08 Fernando Perez <fperez@colorado.edu>
4565
4573
4566 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
4574 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
4567 __IPYTHON__ in __builtins__ to show up in user_ns.
4575 __IPYTHON__ in __builtins__ to show up in user_ns.
4568
4576
4569 2002-07-03 Fernando Perez <fperez@colorado.edu>
4577 2002-07-03 Fernando Perez <fperez@colorado.edu>
4570
4578
4571 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
4579 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
4572 name from @gp_set_instance to @gp_set_default.
4580 name from @gp_set_instance to @gp_set_default.
4573
4581
4574 * IPython/ipmaker.py (make_IPython): default editor value set to
4582 * IPython/ipmaker.py (make_IPython): default editor value set to
4575 '0' (a string), to match the rc file. Otherwise will crash when
4583 '0' (a string), to match the rc file. Otherwise will crash when
4576 .strip() is called on it.
4584 .strip() is called on it.
4577
4585
4578
4586
4579 2002-06-28 Fernando Perez <fperez@colorado.edu>
4587 2002-06-28 Fernando Perez <fperez@colorado.edu>
4580
4588
4581 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
4589 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
4582 of files in current directory when a file is executed via
4590 of files in current directory when a file is executed via
4583 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
4591 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
4584
4592
4585 * setup.py (manfiles): fix for rpm builds, submitted by RA
4593 * setup.py (manfiles): fix for rpm builds, submitted by RA
4586 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
4594 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
4587
4595
4588 * IPython/ipmaker.py (make_IPython): fixed lookup of default
4596 * IPython/ipmaker.py (make_IPython): fixed lookup of default
4589 editor when set to '0'. Problem was, '0' evaluates to True (it's a
4597 editor when set to '0'. Problem was, '0' evaluates to True (it's a
4590 string!). A. Schmolck caught this one.
4598 string!). A. Schmolck caught this one.
4591
4599
4592 2002-06-27 Fernando Perez <fperez@colorado.edu>
4600 2002-06-27 Fernando Perez <fperez@colorado.edu>
4593
4601
4594 * IPython/ipmaker.py (make_IPython): fixed bug when running user
4602 * IPython/ipmaker.py (make_IPython): fixed bug when running user
4595 defined files at the cmd line. __name__ wasn't being set to
4603 defined files at the cmd line. __name__ wasn't being set to
4596 __main__.
4604 __main__.
4597
4605
4598 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
4606 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
4599 regular lists and tuples besides Numeric arrays.
4607 regular lists and tuples besides Numeric arrays.
4600
4608
4601 * IPython/Prompts.py (CachedOutput.__call__): Added output
4609 * IPython/Prompts.py (CachedOutput.__call__): Added output
4602 supression for input ending with ';'. Similar to Mathematica and
4610 supression for input ending with ';'. Similar to Mathematica and
4603 Matlab. The _* vars and Out[] list are still updated, just like
4611 Matlab. The _* vars and Out[] list are still updated, just like
4604 Mathematica behaves.
4612 Mathematica behaves.
4605
4613
4606 2002-06-25 Fernando Perez <fperez@colorado.edu>
4614 2002-06-25 Fernando Perez <fperez@colorado.edu>
4607
4615
4608 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
4616 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
4609 .ini extensions for profiels under Windows.
4617 .ini extensions for profiels under Windows.
4610
4618
4611 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
4619 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
4612 string form. Fix contributed by Alexander Schmolck
4620 string form. Fix contributed by Alexander Schmolck
4613 <a.schmolck-AT-gmx.net>
4621 <a.schmolck-AT-gmx.net>
4614
4622
4615 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
4623 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
4616 pre-configured Gnuplot instance.
4624 pre-configured Gnuplot instance.
4617
4625
4618 2002-06-21 Fernando Perez <fperez@colorado.edu>
4626 2002-06-21 Fernando Perez <fperez@colorado.edu>
4619
4627
4620 * IPython/numutils.py (exp_safe): new function, works around the
4628 * IPython/numutils.py (exp_safe): new function, works around the
4621 underflow problems in Numeric.
4629 underflow problems in Numeric.
4622 (log2): New fn. Safe log in base 2: returns exact integer answer
4630 (log2): New fn. Safe log in base 2: returns exact integer answer
4623 for exact integer powers of 2.
4631 for exact integer powers of 2.
4624
4632
4625 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
4633 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
4626 properly.
4634 properly.
4627
4635
4628 2002-06-20 Fernando Perez <fperez@colorado.edu>
4636 2002-06-20 Fernando Perez <fperez@colorado.edu>
4629
4637
4630 * IPython/genutils.py (timing): new function like
4638 * IPython/genutils.py (timing): new function like
4631 Mathematica's. Similar to time_test, but returns more info.
4639 Mathematica's. Similar to time_test, but returns more info.
4632
4640
4633 2002-06-18 Fernando Perez <fperez@colorado.edu>
4641 2002-06-18 Fernando Perez <fperez@colorado.edu>
4634
4642
4635 * IPython/Magic.py (Magic.magic_save): modified @save and @r
4643 * IPython/Magic.py (Magic.magic_save): modified @save and @r
4636 according to Mike Heeter's suggestions.
4644 according to Mike Heeter's suggestions.
4637
4645
4638 2002-06-16 Fernando Perez <fperez@colorado.edu>
4646 2002-06-16 Fernando Perez <fperez@colorado.edu>
4639
4647
4640 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
4648 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
4641 system. GnuplotMagic is gone as a user-directory option. New files
4649 system. GnuplotMagic is gone as a user-directory option. New files
4642 make it easier to use all the gnuplot stuff both from external
4650 make it easier to use all the gnuplot stuff both from external
4643 programs as well as from IPython. Had to rewrite part of
4651 programs as well as from IPython. Had to rewrite part of
4644 hardcopy() b/c of a strange bug: often the ps files simply don't
4652 hardcopy() b/c of a strange bug: often the ps files simply don't
4645 get created, and require a repeat of the command (often several
4653 get created, and require a repeat of the command (often several
4646 times).
4654 times).
4647
4655
4648 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
4656 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
4649 resolve output channel at call time, so that if sys.stderr has
4657 resolve output channel at call time, so that if sys.stderr has
4650 been redirected by user this gets honored.
4658 been redirected by user this gets honored.
4651
4659
4652 2002-06-13 Fernando Perez <fperez@colorado.edu>
4660 2002-06-13 Fernando Perez <fperez@colorado.edu>
4653
4661
4654 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
4662 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
4655 IPShell. Kept a copy with the old names to avoid breaking people's
4663 IPShell. Kept a copy with the old names to avoid breaking people's
4656 embedded code.
4664 embedded code.
4657
4665
4658 * IPython/ipython: simplified it to the bare minimum after
4666 * IPython/ipython: simplified it to the bare minimum after
4659 Holger's suggestions. Added info about how to use it in
4667 Holger's suggestions. Added info about how to use it in
4660 PYTHONSTARTUP.
4668 PYTHONSTARTUP.
4661
4669
4662 * IPython/Shell.py (IPythonShell): changed the options passing
4670 * IPython/Shell.py (IPythonShell): changed the options passing
4663 from a string with funky %s replacements to a straight list. Maybe
4671 from a string with funky %s replacements to a straight list. Maybe
4664 a bit more typing, but it follows sys.argv conventions, so there's
4672 a bit more typing, but it follows sys.argv conventions, so there's
4665 less special-casing to remember.
4673 less special-casing to remember.
4666
4674
4667 2002-06-12 Fernando Perez <fperez@colorado.edu>
4675 2002-06-12 Fernando Perez <fperez@colorado.edu>
4668
4676
4669 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
4677 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
4670 command. Thanks to a suggestion by Mike Heeter.
4678 command. Thanks to a suggestion by Mike Heeter.
4671 (Magic.magic_pfile): added behavior to look at filenames if given
4679 (Magic.magic_pfile): added behavior to look at filenames if given
4672 arg is not a defined object.
4680 arg is not a defined object.
4673 (Magic.magic_save): New @save function to save code snippets. Also
4681 (Magic.magic_save): New @save function to save code snippets. Also
4674 a Mike Heeter idea.
4682 a Mike Heeter idea.
4675
4683
4676 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
4684 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
4677 plot() and replot(). Much more convenient now, especially for
4685 plot() and replot(). Much more convenient now, especially for
4678 interactive use.
4686 interactive use.
4679
4687
4680 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
4688 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
4681 filenames.
4689 filenames.
4682
4690
4683 2002-06-02 Fernando Perez <fperez@colorado.edu>
4691 2002-06-02 Fernando Perez <fperez@colorado.edu>
4684
4692
4685 * IPython/Struct.py (Struct.__init__): modified to admit
4693 * IPython/Struct.py (Struct.__init__): modified to admit
4686 initialization via another struct.
4694 initialization via another struct.
4687
4695
4688 * IPython/genutils.py (SystemExec.__init__): New stateful
4696 * IPython/genutils.py (SystemExec.__init__): New stateful
4689 interface to xsys and bq. Useful for writing system scripts.
4697 interface to xsys and bq. Useful for writing system scripts.
4690
4698
4691 2002-05-30 Fernando Perez <fperez@colorado.edu>
4699 2002-05-30 Fernando Perez <fperez@colorado.edu>
4692
4700
4693 * MANIFEST.in: Changed docfile selection to exclude all the lyx
4701 * MANIFEST.in: Changed docfile selection to exclude all the lyx
4694 documents. This will make the user download smaller (it's getting
4702 documents. This will make the user download smaller (it's getting
4695 too big).
4703 too big).
4696
4704
4697 2002-05-29 Fernando Perez <fperez@colorado.edu>
4705 2002-05-29 Fernando Perez <fperez@colorado.edu>
4698
4706
4699 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
4707 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
4700 fix problems with shelve and pickle. Seems to work, but I don't
4708 fix problems with shelve and pickle. Seems to work, but I don't
4701 know if corner cases break it. Thanks to Mike Heeter
4709 know if corner cases break it. Thanks to Mike Heeter
4702 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
4710 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
4703
4711
4704 2002-05-24 Fernando Perez <fperez@colorado.edu>
4712 2002-05-24 Fernando Perez <fperez@colorado.edu>
4705
4713
4706 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
4714 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
4707 macros having broken.
4715 macros having broken.
4708
4716
4709 2002-05-21 Fernando Perez <fperez@colorado.edu>
4717 2002-05-21 Fernando Perez <fperez@colorado.edu>
4710
4718
4711 * IPython/Magic.py (Magic.magic_logstart): fixed recently
4719 * IPython/Magic.py (Magic.magic_logstart): fixed recently
4712 introduced logging bug: all history before logging started was
4720 introduced logging bug: all history before logging started was
4713 being written one character per line! This came from the redesign
4721 being written one character per line! This came from the redesign
4714 of the input history as a special list which slices to strings,
4722 of the input history as a special list which slices to strings,
4715 not to lists.
4723 not to lists.
4716
4724
4717 2002-05-20 Fernando Perez <fperez@colorado.edu>
4725 2002-05-20 Fernando Perez <fperez@colorado.edu>
4718
4726
4719 * IPython/Prompts.py (CachedOutput.__init__): made the color table
4727 * IPython/Prompts.py (CachedOutput.__init__): made the color table
4720 be an attribute of all classes in this module. The design of these
4728 be an attribute of all classes in this module. The design of these
4721 classes needs some serious overhauling.
4729 classes needs some serious overhauling.
4722
4730
4723 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
4731 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
4724 which was ignoring '_' in option names.
4732 which was ignoring '_' in option names.
4725
4733
4726 * IPython/ultraTB.py (FormattedTB.__init__): Changed
4734 * IPython/ultraTB.py (FormattedTB.__init__): Changed
4727 'Verbose_novars' to 'Context' and made it the new default. It's a
4735 'Verbose_novars' to 'Context' and made it the new default. It's a
4728 bit more readable and also safer than verbose.
4736 bit more readable and also safer than verbose.
4729
4737
4730 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
4738 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
4731 triple-quoted strings.
4739 triple-quoted strings.
4732
4740
4733 * IPython/OInspect.py (__all__): new module exposing the object
4741 * IPython/OInspect.py (__all__): new module exposing the object
4734 introspection facilities. Now the corresponding magics are dummy
4742 introspection facilities. Now the corresponding magics are dummy
4735 wrappers around this. Having this module will make it much easier
4743 wrappers around this. Having this module will make it much easier
4736 to put these functions into our modified pdb.
4744 to put these functions into our modified pdb.
4737 This new object inspector system uses the new colorizing module,
4745 This new object inspector system uses the new colorizing module,
4738 so source code and other things are nicely syntax highlighted.
4746 so source code and other things are nicely syntax highlighted.
4739
4747
4740 2002-05-18 Fernando Perez <fperez@colorado.edu>
4748 2002-05-18 Fernando Perez <fperez@colorado.edu>
4741
4749
4742 * IPython/ColorANSI.py: Split the coloring tools into a separate
4750 * IPython/ColorANSI.py: Split the coloring tools into a separate
4743 module so I can use them in other code easier (they were part of
4751 module so I can use them in other code easier (they were part of
4744 ultraTB).
4752 ultraTB).
4745
4753
4746 2002-05-17 Fernando Perez <fperez@colorado.edu>
4754 2002-05-17 Fernando Perez <fperez@colorado.edu>
4747
4755
4748 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4756 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4749 fixed it to set the global 'g' also to the called instance, as
4757 fixed it to set the global 'g' also to the called instance, as
4750 long as 'g' was still a gnuplot instance (so it doesn't overwrite
4758 long as 'g' was still a gnuplot instance (so it doesn't overwrite
4751 user's 'g' variables).
4759 user's 'g' variables).
4752
4760
4753 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
4761 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
4754 global variables (aliases to _ih,_oh) so that users which expect
4762 global variables (aliases to _ih,_oh) so that users which expect
4755 In[5] or Out[7] to work aren't unpleasantly surprised.
4763 In[5] or Out[7] to work aren't unpleasantly surprised.
4756 (InputList.__getslice__): new class to allow executing slices of
4764 (InputList.__getslice__): new class to allow executing slices of
4757 input history directly. Very simple class, complements the use of
4765 input history directly. Very simple class, complements the use of
4758 macros.
4766 macros.
4759
4767
4760 2002-05-16 Fernando Perez <fperez@colorado.edu>
4768 2002-05-16 Fernando Perez <fperez@colorado.edu>
4761
4769
4762 * setup.py (docdirbase): make doc directory be just doc/IPython
4770 * setup.py (docdirbase): make doc directory be just doc/IPython
4763 without version numbers, it will reduce clutter for users.
4771 without version numbers, it will reduce clutter for users.
4764
4772
4765 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
4773 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
4766 execfile call to prevent possible memory leak. See for details:
4774 execfile call to prevent possible memory leak. See for details:
4767 http://mail.python.org/pipermail/python-list/2002-February/088476.html
4775 http://mail.python.org/pipermail/python-list/2002-February/088476.html
4768
4776
4769 2002-05-15 Fernando Perez <fperez@colorado.edu>
4777 2002-05-15 Fernando Perez <fperez@colorado.edu>
4770
4778
4771 * IPython/Magic.py (Magic.magic_psource): made the object
4779 * IPython/Magic.py (Magic.magic_psource): made the object
4772 introspection names be more standard: pdoc, pdef, pfile and
4780 introspection names be more standard: pdoc, pdef, pfile and
4773 psource. They all print/page their output, and it makes
4781 psource. They all print/page their output, and it makes
4774 remembering them easier. Kept old names for compatibility as
4782 remembering them easier. Kept old names for compatibility as
4775 aliases.
4783 aliases.
4776
4784
4777 2002-05-14 Fernando Perez <fperez@colorado.edu>
4785 2002-05-14 Fernando Perez <fperez@colorado.edu>
4778
4786
4779 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
4787 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
4780 what the mouse problem was. The trick is to use gnuplot with temp
4788 what the mouse problem was. The trick is to use gnuplot with temp
4781 files and NOT with pipes (for data communication), because having
4789 files and NOT with pipes (for data communication), because having
4782 both pipes and the mouse on is bad news.
4790 both pipes and the mouse on is bad news.
4783
4791
4784 2002-05-13 Fernando Perez <fperez@colorado.edu>
4792 2002-05-13 Fernando Perez <fperez@colorado.edu>
4785
4793
4786 * IPython/Magic.py (Magic._ofind): fixed namespace order search
4794 * IPython/Magic.py (Magic._ofind): fixed namespace order search
4787 bug. Information would be reported about builtins even when
4795 bug. Information would be reported about builtins even when
4788 user-defined functions overrode them.
4796 user-defined functions overrode them.
4789
4797
4790 2002-05-11 Fernando Perez <fperez@colorado.edu>
4798 2002-05-11 Fernando Perez <fperez@colorado.edu>
4791
4799
4792 * IPython/__init__.py (__all__): removed FlexCompleter from
4800 * IPython/__init__.py (__all__): removed FlexCompleter from
4793 __all__ so that things don't fail in platforms without readline.
4801 __all__ so that things don't fail in platforms without readline.
4794
4802
4795 2002-05-10 Fernando Perez <fperez@colorado.edu>
4803 2002-05-10 Fernando Perez <fperez@colorado.edu>
4796
4804
4797 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
4805 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
4798 it requires Numeric, effectively making Numeric a dependency for
4806 it requires Numeric, effectively making Numeric a dependency for
4799 IPython.
4807 IPython.
4800
4808
4801 * Released 0.2.13
4809 * Released 0.2.13
4802
4810
4803 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
4811 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
4804 profiler interface. Now all the major options from the profiler
4812 profiler interface. Now all the major options from the profiler
4805 module are directly supported in IPython, both for single
4813 module are directly supported in IPython, both for single
4806 expressions (@prun) and for full programs (@run -p).
4814 expressions (@prun) and for full programs (@run -p).
4807
4815
4808 2002-05-09 Fernando Perez <fperez@colorado.edu>
4816 2002-05-09 Fernando Perez <fperez@colorado.edu>
4809
4817
4810 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
4818 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
4811 magic properly formatted for screen.
4819 magic properly formatted for screen.
4812
4820
4813 * setup.py (make_shortcut): Changed things to put pdf version in
4821 * setup.py (make_shortcut): Changed things to put pdf version in
4814 doc/ instead of doc/manual (had to change lyxport a bit).
4822 doc/ instead of doc/manual (had to change lyxport a bit).
4815
4823
4816 * IPython/Magic.py (Profile.string_stats): made profile runs go
4824 * IPython/Magic.py (Profile.string_stats): made profile runs go
4817 through pager (they are long and a pager allows searching, saving,
4825 through pager (they are long and a pager allows searching, saving,
4818 etc.)
4826 etc.)
4819
4827
4820 2002-05-08 Fernando Perez <fperez@colorado.edu>
4828 2002-05-08 Fernando Perez <fperez@colorado.edu>
4821
4829
4822 * Released 0.2.12
4830 * Released 0.2.12
4823
4831
4824 2002-05-06 Fernando Perez <fperez@colorado.edu>
4832 2002-05-06 Fernando Perez <fperez@colorado.edu>
4825
4833
4826 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
4834 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
4827 introduced); 'hist n1 n2' was broken.
4835 introduced); 'hist n1 n2' was broken.
4828 (Magic.magic_pdb): added optional on/off arguments to @pdb
4836 (Magic.magic_pdb): added optional on/off arguments to @pdb
4829 (Magic.magic_run): added option -i to @run, which executes code in
4837 (Magic.magic_run): added option -i to @run, which executes code in
4830 the IPython namespace instead of a clean one. Also added @irun as
4838 the IPython namespace instead of a clean one. Also added @irun as
4831 an alias to @run -i.
4839 an alias to @run -i.
4832
4840
4833 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4841 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4834 fixed (it didn't really do anything, the namespaces were wrong).
4842 fixed (it didn't really do anything, the namespaces were wrong).
4835
4843
4836 * IPython/Debugger.py (__init__): Added workaround for python 2.1
4844 * IPython/Debugger.py (__init__): Added workaround for python 2.1
4837
4845
4838 * IPython/__init__.py (__all__): Fixed package namespace, now
4846 * IPython/__init__.py (__all__): Fixed package namespace, now
4839 'import IPython' does give access to IPython.<all> as
4847 'import IPython' does give access to IPython.<all> as
4840 expected. Also renamed __release__ to Release.
4848 expected. Also renamed __release__ to Release.
4841
4849
4842 * IPython/Debugger.py (__license__): created new Pdb class which
4850 * IPython/Debugger.py (__license__): created new Pdb class which
4843 functions like a drop-in for the normal pdb.Pdb but does NOT
4851 functions like a drop-in for the normal pdb.Pdb but does NOT
4844 import readline by default. This way it doesn't muck up IPython's
4852 import readline by default. This way it doesn't muck up IPython's
4845 readline handling, and now tab-completion finally works in the
4853 readline handling, and now tab-completion finally works in the
4846 debugger -- sort of. It completes things globally visible, but the
4854 debugger -- sort of. It completes things globally visible, but the
4847 completer doesn't track the stack as pdb walks it. That's a bit
4855 completer doesn't track the stack as pdb walks it. That's a bit
4848 tricky, and I'll have to implement it later.
4856 tricky, and I'll have to implement it later.
4849
4857
4850 2002-05-05 Fernando Perez <fperez@colorado.edu>
4858 2002-05-05 Fernando Perez <fperez@colorado.edu>
4851
4859
4852 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
4860 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
4853 magic docstrings when printed via ? (explicit \'s were being
4861 magic docstrings when printed via ? (explicit \'s were being
4854 printed).
4862 printed).
4855
4863
4856 * IPython/ipmaker.py (make_IPython): fixed namespace
4864 * IPython/ipmaker.py (make_IPython): fixed namespace
4857 identification bug. Now variables loaded via logs or command-line
4865 identification bug. Now variables loaded via logs or command-line
4858 files are recognized in the interactive namespace by @who.
4866 files are recognized in the interactive namespace by @who.
4859
4867
4860 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
4868 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
4861 log replay system stemming from the string form of Structs.
4869 log replay system stemming from the string form of Structs.
4862
4870
4863 * IPython/Magic.py (Macro.__init__): improved macros to properly
4871 * IPython/Magic.py (Macro.__init__): improved macros to properly
4864 handle magic commands in them.
4872 handle magic commands in them.
4865 (Magic.magic_logstart): usernames are now expanded so 'logstart
4873 (Magic.magic_logstart): usernames are now expanded so 'logstart
4866 ~/mylog' now works.
4874 ~/mylog' now works.
4867
4875
4868 * IPython/iplib.py (complete): fixed bug where paths starting with
4876 * IPython/iplib.py (complete): fixed bug where paths starting with
4869 '/' would be completed as magic names.
4877 '/' would be completed as magic names.
4870
4878
4871 2002-05-04 Fernando Perez <fperez@colorado.edu>
4879 2002-05-04 Fernando Perez <fperez@colorado.edu>
4872
4880
4873 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
4881 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
4874 allow running full programs under the profiler's control.
4882 allow running full programs under the profiler's control.
4875
4883
4876 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
4884 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
4877 mode to report exceptions verbosely but without formatting
4885 mode to report exceptions verbosely but without formatting
4878 variables. This addresses the issue of ipython 'freezing' (it's
4886 variables. This addresses the issue of ipython 'freezing' (it's
4879 not frozen, but caught in an expensive formatting loop) when huge
4887 not frozen, but caught in an expensive formatting loop) when huge
4880 variables are in the context of an exception.
4888 variables are in the context of an exception.
4881 (VerboseTB.text): Added '--->' markers at line where exception was
4889 (VerboseTB.text): Added '--->' markers at line where exception was
4882 triggered. Much clearer to read, especially in NoColor modes.
4890 triggered. Much clearer to read, especially in NoColor modes.
4883
4891
4884 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
4892 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
4885 implemented in reverse when changing to the new parse_options().
4893 implemented in reverse when changing to the new parse_options().
4886
4894
4887 2002-05-03 Fernando Perez <fperez@colorado.edu>
4895 2002-05-03 Fernando Perez <fperez@colorado.edu>
4888
4896
4889 * IPython/Magic.py (Magic.parse_options): new function so that
4897 * IPython/Magic.py (Magic.parse_options): new function so that
4890 magics can parse options easier.
4898 magics can parse options easier.
4891 (Magic.magic_prun): new function similar to profile.run(),
4899 (Magic.magic_prun): new function similar to profile.run(),
4892 suggested by Chris Hart.
4900 suggested by Chris Hart.
4893 (Magic.magic_cd): fixed behavior so that it only changes if
4901 (Magic.magic_cd): fixed behavior so that it only changes if
4894 directory actually is in history.
4902 directory actually is in history.
4895
4903
4896 * IPython/usage.py (__doc__): added information about potential
4904 * IPython/usage.py (__doc__): added information about potential
4897 slowness of Verbose exception mode when there are huge data
4905 slowness of Verbose exception mode when there are huge data
4898 structures to be formatted (thanks to Archie Paulson).
4906 structures to be formatted (thanks to Archie Paulson).
4899
4907
4900 * IPython/ipmaker.py (make_IPython): Changed default logging
4908 * IPython/ipmaker.py (make_IPython): Changed default logging
4901 (when simply called with -log) to use curr_dir/ipython.log in
4909 (when simply called with -log) to use curr_dir/ipython.log in
4902 rotate mode. Fixed crash which was occuring with -log before
4910 rotate mode. Fixed crash which was occuring with -log before
4903 (thanks to Jim Boyle).
4911 (thanks to Jim Boyle).
4904
4912
4905 2002-05-01 Fernando Perez <fperez@colorado.edu>
4913 2002-05-01 Fernando Perez <fperez@colorado.edu>
4906
4914
4907 * Released 0.2.11 for these fixes (mainly the ultraTB one which
4915 * Released 0.2.11 for these fixes (mainly the ultraTB one which
4908 was nasty -- though somewhat of a corner case).
4916 was nasty -- though somewhat of a corner case).
4909
4917
4910 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
4918 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
4911 text (was a bug).
4919 text (was a bug).
4912
4920
4913 2002-04-30 Fernando Perez <fperez@colorado.edu>
4921 2002-04-30 Fernando Perez <fperez@colorado.edu>
4914
4922
4915 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
4923 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
4916 a print after ^D or ^C from the user so that the In[] prompt
4924 a print after ^D or ^C from the user so that the In[] prompt
4917 doesn't over-run the gnuplot one.
4925 doesn't over-run the gnuplot one.
4918
4926
4919 2002-04-29 Fernando Perez <fperez@colorado.edu>
4927 2002-04-29 Fernando Perez <fperez@colorado.edu>
4920
4928
4921 * Released 0.2.10
4929 * Released 0.2.10
4922
4930
4923 * IPython/__release__.py (version): get date dynamically.
4931 * IPython/__release__.py (version): get date dynamically.
4924
4932
4925 * Misc. documentation updates thanks to Arnd's comments. Also ran
4933 * Misc. documentation updates thanks to Arnd's comments. Also ran
4926 a full spellcheck on the manual (hadn't been done in a while).
4934 a full spellcheck on the manual (hadn't been done in a while).
4927
4935
4928 2002-04-27 Fernando Perez <fperez@colorado.edu>
4936 2002-04-27 Fernando Perez <fperez@colorado.edu>
4929
4937
4930 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
4938 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
4931 starting a log in mid-session would reset the input history list.
4939 starting a log in mid-session would reset the input history list.
4932
4940
4933 2002-04-26 Fernando Perez <fperez@colorado.edu>
4941 2002-04-26 Fernando Perez <fperez@colorado.edu>
4934
4942
4935 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
4943 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
4936 all files were being included in an update. Now anything in
4944 all files were being included in an update. Now anything in
4937 UserConfig that matches [A-Za-z]*.py will go (this excludes
4945 UserConfig that matches [A-Za-z]*.py will go (this excludes
4938 __init__.py)
4946 __init__.py)
4939
4947
4940 2002-04-25 Fernando Perez <fperez@colorado.edu>
4948 2002-04-25 Fernando Perez <fperez@colorado.edu>
4941
4949
4942 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
4950 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
4943 to __builtins__ so that any form of embedded or imported code can
4951 to __builtins__ so that any form of embedded or imported code can
4944 test for being inside IPython.
4952 test for being inside IPython.
4945
4953
4946 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
4954 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
4947 changed to GnuplotMagic because it's now an importable module,
4955 changed to GnuplotMagic because it's now an importable module,
4948 this makes the name follow that of the standard Gnuplot module.
4956 this makes the name follow that of the standard Gnuplot module.
4949 GnuplotMagic can now be loaded at any time in mid-session.
4957 GnuplotMagic can now be loaded at any time in mid-session.
4950
4958
4951 2002-04-24 Fernando Perez <fperez@colorado.edu>
4959 2002-04-24 Fernando Perez <fperez@colorado.edu>
4952
4960
4953 * IPython/numutils.py: removed SIUnits. It doesn't properly set
4961 * IPython/numutils.py: removed SIUnits. It doesn't properly set
4954 the globals (IPython has its own namespace) and the
4962 the globals (IPython has its own namespace) and the
4955 PhysicalQuantity stuff is much better anyway.
4963 PhysicalQuantity stuff is much better anyway.
4956
4964
4957 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
4965 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
4958 embedding example to standard user directory for
4966 embedding example to standard user directory for
4959 distribution. Also put it in the manual.
4967 distribution. Also put it in the manual.
4960
4968
4961 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
4969 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
4962 instance as first argument (so it doesn't rely on some obscure
4970 instance as first argument (so it doesn't rely on some obscure
4963 hidden global).
4971 hidden global).
4964
4972
4965 * IPython/UserConfig/ipythonrc.py: put () back in accepted
4973 * IPython/UserConfig/ipythonrc.py: put () back in accepted
4966 delimiters. While it prevents ().TAB from working, it allows
4974 delimiters. While it prevents ().TAB from working, it allows
4967 completions in open (... expressions. This is by far a more common
4975 completions in open (... expressions. This is by far a more common
4968 case.
4976 case.
4969
4977
4970 2002-04-23 Fernando Perez <fperez@colorado.edu>
4978 2002-04-23 Fernando Perez <fperez@colorado.edu>
4971
4979
4972 * IPython/Extensions/InterpreterPasteInput.py: new
4980 * IPython/Extensions/InterpreterPasteInput.py: new
4973 syntax-processing module for pasting lines with >>> or ... at the
4981 syntax-processing module for pasting lines with >>> or ... at the
4974 start.
4982 start.
4975
4983
4976 * IPython/Extensions/PhysicalQ_Interactive.py
4984 * IPython/Extensions/PhysicalQ_Interactive.py
4977 (PhysicalQuantityInteractive.__int__): fixed to work with either
4985 (PhysicalQuantityInteractive.__int__): fixed to work with either
4978 Numeric or math.
4986 Numeric or math.
4979
4987
4980 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
4988 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
4981 provided profiles. Now we have:
4989 provided profiles. Now we have:
4982 -math -> math module as * and cmath with its own namespace.
4990 -math -> math module as * and cmath with its own namespace.
4983 -numeric -> Numeric as *, plus gnuplot & grace
4991 -numeric -> Numeric as *, plus gnuplot & grace
4984 -physics -> same as before
4992 -physics -> same as before
4985
4993
4986 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
4994 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
4987 user-defined magics wouldn't be found by @magic if they were
4995 user-defined magics wouldn't be found by @magic if they were
4988 defined as class methods. Also cleaned up the namespace search
4996 defined as class methods. Also cleaned up the namespace search
4989 logic and the string building (to use %s instead of many repeated
4997 logic and the string building (to use %s instead of many repeated
4990 string adds).
4998 string adds).
4991
4999
4992 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5000 * IPython/UserConfig/example-magic.py (magic_foo): updated example
4993 of user-defined magics to operate with class methods (cleaner, in
5001 of user-defined magics to operate with class methods (cleaner, in
4994 line with the gnuplot code).
5002 line with the gnuplot code).
4995
5003
4996 2002-04-22 Fernando Perez <fperez@colorado.edu>
5004 2002-04-22 Fernando Perez <fperez@colorado.edu>
4997
5005
4998 * setup.py: updated dependency list so that manual is updated when
5006 * setup.py: updated dependency list so that manual is updated when
4999 all included files change.
5007 all included files change.
5000
5008
5001 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5009 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5002 the delimiter removal option (the fix is ugly right now).
5010 the delimiter removal option (the fix is ugly right now).
5003
5011
5004 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5012 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5005 all of the math profile (quicker loading, no conflict between
5013 all of the math profile (quicker loading, no conflict between
5006 g-9.8 and g-gnuplot).
5014 g-9.8 and g-gnuplot).
5007
5015
5008 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5016 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5009 name of post-mortem files to IPython_crash_report.txt.
5017 name of post-mortem files to IPython_crash_report.txt.
5010
5018
5011 * Cleanup/update of the docs. Added all the new readline info and
5019 * Cleanup/update of the docs. Added all the new readline info and
5012 formatted all lists as 'real lists'.
5020 formatted all lists as 'real lists'.
5013
5021
5014 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5022 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5015 tab-completion options, since the full readline parse_and_bind is
5023 tab-completion options, since the full readline parse_and_bind is
5016 now accessible.
5024 now accessible.
5017
5025
5018 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5026 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5019 handling of readline options. Now users can specify any string to
5027 handling of readline options. Now users can specify any string to
5020 be passed to parse_and_bind(), as well as the delimiters to be
5028 be passed to parse_and_bind(), as well as the delimiters to be
5021 removed.
5029 removed.
5022 (InteractiveShell.__init__): Added __name__ to the global
5030 (InteractiveShell.__init__): Added __name__ to the global
5023 namespace so that things like Itpl which rely on its existence
5031 namespace so that things like Itpl which rely on its existence
5024 don't crash.
5032 don't crash.
5025 (InteractiveShell._prefilter): Defined the default with a _ so
5033 (InteractiveShell._prefilter): Defined the default with a _ so
5026 that prefilter() is easier to override, while the default one
5034 that prefilter() is easier to override, while the default one
5027 remains available.
5035 remains available.
5028
5036
5029 2002-04-18 Fernando Perez <fperez@colorado.edu>
5037 2002-04-18 Fernando Perez <fperez@colorado.edu>
5030
5038
5031 * Added information about pdb in the docs.
5039 * Added information about pdb in the docs.
5032
5040
5033 2002-04-17 Fernando Perez <fperez@colorado.edu>
5041 2002-04-17 Fernando Perez <fperez@colorado.edu>
5034
5042
5035 * IPython/ipmaker.py (make_IPython): added rc_override option to
5043 * IPython/ipmaker.py (make_IPython): added rc_override option to
5036 allow passing config options at creation time which may override
5044 allow passing config options at creation time which may override
5037 anything set in the config files or command line. This is
5045 anything set in the config files or command line. This is
5038 particularly useful for configuring embedded instances.
5046 particularly useful for configuring embedded instances.
5039
5047
5040 2002-04-15 Fernando Perez <fperez@colorado.edu>
5048 2002-04-15 Fernando Perez <fperez@colorado.edu>
5041
5049
5042 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5050 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5043 crash embedded instances because of the input cache falling out of
5051 crash embedded instances because of the input cache falling out of
5044 sync with the output counter.
5052 sync with the output counter.
5045
5053
5046 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5054 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5047 mode which calls pdb after an uncaught exception in IPython itself.
5055 mode which calls pdb after an uncaught exception in IPython itself.
5048
5056
5049 2002-04-14 Fernando Perez <fperez@colorado.edu>
5057 2002-04-14 Fernando Perez <fperez@colorado.edu>
5050
5058
5051 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5059 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5052 readline, fix it back after each call.
5060 readline, fix it back after each call.
5053
5061
5054 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5062 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5055 method to force all access via __call__(), which guarantees that
5063 method to force all access via __call__(), which guarantees that
5056 traceback references are properly deleted.
5064 traceback references are properly deleted.
5057
5065
5058 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5066 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5059 improve printing when pprint is in use.
5067 improve printing when pprint is in use.
5060
5068
5061 2002-04-13 Fernando Perez <fperez@colorado.edu>
5069 2002-04-13 Fernando Perez <fperez@colorado.edu>
5062
5070
5063 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5071 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5064 exceptions aren't caught anymore. If the user triggers one, he
5072 exceptions aren't caught anymore. If the user triggers one, he
5065 should know why he's doing it and it should go all the way up,
5073 should know why he's doing it and it should go all the way up,
5066 just like any other exception. So now @abort will fully kill the
5074 just like any other exception. So now @abort will fully kill the
5067 embedded interpreter and the embedding code (unless that happens
5075 embedded interpreter and the embedding code (unless that happens
5068 to catch SystemExit).
5076 to catch SystemExit).
5069
5077
5070 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5078 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5071 and a debugger() method to invoke the interactive pdb debugger
5079 and a debugger() method to invoke the interactive pdb debugger
5072 after printing exception information. Also added the corresponding
5080 after printing exception information. Also added the corresponding
5073 -pdb option and @pdb magic to control this feature, and updated
5081 -pdb option and @pdb magic to control this feature, and updated
5074 the docs. After a suggestion from Christopher Hart
5082 the docs. After a suggestion from Christopher Hart
5075 (hart-AT-caltech.edu).
5083 (hart-AT-caltech.edu).
5076
5084
5077 2002-04-12 Fernando Perez <fperez@colorado.edu>
5085 2002-04-12 Fernando Perez <fperez@colorado.edu>
5078
5086
5079 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5087 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5080 the exception handlers defined by the user (not the CrashHandler)
5088 the exception handlers defined by the user (not the CrashHandler)
5081 so that user exceptions don't trigger an ipython bug report.
5089 so that user exceptions don't trigger an ipython bug report.
5082
5090
5083 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5091 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5084 configurable (it should have always been so).
5092 configurable (it should have always been so).
5085
5093
5086 2002-03-26 Fernando Perez <fperez@colorado.edu>
5094 2002-03-26 Fernando Perez <fperez@colorado.edu>
5087
5095
5088 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5096 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5089 and there to fix embedding namespace issues. This should all be
5097 and there to fix embedding namespace issues. This should all be
5090 done in a more elegant way.
5098 done in a more elegant way.
5091
5099
5092 2002-03-25 Fernando Perez <fperez@colorado.edu>
5100 2002-03-25 Fernando Perez <fperez@colorado.edu>
5093
5101
5094 * IPython/genutils.py (get_home_dir): Try to make it work under
5102 * IPython/genutils.py (get_home_dir): Try to make it work under
5095 win9x also.
5103 win9x also.
5096
5104
5097 2002-03-20 Fernando Perez <fperez@colorado.edu>
5105 2002-03-20 Fernando Perez <fperez@colorado.edu>
5098
5106
5099 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5107 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5100 sys.displayhook untouched upon __init__.
5108 sys.displayhook untouched upon __init__.
5101
5109
5102 2002-03-19 Fernando Perez <fperez@colorado.edu>
5110 2002-03-19 Fernando Perez <fperez@colorado.edu>
5103
5111
5104 * Released 0.2.9 (for embedding bug, basically).
5112 * Released 0.2.9 (for embedding bug, basically).
5105
5113
5106 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5114 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5107 exceptions so that enclosing shell's state can be restored.
5115 exceptions so that enclosing shell's state can be restored.
5108
5116
5109 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5117 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5110 naming conventions in the .ipython/ dir.
5118 naming conventions in the .ipython/ dir.
5111
5119
5112 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5120 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5113 from delimiters list so filenames with - in them get expanded.
5121 from delimiters list so filenames with - in them get expanded.
5114
5122
5115 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5123 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5116 sys.displayhook not being properly restored after an embedded call.
5124 sys.displayhook not being properly restored after an embedded call.
5117
5125
5118 2002-03-18 Fernando Perez <fperez@colorado.edu>
5126 2002-03-18 Fernando Perez <fperez@colorado.edu>
5119
5127
5120 * Released 0.2.8
5128 * Released 0.2.8
5121
5129
5122 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5130 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5123 some files weren't being included in a -upgrade.
5131 some files weren't being included in a -upgrade.
5124 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5132 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5125 on' so that the first tab completes.
5133 on' so that the first tab completes.
5126 (InteractiveShell.handle_magic): fixed bug with spaces around
5134 (InteractiveShell.handle_magic): fixed bug with spaces around
5127 quotes breaking many magic commands.
5135 quotes breaking many magic commands.
5128
5136
5129 * setup.py: added note about ignoring the syntax error messages at
5137 * setup.py: added note about ignoring the syntax error messages at
5130 installation.
5138 installation.
5131
5139
5132 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5140 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5133 streamlining the gnuplot interface, now there's only one magic @gp.
5141 streamlining the gnuplot interface, now there's only one magic @gp.
5134
5142
5135 2002-03-17 Fernando Perez <fperez@colorado.edu>
5143 2002-03-17 Fernando Perez <fperez@colorado.edu>
5136
5144
5137 * IPython/UserConfig/magic_gnuplot.py: new name for the
5145 * IPython/UserConfig/magic_gnuplot.py: new name for the
5138 example-magic_pm.py file. Much enhanced system, now with a shell
5146 example-magic_pm.py file. Much enhanced system, now with a shell
5139 for communicating directly with gnuplot, one command at a time.
5147 for communicating directly with gnuplot, one command at a time.
5140
5148
5141 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5149 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5142 setting __name__=='__main__'.
5150 setting __name__=='__main__'.
5143
5151
5144 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5152 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5145 mini-shell for accessing gnuplot from inside ipython. Should
5153 mini-shell for accessing gnuplot from inside ipython. Should
5146 extend it later for grace access too. Inspired by Arnd's
5154 extend it later for grace access too. Inspired by Arnd's
5147 suggestion.
5155 suggestion.
5148
5156
5149 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5157 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5150 calling magic functions with () in their arguments. Thanks to Arnd
5158 calling magic functions with () in their arguments. Thanks to Arnd
5151 Baecker for pointing this to me.
5159 Baecker for pointing this to me.
5152
5160
5153 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5161 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5154 infinitely for integer or complex arrays (only worked with floats).
5162 infinitely for integer or complex arrays (only worked with floats).
5155
5163
5156 2002-03-16 Fernando Perez <fperez@colorado.edu>
5164 2002-03-16 Fernando Perez <fperez@colorado.edu>
5157
5165
5158 * setup.py: Merged setup and setup_windows into a single script
5166 * setup.py: Merged setup and setup_windows into a single script
5159 which properly handles things for windows users.
5167 which properly handles things for windows users.
5160
5168
5161 2002-03-15 Fernando Perez <fperez@colorado.edu>
5169 2002-03-15 Fernando Perez <fperez@colorado.edu>
5162
5170
5163 * Big change to the manual: now the magics are all automatically
5171 * Big change to the manual: now the magics are all automatically
5164 documented. This information is generated from their docstrings
5172 documented. This information is generated from their docstrings
5165 and put in a latex file included by the manual lyx file. This way
5173 and put in a latex file included by the manual lyx file. This way
5166 we get always up to date information for the magics. The manual
5174 we get always up to date information for the magics. The manual
5167 now also has proper version information, also auto-synced.
5175 now also has proper version information, also auto-synced.
5168
5176
5169 For this to work, an undocumented --magic_docstrings option was added.
5177 For this to work, an undocumented --magic_docstrings option was added.
5170
5178
5171 2002-03-13 Fernando Perez <fperez@colorado.edu>
5179 2002-03-13 Fernando Perez <fperez@colorado.edu>
5172
5180
5173 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5181 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5174 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5182 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5175
5183
5176 2002-03-12 Fernando Perez <fperez@colorado.edu>
5184 2002-03-12 Fernando Perez <fperez@colorado.edu>
5177
5185
5178 * IPython/ultraTB.py (TermColors): changed color escapes again to
5186 * IPython/ultraTB.py (TermColors): changed color escapes again to
5179 fix the (old, reintroduced) line-wrapping bug. Basically, if
5187 fix the (old, reintroduced) line-wrapping bug. Basically, if
5180 \001..\002 aren't given in the color escapes, lines get wrapped
5188 \001..\002 aren't given in the color escapes, lines get wrapped
5181 weirdly. But giving those screws up old xterms and emacs terms. So
5189 weirdly. But giving those screws up old xterms and emacs terms. So
5182 I added some logic for emacs terms to be ok, but I can't identify old
5190 I added some logic for emacs terms to be ok, but I can't identify old
5183 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5191 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5184
5192
5185 2002-03-10 Fernando Perez <fperez@colorado.edu>
5193 2002-03-10 Fernando Perez <fperez@colorado.edu>
5186
5194
5187 * IPython/usage.py (__doc__): Various documentation cleanups and
5195 * IPython/usage.py (__doc__): Various documentation cleanups and
5188 updates, both in usage docstrings and in the manual.
5196 updates, both in usage docstrings and in the manual.
5189
5197
5190 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5198 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5191 handling of caching. Set minimum acceptabe value for having a
5199 handling of caching. Set minimum acceptabe value for having a
5192 cache at 20 values.
5200 cache at 20 values.
5193
5201
5194 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5202 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5195 install_first_time function to a method, renamed it and added an
5203 install_first_time function to a method, renamed it and added an
5196 'upgrade' mode. Now people can update their config directory with
5204 'upgrade' mode. Now people can update their config directory with
5197 a simple command line switch (-upgrade, also new).
5205 a simple command line switch (-upgrade, also new).
5198
5206
5199 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5207 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5200 @file (convenient for automagic users under Python >= 2.2).
5208 @file (convenient for automagic users under Python >= 2.2).
5201 Removed @files (it seemed more like a plural than an abbrev. of
5209 Removed @files (it seemed more like a plural than an abbrev. of
5202 'file show').
5210 'file show').
5203
5211
5204 * IPython/iplib.py (install_first_time): Fixed crash if there were
5212 * IPython/iplib.py (install_first_time): Fixed crash if there were
5205 backup files ('~') in .ipython/ install directory.
5213 backup files ('~') in .ipython/ install directory.
5206
5214
5207 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5215 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5208 system. Things look fine, but these changes are fairly
5216 system. Things look fine, but these changes are fairly
5209 intrusive. Test them for a few days.
5217 intrusive. Test them for a few days.
5210
5218
5211 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5219 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5212 the prompts system. Now all in/out prompt strings are user
5220 the prompts system. Now all in/out prompt strings are user
5213 controllable. This is particularly useful for embedding, as one
5221 controllable. This is particularly useful for embedding, as one
5214 can tag embedded instances with particular prompts.
5222 can tag embedded instances with particular prompts.
5215
5223
5216 Also removed global use of sys.ps1/2, which now allows nested
5224 Also removed global use of sys.ps1/2, which now allows nested
5217 embeddings without any problems. Added command-line options for
5225 embeddings without any problems. Added command-line options for
5218 the prompt strings.
5226 the prompt strings.
5219
5227
5220 2002-03-08 Fernando Perez <fperez@colorado.edu>
5228 2002-03-08 Fernando Perez <fperez@colorado.edu>
5221
5229
5222 * IPython/UserConfig/example-embed-short.py (ipshell): added
5230 * IPython/UserConfig/example-embed-short.py (ipshell): added
5223 example file with the bare minimum code for embedding.
5231 example file with the bare minimum code for embedding.
5224
5232
5225 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5233 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5226 functionality for the embeddable shell to be activated/deactivated
5234 functionality for the embeddable shell to be activated/deactivated
5227 either globally or at each call.
5235 either globally or at each call.
5228
5236
5229 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5237 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5230 rewriting the prompt with '--->' for auto-inputs with proper
5238 rewriting the prompt with '--->' for auto-inputs with proper
5231 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5239 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5232 this is handled by the prompts class itself, as it should.
5240 this is handled by the prompts class itself, as it should.
5233
5241
5234 2002-03-05 Fernando Perez <fperez@colorado.edu>
5242 2002-03-05 Fernando Perez <fperez@colorado.edu>
5235
5243
5236 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5244 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5237 @logstart to avoid name clashes with the math log function.
5245 @logstart to avoid name clashes with the math log function.
5238
5246
5239 * Big updates to X/Emacs section of the manual.
5247 * Big updates to X/Emacs section of the manual.
5240
5248
5241 * Removed ipython_emacs. Milan explained to me how to pass
5249 * Removed ipython_emacs. Milan explained to me how to pass
5242 arguments to ipython through Emacs. Some day I'm going to end up
5250 arguments to ipython through Emacs. Some day I'm going to end up
5243 learning some lisp...
5251 learning some lisp...
5244
5252
5245 2002-03-04 Fernando Perez <fperez@colorado.edu>
5253 2002-03-04 Fernando Perez <fperez@colorado.edu>
5246
5254
5247 * IPython/ipython_emacs: Created script to be used as the
5255 * IPython/ipython_emacs: Created script to be used as the
5248 py-python-command Emacs variable so we can pass IPython
5256 py-python-command Emacs variable so we can pass IPython
5249 parameters. I can't figure out how to tell Emacs directly to pass
5257 parameters. I can't figure out how to tell Emacs directly to pass
5250 parameters to IPython, so a dummy shell script will do it.
5258 parameters to IPython, so a dummy shell script will do it.
5251
5259
5252 Other enhancements made for things to work better under Emacs'
5260 Other enhancements made for things to work better under Emacs'
5253 various types of terminals. Many thanks to Milan Zamazal
5261 various types of terminals. Many thanks to Milan Zamazal
5254 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5262 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5255
5263
5256 2002-03-01 Fernando Perez <fperez@colorado.edu>
5264 2002-03-01 Fernando Perez <fperez@colorado.edu>
5257
5265
5258 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5266 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5259 that loading of readline is now optional. This gives better
5267 that loading of readline is now optional. This gives better
5260 control to emacs users.
5268 control to emacs users.
5261
5269
5262 * IPython/ultraTB.py (__date__): Modified color escape sequences
5270 * IPython/ultraTB.py (__date__): Modified color escape sequences
5263 and now things work fine under xterm and in Emacs' term buffers
5271 and now things work fine under xterm and in Emacs' term buffers
5264 (though not shell ones). Well, in emacs you get colors, but all
5272 (though not shell ones). Well, in emacs you get colors, but all
5265 seem to be 'light' colors (no difference between dark and light
5273 seem to be 'light' colors (no difference between dark and light
5266 ones). But the garbage chars are gone, and also in xterms. It
5274 ones). But the garbage chars are gone, and also in xterms. It
5267 seems that now I'm using 'cleaner' ansi sequences.
5275 seems that now I'm using 'cleaner' ansi sequences.
5268
5276
5269 2002-02-21 Fernando Perez <fperez@colorado.edu>
5277 2002-02-21 Fernando Perez <fperez@colorado.edu>
5270
5278
5271 * Released 0.2.7 (mainly to publish the scoping fix).
5279 * Released 0.2.7 (mainly to publish the scoping fix).
5272
5280
5273 * IPython/Logger.py (Logger.logstate): added. A corresponding
5281 * IPython/Logger.py (Logger.logstate): added. A corresponding
5274 @logstate magic was created.
5282 @logstate magic was created.
5275
5283
5276 * IPython/Magic.py: fixed nested scoping problem under Python
5284 * IPython/Magic.py: fixed nested scoping problem under Python
5277 2.1.x (automagic wasn't working).
5285 2.1.x (automagic wasn't working).
5278
5286
5279 2002-02-20 Fernando Perez <fperez@colorado.edu>
5287 2002-02-20 Fernando Perez <fperez@colorado.edu>
5280
5288
5281 * Released 0.2.6.
5289 * Released 0.2.6.
5282
5290
5283 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
5291 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
5284 option so that logs can come out without any headers at all.
5292 option so that logs can come out without any headers at all.
5285
5293
5286 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
5294 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
5287 SciPy.
5295 SciPy.
5288
5296
5289 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
5297 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
5290 that embedded IPython calls don't require vars() to be explicitly
5298 that embedded IPython calls don't require vars() to be explicitly
5291 passed. Now they are extracted from the caller's frame (code
5299 passed. Now they are extracted from the caller's frame (code
5292 snatched from Eric Jones' weave). Added better documentation to
5300 snatched from Eric Jones' weave). Added better documentation to
5293 the section on embedding and the example file.
5301 the section on embedding and the example file.
5294
5302
5295 * IPython/genutils.py (page): Changed so that under emacs, it just
5303 * IPython/genutils.py (page): Changed so that under emacs, it just
5296 prints the string. You can then page up and down in the emacs
5304 prints the string. You can then page up and down in the emacs
5297 buffer itself. This is how the builtin help() works.
5305 buffer itself. This is how the builtin help() works.
5298
5306
5299 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
5307 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
5300 macro scoping: macros need to be executed in the user's namespace
5308 macro scoping: macros need to be executed in the user's namespace
5301 to work as if they had been typed by the user.
5309 to work as if they had been typed by the user.
5302
5310
5303 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
5311 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
5304 execute automatically (no need to type 'exec...'). They then
5312 execute automatically (no need to type 'exec...'). They then
5305 behave like 'true macros'. The printing system was also modified
5313 behave like 'true macros'. The printing system was also modified
5306 for this to work.
5314 for this to work.
5307
5315
5308 2002-02-19 Fernando Perez <fperez@colorado.edu>
5316 2002-02-19 Fernando Perez <fperez@colorado.edu>
5309
5317
5310 * IPython/genutils.py (page_file): new function for paging files
5318 * IPython/genutils.py (page_file): new function for paging files
5311 in an OS-independent way. Also necessary for file viewing to work
5319 in an OS-independent way. Also necessary for file viewing to work
5312 well inside Emacs buffers.
5320 well inside Emacs buffers.
5313 (page): Added checks for being in an emacs buffer.
5321 (page): Added checks for being in an emacs buffer.
5314 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
5322 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
5315 same bug in iplib.
5323 same bug in iplib.
5316
5324
5317 2002-02-18 Fernando Perez <fperez@colorado.edu>
5325 2002-02-18 Fernando Perez <fperez@colorado.edu>
5318
5326
5319 * IPython/iplib.py (InteractiveShell.init_readline): modified use
5327 * IPython/iplib.py (InteractiveShell.init_readline): modified use
5320 of readline so that IPython can work inside an Emacs buffer.
5328 of readline so that IPython can work inside an Emacs buffer.
5321
5329
5322 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
5330 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
5323 method signatures (they weren't really bugs, but it looks cleaner
5331 method signatures (they weren't really bugs, but it looks cleaner
5324 and keeps PyChecker happy).
5332 and keeps PyChecker happy).
5325
5333
5326 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
5334 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
5327 for implementing various user-defined hooks. Currently only
5335 for implementing various user-defined hooks. Currently only
5328 display is done.
5336 display is done.
5329
5337
5330 * IPython/Prompts.py (CachedOutput._display): changed display
5338 * IPython/Prompts.py (CachedOutput._display): changed display
5331 functions so that they can be dynamically changed by users easily.
5339 functions so that they can be dynamically changed by users easily.
5332
5340
5333 * IPython/Extensions/numeric_formats.py (num_display): added an
5341 * IPython/Extensions/numeric_formats.py (num_display): added an
5334 extension for printing NumPy arrays in flexible manners. It
5342 extension for printing NumPy arrays in flexible manners. It
5335 doesn't do anything yet, but all the structure is in
5343 doesn't do anything yet, but all the structure is in
5336 place. Ultimately the plan is to implement output format control
5344 place. Ultimately the plan is to implement output format control
5337 like in Octave.
5345 like in Octave.
5338
5346
5339 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
5347 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
5340 methods are found at run-time by all the automatic machinery.
5348 methods are found at run-time by all the automatic machinery.
5341
5349
5342 2002-02-17 Fernando Perez <fperez@colorado.edu>
5350 2002-02-17 Fernando Perez <fperez@colorado.edu>
5343
5351
5344 * setup_Windows.py (make_shortcut): documented. Cleaned up the
5352 * setup_Windows.py (make_shortcut): documented. Cleaned up the
5345 whole file a little.
5353 whole file a little.
5346
5354
5347 * ToDo: closed this document. Now there's a new_design.lyx
5355 * ToDo: closed this document. Now there's a new_design.lyx
5348 document for all new ideas. Added making a pdf of it for the
5356 document for all new ideas. Added making a pdf of it for the
5349 end-user distro.
5357 end-user distro.
5350
5358
5351 * IPython/Logger.py (Logger.switch_log): Created this to replace
5359 * IPython/Logger.py (Logger.switch_log): Created this to replace
5352 logon() and logoff(). It also fixes a nasty crash reported by
5360 logon() and logoff(). It also fixes a nasty crash reported by
5353 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
5361 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
5354
5362
5355 * IPython/iplib.py (complete): got auto-completion to work with
5363 * IPython/iplib.py (complete): got auto-completion to work with
5356 automagic (I had wanted this for a long time).
5364 automagic (I had wanted this for a long time).
5357
5365
5358 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
5366 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
5359 to @file, since file() is now a builtin and clashes with automagic
5367 to @file, since file() is now a builtin and clashes with automagic
5360 for @file.
5368 for @file.
5361
5369
5362 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
5370 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
5363 of this was previously in iplib, which had grown to more than 2000
5371 of this was previously in iplib, which had grown to more than 2000
5364 lines, way too long. No new functionality, but it makes managing
5372 lines, way too long. No new functionality, but it makes managing
5365 the code a bit easier.
5373 the code a bit easier.
5366
5374
5367 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
5375 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
5368 information to crash reports.
5376 information to crash reports.
5369
5377
5370 2002-02-12 Fernando Perez <fperez@colorado.edu>
5378 2002-02-12 Fernando Perez <fperez@colorado.edu>
5371
5379
5372 * Released 0.2.5.
5380 * Released 0.2.5.
5373
5381
5374 2002-02-11 Fernando Perez <fperez@colorado.edu>
5382 2002-02-11 Fernando Perez <fperez@colorado.edu>
5375
5383
5376 * Wrote a relatively complete Windows installer. It puts
5384 * Wrote a relatively complete Windows installer. It puts
5377 everything in place, creates Start Menu entries and fixes the
5385 everything in place, creates Start Menu entries and fixes the
5378 color issues. Nothing fancy, but it works.
5386 color issues. Nothing fancy, but it works.
5379
5387
5380 2002-02-10 Fernando Perez <fperez@colorado.edu>
5388 2002-02-10 Fernando Perez <fperez@colorado.edu>
5381
5389
5382 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
5390 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
5383 os.path.expanduser() call so that we can type @run ~/myfile.py and
5391 os.path.expanduser() call so that we can type @run ~/myfile.py and
5384 have thigs work as expected.
5392 have thigs work as expected.
5385
5393
5386 * IPython/genutils.py (page): fixed exception handling so things
5394 * IPython/genutils.py (page): fixed exception handling so things
5387 work both in Unix and Windows correctly. Quitting a pager triggers
5395 work both in Unix and Windows correctly. Quitting a pager triggers
5388 an IOError/broken pipe in Unix, and in windows not finding a pager
5396 an IOError/broken pipe in Unix, and in windows not finding a pager
5389 is also an IOError, so I had to actually look at the return value
5397 is also an IOError, so I had to actually look at the return value
5390 of the exception, not just the exception itself. Should be ok now.
5398 of the exception, not just the exception itself. Should be ok now.
5391
5399
5392 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
5400 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
5393 modified to allow case-insensitive color scheme changes.
5401 modified to allow case-insensitive color scheme changes.
5394
5402
5395 2002-02-09 Fernando Perez <fperez@colorado.edu>
5403 2002-02-09 Fernando Perez <fperez@colorado.edu>
5396
5404
5397 * IPython/genutils.py (native_line_ends): new function to leave
5405 * IPython/genutils.py (native_line_ends): new function to leave
5398 user config files with os-native line-endings.
5406 user config files with os-native line-endings.
5399
5407
5400 * README and manual updates.
5408 * README and manual updates.
5401
5409
5402 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
5410 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
5403 instead of StringType to catch Unicode strings.
5411 instead of StringType to catch Unicode strings.
5404
5412
5405 * IPython/genutils.py (filefind): fixed bug for paths with
5413 * IPython/genutils.py (filefind): fixed bug for paths with
5406 embedded spaces (very common in Windows).
5414 embedded spaces (very common in Windows).
5407
5415
5408 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
5416 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
5409 files under Windows, so that they get automatically associated
5417 files under Windows, so that they get automatically associated
5410 with a text editor. Windows makes it a pain to handle
5418 with a text editor. Windows makes it a pain to handle
5411 extension-less files.
5419 extension-less files.
5412
5420
5413 * IPython/iplib.py (InteractiveShell.init_readline): Made the
5421 * IPython/iplib.py (InteractiveShell.init_readline): Made the
5414 warning about readline only occur for Posix. In Windows there's no
5422 warning about readline only occur for Posix. In Windows there's no
5415 way to get readline, so why bother with the warning.
5423 way to get readline, so why bother with the warning.
5416
5424
5417 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
5425 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
5418 for __str__ instead of dir(self), since dir() changed in 2.2.
5426 for __str__ instead of dir(self), since dir() changed in 2.2.
5419
5427
5420 * Ported to Windows! Tested on XP, I suspect it should work fine
5428 * Ported to Windows! Tested on XP, I suspect it should work fine
5421 on NT/2000, but I don't think it will work on 98 et al. That
5429 on NT/2000, but I don't think it will work on 98 et al. That
5422 series of Windows is such a piece of junk anyway that I won't try
5430 series of Windows is such a piece of junk anyway that I won't try
5423 porting it there. The XP port was straightforward, showed a few
5431 porting it there. The XP port was straightforward, showed a few
5424 bugs here and there (fixed all), in particular some string
5432 bugs here and there (fixed all), in particular some string
5425 handling stuff which required considering Unicode strings (which
5433 handling stuff which required considering Unicode strings (which
5426 Windows uses). This is good, but hasn't been too tested :) No
5434 Windows uses). This is good, but hasn't been too tested :) No
5427 fancy installer yet, I'll put a note in the manual so people at
5435 fancy installer yet, I'll put a note in the manual so people at
5428 least make manually a shortcut.
5436 least make manually a shortcut.
5429
5437
5430 * IPython/iplib.py (Magic.magic_colors): Unified the color options
5438 * IPython/iplib.py (Magic.magic_colors): Unified the color options
5431 into a single one, "colors". This now controls both prompt and
5439 into a single one, "colors". This now controls both prompt and
5432 exception color schemes, and can be changed both at startup
5440 exception color schemes, and can be changed both at startup
5433 (either via command-line switches or via ipythonrc files) and at
5441 (either via command-line switches or via ipythonrc files) and at
5434 runtime, with @colors.
5442 runtime, with @colors.
5435 (Magic.magic_run): renamed @prun to @run and removed the old
5443 (Magic.magic_run): renamed @prun to @run and removed the old
5436 @run. The two were too similar to warrant keeping both.
5444 @run. The two were too similar to warrant keeping both.
5437
5445
5438 2002-02-03 Fernando Perez <fperez@colorado.edu>
5446 2002-02-03 Fernando Perez <fperez@colorado.edu>
5439
5447
5440 * IPython/iplib.py (install_first_time): Added comment on how to
5448 * IPython/iplib.py (install_first_time): Added comment on how to
5441 configure the color options for first-time users. Put a <return>
5449 configure the color options for first-time users. Put a <return>
5442 request at the end so that small-terminal users get a chance to
5450 request at the end so that small-terminal users get a chance to
5443 read the startup info.
5451 read the startup info.
5444
5452
5445 2002-01-23 Fernando Perez <fperez@colorado.edu>
5453 2002-01-23 Fernando Perez <fperez@colorado.edu>
5446
5454
5447 * IPython/iplib.py (CachedOutput.update): Changed output memory
5455 * IPython/iplib.py (CachedOutput.update): Changed output memory
5448 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
5456 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
5449 input history we still use _i. Did this b/c these variable are
5457 input history we still use _i. Did this b/c these variable are
5450 very commonly used in interactive work, so the less we need to
5458 very commonly used in interactive work, so the less we need to
5451 type the better off we are.
5459 type the better off we are.
5452 (Magic.magic_prun): updated @prun to better handle the namespaces
5460 (Magic.magic_prun): updated @prun to better handle the namespaces
5453 the file will run in, including a fix for __name__ not being set
5461 the file will run in, including a fix for __name__ not being set
5454 before.
5462 before.
5455
5463
5456 2002-01-20 Fernando Perez <fperez@colorado.edu>
5464 2002-01-20 Fernando Perez <fperez@colorado.edu>
5457
5465
5458 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
5466 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
5459 extra garbage for Python 2.2. Need to look more carefully into
5467 extra garbage for Python 2.2. Need to look more carefully into
5460 this later.
5468 this later.
5461
5469
5462 2002-01-19 Fernando Perez <fperez@colorado.edu>
5470 2002-01-19 Fernando Perez <fperez@colorado.edu>
5463
5471
5464 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
5472 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
5465 display SyntaxError exceptions properly formatted when they occur
5473 display SyntaxError exceptions properly formatted when they occur
5466 (they can be triggered by imported code).
5474 (they can be triggered by imported code).
5467
5475
5468 2002-01-18 Fernando Perez <fperez@colorado.edu>
5476 2002-01-18 Fernando Perez <fperez@colorado.edu>
5469
5477
5470 * IPython/iplib.py (InteractiveShell.safe_execfile): now
5478 * IPython/iplib.py (InteractiveShell.safe_execfile): now
5471 SyntaxError exceptions are reported nicely formatted, instead of
5479 SyntaxError exceptions are reported nicely formatted, instead of
5472 spitting out only offset information as before.
5480 spitting out only offset information as before.
5473 (Magic.magic_prun): Added the @prun function for executing
5481 (Magic.magic_prun): Added the @prun function for executing
5474 programs with command line args inside IPython.
5482 programs with command line args inside IPython.
5475
5483
5476 2002-01-16 Fernando Perez <fperez@colorado.edu>
5484 2002-01-16 Fernando Perez <fperez@colorado.edu>
5477
5485
5478 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
5486 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
5479 to *not* include the last item given in a range. This brings their
5487 to *not* include the last item given in a range. This brings their
5480 behavior in line with Python's slicing:
5488 behavior in line with Python's slicing:
5481 a[n1:n2] -> a[n1]...a[n2-1]
5489 a[n1:n2] -> a[n1]...a[n2-1]
5482 It may be a bit less convenient, but I prefer to stick to Python's
5490 It may be a bit less convenient, but I prefer to stick to Python's
5483 conventions *everywhere*, so users never have to wonder.
5491 conventions *everywhere*, so users never have to wonder.
5484 (Magic.magic_macro): Added @macro function to ease the creation of
5492 (Magic.magic_macro): Added @macro function to ease the creation of
5485 macros.
5493 macros.
5486
5494
5487 2002-01-05 Fernando Perez <fperez@colorado.edu>
5495 2002-01-05 Fernando Perez <fperez@colorado.edu>
5488
5496
5489 * Released 0.2.4.
5497 * Released 0.2.4.
5490
5498
5491 * IPython/iplib.py (Magic.magic_pdef):
5499 * IPython/iplib.py (Magic.magic_pdef):
5492 (InteractiveShell.safe_execfile): report magic lines and error
5500 (InteractiveShell.safe_execfile): report magic lines and error
5493 lines without line numbers so one can easily copy/paste them for
5501 lines without line numbers so one can easily copy/paste them for
5494 re-execution.
5502 re-execution.
5495
5503
5496 * Updated manual with recent changes.
5504 * Updated manual with recent changes.
5497
5505
5498 * IPython/iplib.py (Magic.magic_oinfo): added constructor
5506 * IPython/iplib.py (Magic.magic_oinfo): added constructor
5499 docstring printing when class? is called. Very handy for knowing
5507 docstring printing when class? is called. Very handy for knowing
5500 how to create class instances (as long as __init__ is well
5508 how to create class instances (as long as __init__ is well
5501 documented, of course :)
5509 documented, of course :)
5502 (Magic.magic_doc): print both class and constructor docstrings.
5510 (Magic.magic_doc): print both class and constructor docstrings.
5503 (Magic.magic_pdef): give constructor info if passed a class and
5511 (Magic.magic_pdef): give constructor info if passed a class and
5504 __call__ info for callable object instances.
5512 __call__ info for callable object instances.
5505
5513
5506 2002-01-04 Fernando Perez <fperez@colorado.edu>
5514 2002-01-04 Fernando Perez <fperez@colorado.edu>
5507
5515
5508 * Made deep_reload() off by default. It doesn't always work
5516 * Made deep_reload() off by default. It doesn't always work
5509 exactly as intended, so it's probably safer to have it off. It's
5517 exactly as intended, so it's probably safer to have it off. It's
5510 still available as dreload() anyway, so nothing is lost.
5518 still available as dreload() anyway, so nothing is lost.
5511
5519
5512 2002-01-02 Fernando Perez <fperez@colorado.edu>
5520 2002-01-02 Fernando Perez <fperez@colorado.edu>
5513
5521
5514 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
5522 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
5515 so I wanted an updated release).
5523 so I wanted an updated release).
5516
5524
5517 2001-12-27 Fernando Perez <fperez@colorado.edu>
5525 2001-12-27 Fernando Perez <fperez@colorado.edu>
5518
5526
5519 * IPython/iplib.py (InteractiveShell.interact): Added the original
5527 * IPython/iplib.py (InteractiveShell.interact): Added the original
5520 code from 'code.py' for this module in order to change the
5528 code from 'code.py' for this module in order to change the
5521 handling of a KeyboardInterrupt. This was necessary b/c otherwise
5529 handling of a KeyboardInterrupt. This was necessary b/c otherwise
5522 the history cache would break when the user hit Ctrl-C, and
5530 the history cache would break when the user hit Ctrl-C, and
5523 interact() offers no way to add any hooks to it.
5531 interact() offers no way to add any hooks to it.
5524
5532
5525 2001-12-23 Fernando Perez <fperez@colorado.edu>
5533 2001-12-23 Fernando Perez <fperez@colorado.edu>
5526
5534
5527 * setup.py: added check for 'MANIFEST' before trying to remove
5535 * setup.py: added check for 'MANIFEST' before trying to remove
5528 it. Thanks to Sean Reifschneider.
5536 it. Thanks to Sean Reifschneider.
5529
5537
5530 2001-12-22 Fernando Perez <fperez@colorado.edu>
5538 2001-12-22 Fernando Perez <fperez@colorado.edu>
5531
5539
5532 * Released 0.2.2.
5540 * Released 0.2.2.
5533
5541
5534 * Finished (reasonably) writing the manual. Later will add the
5542 * Finished (reasonably) writing the manual. Later will add the
5535 python-standard navigation stylesheets, but for the time being
5543 python-standard navigation stylesheets, but for the time being
5536 it's fairly complete. Distribution will include html and pdf
5544 it's fairly complete. Distribution will include html and pdf
5537 versions.
5545 versions.
5538
5546
5539 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
5547 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
5540 (MayaVi author).
5548 (MayaVi author).
5541
5549
5542 2001-12-21 Fernando Perez <fperez@colorado.edu>
5550 2001-12-21 Fernando Perez <fperez@colorado.edu>
5543
5551
5544 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
5552 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
5545 good public release, I think (with the manual and the distutils
5553 good public release, I think (with the manual and the distutils
5546 installer). The manual can use some work, but that can go
5554 installer). The manual can use some work, but that can go
5547 slowly. Otherwise I think it's quite nice for end users. Next
5555 slowly. Otherwise I think it's quite nice for end users. Next
5548 summer, rewrite the guts of it...
5556 summer, rewrite the guts of it...
5549
5557
5550 * Changed format of ipythonrc files to use whitespace as the
5558 * Changed format of ipythonrc files to use whitespace as the
5551 separator instead of an explicit '='. Cleaner.
5559 separator instead of an explicit '='. Cleaner.
5552
5560
5553 2001-12-20 Fernando Perez <fperez@colorado.edu>
5561 2001-12-20 Fernando Perez <fperez@colorado.edu>
5554
5562
5555 * Started a manual in LyX. For now it's just a quick merge of the
5563 * Started a manual in LyX. For now it's just a quick merge of the
5556 various internal docstrings and READMEs. Later it may grow into a
5564 various internal docstrings and READMEs. Later it may grow into a
5557 nice, full-blown manual.
5565 nice, full-blown manual.
5558
5566
5559 * Set up a distutils based installer. Installation should now be
5567 * Set up a distutils based installer. Installation should now be
5560 trivially simple for end-users.
5568 trivially simple for end-users.
5561
5569
5562 2001-12-11 Fernando Perez <fperez@colorado.edu>
5570 2001-12-11 Fernando Perez <fperez@colorado.edu>
5563
5571
5564 * Released 0.2.0. First public release, announced it at
5572 * Released 0.2.0. First public release, announced it at
5565 comp.lang.python. From now on, just bugfixes...
5573 comp.lang.python. From now on, just bugfixes...
5566
5574
5567 * Went through all the files, set copyright/license notices and
5575 * Went through all the files, set copyright/license notices and
5568 cleaned up things. Ready for release.
5576 cleaned up things. Ready for release.
5569
5577
5570 2001-12-10 Fernando Perez <fperez@colorado.edu>
5578 2001-12-10 Fernando Perez <fperez@colorado.edu>
5571
5579
5572 * Changed the first-time installer not to use tarfiles. It's more
5580 * Changed the first-time installer not to use tarfiles. It's more
5573 robust now and less unix-dependent. Also makes it easier for
5581 robust now and less unix-dependent. Also makes it easier for
5574 people to later upgrade versions.
5582 people to later upgrade versions.
5575
5583
5576 * Changed @exit to @abort to reflect the fact that it's pretty
5584 * Changed @exit to @abort to reflect the fact that it's pretty
5577 brutal (a sys.exit()). The difference between @abort and Ctrl-D
5585 brutal (a sys.exit()). The difference between @abort and Ctrl-D
5578 becomes significant only when IPyhton is embedded: in that case,
5586 becomes significant only when IPyhton is embedded: in that case,
5579 C-D closes IPython only, but @abort kills the enclosing program
5587 C-D closes IPython only, but @abort kills the enclosing program
5580 too (unless it had called IPython inside a try catching
5588 too (unless it had called IPython inside a try catching
5581 SystemExit).
5589 SystemExit).
5582
5590
5583 * Created Shell module which exposes the actuall IPython Shell
5591 * Created Shell module which exposes the actuall IPython Shell
5584 classes, currently the normal and the embeddable one. This at
5592 classes, currently the normal and the embeddable one. This at
5585 least offers a stable interface we won't need to change when
5593 least offers a stable interface we won't need to change when
5586 (later) the internals are rewritten. That rewrite will be confined
5594 (later) the internals are rewritten. That rewrite will be confined
5587 to iplib and ipmaker, but the Shell interface should remain as is.
5595 to iplib and ipmaker, but the Shell interface should remain as is.
5588
5596
5589 * Added embed module which offers an embeddable IPShell object,
5597 * Added embed module which offers an embeddable IPShell object,
5590 useful to fire up IPython *inside* a running program. Great for
5598 useful to fire up IPython *inside* a running program. Great for
5591 debugging or dynamical data analysis.
5599 debugging or dynamical data analysis.
5592
5600
5593 2001-12-08 Fernando Perez <fperez@colorado.edu>
5601 2001-12-08 Fernando Perez <fperez@colorado.edu>
5594
5602
5595 * Fixed small bug preventing seeing info from methods of defined
5603 * Fixed small bug preventing seeing info from methods of defined
5596 objects (incorrect namespace in _ofind()).
5604 objects (incorrect namespace in _ofind()).
5597
5605
5598 * Documentation cleanup. Moved the main usage docstrings to a
5606 * Documentation cleanup. Moved the main usage docstrings to a
5599 separate file, usage.py (cleaner to maintain, and hopefully in the
5607 separate file, usage.py (cleaner to maintain, and hopefully in the
5600 future some perlpod-like way of producing interactive, man and
5608 future some perlpod-like way of producing interactive, man and
5601 html docs out of it will be found).
5609 html docs out of it will be found).
5602
5610
5603 * Added @profile to see your profile at any time.
5611 * Added @profile to see your profile at any time.
5604
5612
5605 * Added @p as an alias for 'print'. It's especially convenient if
5613 * Added @p as an alias for 'print'. It's especially convenient if
5606 using automagic ('p x' prints x).
5614 using automagic ('p x' prints x).
5607
5615
5608 * Small cleanups and fixes after a pychecker run.
5616 * Small cleanups and fixes after a pychecker run.
5609
5617
5610 * Changed the @cd command to handle @cd - and @cd -<n> for
5618 * Changed the @cd command to handle @cd - and @cd -<n> for
5611 visiting any directory in _dh.
5619 visiting any directory in _dh.
5612
5620
5613 * Introduced _dh, a history of visited directories. @dhist prints
5621 * Introduced _dh, a history of visited directories. @dhist prints
5614 it out with numbers.
5622 it out with numbers.
5615
5623
5616 2001-12-07 Fernando Perez <fperez@colorado.edu>
5624 2001-12-07 Fernando Perez <fperez@colorado.edu>
5617
5625
5618 * Released 0.1.22
5626 * Released 0.1.22
5619
5627
5620 * Made initialization a bit more robust against invalid color
5628 * Made initialization a bit more robust against invalid color
5621 options in user input (exit, not traceback-crash).
5629 options in user input (exit, not traceback-crash).
5622
5630
5623 * Changed the bug crash reporter to write the report only in the
5631 * Changed the bug crash reporter to write the report only in the
5624 user's .ipython directory. That way IPython won't litter people's
5632 user's .ipython directory. That way IPython won't litter people's
5625 hard disks with crash files all over the place. Also print on
5633 hard disks with crash files all over the place. Also print on
5626 screen the necessary mail command.
5634 screen the necessary mail command.
5627
5635
5628 * With the new ultraTB, implemented LightBG color scheme for light
5636 * With the new ultraTB, implemented LightBG color scheme for light
5629 background terminals. A lot of people like white backgrounds, so I
5637 background terminals. A lot of people like white backgrounds, so I
5630 guess we should at least give them something readable.
5638 guess we should at least give them something readable.
5631
5639
5632 2001-12-06 Fernando Perez <fperez@colorado.edu>
5640 2001-12-06 Fernando Perez <fperez@colorado.edu>
5633
5641
5634 * Modified the structure of ultraTB. Now there's a proper class
5642 * Modified the structure of ultraTB. Now there's a proper class
5635 for tables of color schemes which allow adding schemes easily and
5643 for tables of color schemes which allow adding schemes easily and
5636 switching the active scheme without creating a new instance every
5644 switching the active scheme without creating a new instance every
5637 time (which was ridiculous). The syntax for creating new schemes
5645 time (which was ridiculous). The syntax for creating new schemes
5638 is also cleaner. I think ultraTB is finally done, with a clean
5646 is also cleaner. I think ultraTB is finally done, with a clean
5639 class structure. Names are also much cleaner (now there's proper
5647 class structure. Names are also much cleaner (now there's proper
5640 color tables, no need for every variable to also have 'color' in
5648 color tables, no need for every variable to also have 'color' in
5641 its name).
5649 its name).
5642
5650
5643 * Broke down genutils into separate files. Now genutils only
5651 * Broke down genutils into separate files. Now genutils only
5644 contains utility functions, and classes have been moved to their
5652 contains utility functions, and classes have been moved to their
5645 own files (they had enough independent functionality to warrant
5653 own files (they had enough independent functionality to warrant
5646 it): ConfigLoader, OutputTrap, Struct.
5654 it): ConfigLoader, OutputTrap, Struct.
5647
5655
5648 2001-12-05 Fernando Perez <fperez@colorado.edu>
5656 2001-12-05 Fernando Perez <fperez@colorado.edu>
5649
5657
5650 * IPython turns 21! Released version 0.1.21, as a candidate for
5658 * IPython turns 21! Released version 0.1.21, as a candidate for
5651 public consumption. If all goes well, release in a few days.
5659 public consumption. If all goes well, release in a few days.
5652
5660
5653 * Fixed path bug (files in Extensions/ directory wouldn't be found
5661 * Fixed path bug (files in Extensions/ directory wouldn't be found
5654 unless IPython/ was explicitly in sys.path).
5662 unless IPython/ was explicitly in sys.path).
5655
5663
5656 * Extended the FlexCompleter class as MagicCompleter to allow
5664 * Extended the FlexCompleter class as MagicCompleter to allow
5657 completion of @-starting lines.
5665 completion of @-starting lines.
5658
5666
5659 * Created __release__.py file as a central repository for release
5667 * Created __release__.py file as a central repository for release
5660 info that other files can read from.
5668 info that other files can read from.
5661
5669
5662 * Fixed small bug in logging: when logging was turned on in
5670 * Fixed small bug in logging: when logging was turned on in
5663 mid-session, old lines with special meanings (!@?) were being
5671 mid-session, old lines with special meanings (!@?) were being
5664 logged without the prepended comment, which is necessary since
5672 logged without the prepended comment, which is necessary since
5665 they are not truly valid python syntax. This should make session
5673 they are not truly valid python syntax. This should make session
5666 restores produce less errors.
5674 restores produce less errors.
5667
5675
5668 * The namespace cleanup forced me to make a FlexCompleter class
5676 * The namespace cleanup forced me to make a FlexCompleter class
5669 which is nothing but a ripoff of rlcompleter, but with selectable
5677 which is nothing but a ripoff of rlcompleter, but with selectable
5670 namespace (rlcompleter only works in __main__.__dict__). I'll try
5678 namespace (rlcompleter only works in __main__.__dict__). I'll try
5671 to submit a note to the authors to see if this change can be
5679 to submit a note to the authors to see if this change can be
5672 incorporated in future rlcompleter releases (Dec.6: done)
5680 incorporated in future rlcompleter releases (Dec.6: done)
5673
5681
5674 * More fixes to namespace handling. It was a mess! Now all
5682 * More fixes to namespace handling. It was a mess! Now all
5675 explicit references to __main__.__dict__ are gone (except when
5683 explicit references to __main__.__dict__ are gone (except when
5676 really needed) and everything is handled through the namespace
5684 really needed) and everything is handled through the namespace
5677 dicts in the IPython instance. We seem to be getting somewhere
5685 dicts in the IPython instance. We seem to be getting somewhere
5678 with this, finally...
5686 with this, finally...
5679
5687
5680 * Small documentation updates.
5688 * Small documentation updates.
5681
5689
5682 * Created the Extensions directory under IPython (with an
5690 * Created the Extensions directory under IPython (with an
5683 __init__.py). Put the PhysicalQ stuff there. This directory should
5691 __init__.py). Put the PhysicalQ stuff there. This directory should
5684 be used for all special-purpose extensions.
5692 be used for all special-purpose extensions.
5685
5693
5686 * File renaming:
5694 * File renaming:
5687 ipythonlib --> ipmaker
5695 ipythonlib --> ipmaker
5688 ipplib --> iplib
5696 ipplib --> iplib
5689 This makes a bit more sense in terms of what these files actually do.
5697 This makes a bit more sense in terms of what these files actually do.
5690
5698
5691 * Moved all the classes and functions in ipythonlib to ipplib, so
5699 * Moved all the classes and functions in ipythonlib to ipplib, so
5692 now ipythonlib only has make_IPython(). This will ease up its
5700 now ipythonlib only has make_IPython(). This will ease up its
5693 splitting in smaller functional chunks later.
5701 splitting in smaller functional chunks later.
5694
5702
5695 * Cleaned up (done, I think) output of @whos. Better column
5703 * Cleaned up (done, I think) output of @whos. Better column
5696 formatting, and now shows str(var) for as much as it can, which is
5704 formatting, and now shows str(var) for as much as it can, which is
5697 typically what one gets with a 'print var'.
5705 typically what one gets with a 'print var'.
5698
5706
5699 2001-12-04 Fernando Perez <fperez@colorado.edu>
5707 2001-12-04 Fernando Perez <fperez@colorado.edu>
5700
5708
5701 * Fixed namespace problems. Now builtin/IPyhton/user names get
5709 * Fixed namespace problems. Now builtin/IPyhton/user names get
5702 properly reported in their namespace. Internal namespace handling
5710 properly reported in their namespace. Internal namespace handling
5703 is finally getting decent (not perfect yet, but much better than
5711 is finally getting decent (not perfect yet, but much better than
5704 the ad-hoc mess we had).
5712 the ad-hoc mess we had).
5705
5713
5706 * Removed -exit option. If people just want to run a python
5714 * Removed -exit option. If people just want to run a python
5707 script, that's what the normal interpreter is for. Less
5715 script, that's what the normal interpreter is for. Less
5708 unnecessary options, less chances for bugs.
5716 unnecessary options, less chances for bugs.
5709
5717
5710 * Added a crash handler which generates a complete post-mortem if
5718 * Added a crash handler which generates a complete post-mortem if
5711 IPython crashes. This will help a lot in tracking bugs down the
5719 IPython crashes. This will help a lot in tracking bugs down the
5712 road.
5720 road.
5713
5721
5714 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
5722 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
5715 which were boud to functions being reassigned would bypass the
5723 which were boud to functions being reassigned would bypass the
5716 logger, breaking the sync of _il with the prompt counter. This
5724 logger, breaking the sync of _il with the prompt counter. This
5717 would then crash IPython later when a new line was logged.
5725 would then crash IPython later when a new line was logged.
5718
5726
5719 2001-12-02 Fernando Perez <fperez@colorado.edu>
5727 2001-12-02 Fernando Perez <fperez@colorado.edu>
5720
5728
5721 * Made IPython a package. This means people don't have to clutter
5729 * Made IPython a package. This means people don't have to clutter
5722 their sys.path with yet another directory. Changed the INSTALL
5730 their sys.path with yet another directory. Changed the INSTALL
5723 file accordingly.
5731 file accordingly.
5724
5732
5725 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
5733 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
5726 sorts its output (so @who shows it sorted) and @whos formats the
5734 sorts its output (so @who shows it sorted) and @whos formats the
5727 table according to the width of the first column. Nicer, easier to
5735 table according to the width of the first column. Nicer, easier to
5728 read. Todo: write a generic table_format() which takes a list of
5736 read. Todo: write a generic table_format() which takes a list of
5729 lists and prints it nicely formatted, with optional row/column
5737 lists and prints it nicely formatted, with optional row/column
5730 separators and proper padding and justification.
5738 separators and proper padding and justification.
5731
5739
5732 * Released 0.1.20
5740 * Released 0.1.20
5733
5741
5734 * Fixed bug in @log which would reverse the inputcache list (a
5742 * Fixed bug in @log which would reverse the inputcache list (a
5735 copy operation was missing).
5743 copy operation was missing).
5736
5744
5737 * Code cleanup. @config was changed to use page(). Better, since
5745 * Code cleanup. @config was changed to use page(). Better, since
5738 its output is always quite long.
5746 its output is always quite long.
5739
5747
5740 * Itpl is back as a dependency. I was having too many problems
5748 * Itpl is back as a dependency. I was having too many problems
5741 getting the parametric aliases to work reliably, and it's just
5749 getting the parametric aliases to work reliably, and it's just
5742 easier to code weird string operations with it than playing %()s
5750 easier to code weird string operations with it than playing %()s
5743 games. It's only ~6k, so I don't think it's too big a deal.
5751 games. It's only ~6k, so I don't think it's too big a deal.
5744
5752
5745 * Found (and fixed) a very nasty bug with history. !lines weren't
5753 * Found (and fixed) a very nasty bug with history. !lines weren't
5746 getting cached, and the out of sync caches would crash
5754 getting cached, and the out of sync caches would crash
5747 IPython. Fixed it by reorganizing the prefilter/handlers/logger
5755 IPython. Fixed it by reorganizing the prefilter/handlers/logger
5748 division of labor a bit better. Bug fixed, cleaner structure.
5756 division of labor a bit better. Bug fixed, cleaner structure.
5749
5757
5750 2001-12-01 Fernando Perez <fperez@colorado.edu>
5758 2001-12-01 Fernando Perez <fperez@colorado.edu>
5751
5759
5752 * Released 0.1.19
5760 * Released 0.1.19
5753
5761
5754 * Added option -n to @hist to prevent line number printing. Much
5762 * Added option -n to @hist to prevent line number printing. Much
5755 easier to copy/paste code this way.
5763 easier to copy/paste code this way.
5756
5764
5757 * Created global _il to hold the input list. Allows easy
5765 * Created global _il to hold the input list. Allows easy
5758 re-execution of blocks of code by slicing it (inspired by Janko's
5766 re-execution of blocks of code by slicing it (inspired by Janko's
5759 comment on 'macros').
5767 comment on 'macros').
5760
5768
5761 * Small fixes and doc updates.
5769 * Small fixes and doc updates.
5762
5770
5763 * Rewrote @history function (was @h). Renamed it to @hist, @h is
5771 * Rewrote @history function (was @h). Renamed it to @hist, @h is
5764 much too fragile with automagic. Handles properly multi-line
5772 much too fragile with automagic. Handles properly multi-line
5765 statements and takes parameters.
5773 statements and takes parameters.
5766
5774
5767 2001-11-30 Fernando Perez <fperez@colorado.edu>
5775 2001-11-30 Fernando Perez <fperez@colorado.edu>
5768
5776
5769 * Version 0.1.18 released.
5777 * Version 0.1.18 released.
5770
5778
5771 * Fixed nasty namespace bug in initial module imports.
5779 * Fixed nasty namespace bug in initial module imports.
5772
5780
5773 * Added copyright/license notes to all code files (except
5781 * Added copyright/license notes to all code files (except
5774 DPyGetOpt). For the time being, LGPL. That could change.
5782 DPyGetOpt). For the time being, LGPL. That could change.
5775
5783
5776 * Rewrote a much nicer README, updated INSTALL, cleaned up
5784 * Rewrote a much nicer README, updated INSTALL, cleaned up
5777 ipythonrc-* samples.
5785 ipythonrc-* samples.
5778
5786
5779 * Overall code/documentation cleanup. Basically ready for
5787 * Overall code/documentation cleanup. Basically ready for
5780 release. Only remaining thing: licence decision (LGPL?).
5788 release. Only remaining thing: licence decision (LGPL?).
5781
5789
5782 * Converted load_config to a class, ConfigLoader. Now recursion
5790 * Converted load_config to a class, ConfigLoader. Now recursion
5783 control is better organized. Doesn't include the same file twice.
5791 control is better organized. Doesn't include the same file twice.
5784
5792
5785 2001-11-29 Fernando Perez <fperez@colorado.edu>
5793 2001-11-29 Fernando Perez <fperez@colorado.edu>
5786
5794
5787 * Got input history working. Changed output history variables from
5795 * Got input history working. Changed output history variables from
5788 _p to _o so that _i is for input and _o for output. Just cleaner
5796 _p to _o so that _i is for input and _o for output. Just cleaner
5789 convention.
5797 convention.
5790
5798
5791 * Implemented parametric aliases. This pretty much allows the
5799 * Implemented parametric aliases. This pretty much allows the
5792 alias system to offer full-blown shell convenience, I think.
5800 alias system to offer full-blown shell convenience, I think.
5793
5801
5794 * Version 0.1.17 released, 0.1.18 opened.
5802 * Version 0.1.17 released, 0.1.18 opened.
5795
5803
5796 * dot_ipython/ipythonrc (alias): added documentation.
5804 * dot_ipython/ipythonrc (alias): added documentation.
5797 (xcolor): Fixed small bug (xcolors -> xcolor)
5805 (xcolor): Fixed small bug (xcolors -> xcolor)
5798
5806
5799 * Changed the alias system. Now alias is a magic command to define
5807 * Changed the alias system. Now alias is a magic command to define
5800 aliases just like the shell. Rationale: the builtin magics should
5808 aliases just like the shell. Rationale: the builtin magics should
5801 be there for things deeply connected to IPython's
5809 be there for things deeply connected to IPython's
5802 architecture. And this is a much lighter system for what I think
5810 architecture. And this is a much lighter system for what I think
5803 is the really important feature: allowing users to define quickly
5811 is the really important feature: allowing users to define quickly
5804 magics that will do shell things for them, so they can customize
5812 magics that will do shell things for them, so they can customize
5805 IPython easily to match their work habits. If someone is really
5813 IPython easily to match their work habits. If someone is really
5806 desperate to have another name for a builtin alias, they can
5814 desperate to have another name for a builtin alias, they can
5807 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
5815 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
5808 works.
5816 works.
5809
5817
5810 2001-11-28 Fernando Perez <fperez@colorado.edu>
5818 2001-11-28 Fernando Perez <fperez@colorado.edu>
5811
5819
5812 * Changed @file so that it opens the source file at the proper
5820 * Changed @file so that it opens the source file at the proper
5813 line. Since it uses less, if your EDITOR environment is
5821 line. Since it uses less, if your EDITOR environment is
5814 configured, typing v will immediately open your editor of choice
5822 configured, typing v will immediately open your editor of choice
5815 right at the line where the object is defined. Not as quick as
5823 right at the line where the object is defined. Not as quick as
5816 having a direct @edit command, but for all intents and purposes it
5824 having a direct @edit command, but for all intents and purposes it
5817 works. And I don't have to worry about writing @edit to deal with
5825 works. And I don't have to worry about writing @edit to deal with
5818 all the editors, less does that.
5826 all the editors, less does that.
5819
5827
5820 * Version 0.1.16 released, 0.1.17 opened.
5828 * Version 0.1.16 released, 0.1.17 opened.
5821
5829
5822 * Fixed some nasty bugs in the page/page_dumb combo that could
5830 * Fixed some nasty bugs in the page/page_dumb combo that could
5823 crash IPython.
5831 crash IPython.
5824
5832
5825 2001-11-27 Fernando Perez <fperez@colorado.edu>
5833 2001-11-27 Fernando Perez <fperez@colorado.edu>
5826
5834
5827 * Version 0.1.15 released, 0.1.16 opened.
5835 * Version 0.1.15 released, 0.1.16 opened.
5828
5836
5829 * Finally got ? and ?? to work for undefined things: now it's
5837 * Finally got ? and ?? to work for undefined things: now it's
5830 possible to type {}.get? and get information about the get method
5838 possible to type {}.get? and get information about the get method
5831 of dicts, or os.path? even if only os is defined (so technically
5839 of dicts, or os.path? even if only os is defined (so technically
5832 os.path isn't). Works at any level. For example, after import os,
5840 os.path isn't). Works at any level. For example, after import os,
5833 os?, os.path?, os.path.abspath? all work. This is great, took some
5841 os?, os.path?, os.path.abspath? all work. This is great, took some
5834 work in _ofind.
5842 work in _ofind.
5835
5843
5836 * Fixed more bugs with logging. The sanest way to do it was to add
5844 * Fixed more bugs with logging. The sanest way to do it was to add
5837 to @log a 'mode' parameter. Killed two in one shot (this mode
5845 to @log a 'mode' parameter. Killed two in one shot (this mode
5838 option was a request of Janko's). I think it's finally clean
5846 option was a request of Janko's). I think it's finally clean
5839 (famous last words).
5847 (famous last words).
5840
5848
5841 * Added a page_dumb() pager which does a decent job of paging on
5849 * Added a page_dumb() pager which does a decent job of paging on
5842 screen, if better things (like less) aren't available. One less
5850 screen, if better things (like less) aren't available. One less
5843 unix dependency (someday maybe somebody will port this to
5851 unix dependency (someday maybe somebody will port this to
5844 windows).
5852 windows).
5845
5853
5846 * Fixed problem in magic_log: would lock of logging out if log
5854 * Fixed problem in magic_log: would lock of logging out if log
5847 creation failed (because it would still think it had succeeded).
5855 creation failed (because it would still think it had succeeded).
5848
5856
5849 * Improved the page() function using curses to auto-detect screen
5857 * Improved the page() function using curses to auto-detect screen
5850 size. Now it can make a much better decision on whether to print
5858 size. Now it can make a much better decision on whether to print
5851 or page a string. Option screen_length was modified: a value 0
5859 or page a string. Option screen_length was modified: a value 0
5852 means auto-detect, and that's the default now.
5860 means auto-detect, and that's the default now.
5853
5861
5854 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
5862 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
5855 go out. I'll test it for a few days, then talk to Janko about
5863 go out. I'll test it for a few days, then talk to Janko about
5856 licences and announce it.
5864 licences and announce it.
5857
5865
5858 * Fixed the length of the auto-generated ---> prompt which appears
5866 * Fixed the length of the auto-generated ---> prompt which appears
5859 for auto-parens and auto-quotes. Getting this right isn't trivial,
5867 for auto-parens and auto-quotes. Getting this right isn't trivial,
5860 with all the color escapes, different prompt types and optional
5868 with all the color escapes, different prompt types and optional
5861 separators. But it seems to be working in all the combinations.
5869 separators. But it seems to be working in all the combinations.
5862
5870
5863 2001-11-26 Fernando Perez <fperez@colorado.edu>
5871 2001-11-26 Fernando Perez <fperez@colorado.edu>
5864
5872
5865 * Wrote a regexp filter to get option types from the option names
5873 * Wrote a regexp filter to get option types from the option names
5866 string. This eliminates the need to manually keep two duplicate
5874 string. This eliminates the need to manually keep two duplicate
5867 lists.
5875 lists.
5868
5876
5869 * Removed the unneeded check_option_names. Now options are handled
5877 * Removed the unneeded check_option_names. Now options are handled
5870 in a much saner manner and it's easy to visually check that things
5878 in a much saner manner and it's easy to visually check that things
5871 are ok.
5879 are ok.
5872
5880
5873 * Updated version numbers on all files I modified to carry a
5881 * Updated version numbers on all files I modified to carry a
5874 notice so Janko and Nathan have clear version markers.
5882 notice so Janko and Nathan have clear version markers.
5875
5883
5876 * Updated docstring for ultraTB with my changes. I should send
5884 * Updated docstring for ultraTB with my changes. I should send
5877 this to Nathan.
5885 this to Nathan.
5878
5886
5879 * Lots of small fixes. Ran everything through pychecker again.
5887 * Lots of small fixes. Ran everything through pychecker again.
5880
5888
5881 * Made loading of deep_reload an cmd line option. If it's not too
5889 * Made loading of deep_reload an cmd line option. If it's not too
5882 kosher, now people can just disable it. With -nodeep_reload it's
5890 kosher, now people can just disable it. With -nodeep_reload it's
5883 still available as dreload(), it just won't overwrite reload().
5891 still available as dreload(), it just won't overwrite reload().
5884
5892
5885 * Moved many options to the no| form (-opt and -noopt
5893 * Moved many options to the no| form (-opt and -noopt
5886 accepted). Cleaner.
5894 accepted). Cleaner.
5887
5895
5888 * Changed magic_log so that if called with no parameters, it uses
5896 * Changed magic_log so that if called with no parameters, it uses
5889 'rotate' mode. That way auto-generated logs aren't automatically
5897 'rotate' mode. That way auto-generated logs aren't automatically
5890 over-written. For normal logs, now a backup is made if it exists
5898 over-written. For normal logs, now a backup is made if it exists
5891 (only 1 level of backups). A new 'backup' mode was added to the
5899 (only 1 level of backups). A new 'backup' mode was added to the
5892 Logger class to support this. This was a request by Janko.
5900 Logger class to support this. This was a request by Janko.
5893
5901
5894 * Added @logoff/@logon to stop/restart an active log.
5902 * Added @logoff/@logon to stop/restart an active log.
5895
5903
5896 * Fixed a lot of bugs in log saving/replay. It was pretty
5904 * Fixed a lot of bugs in log saving/replay. It was pretty
5897 broken. Now special lines (!@,/) appear properly in the command
5905 broken. Now special lines (!@,/) appear properly in the command
5898 history after a log replay.
5906 history after a log replay.
5899
5907
5900 * Tried and failed to implement full session saving via pickle. My
5908 * Tried and failed to implement full session saving via pickle. My
5901 idea was to pickle __main__.__dict__, but modules can't be
5909 idea was to pickle __main__.__dict__, but modules can't be
5902 pickled. This would be a better alternative to replaying logs, but
5910 pickled. This would be a better alternative to replaying logs, but
5903 seems quite tricky to get to work. Changed -session to be called
5911 seems quite tricky to get to work. Changed -session to be called
5904 -logplay, which more accurately reflects what it does. And if we
5912 -logplay, which more accurately reflects what it does. And if we
5905 ever get real session saving working, -session is now available.
5913 ever get real session saving working, -session is now available.
5906
5914
5907 * Implemented color schemes for prompts also. As for tracebacks,
5915 * Implemented color schemes for prompts also. As for tracebacks,
5908 currently only NoColor and Linux are supported. But now the
5916 currently only NoColor and Linux are supported. But now the
5909 infrastructure is in place, based on a generic ColorScheme
5917 infrastructure is in place, based on a generic ColorScheme
5910 class. So writing and activating new schemes both for the prompts
5918 class. So writing and activating new schemes both for the prompts
5911 and the tracebacks should be straightforward.
5919 and the tracebacks should be straightforward.
5912
5920
5913 * Version 0.1.13 released, 0.1.14 opened.
5921 * Version 0.1.13 released, 0.1.14 opened.
5914
5922
5915 * Changed handling of options for output cache. Now counter is
5923 * Changed handling of options for output cache. Now counter is
5916 hardwired starting at 1 and one specifies the maximum number of
5924 hardwired starting at 1 and one specifies the maximum number of
5917 entries *in the outcache* (not the max prompt counter). This is
5925 entries *in the outcache* (not the max prompt counter). This is
5918 much better, since many statements won't increase the cache
5926 much better, since many statements won't increase the cache
5919 count. It also eliminated some confusing options, now there's only
5927 count. It also eliminated some confusing options, now there's only
5920 one: cache_size.
5928 one: cache_size.
5921
5929
5922 * Added 'alias' magic function and magic_alias option in the
5930 * Added 'alias' magic function and magic_alias option in the
5923 ipythonrc file. Now the user can easily define whatever names he
5931 ipythonrc file. Now the user can easily define whatever names he
5924 wants for the magic functions without having to play weird
5932 wants for the magic functions without having to play weird
5925 namespace games. This gives IPython a real shell-like feel.
5933 namespace games. This gives IPython a real shell-like feel.
5926
5934
5927 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
5935 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
5928 @ or not).
5936 @ or not).
5929
5937
5930 This was one of the last remaining 'visible' bugs (that I know
5938 This was one of the last remaining 'visible' bugs (that I know
5931 of). I think if I can clean up the session loading so it works
5939 of). I think if I can clean up the session loading so it works
5932 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
5940 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
5933 about licensing).
5941 about licensing).
5934
5942
5935 2001-11-25 Fernando Perez <fperez@colorado.edu>
5943 2001-11-25 Fernando Perez <fperez@colorado.edu>
5936
5944
5937 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
5945 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
5938 there's a cleaner distinction between what ? and ?? show.
5946 there's a cleaner distinction between what ? and ?? show.
5939
5947
5940 * Added screen_length option. Now the user can define his own
5948 * Added screen_length option. Now the user can define his own
5941 screen size for page() operations.
5949 screen size for page() operations.
5942
5950
5943 * Implemented magic shell-like functions with automatic code
5951 * Implemented magic shell-like functions with automatic code
5944 generation. Now adding another function is just a matter of adding
5952 generation. Now adding another function is just a matter of adding
5945 an entry to a dict, and the function is dynamically generated at
5953 an entry to a dict, and the function is dynamically generated at
5946 run-time. Python has some really cool features!
5954 run-time. Python has some really cool features!
5947
5955
5948 * Renamed many options to cleanup conventions a little. Now all
5956 * Renamed many options to cleanup conventions a little. Now all
5949 are lowercase, and only underscores where needed. Also in the code
5957 are lowercase, and only underscores where needed. Also in the code
5950 option name tables are clearer.
5958 option name tables are clearer.
5951
5959
5952 * Changed prompts a little. Now input is 'In [n]:' instead of
5960 * Changed prompts a little. Now input is 'In [n]:' instead of
5953 'In[n]:='. This allows it the numbers to be aligned with the
5961 'In[n]:='. This allows it the numbers to be aligned with the
5954 Out[n] numbers, and removes usage of ':=' which doesn't exist in
5962 Out[n] numbers, and removes usage of ':=' which doesn't exist in
5955 Python (it was a Mathematica thing). The '...' continuation prompt
5963 Python (it was a Mathematica thing). The '...' continuation prompt
5956 was also changed a little to align better.
5964 was also changed a little to align better.
5957
5965
5958 * Fixed bug when flushing output cache. Not all _p<n> variables
5966 * Fixed bug when flushing output cache. Not all _p<n> variables
5959 exist, so their deletion needs to be wrapped in a try:
5967 exist, so their deletion needs to be wrapped in a try:
5960
5968
5961 * Figured out how to properly use inspect.formatargspec() (it
5969 * Figured out how to properly use inspect.formatargspec() (it
5962 requires the args preceded by *). So I removed all the code from
5970 requires the args preceded by *). So I removed all the code from
5963 _get_pdef in Magic, which was just replicating that.
5971 _get_pdef in Magic, which was just replicating that.
5964
5972
5965 * Added test to prefilter to allow redefining magic function names
5973 * Added test to prefilter to allow redefining magic function names
5966 as variables. This is ok, since the @ form is always available,
5974 as variables. This is ok, since the @ form is always available,
5967 but whe should allow the user to define a variable called 'ls' if
5975 but whe should allow the user to define a variable called 'ls' if
5968 he needs it.
5976 he needs it.
5969
5977
5970 * Moved the ToDo information from README into a separate ToDo.
5978 * Moved the ToDo information from README into a separate ToDo.
5971
5979
5972 * General code cleanup and small bugfixes. I think it's close to a
5980 * General code cleanup and small bugfixes. I think it's close to a
5973 state where it can be released, obviously with a big 'beta'
5981 state where it can be released, obviously with a big 'beta'
5974 warning on it.
5982 warning on it.
5975
5983
5976 * Got the magic function split to work. Now all magics are defined
5984 * Got the magic function split to work. Now all magics are defined
5977 in a separate class. It just organizes things a bit, and now
5985 in a separate class. It just organizes things a bit, and now
5978 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
5986 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
5979 was too long).
5987 was too long).
5980
5988
5981 * Changed @clear to @reset to avoid potential confusions with
5989 * Changed @clear to @reset to avoid potential confusions with
5982 the shell command clear. Also renamed @cl to @clear, which does
5990 the shell command clear. Also renamed @cl to @clear, which does
5983 exactly what people expect it to from their shell experience.
5991 exactly what people expect it to from their shell experience.
5984
5992
5985 Added a check to the @reset command (since it's so
5993 Added a check to the @reset command (since it's so
5986 destructive, it's probably a good idea to ask for confirmation).
5994 destructive, it's probably a good idea to ask for confirmation).
5987 But now reset only works for full namespace resetting. Since the
5995 But now reset only works for full namespace resetting. Since the
5988 del keyword is already there for deleting a few specific
5996 del keyword is already there for deleting a few specific
5989 variables, I don't see the point of having a redundant magic
5997 variables, I don't see the point of having a redundant magic
5990 function for the same task.
5998 function for the same task.
5991
5999
5992 2001-11-24 Fernando Perez <fperez@colorado.edu>
6000 2001-11-24 Fernando Perez <fperez@colorado.edu>
5993
6001
5994 * Updated the builtin docs (esp. the ? ones).
6002 * Updated the builtin docs (esp. the ? ones).
5995
6003
5996 * Ran all the code through pychecker. Not terribly impressed with
6004 * Ran all the code through pychecker. Not terribly impressed with
5997 it: lots of spurious warnings and didn't really find anything of
6005 it: lots of spurious warnings and didn't really find anything of
5998 substance (just a few modules being imported and not used).
6006 substance (just a few modules being imported and not used).
5999
6007
6000 * Implemented the new ultraTB functionality into IPython. New
6008 * Implemented the new ultraTB functionality into IPython. New
6001 option: xcolors. This chooses color scheme. xmode now only selects
6009 option: xcolors. This chooses color scheme. xmode now only selects
6002 between Plain and Verbose. Better orthogonality.
6010 between Plain and Verbose. Better orthogonality.
6003
6011
6004 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6012 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6005 mode and color scheme for the exception handlers. Now it's
6013 mode and color scheme for the exception handlers. Now it's
6006 possible to have the verbose traceback with no coloring.
6014 possible to have the verbose traceback with no coloring.
6007
6015
6008 2001-11-23 Fernando Perez <fperez@colorado.edu>
6016 2001-11-23 Fernando Perez <fperez@colorado.edu>
6009
6017
6010 * Version 0.1.12 released, 0.1.13 opened.
6018 * Version 0.1.12 released, 0.1.13 opened.
6011
6019
6012 * Removed option to set auto-quote and auto-paren escapes by
6020 * Removed option to set auto-quote and auto-paren escapes by
6013 user. The chances of breaking valid syntax are just too high. If
6021 user. The chances of breaking valid syntax are just too high. If
6014 someone *really* wants, they can always dig into the code.
6022 someone *really* wants, they can always dig into the code.
6015
6023
6016 * Made prompt separators configurable.
6024 * Made prompt separators configurable.
6017
6025
6018 2001-11-22 Fernando Perez <fperez@colorado.edu>
6026 2001-11-22 Fernando Perez <fperez@colorado.edu>
6019
6027
6020 * Small bugfixes in many places.
6028 * Small bugfixes in many places.
6021
6029
6022 * Removed the MyCompleter class from ipplib. It seemed redundant
6030 * Removed the MyCompleter class from ipplib. It seemed redundant
6023 with the C-p,C-n history search functionality. Less code to
6031 with the C-p,C-n history search functionality. Less code to
6024 maintain.
6032 maintain.
6025
6033
6026 * Moved all the original ipython.py code into ipythonlib.py. Right
6034 * Moved all the original ipython.py code into ipythonlib.py. Right
6027 now it's just one big dump into a function called make_IPython, so
6035 now it's just one big dump into a function called make_IPython, so
6028 no real modularity has been gained. But at least it makes the
6036 no real modularity has been gained. But at least it makes the
6029 wrapper script tiny, and since ipythonlib is a module, it gets
6037 wrapper script tiny, and since ipythonlib is a module, it gets
6030 compiled and startup is much faster.
6038 compiled and startup is much faster.
6031
6039
6032 This is a reasobably 'deep' change, so we should test it for a
6040 This is a reasobably 'deep' change, so we should test it for a
6033 while without messing too much more with the code.
6041 while without messing too much more with the code.
6034
6042
6035 2001-11-21 Fernando Perez <fperez@colorado.edu>
6043 2001-11-21 Fernando Perez <fperez@colorado.edu>
6036
6044
6037 * Version 0.1.11 released, 0.1.12 opened for further work.
6045 * Version 0.1.11 released, 0.1.12 opened for further work.
6038
6046
6039 * Removed dependency on Itpl. It was only needed in one place. It
6047 * Removed dependency on Itpl. It was only needed in one place. It
6040 would be nice if this became part of python, though. It makes life
6048 would be nice if this became part of python, though. It makes life
6041 *a lot* easier in some cases.
6049 *a lot* easier in some cases.
6042
6050
6043 * Simplified the prefilter code a bit. Now all handlers are
6051 * Simplified the prefilter code a bit. Now all handlers are
6044 expected to explicitly return a value (at least a blank string).
6052 expected to explicitly return a value (at least a blank string).
6045
6053
6046 * Heavy edits in ipplib. Removed the help system altogether. Now
6054 * Heavy edits in ipplib. Removed the help system altogether. Now
6047 obj?/?? is used for inspecting objects, a magic @doc prints
6055 obj?/?? is used for inspecting objects, a magic @doc prints
6048 docstrings, and full-blown Python help is accessed via the 'help'
6056 docstrings, and full-blown Python help is accessed via the 'help'
6049 keyword. This cleans up a lot of code (less to maintain) and does
6057 keyword. This cleans up a lot of code (less to maintain) and does
6050 the job. Since 'help' is now a standard Python component, might as
6058 the job. Since 'help' is now a standard Python component, might as
6051 well use it and remove duplicate functionality.
6059 well use it and remove duplicate functionality.
6052
6060
6053 Also removed the option to use ipplib as a standalone program. By
6061 Also removed the option to use ipplib as a standalone program. By
6054 now it's too dependent on other parts of IPython to function alone.
6062 now it's too dependent on other parts of IPython to function alone.
6055
6063
6056 * Fixed bug in genutils.pager. It would crash if the pager was
6064 * Fixed bug in genutils.pager. It would crash if the pager was
6057 exited immediately after opening (broken pipe).
6065 exited immediately after opening (broken pipe).
6058
6066
6059 * Trimmed down the VerboseTB reporting a little. The header is
6067 * Trimmed down the VerboseTB reporting a little. The header is
6060 much shorter now and the repeated exception arguments at the end
6068 much shorter now and the repeated exception arguments at the end
6061 have been removed. For interactive use the old header seemed a bit
6069 have been removed. For interactive use the old header seemed a bit
6062 excessive.
6070 excessive.
6063
6071
6064 * Fixed small bug in output of @whos for variables with multi-word
6072 * Fixed small bug in output of @whos for variables with multi-word
6065 types (only first word was displayed).
6073 types (only first word was displayed).
6066
6074
6067 2001-11-17 Fernando Perez <fperez@colorado.edu>
6075 2001-11-17 Fernando Perez <fperez@colorado.edu>
6068
6076
6069 * Version 0.1.10 released, 0.1.11 opened for further work.
6077 * Version 0.1.10 released, 0.1.11 opened for further work.
6070
6078
6071 * Modified dirs and friends. dirs now *returns* the stack (not
6079 * Modified dirs and friends. dirs now *returns* the stack (not
6072 prints), so one can manipulate it as a variable. Convenient to
6080 prints), so one can manipulate it as a variable. Convenient to
6073 travel along many directories.
6081 travel along many directories.
6074
6082
6075 * Fixed bug in magic_pdef: would only work with functions with
6083 * Fixed bug in magic_pdef: would only work with functions with
6076 arguments with default values.
6084 arguments with default values.
6077
6085
6078 2001-11-14 Fernando Perez <fperez@colorado.edu>
6086 2001-11-14 Fernando Perez <fperez@colorado.edu>
6079
6087
6080 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6088 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6081 example with IPython. Various other minor fixes and cleanups.
6089 example with IPython. Various other minor fixes and cleanups.
6082
6090
6083 * Version 0.1.9 released, 0.1.10 opened for further work.
6091 * Version 0.1.9 released, 0.1.10 opened for further work.
6084
6092
6085 * Added sys.path to the list of directories searched in the
6093 * Added sys.path to the list of directories searched in the
6086 execfile= option. It used to be the current directory and the
6094 execfile= option. It used to be the current directory and the
6087 user's IPYTHONDIR only.
6095 user's IPYTHONDIR only.
6088
6096
6089 2001-11-13 Fernando Perez <fperez@colorado.edu>
6097 2001-11-13 Fernando Perez <fperez@colorado.edu>
6090
6098
6091 * Reinstated the raw_input/prefilter separation that Janko had
6099 * Reinstated the raw_input/prefilter separation that Janko had
6092 initially. This gives a more convenient setup for extending the
6100 initially. This gives a more convenient setup for extending the
6093 pre-processor from the outside: raw_input always gets a string,
6101 pre-processor from the outside: raw_input always gets a string,
6094 and prefilter has to process it. We can then redefine prefilter
6102 and prefilter has to process it. We can then redefine prefilter
6095 from the outside and implement extensions for special
6103 from the outside and implement extensions for special
6096 purposes.
6104 purposes.
6097
6105
6098 Today I got one for inputting PhysicalQuantity objects
6106 Today I got one for inputting PhysicalQuantity objects
6099 (from Scientific) without needing any function calls at
6107 (from Scientific) without needing any function calls at
6100 all. Extremely convenient, and it's all done as a user-level
6108 all. Extremely convenient, and it's all done as a user-level
6101 extension (no IPython code was touched). Now instead of:
6109 extension (no IPython code was touched). Now instead of:
6102 a = PhysicalQuantity(4.2,'m/s**2')
6110 a = PhysicalQuantity(4.2,'m/s**2')
6103 one can simply say
6111 one can simply say
6104 a = 4.2 m/s**2
6112 a = 4.2 m/s**2
6105 or even
6113 or even
6106 a = 4.2 m/s^2
6114 a = 4.2 m/s^2
6107
6115
6108 I use this, but it's also a proof of concept: IPython really is
6116 I use this, but it's also a proof of concept: IPython really is
6109 fully user-extensible, even at the level of the parsing of the
6117 fully user-extensible, even at the level of the parsing of the
6110 command line. It's not trivial, but it's perfectly doable.
6118 command line. It's not trivial, but it's perfectly doable.
6111
6119
6112 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6120 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6113 the problem of modules being loaded in the inverse order in which
6121 the problem of modules being loaded in the inverse order in which
6114 they were defined in
6122 they were defined in
6115
6123
6116 * Version 0.1.8 released, 0.1.9 opened for further work.
6124 * Version 0.1.8 released, 0.1.9 opened for further work.
6117
6125
6118 * Added magics pdef, source and file. They respectively show the
6126 * Added magics pdef, source and file. They respectively show the
6119 definition line ('prototype' in C), source code and full python
6127 definition line ('prototype' in C), source code and full python
6120 file for any callable object. The object inspector oinfo uses
6128 file for any callable object. The object inspector oinfo uses
6121 these to show the same information.
6129 these to show the same information.
6122
6130
6123 * Version 0.1.7 released, 0.1.8 opened for further work.
6131 * Version 0.1.7 released, 0.1.8 opened for further work.
6124
6132
6125 * Separated all the magic functions into a class called Magic. The
6133 * Separated all the magic functions into a class called Magic. The
6126 InteractiveShell class was becoming too big for Xemacs to handle
6134 InteractiveShell class was becoming too big for Xemacs to handle
6127 (de-indenting a line would lock it up for 10 seconds while it
6135 (de-indenting a line would lock it up for 10 seconds while it
6128 backtracked on the whole class!)
6136 backtracked on the whole class!)
6129
6137
6130 FIXME: didn't work. It can be done, but right now namespaces are
6138 FIXME: didn't work. It can be done, but right now namespaces are
6131 all messed up. Do it later (reverted it for now, so at least
6139 all messed up. Do it later (reverted it for now, so at least
6132 everything works as before).
6140 everything works as before).
6133
6141
6134 * Got the object introspection system (magic_oinfo) working! I
6142 * Got the object introspection system (magic_oinfo) working! I
6135 think this is pretty much ready for release to Janko, so he can
6143 think this is pretty much ready for release to Janko, so he can
6136 test it for a while and then announce it. Pretty much 100% of what
6144 test it for a while and then announce it. Pretty much 100% of what
6137 I wanted for the 'phase 1' release is ready. Happy, tired.
6145 I wanted for the 'phase 1' release is ready. Happy, tired.
6138
6146
6139 2001-11-12 Fernando Perez <fperez@colorado.edu>
6147 2001-11-12 Fernando Perez <fperez@colorado.edu>
6140
6148
6141 * Version 0.1.6 released, 0.1.7 opened for further work.
6149 * Version 0.1.6 released, 0.1.7 opened for further work.
6142
6150
6143 * Fixed bug in printing: it used to test for truth before
6151 * Fixed bug in printing: it used to test for truth before
6144 printing, so 0 wouldn't print. Now checks for None.
6152 printing, so 0 wouldn't print. Now checks for None.
6145
6153
6146 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6154 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6147 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6155 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6148 reaches by hand into the outputcache. Think of a better way to do
6156 reaches by hand into the outputcache. Think of a better way to do
6149 this later.
6157 this later.
6150
6158
6151 * Various small fixes thanks to Nathan's comments.
6159 * Various small fixes thanks to Nathan's comments.
6152
6160
6153 * Changed magic_pprint to magic_Pprint. This way it doesn't
6161 * Changed magic_pprint to magic_Pprint. This way it doesn't
6154 collide with pprint() and the name is consistent with the command
6162 collide with pprint() and the name is consistent with the command
6155 line option.
6163 line option.
6156
6164
6157 * Changed prompt counter behavior to be fully like
6165 * Changed prompt counter behavior to be fully like
6158 Mathematica's. That is, even input that doesn't return a result
6166 Mathematica's. That is, even input that doesn't return a result
6159 raises the prompt counter. The old behavior was kind of confusing
6167 raises the prompt counter. The old behavior was kind of confusing
6160 (getting the same prompt number several times if the operation
6168 (getting the same prompt number several times if the operation
6161 didn't return a result).
6169 didn't return a result).
6162
6170
6163 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6171 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6164
6172
6165 * Fixed -Classic mode (wasn't working anymore).
6173 * Fixed -Classic mode (wasn't working anymore).
6166
6174
6167 * Added colored prompts using Nathan's new code. Colors are
6175 * Added colored prompts using Nathan's new code. Colors are
6168 currently hardwired, they can be user-configurable. For
6176 currently hardwired, they can be user-configurable. For
6169 developers, they can be chosen in file ipythonlib.py, at the
6177 developers, they can be chosen in file ipythonlib.py, at the
6170 beginning of the CachedOutput class def.
6178 beginning of the CachedOutput class def.
6171
6179
6172 2001-11-11 Fernando Perez <fperez@colorado.edu>
6180 2001-11-11 Fernando Perez <fperez@colorado.edu>
6173
6181
6174 * Version 0.1.5 released, 0.1.6 opened for further work.
6182 * Version 0.1.5 released, 0.1.6 opened for further work.
6175
6183
6176 * Changed magic_env to *return* the environment as a dict (not to
6184 * Changed magic_env to *return* the environment as a dict (not to
6177 print it). This way it prints, but it can also be processed.
6185 print it). This way it prints, but it can also be processed.
6178
6186
6179 * Added Verbose exception reporting to interactive
6187 * Added Verbose exception reporting to interactive
6180 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6188 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6181 traceback. Had to make some changes to the ultraTB file. This is
6189 traceback. Had to make some changes to the ultraTB file. This is
6182 probably the last 'big' thing in my mental todo list. This ties
6190 probably the last 'big' thing in my mental todo list. This ties
6183 in with the next entry:
6191 in with the next entry:
6184
6192
6185 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6193 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6186 has to specify is Plain, Color or Verbose for all exception
6194 has to specify is Plain, Color or Verbose for all exception
6187 handling.
6195 handling.
6188
6196
6189 * Removed ShellServices option. All this can really be done via
6197 * Removed ShellServices option. All this can really be done via
6190 the magic system. It's easier to extend, cleaner and has automatic
6198 the magic system. It's easier to extend, cleaner and has automatic
6191 namespace protection and documentation.
6199 namespace protection and documentation.
6192
6200
6193 2001-11-09 Fernando Perez <fperez@colorado.edu>
6201 2001-11-09 Fernando Perez <fperez@colorado.edu>
6194
6202
6195 * Fixed bug in output cache flushing (missing parameter to
6203 * Fixed bug in output cache flushing (missing parameter to
6196 __init__). Other small bugs fixed (found using pychecker).
6204 __init__). Other small bugs fixed (found using pychecker).
6197
6205
6198 * Version 0.1.4 opened for bugfixing.
6206 * Version 0.1.4 opened for bugfixing.
6199
6207
6200 2001-11-07 Fernando Perez <fperez@colorado.edu>
6208 2001-11-07 Fernando Perez <fperez@colorado.edu>
6201
6209
6202 * Version 0.1.3 released, mainly because of the raw_input bug.
6210 * Version 0.1.3 released, mainly because of the raw_input bug.
6203
6211
6204 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6212 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6205 and when testing for whether things were callable, a call could
6213 and when testing for whether things were callable, a call could
6206 actually be made to certain functions. They would get called again
6214 actually be made to certain functions. They would get called again
6207 once 'really' executed, with a resulting double call. A disaster
6215 once 'really' executed, with a resulting double call. A disaster
6208 in many cases (list.reverse() would never work!).
6216 in many cases (list.reverse() would never work!).
6209
6217
6210 * Removed prefilter() function, moved its code to raw_input (which
6218 * Removed prefilter() function, moved its code to raw_input (which
6211 after all was just a near-empty caller for prefilter). This saves
6219 after all was just a near-empty caller for prefilter). This saves
6212 a function call on every prompt, and simplifies the class a tiny bit.
6220 a function call on every prompt, and simplifies the class a tiny bit.
6213
6221
6214 * Fix _ip to __ip name in magic example file.
6222 * Fix _ip to __ip name in magic example file.
6215
6223
6216 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6224 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6217 work with non-gnu versions of tar.
6225 work with non-gnu versions of tar.
6218
6226
6219 2001-11-06 Fernando Perez <fperez@colorado.edu>
6227 2001-11-06 Fernando Perez <fperez@colorado.edu>
6220
6228
6221 * Version 0.1.2. Just to keep track of the recent changes.
6229 * Version 0.1.2. Just to keep track of the recent changes.
6222
6230
6223 * Fixed nasty bug in output prompt routine. It used to check 'if
6231 * Fixed nasty bug in output prompt routine. It used to check 'if
6224 arg != None...'. Problem is, this fails if arg implements a
6232 arg != None...'. Problem is, this fails if arg implements a
6225 special comparison (__cmp__) which disallows comparing to
6233 special comparison (__cmp__) which disallows comparing to
6226 None. Found it when trying to use the PhysicalQuantity module from
6234 None. Found it when trying to use the PhysicalQuantity module from
6227 ScientificPython.
6235 ScientificPython.
6228
6236
6229 2001-11-05 Fernando Perez <fperez@colorado.edu>
6237 2001-11-05 Fernando Perez <fperez@colorado.edu>
6230
6238
6231 * Also added dirs. Now the pushd/popd/dirs family functions
6239 * Also added dirs. Now the pushd/popd/dirs family functions
6232 basically like the shell, with the added convenience of going home
6240 basically like the shell, with the added convenience of going home
6233 when called with no args.
6241 when called with no args.
6234
6242
6235 * pushd/popd slightly modified to mimic shell behavior more
6243 * pushd/popd slightly modified to mimic shell behavior more
6236 closely.
6244 closely.
6237
6245
6238 * Added env,pushd,popd from ShellServices as magic functions. I
6246 * Added env,pushd,popd from ShellServices as magic functions. I
6239 think the cleanest will be to port all desired functions from
6247 think the cleanest will be to port all desired functions from
6240 ShellServices as magics and remove ShellServices altogether. This
6248 ShellServices as magics and remove ShellServices altogether. This
6241 will provide a single, clean way of adding functionality
6249 will provide a single, clean way of adding functionality
6242 (shell-type or otherwise) to IP.
6250 (shell-type or otherwise) to IP.
6243
6251
6244 2001-11-04 Fernando Perez <fperez@colorado.edu>
6252 2001-11-04 Fernando Perez <fperez@colorado.edu>
6245
6253
6246 * Added .ipython/ directory to sys.path. This way users can keep
6254 * Added .ipython/ directory to sys.path. This way users can keep
6247 customizations there and access them via import.
6255 customizations there and access them via import.
6248
6256
6249 2001-11-03 Fernando Perez <fperez@colorado.edu>
6257 2001-11-03 Fernando Perez <fperez@colorado.edu>
6250
6258
6251 * Opened version 0.1.1 for new changes.
6259 * Opened version 0.1.1 for new changes.
6252
6260
6253 * Changed version number to 0.1.0: first 'public' release, sent to
6261 * Changed version number to 0.1.0: first 'public' release, sent to
6254 Nathan and Janko.
6262 Nathan and Janko.
6255
6263
6256 * Lots of small fixes and tweaks.
6264 * Lots of small fixes and tweaks.
6257
6265
6258 * Minor changes to whos format. Now strings are shown, snipped if
6266 * Minor changes to whos format. Now strings are shown, snipped if
6259 too long.
6267 too long.
6260
6268
6261 * Changed ShellServices to work on __main__ so they show up in @who
6269 * Changed ShellServices to work on __main__ so they show up in @who
6262
6270
6263 * Help also works with ? at the end of a line:
6271 * Help also works with ? at the end of a line:
6264 ?sin and sin?
6272 ?sin and sin?
6265 both produce the same effect. This is nice, as often I use the
6273 both produce the same effect. This is nice, as often I use the
6266 tab-complete to find the name of a method, but I used to then have
6274 tab-complete to find the name of a method, but I used to then have
6267 to go to the beginning of the line to put a ? if I wanted more
6275 to go to the beginning of the line to put a ? if I wanted more
6268 info. Now I can just add the ? and hit return. Convenient.
6276 info. Now I can just add the ? and hit return. Convenient.
6269
6277
6270 2001-11-02 Fernando Perez <fperez@colorado.edu>
6278 2001-11-02 Fernando Perez <fperez@colorado.edu>
6271
6279
6272 * Python version check (>=2.1) added.
6280 * Python version check (>=2.1) added.
6273
6281
6274 * Added LazyPython documentation. At this point the docs are quite
6282 * Added LazyPython documentation. At this point the docs are quite
6275 a mess. A cleanup is in order.
6283 a mess. A cleanup is in order.
6276
6284
6277 * Auto-installer created. For some bizarre reason, the zipfiles
6285 * Auto-installer created. For some bizarre reason, the zipfiles
6278 module isn't working on my system. So I made a tar version
6286 module isn't working on my system. So I made a tar version
6279 (hopefully the command line options in various systems won't kill
6287 (hopefully the command line options in various systems won't kill
6280 me).
6288 me).
6281
6289
6282 * Fixes to Struct in genutils. Now all dictionary-like methods are
6290 * Fixes to Struct in genutils. Now all dictionary-like methods are
6283 protected (reasonably).
6291 protected (reasonably).
6284
6292
6285 * Added pager function to genutils and changed ? to print usage
6293 * Added pager function to genutils and changed ? to print usage
6286 note through it (it was too long).
6294 note through it (it was too long).
6287
6295
6288 * Added the LazyPython functionality. Works great! I changed the
6296 * Added the LazyPython functionality. Works great! I changed the
6289 auto-quote escape to ';', it's on home row and next to '. But
6297 auto-quote escape to ';', it's on home row and next to '. But
6290 both auto-quote and auto-paren (still /) escapes are command-line
6298 both auto-quote and auto-paren (still /) escapes are command-line
6291 parameters.
6299 parameters.
6292
6300
6293
6301
6294 2001-11-01 Fernando Perez <fperez@colorado.edu>
6302 2001-11-01 Fernando Perez <fperez@colorado.edu>
6295
6303
6296 * Version changed to 0.0.7. Fairly large change: configuration now
6304 * Version changed to 0.0.7. Fairly large change: configuration now
6297 is all stored in a directory, by default .ipython. There, all
6305 is all stored in a directory, by default .ipython. There, all
6298 config files have normal looking names (not .names)
6306 config files have normal looking names (not .names)
6299
6307
6300 * Version 0.0.6 Released first to Lucas and Archie as a test
6308 * Version 0.0.6 Released first to Lucas and Archie as a test
6301 run. Since it's the first 'semi-public' release, change version to
6309 run. Since it's the first 'semi-public' release, change version to
6302 > 0.0.6 for any changes now.
6310 > 0.0.6 for any changes now.
6303
6311
6304 * Stuff I had put in the ipplib.py changelog:
6312 * Stuff I had put in the ipplib.py changelog:
6305
6313
6306 Changes to InteractiveShell:
6314 Changes to InteractiveShell:
6307
6315
6308 - Made the usage message a parameter.
6316 - Made the usage message a parameter.
6309
6317
6310 - Require the name of the shell variable to be given. It's a bit
6318 - Require the name of the shell variable to be given. It's a bit
6311 of a hack, but allows the name 'shell' not to be hardwired in the
6319 of a hack, but allows the name 'shell' not to be hardwired in the
6312 magic (@) handler, which is problematic b/c it requires
6320 magic (@) handler, which is problematic b/c it requires
6313 polluting the global namespace with 'shell'. This in turn is
6321 polluting the global namespace with 'shell'. This in turn is
6314 fragile: if a user redefines a variable called shell, things
6322 fragile: if a user redefines a variable called shell, things
6315 break.
6323 break.
6316
6324
6317 - magic @: all functions available through @ need to be defined
6325 - magic @: all functions available through @ need to be defined
6318 as magic_<name>, even though they can be called simply as
6326 as magic_<name>, even though they can be called simply as
6319 @<name>. This allows the special command @magic to gather
6327 @<name>. This allows the special command @magic to gather
6320 information automatically about all existing magic functions,
6328 information automatically about all existing magic functions,
6321 even if they are run-time user extensions, by parsing the shell
6329 even if they are run-time user extensions, by parsing the shell
6322 instance __dict__ looking for special magic_ names.
6330 instance __dict__ looking for special magic_ names.
6323
6331
6324 - mainloop: added *two* local namespace parameters. This allows
6332 - mainloop: added *two* local namespace parameters. This allows
6325 the class to differentiate between parameters which were there
6333 the class to differentiate between parameters which were there
6326 before and after command line initialization was processed. This
6334 before and after command line initialization was processed. This
6327 way, later @who can show things loaded at startup by the
6335 way, later @who can show things loaded at startup by the
6328 user. This trick was necessary to make session saving/reloading
6336 user. This trick was necessary to make session saving/reloading
6329 really work: ideally after saving/exiting/reloading a session,
6337 really work: ideally after saving/exiting/reloading a session,
6330 *everything* should look the same, including the output of @who. I
6338 *everything* should look the same, including the output of @who. I
6331 was only able to make this work with this double namespace
6339 was only able to make this work with this double namespace
6332 trick.
6340 trick.
6333
6341
6334 - added a header to the logfile which allows (almost) full
6342 - added a header to the logfile which allows (almost) full
6335 session restoring.
6343 session restoring.
6336
6344
6337 - prepend lines beginning with @ or !, with a and log
6345 - prepend lines beginning with @ or !, with a and log
6338 them. Why? !lines: may be useful to know what you did @lines:
6346 them. Why? !lines: may be useful to know what you did @lines:
6339 they may affect session state. So when restoring a session, at
6347 they may affect session state. So when restoring a session, at
6340 least inform the user of their presence. I couldn't quite get
6348 least inform the user of their presence. I couldn't quite get
6341 them to properly re-execute, but at least the user is warned.
6349 them to properly re-execute, but at least the user is warned.
6342
6350
6343 * Started ChangeLog.
6351 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now