##// 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 1 # -*- coding: utf-8 -*-
2 2 """
3 3 Pdb debugger class.
4 4
5 5 Modified from the standard pdb.Pdb class to avoid including readline, so that
6 6 the command line completion of other programs which include this isn't
7 7 damaged.
8 8
9 9 In the future, this class will be expanded with improvements over the standard
10 10 pdb.
11 11
12 12 The code in this file is mainly lifted out of cmd.py in Python 2.2, with minor
13 13 changes. Licensing should therefore be under the standard Python terms. For
14 14 details on the PSF (Python Software Foundation) standard license, see:
15 15
16 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 22 # Since this file is essentially a modified copy of the pdb module which is
23 23 # part of the standard Python distribution, I assume that the proper procedure
24 24 # is to maintain its copyright as belonging to the Python Software Foundation
25 25 # (in addition to my own, for all new code).
26 26 #
27 27 # Copyright (C) 2001 Python Software Foundation, www.python.org
28 28 # Copyright (C) 2005-2006 Fernando Perez. <fperez@colorado.edu>
29 29 #
30 30 # Distributed under the terms of the BSD License. The full license is in
31 31 # the file COPYING, distributed as part of this software.
32 32 #
33 33 #*****************************************************************************
34 34
35 35 from IPython import Release
36 36 __author__ = '%s <%s>' % Release.authors['Fernando']
37 37 __license__ = 'Python'
38 38
39 39 import bdb
40 40 import cmd
41 41 import linecache
42 42 import os
43 43 import sys
44 44
45 45 from IPython import PyColorize, ColorANSI, ipapi
46 46 from IPython.genutils import Term
47 47 from IPython.excolors import ExceptionColors
48 48
49 49 # See if we can use pydb.
50 50 has_pydb = False
51 51 prompt = 'ipdb> '
52 52 try:
53 53 import pydb
54 54 if hasattr(pydb.pydb, "runl"):
55 55 has_pydb = True
56 56 from pydb import Pdb as OldPdb
57 57 except ImportError:
58 58 pass
59 59
60 60 if has_pydb:
61 61 from pydb import Pdb as OldPdb
62 62 prompt = 'ipydb> '
63 63 else:
64 64 from pdb import Pdb as OldPdb
65 65
66 66 # Allow the set_trace code to operate outside of an ipython instance, even if
67 67 # it does so with some limitations. The rest of this support is implemented in
68 68 # the Tracer constructor.
69 69 def BdbQuit_excepthook(et,ev,tb):
70 70 if et==bdb.BdbQuit:
71 71 print 'Exiting Debugger.'
72 72 else:
73 73 ehook.excepthook_ori(et,ev,tb)
74 74
75 75 def BdbQuit_IPython_excepthook(self,et,ev,tb):
76 76 print 'Exiting Debugger.'
77 77
78 78 class Tracer(object):
79 79 """Class for local debugging, similar to pdb.set_trace.
80 80
81 81 Instances of this class, when called, behave like pdb.set_trace, but
82 82 providing IPython's enhanced capabilities.
83 83
84 84 This is implemented as a class which must be initialized in your own code
85 85 and not as a standalone function because we need to detect at runtime
86 86 whether IPython is already active or not. That detection is done in the
87 87 constructor, ensuring that this code plays nicely with a running IPython,
88 88 while functioning acceptably (though with limitations) if outside of it.
89 89 """
90 90
91 91 def __init__(self,colors=None):
92 92 """Create a local debugger instance.
93 93
94 94 :Parameters:
95 95
96 96 - `colors` (None): a string containing the name of the color scheme to
97 97 use, it must be one of IPython's valid color schemes. If not given, the
98 98 function will default to the current IPython scheme when running inside
99 99 IPython, and to 'NoColor' otherwise.
100 100
101 101 Usage example:
102 102
103 103 from IPython.Debugger import Tracer; debug_here = Tracer()
104 104
105 105 ... later in your code
106 106 debug_here() # -> will open up the debugger at that point.
107 107
108 108 Once the debugger activates, you can use all of its regular commands to
109 109 step through code, set breakpoints, etc. See the pdb documentation
110 110 from the Python standard library for usage details.
111 111 """
112 112
113 113 global __IPYTHON__
114 114 try:
115 115 __IPYTHON__
116 116 except NameError:
117 117 # Outside of ipython, we set our own exception hook manually
118 118 __IPYTHON__ = ipapi.get(True,False)
119 119 BdbQuit_excepthook.excepthook_ori = sys.excepthook
120 120 sys.excepthook = BdbQuit_excepthook
121 121 def_colors = 'NoColor'
122 122 try:
123 123 # Limited tab completion support
124 124 import rlcompleter,readline
125 125 readline.parse_and_bind('tab: complete')
126 126 except ImportError:
127 127 pass
128 128 else:
129 129 # In ipython, we use its custom exception handler mechanism
130 130 ip = ipapi.get()
131 131 def_colors = ip.options.colors
132 132 ip.set_custom_exc((bdb.BdbQuit,),BdbQuit_IPython_excepthook)
133 133
134 134 if colors is None:
135 135 colors = def_colors
136 136 self.debugger = Pdb(colors)
137 137
138 138 def __call__(self):
139 139 """Starts an interactive debugger at the point where called.
140 140
141 141 This is similar to the pdb.set_trace() function from the std lib, but
142 142 using IPython's enhanced debugger."""
143 143
144 144 self.debugger.set_trace(sys._getframe().f_back)
145 145
146 146 def decorate_fn_with_doc(new_fn, old_fn, additional_text=""):
147 147 """Make new_fn have old_fn's doc string. This is particularly useful
148 148 for the do_... commands that hook into the help system.
149 149 Adapted from from a comp.lang.python posting
150 150 by Duncan Booth."""
151 151 def wrapper(*args, **kw):
152 152 return new_fn(*args, **kw)
153 153 if old_fn.__doc__:
154 154 wrapper.__doc__ = old_fn.__doc__ + additional_text
155 155 return wrapper
156 156
157 157 def _file_lines(fname):
158 158 """Return the contents of a named file as a list of lines.
159 159
160 160 This function never raises an IOError exception: if the file can't be
161 161 read, it simply returns an empty list."""
162 162
163 163 try:
164 164 outfile = open(fname)
165 165 except IOError:
166 166 return []
167 167 else:
168 168 out = outfile.readlines()
169 169 outfile.close()
170 170 return out
171 171
172 172 class Pdb(OldPdb):
173 173 """Modified Pdb class, does not load readline."""
174 174
175 175 if sys.version[:3] >= '2.5' or has_pydb:
176 176 def __init__(self,color_scheme='NoColor',completekey=None,
177 177 stdin=None, stdout=None):
178 178
179 179 # Parent constructor:
180 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 182 else:
183 183 OldPdb.__init__(self,completekey,stdin,stdout)
184 184
185 185 self.prompt = prompt # The default prompt is '(Pdb)'
186 186
187 187 # IPython changes...
188 188 self.is_pydb = has_pydb
189 189
190 190 if self.is_pydb:
191 191
192 192 # iplib.py's ipalias seems to want pdb's checkline
193 193 # which located in pydb.fn
194 194 import pydb.fns
195 195 self.checkline = lambda filename, lineno: \
196 196 pydb.fns.checkline(self, filename, lineno)
197 197
198 198 self.curframe = None
199 199 self.do_restart = self.new_do_restart
200 200
201 201 self.old_all_completions = __IPYTHON__.Completer.all_completions
202 202 __IPYTHON__.Completer.all_completions=self.all_completions
203 203
204 204 self.do_list = decorate_fn_with_doc(self.list_command_pydb,
205 205 OldPdb.do_list)
206 206 self.do_l = self.do_list
207 207 self.do_frame = decorate_fn_with_doc(self.new_do_frame,
208 208 OldPdb.do_frame)
209 209
210 210 self.aliases = {}
211 211
212 212 # Create color table: we copy the default one from the traceback
213 213 # module and add a few attributes needed for debugging
214 214 self.color_scheme_table = ExceptionColors.copy()
215 215
216 216 # shorthands
217 217 C = ColorANSI.TermColors
218 218 cst = self.color_scheme_table
219 219
220 220 cst['NoColor'].colors.breakpoint_enabled = C.NoColor
221 221 cst['NoColor'].colors.breakpoint_disabled = C.NoColor
222 222
223 223 cst['Linux'].colors.breakpoint_enabled = C.LightRed
224 224 cst['Linux'].colors.breakpoint_disabled = C.Red
225 225
226 226 cst['LightBG'].colors.breakpoint_enabled = C.LightRed
227 227 cst['LightBG'].colors.breakpoint_disabled = C.Red
228 228
229 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 236 else:
232 237 # Ugly hack: for Python 2.3-2.4, we can't call the parent constructor,
233 238 # because it binds readline and breaks tab-completion. This means we
234 239 # have to COPY the constructor here.
235 240 def __init__(self,color_scheme='NoColor'):
236 241 bdb.Bdb.__init__(self)
237 242 cmd.Cmd.__init__(self,completekey=None) # don't load readline
238 243 self.prompt = 'ipdb> ' # The default prompt is '(Pdb)'
239 244 self.aliases = {}
240 245
241 246 # These two lines are part of the py2.4 constructor, let's put them
242 247 # unconditionally here as they won't cause any problems in 2.3.
243 248 self.mainpyfile = ''
244 249 self._wait_for_mainpyfile = 0
245 250
246 251 # Read $HOME/.pdbrc and ./.pdbrc
247 252 try:
248 253 self.rcLines = _file_lines(os.path.join(os.environ['HOME'],
249 254 ".pdbrc"))
250 255 except KeyError:
251 256 self.rcLines = []
252 257 self.rcLines.extend(_file_lines(".pdbrc"))
253 258
254 259 # Create color table: we copy the default one from the traceback
255 260 # module and add a few attributes needed for debugging
256 261 ExceptionColors.set_active_scheme(color_scheme)
257 262 self.color_scheme_table = ExceptionColors.copy()
258 263
259 264 # shorthands
260 265 C = ColorANSI.TermColors
261 266 cst = self.color_scheme_table
262 267
263 268 cst['NoColor'].colors.breakpoint_enabled = C.NoColor
264 269 cst['NoColor'].colors.breakpoint_disabled = C.NoColor
265 270
266 271 cst['Linux'].colors.breakpoint_enabled = C.LightRed
267 272 cst['Linux'].colors.breakpoint_disabled = C.Red
268 273
269 274 cst['LightBG'].colors.breakpoint_enabled = C.LightRed
270 275 cst['LightBG'].colors.breakpoint_disabled = C.Red
271 276
272 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 283 def set_colors(self, scheme):
275 284 """Shorthand access to the color table scheme selector method."""
276 285 self.color_scheme_table.set_active_scheme(scheme)
277 286
278 287 def interaction(self, frame, traceback):
279 288 __IPYTHON__.set_completer_frame(frame)
280 289 OldPdb.interaction(self, frame, traceback)
281 290
282 291 def new_do_up(self, arg):
283 292 OldPdb.do_up(self, arg)
284 293 __IPYTHON__.set_completer_frame(self.curframe)
285 294 do_u = do_up = decorate_fn_with_doc(new_do_up, OldPdb.do_up)
286 295
287 296 def new_do_down(self, arg):
288 297 OldPdb.do_down(self, arg)
289 298 __IPYTHON__.set_completer_frame(self.curframe)
290 299
291 300 do_d = do_down = decorate_fn_with_doc(new_do_down, OldPdb.do_down)
292 301
293 302 def new_do_frame(self, arg):
294 303 OldPdb.do_frame(self, arg)
295 304 __IPYTHON__.set_completer_frame(self.curframe)
296 305
297 306 def new_do_quit(self, arg):
298 307
299 308 if hasattr(self, 'old_all_completions'):
300 309 __IPYTHON__.Completer.all_completions=self.old_all_completions
301 310
302 311
303 312 return OldPdb.do_quit(self, arg)
304 313
305 314 do_q = do_quit = decorate_fn_with_doc(new_do_quit, OldPdb.do_quit)
306 315
307 316 def new_do_restart(self, arg):
308 317 """Restart command. In the context of ipython this is exactly the same
309 318 thing as 'quit'."""
310 319 self.msg("Restart doesn't make sense here. Using 'quit' instead.")
311 320 return self.do_quit(arg)
312 321
313 322 def postloop(self):
314 323 __IPYTHON__.set_completer_frame(None)
315 324
316 325 def print_stack_trace(self):
317 326 try:
318 327 for frame_lineno in self.stack:
319 328 self.print_stack_entry(frame_lineno, context = 5)
320 329 except KeyboardInterrupt:
321 330 pass
322 331
323 332 def print_stack_entry(self,frame_lineno,prompt_prefix='\n-> ',
324 333 context = 3):
325 334 #frame, lineno = frame_lineno
326 335 print >>Term.cout, self.format_stack_entry(frame_lineno, '', context)
327 336
328 337 def format_stack_entry(self, frame_lineno, lprefix=': ', context = 3):
329 338 import linecache, repr
330 339
331 340 ret = []
332 341
333 342 Colors = self.color_scheme_table.active_colors
334 343 ColorsNormal = Colors.Normal
335 344 tpl_link = '%s%%s%s' % (Colors.filenameEm, ColorsNormal)
336 345 tpl_call = '%s%%s%s%%s%s' % (Colors.vName, Colors.valEm, ColorsNormal)
337 346 tpl_line = '%%s%s%%s %s%%s' % (Colors.lineno, ColorsNormal)
338 347 tpl_line_em = '%%s%s%%s %s%%s%s' % (Colors.linenoEm, Colors.line,
339 348 ColorsNormal)
340 349
341 350 frame, lineno = frame_lineno
342 351
343 352 return_value = ''
344 353 if '__return__' in frame.f_locals:
345 354 rv = frame.f_locals['__return__']
346 355 #return_value += '->'
347 356 return_value += repr.repr(rv) + '\n'
348 357 ret.append(return_value)
349 358
350 359 #s = filename + '(' + `lineno` + ')'
351 360 filename = self.canonic(frame.f_code.co_filename)
352 361 link = tpl_link % filename
353 362
354 363 if frame.f_code.co_name:
355 364 func = frame.f_code.co_name
356 365 else:
357 366 func = "<lambda>"
358 367
359 368 call = ''
360 369 if func != '?':
361 370 if '__args__' in frame.f_locals:
362 371 args = repr.repr(frame.f_locals['__args__'])
363 372 else:
364 373 args = '()'
365 374 call = tpl_call % (func, args)
366 375
367 376 # The level info should be generated in the same format pdb uses, to
368 377 # avoid breaking the pdbtrack functionality of python-mode in *emacs.
369 378 if frame is self.curframe:
370 379 ret.append('> ')
371 380 else:
372 381 ret.append(' ')
373 382 ret.append('%s(%s)%s\n' % (link,lineno,call))
374 383
375 384 start = lineno - 1 - context//2
376 385 lines = linecache.getlines(filename)
377 386 start = max(start, 0)
378 387 start = min(start, len(lines) - context)
379 388 lines = lines[start : start + context]
380 389
381 390 for i,line in enumerate(lines):
382 391 show_arrow = (start + 1 + i == lineno)
383 392 linetpl = (frame is self.curframe or show_arrow) \
384 393 and tpl_line_em \
385 394 or tpl_line
386 395 ret.append(self.__format_line(linetpl, filename,
387 396 start + 1 + i, line,
388 397 arrow = show_arrow) )
389 398
390 399 return ''.join(ret)
391 400
392 401 def __format_line(self, tpl_line, filename, lineno, line, arrow = False):
393 402 bp_mark = ""
394 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 409 bp = None
397 410 if lineno in self.get_file_breaks(filename):
398 411 bps = self.get_breaks(filename, lineno)
399 412 bp = bps[-1]
400 413
401 414 if bp:
402 415 Colors = self.color_scheme_table.active_colors
403 416 bp_mark = str(bp.number)
404 417 bp_mark_color = Colors.breakpoint_enabled
405 418 if not bp.enabled:
406 419 bp_mark_color = Colors.breakpoint_disabled
407 420
408 421 numbers_width = 7
409 422 if arrow:
410 423 # This is the line with the error
411 424 pad = numbers_width - len(str(lineno)) - len(bp_mark)
412 425 if pad >= 3:
413 426 marker = '-'*(pad-3) + '-> '
414 427 elif pad == 2:
415 428 marker = '> '
416 429 elif pad == 1:
417 430 marker = '>'
418 431 else:
419 432 marker = ''
420 433 num = '%s%s' % (marker, str(lineno))
421 434 line = tpl_line % (bp_mark_color + bp_mark, num, line)
422 435 else:
423 436 num = '%*s' % (numbers_width - len(bp_mark), str(lineno))
424 437 line = tpl_line % (bp_mark_color + bp_mark, num, line)
425 438
426 439 return line
427 440
428 441 def list_command_pydb(self, arg):
429 442 """List command to use if we have a newer pydb installed"""
430 443 filename, first, last = OldPdb.parse_list_cmd(self, arg)
431 444 if filename is not None:
432 445 self.print_list_lines(filename, first, last)
433 446
434 447 def print_list_lines(self, filename, first, last):
435 448 """The printing (as opposed to the parsing part of a 'list'
436 449 command."""
437 450 try:
438 451 Colors = self.color_scheme_table.active_colors
439 452 ColorsNormal = Colors.Normal
440 453 tpl_line = '%%s%s%%s %s%%s' % (Colors.lineno, ColorsNormal)
441 454 tpl_line_em = '%%s%s%%s %s%%s%s' % (Colors.linenoEm, Colors.line, ColorsNormal)
442 455 src = []
443 456 for lineno in range(first, last+1):
444 457 line = linecache.getline(filename, lineno)
445 458 if not line:
446 459 break
447 460
448 461 if lineno == self.curframe.f_lineno:
449 462 line = self.__format_line(tpl_line_em, filename, lineno, line, arrow = True)
450 463 else:
451 464 line = self.__format_line(tpl_line, filename, lineno, line, arrow = False)
452 465
453 466 src.append(line)
454 467 self.lineno = lineno
455 468
456 469 print >>Term.cout, ''.join(src)
457 470
458 471 except KeyboardInterrupt:
459 472 pass
460 473
461 474 def do_list(self, arg):
462 475 self.lastcmd = 'list'
463 476 last = None
464 477 if arg:
465 478 try:
466 479 x = eval(arg, {}, {})
467 480 if type(x) == type(()):
468 481 first, last = x
469 482 first = int(first)
470 483 last = int(last)
471 484 if last < first:
472 485 # Assume it's a count
473 486 last = first + last
474 487 else:
475 488 first = max(1, int(x) - 5)
476 489 except:
477 490 print '*** Error in argument:', `arg`
478 491 return
479 492 elif self.lineno is None:
480 493 first = max(1, self.curframe.f_lineno - 5)
481 494 else:
482 495 first = self.lineno + 1
483 496 if last is None:
484 497 last = first + 10
485 498 self.print_list_lines(self.curframe.f_code.co_filename, first, last)
486 499
487 500 do_l = do_list
488 501
489 502 def do_pdef(self, arg):
490 503 """The debugger interface to magic_pdef"""
491 504 namespaces = [('Locals', self.curframe.f_locals),
492 505 ('Globals', self.curframe.f_globals)]
493 506 __IPYTHON__.magic_pdef(arg, namespaces=namespaces)
494 507
495 508 def do_pdoc(self, arg):
496 509 """The debugger interface to magic_pdoc"""
497 510 namespaces = [('Locals', self.curframe.f_locals),
498 511 ('Globals', self.curframe.f_globals)]
499 512 __IPYTHON__.magic_pdoc(arg, namespaces=namespaces)
500 513
501 514 def do_pinfo(self, arg):
502 515 """The debugger equivalant of ?obj"""
503 516 namespaces = [('Locals', self.curframe.f_locals),
504 517 ('Globals', self.curframe.f_globals)]
505 518 __IPYTHON__.magic_pinfo("pinfo %s" % arg, namespaces=namespaces)
@@ -1,260 +1,267 b''
1 1 # -*- coding: utf-8 -*-
2 2 """
3 3 Class and program to colorize python source code for ANSI terminals.
4 4
5 5 Based on an HTML code highlighter by Jurgen Hermann found at:
6 6 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52298
7 7
8 8 Modifications by Fernando Perez (fperez@colorado.edu).
9 9
10 10 Information on the original HTML highlighter follows:
11 11
12 12 MoinMoin - Python Source Parser
13 13
14 14 Title:olorize Python source using the built-in tokenizer
15 15
16 16 Submitter: Jurgen Hermann
17 17 Last Updated:2001/04/06
18 18
19 19 Version no:1.2
20 20
21 21 Description:
22 22
23 23 This code is part of MoinMoin (http://moin.sourceforge.net/) and converts
24 24 Python source code to HTML markup, rendering comments, keywords,
25 25 operators, numeric and string literals in different colors.
26 26
27 27 It shows how to use the built-in keyword, token and tokenize modules to
28 28 scan Python source code and re-emit it with no changes to its original
29 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 33 __all__ = ['ANSICodeColors','Parser']
34 34
35 35 _scheme_default = 'Linux'
36 36
37 37 # Imports
38 38 import cStringIO
39 39 import keyword
40 40 import os
41 41 import string
42 42 import sys
43 43 import token
44 44 import tokenize
45 45
46 46 from IPython.ColorANSI import *
47 47
48 48 #############################################################################
49 49 ### Python Source Parser (does Hilighting)
50 50 #############################################################################
51 51
52 52 _KEYWORD = token.NT_OFFSET + 1
53 53 _TEXT = token.NT_OFFSET + 2
54 54
55 55 #****************************************************************************
56 56 # Builtin color schemes
57 57
58 58 Colors = TermColors # just a shorthand
59 59
60 60 # Build a few color schemes
61 61 NoColor = ColorScheme(
62 62 'NoColor',{
63 63 token.NUMBER : Colors.NoColor,
64 64 token.OP : Colors.NoColor,
65 65 token.STRING : Colors.NoColor,
66 66 tokenize.COMMENT : Colors.NoColor,
67 67 token.NAME : Colors.NoColor,
68 68 token.ERRORTOKEN : Colors.NoColor,
69 69
70 70 _KEYWORD : Colors.NoColor,
71 71 _TEXT : Colors.NoColor,
72 72
73 73 'normal' : Colors.NoColor # color off (usu. Colors.Normal)
74 74 } )
75 75
76 76 LinuxColors = ColorScheme(
77 77 'Linux',{
78 78 token.NUMBER : Colors.LightCyan,
79 79 token.OP : Colors.Yellow,
80 80 token.STRING : Colors.LightBlue,
81 81 tokenize.COMMENT : Colors.LightRed,
82 82 token.NAME : Colors.White,
83 83 token.ERRORTOKEN : Colors.Red,
84 84
85 85 _KEYWORD : Colors.LightGreen,
86 86 _TEXT : Colors.Yellow,
87 87
88 88 'normal' : Colors.Normal # color off (usu. Colors.Normal)
89 89 } )
90 90
91 91 LightBGColors = ColorScheme(
92 92 'LightBG',{
93 93 token.NUMBER : Colors.Cyan,
94 94 token.OP : Colors.Blue,
95 95 token.STRING : Colors.Blue,
96 96 tokenize.COMMENT : Colors.Red,
97 97 token.NAME : Colors.Black,
98 98 token.ERRORTOKEN : Colors.Red,
99 99
100 100 _KEYWORD : Colors.Green,
101 101 _TEXT : Colors.Blue,
102 102
103 103 'normal' : Colors.Normal # color off (usu. Colors.Normal)
104 104 } )
105 105
106 106 # Build table of color schemes (needed by the parser)
107 107 ANSICodeColors = ColorSchemeTable([NoColor,LinuxColors,LightBGColors],
108 108 _scheme_default)
109 109
110 110 class Parser:
111 111 """ Format colored Python source.
112 112 """
113 113
114 114 def __init__(self, color_table=None,out = sys.stdout):
115 115 """ Create a parser with a specified color table and output channel.
116 116
117 117 Call format() to process code.
118 118 """
119 119 self.color_table = color_table and color_table or ANSICodeColors
120 120 self.out = out
121 121
122 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 126 """ Parse and send the colored source.
124 127
125 128 If out and scheme are not specified, the defaults (given to
126 129 constructor) are used.
127 130
128 131 out should be a file-type object. Optionally, out can be given as the
129 132 string 'str' and the parser will automatically return the output in a
130 133 string."""
131 134
132 135 self.raw = string.strip(string.expandtabs(raw))
133 136 string_output = 0
134 137 if out == 'str' or self.out == 'str':
135 138 out_old = self.out
136 139 self.out = cStringIO.StringIO()
137 140 string_output = 1
138 141 elif out is not None:
139 142 self.out = out
140 143 # local shorthand
141 144 colors = self.color_table[scheme].colors
142 145 self.colors = colors # put in object so __call__ sees it
143 146 # store line offsets in self.lines
144 147 self.lines = [0, 0]
145 148 pos = 0
146 149 while 1:
147 150 pos = string.find(self.raw, '\n', pos) + 1
148 151 if not pos: break
149 152 self.lines.append(pos)
150 153 self.lines.append(len(self.raw))
151 154
152 155 # parse the source and write it
153 156 self.pos = 0
154 157 text = cStringIO.StringIO(self.raw)
155 158 #self.out.write('<pre><font face="Courier New">')
159
160 error = False
156 161 try:
157 162 tokenize.tokenize(text.readline, self)
158 163 except tokenize.TokenError, ex:
159 164 msg = ex[0]
160 165 line = ex[1][0]
161 166 self.out.write("%s\n\n*** ERROR: %s%s%s\n" %
162 167 (colors[token.ERRORTOKEN],
163 168 msg, self.raw[self.lines[line]:],
164 169 colors.normal)
165 170 )
171 error = True
166 172 self.out.write(colors.normal+'\n')
167 173 if string_output:
168 174 output = self.out.getvalue()
169 175 self.out = out_old
170 return output
176 return (output, error)
177 return (None, error)
171 178
172 179 def __call__(self, toktype, toktext, (srow,scol), (erow,ecol), line):
173 180 """ Token handler, with syntax highlighting."""
174 181
175 182 # local shorthand
176 183 colors = self.colors
177 184
178 185 # line separator, so this works across platforms
179 186 linesep = os.linesep
180 187
181 188 # calculate new positions
182 189 oldpos = self.pos
183 190 newpos = self.lines[srow] + scol
184 191 self.pos = newpos + len(toktext)
185 192
186 193 # handle newlines
187 194 if toktype in [token.NEWLINE, tokenize.NL]:
188 195 self.out.write(linesep)
189 196 return
190 197
191 198 # send the original whitespace, if needed
192 199 if newpos > oldpos:
193 200 self.out.write(self.raw[oldpos:newpos])
194 201
195 202 # skip indenting tokens
196 203 if toktype in [token.INDENT, token.DEDENT]:
197 204 self.pos = newpos
198 205 return
199 206
200 207 # map token type to a color group
201 208 if token.LPAR <= toktype and toktype <= token.OP:
202 209 toktype = token.OP
203 210 elif toktype == token.NAME and keyword.iskeyword(toktext):
204 211 toktype = _KEYWORD
205 212 color = colors.get(toktype, colors[_TEXT])
206 213
207 214 #print '<%s>' % toktext, # dbg
208 215
209 216 # Triple quoted strings must be handled carefully so that backtracking
210 217 # in pagers works correctly. We need color terminators on _each_ line.
211 218 if linesep in toktext:
212 219 toktext = toktext.replace(linesep, '%s%s%s' %
213 220 (colors.normal,linesep,color))
214 221
215 222 # send text
216 223 self.out.write('%s%s%s' % (color,toktext,colors.normal))
217 224
218 225 def main():
219 226 """Colorize a python file using ANSI color escapes and print to stdout.
220 227
221 228 Usage:
222 229 %s [-s scheme] filename
223 230
224 231 Options:
225 232
226 233 -s scheme: give the color scheme to use. Currently only 'Linux'
227 234 (default) and 'LightBG' and 'NoColor' are implemented (give without
228 235 quotes). """
229 236
230 237 def usage():
231 238 print >> sys.stderr, main.__doc__ % sys.argv[0]
232 239 sys.exit(1)
233 240
234 241 # FIXME: rewrite this to at least use getopt
235 242 try:
236 243 if sys.argv[1] == '-s':
237 244 scheme_name = sys.argv[2]
238 245 del sys.argv[1:3]
239 246 else:
240 247 scheme_name = _scheme_default
241 248
242 249 except:
243 250 usage()
244 251
245 252 try:
246 253 fname = sys.argv[1]
247 254 except:
248 255 usage()
249 256
250 257 # write colorized version to stdout
251 258 parser = Parser()
252 259 try:
253 260 parser.format(file(fname).read(),scheme = scheme_name)
254 261 except IOError,msg:
255 262 # if user reads through a pager and quits, don't print traceback
256 263 if msg.args != (32,'Broken pipe'):
257 264 raise
258 265
259 266 if __name__ == "__main__":
260 267 main()
@@ -1,903 +1,924 b''
1 1 # -*- coding: utf-8 -*-
2 2 """
3 3 ultraTB.py -- Spice up your tracebacks!
4 4
5 5 * ColorTB
6 6 I've always found it a bit hard to visually parse tracebacks in Python. The
7 7 ColorTB class is a solution to that problem. It colors the different parts of a
8 8 traceback in a manner similar to what you would expect from a syntax-highlighting
9 9 text editor.
10 10
11 11 Installation instructions for ColorTB:
12 12 import sys,ultraTB
13 13 sys.excepthook = ultraTB.ColorTB()
14 14
15 15 * VerboseTB
16 16 I've also included a port of Ka-Ping Yee's "cgitb.py" that produces all kinds
17 17 of useful info when a traceback occurs. Ping originally had it spit out HTML
18 18 and intended it for CGI programmers, but why should they have all the fun? I
19 19 altered it to spit out colored text to the terminal. It's a bit overwhelming,
20 20 but kind of neat, and maybe useful for long-running programs that you believe
21 21 are bug-free. If a crash *does* occur in that type of program you want details.
22 22 Give it a shot--you'll love it or you'll hate it.
23 23
24 24 Note:
25 25
26 26 The Verbose mode prints the variables currently visible where the exception
27 27 happened (shortening their strings if too long). This can potentially be
28 28 very slow, if you happen to have a huge data structure whose string
29 29 representation is complex to compute. Your computer may appear to freeze for
30 30 a while with cpu usage at 100%. If this occurs, you can cancel the traceback
31 31 with Ctrl-C (maybe hitting it more than once).
32 32
33 33 If you encounter this kind of situation often, you may want to use the
34 34 Verbose_novars mode instead of the regular Verbose, which avoids formatting
35 35 variables (but otherwise includes the information and context given by
36 36 Verbose).
37 37
38 38
39 39 Installation instructions for ColorTB:
40 40 import sys,ultraTB
41 41 sys.excepthook = ultraTB.VerboseTB()
42 42
43 43 Note: Much of the code in this module was lifted verbatim from the standard
44 44 library module 'traceback.py' and Ka-Ping Yee's 'cgitb.py'.
45 45
46 46 * Color schemes
47 47 The colors are defined in the class TBTools through the use of the
48 48 ColorSchemeTable class. Currently the following exist:
49 49
50 50 - NoColor: allows all of this module to be used in any terminal (the color
51 51 escapes are just dummy blank strings).
52 52
53 53 - Linux: is meant to look good in a terminal like the Linux console (black
54 54 or very dark background).
55 55
56 56 - LightBG: similar to Linux but swaps dark/light colors to be more readable
57 57 in light background terminals.
58 58
59 59 You can implement other color schemes easily, the syntax is fairly
60 60 self-explanatory. Please send back new schemes you develop to the author for
61 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 66 # Copyright (C) 2001 Nathaniel Gray <n8gray@caltech.edu>
67 67 # Copyright (C) 2001-2004 Fernando Perez <fperez@colorado.edu>
68 68 #
69 69 # Distributed under the terms of the BSD License. The full license is in
70 70 # the file COPYING, distributed as part of this software.
71 71 #*****************************************************************************
72 72
73 73 from IPython import Release
74 74 __author__ = '%s <%s>\n%s <%s>' % (Release.authors['Nathan']+
75 75 Release.authors['Fernando'])
76 76 __license__ = Release.license
77 77
78 78 # Required modules
79 79 import inspect
80 80 import keyword
81 81 import linecache
82 82 import os
83 83 import pydoc
84 84 import string
85 85 import sys
86 86 import time
87 87 import tokenize
88 88 import traceback
89 89 import types
90 90
91 91 # IPython's own modules
92 92 # Modified pdb which doesn't damage IPython's readline handling
93 from IPython import Debugger
93 from IPython import Debugger, PyColorize
94 94 from IPython.ipstruct import Struct
95 95 from IPython.excolors import ExceptionColors
96 96 from IPython.genutils import Term,uniq_stable,error,info
97 97
98 98 # Globals
99 99 # amount of space to put line numbers before verbose tracebacks
100 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 109 # Code begins
104 110
105 111 # Utility functions
106 112 def inspect_error():
107 113 """Print a message about internal inspect errors.
108 114
109 115 These are unfortunately quite common."""
110 116
111 117 error('Internal Python error in the inspect module.\n'
112 118 'Below is the traceback from this internal error.\n')
113 119
114 120 def _fixed_getinnerframes(etb, context=1,tb_offset=0):
115 121 import linecache
116 122 LNUM_POS, LINES_POS, INDEX_POS = 2, 4, 5
117 123
118 124 records = inspect.getinnerframes(etb, context)
119 125
120 126 # If the error is at the console, don't build any context, since it would
121 127 # otherwise produce 5 blank lines printed out (there is no file at the
122 128 # console)
123 129 rec_check = records[tb_offset:]
124 130 try:
125 131 rname = rec_check[0][1]
126 132 if rname == '<ipython console>' or rname.endswith('<string>'):
127 133 return rec_check
128 134 except IndexError:
129 135 pass
130 136
131 137 aux = traceback.extract_tb(etb)
132 138 assert len(records) == len(aux)
133 139 for i, (file, lnum, _, _) in zip(range(len(records)), aux):
134 140 maybeStart = lnum-1 - context//2
135 141 start = max(maybeStart, 0)
136 142 end = start + context
137 143 lines = linecache.getlines(file)[start:end]
138 144 # pad with empty lines if necessary
139 145 if maybeStart < 0:
140 146 lines = (['\n'] * -maybeStart) + lines
141 147 if len(lines) < context:
142 148 lines += ['\n'] * (context - len(lines))
143 149 buf = list(records[i])
144 150 buf[LNUM_POS] = lnum
145 151 buf[INDEX_POS] = lnum - 1 - start
146 152 buf[LINES_POS] = lines
147 153 records[i] = tuple(buf)
148 154 return records[tb_offset:]
149 155
150 156 # Helper function -- largely belongs to VerboseTB, but we need the same
151 157 # functionality to produce a pseudo verbose TB for SyntaxErrors, so that they
152 158 # can be recognized properly by ipython.el's py-traceback-line-re
153 159 # (SyntaxErrors have to be treated specially because they have no traceback)
160
161 _parser = PyColorize.Parser()
162
154 163 def _formatTracebackLines(lnum, index, lines, Colors, lvals=None):
155 164 numbers_width = INDENT_SIZE - 1
156 165 res = []
157 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 175 for line in lines:
176 new_line, err = _line_format(line,'str',scheme)
177 if not err: line = new_line
178
159 179 if i == lnum:
160 180 # This is the line with the error
161 181 pad = numbers_width - len(str(i))
162 182 if pad >= 3:
163 183 marker = '-'*(pad-3) + '-> '
164 184 elif pad == 2:
165 185 marker = '> '
166 186 elif pad == 1:
167 187 marker = '>'
168 188 else:
169 189 marker = ''
170 190 num = marker + str(i)
171 191 line = '%s%s%s %s%s' %(Colors.linenoEm, num,
172 192 Colors.line, line, Colors.Normal)
173 193 else:
174 194 num = '%*s' % (numbers_width,i)
175 195 line = '%s%s%s %s' %(Colors.lineno, num,
176 196 Colors.Normal, line)
177 197
178 198 res.append(line)
179 199 if lvals and i == lnum:
180 200 res.append(lvals + '\n')
181 201 i = i + 1
182 202 return res
183 203
204
184 205 #---------------------------------------------------------------------------
185 206 # Module classes
186 207 class TBTools:
187 208 """Basic tools used by all traceback printer classes."""
188 209
189 210 def __init__(self,color_scheme = 'NoColor',call_pdb=False):
190 211 # Whether to call the interactive pdb debugger after printing
191 212 # tracebacks or not
192 213 self.call_pdb = call_pdb
193 214
194 215 # Create color table
195 216 self.color_scheme_table = ExceptionColors
196 217
197 218 self.set_colors(color_scheme)
198 219 self.old_scheme = color_scheme # save initial value for toggles
199 220
200 221 if call_pdb:
201 222 self.pdb = Debugger.Pdb(self.color_scheme_table.active_scheme_name)
202 223 else:
203 224 self.pdb = None
204 225
205 226 def set_colors(self,*args,**kw):
206 227 """Shorthand access to the color table scheme selector method."""
207 228
208 229 # Set own color table
209 230 self.color_scheme_table.set_active_scheme(*args,**kw)
210 231 # for convenience, set Colors to the active scheme
211 232 self.Colors = self.color_scheme_table.active_colors
212 233 # Also set colors of debugger
213 234 if hasattr(self,'pdb') and self.pdb is not None:
214 235 self.pdb.set_colors(*args,**kw)
215 236
216 237 def color_toggle(self):
217 238 """Toggle between the currently active color scheme and NoColor."""
218 239
219 240 if self.color_scheme_table.active_scheme_name == 'NoColor':
220 241 self.color_scheme_table.set_active_scheme(self.old_scheme)
221 242 self.Colors = self.color_scheme_table.active_colors
222 243 else:
223 244 self.old_scheme = self.color_scheme_table.active_scheme_name
224 245 self.color_scheme_table.set_active_scheme('NoColor')
225 246 self.Colors = self.color_scheme_table.active_colors
226 247
227 248 #---------------------------------------------------------------------------
228 249 class ListTB(TBTools):
229 250 """Print traceback information from a traceback list, with optional color.
230 251
231 252 Calling: requires 3 arguments:
232 253 (etype, evalue, elist)
233 254 as would be obtained by:
234 255 etype, evalue, tb = sys.exc_info()
235 256 if tb:
236 257 elist = traceback.extract_tb(tb)
237 258 else:
238 259 elist = None
239 260
240 261 It can thus be used by programs which need to process the traceback before
241 262 printing (such as console replacements based on the code module from the
242 263 standard library).
243 264
244 265 Because they are meant to be called without a full traceback (only a
245 266 list), instances of this class can't call the interactive pdb debugger."""
246 267
247 268 def __init__(self,color_scheme = 'NoColor'):
248 269 TBTools.__init__(self,color_scheme = color_scheme,call_pdb=0)
249 270
250 271 def __call__(self, etype, value, elist):
251 272 Term.cout.flush()
252 273 Term.cerr.flush()
253 274 print >> Term.cerr, self.text(etype,value,elist)
254 275
255 276 def text(self,etype, value, elist,context=5):
256 277 """Return a color formatted string with the traceback info."""
257 278
258 279 Colors = self.Colors
259 280 out_string = ['%s%s%s\n' % (Colors.topline,'-'*60,Colors.Normal)]
260 281 if elist:
261 282 out_string.append('Traceback %s(most recent call last)%s:' % \
262 283 (Colors.normalEm, Colors.Normal) + '\n')
263 284 out_string.extend(self._format_list(elist))
264 285 lines = self._format_exception_only(etype, value)
265 286 for line in lines[:-1]:
266 287 out_string.append(" "+line)
267 288 out_string.append(lines[-1])
268 289 return ''.join(out_string)
269 290
270 291 def _format_list(self, extracted_list):
271 292 """Format a list of traceback entry tuples for printing.
272 293
273 294 Given a list of tuples as returned by extract_tb() or
274 295 extract_stack(), return a list of strings ready for printing.
275 296 Each string in the resulting list corresponds to the item with the
276 297 same index in the argument list. Each string ends in a newline;
277 298 the strings may contain internal newlines as well, for those items
278 299 whose source text line is not None.
279 300
280 301 Lifted almost verbatim from traceback.py
281 302 """
282 303
283 304 Colors = self.Colors
284 305 list = []
285 306 for filename, lineno, name, line in extracted_list[:-1]:
286 307 item = ' File %s"%s"%s, line %s%d%s, in %s%s%s\n' % \
287 308 (Colors.filename, filename, Colors.Normal,
288 309 Colors.lineno, lineno, Colors.Normal,
289 310 Colors.name, name, Colors.Normal)
290 311 if line:
291 312 item = item + ' %s\n' % line.strip()
292 313 list.append(item)
293 314 # Emphasize the last entry
294 315 filename, lineno, name, line = extracted_list[-1]
295 316 item = '%s File %s"%s"%s, line %s%d%s, in %s%s%s%s\n' % \
296 317 (Colors.normalEm,
297 318 Colors.filenameEm, filename, Colors.normalEm,
298 319 Colors.linenoEm, lineno, Colors.normalEm,
299 320 Colors.nameEm, name, Colors.normalEm,
300 321 Colors.Normal)
301 322 if line:
302 323 item = item + '%s %s%s\n' % (Colors.line, line.strip(),
303 324 Colors.Normal)
304 325 list.append(item)
305 326 return list
306 327
307 328 def _format_exception_only(self, etype, value):
308 329 """Format the exception part of a traceback.
309 330
310 331 The arguments are the exception type and value such as given by
311 332 sys.exc_info()[:2]. The return value is a list of strings, each ending
312 333 in a newline. Normally, the list contains a single string; however,
313 334 for SyntaxError exceptions, it contains several lines that (when
314 335 printed) display detailed information about where the syntax error
315 336 occurred. The message indicating which exception occurred is the
316 337 always last string in the list.
317 338
318 339 Also lifted nearly verbatim from traceback.py
319 340 """
320 341
321 342 Colors = self.Colors
322 343 list = []
323 344 if type(etype) == types.ClassType:
324 345 stype = Colors.excName + etype.__name__ + Colors.Normal
325 346 else:
326 347 stype = etype # String exceptions don't get special coloring
327 348 if value is None:
328 349 list.append( str(stype) + '\n')
329 350 else:
330 351 if etype is SyntaxError:
331 352 try:
332 353 msg, (filename, lineno, offset, line) = value
333 354 except:
334 355 pass
335 356 else:
336 357 #print 'filename is',filename # dbg
337 358 if not filename: filename = "<string>"
338 359 list.append('%s File %s"%s"%s, line %s%d%s\n' % \
339 360 (Colors.normalEm,
340 361 Colors.filenameEm, filename, Colors.normalEm,
341 362 Colors.linenoEm, lineno, Colors.Normal ))
342 363 if line is not None:
343 364 i = 0
344 365 while i < len(line) and line[i].isspace():
345 366 i = i+1
346 367 list.append('%s %s%s\n' % (Colors.line,
347 368 line.strip(),
348 369 Colors.Normal))
349 370 if offset is not None:
350 371 s = ' '
351 372 for c in line[i:offset-1]:
352 373 if c.isspace():
353 374 s = s + c
354 375 else:
355 376 s = s + ' '
356 377 list.append('%s%s^%s\n' % (Colors.caret, s,
357 378 Colors.Normal) )
358 379 value = msg
359 380 s = self._some_str(value)
360 381 if s:
361 382 list.append('%s%s:%s %s\n' % (str(stype), Colors.excName,
362 383 Colors.Normal, s))
363 384 else:
364 385 list.append('%s\n' % str(stype))
365 386 return list
366 387
367 388 def _some_str(self, value):
368 389 # Lifted from traceback.py
369 390 try:
370 391 return str(value)
371 392 except:
372 393 return '<unprintable %s object>' % type(value).__name__
373 394
374 395 #----------------------------------------------------------------------------
375 396 class VerboseTB(TBTools):
376 397 """A port of Ka-Ping Yee's cgitb.py module that outputs color text instead
377 398 of HTML. Requires inspect and pydoc. Crazy, man.
378 399
379 400 Modified version which optionally strips the topmost entries from the
380 401 traceback, to be used with alternate interpreters (because their own code
381 402 would appear in the traceback)."""
382 403
383 404 def __init__(self,color_scheme = 'Linux',tb_offset=0,long_header=0,
384 405 call_pdb = 0, include_vars=1):
385 406 """Specify traceback offset, headers and color scheme.
386 407
387 408 Define how many frames to drop from the tracebacks. Calling it with
388 409 tb_offset=1 allows use of this handler in interpreters which will have
389 410 their own code at the top of the traceback (VerboseTB will first
390 411 remove that frame before printing the traceback info)."""
391 412 TBTools.__init__(self,color_scheme=color_scheme,call_pdb=call_pdb)
392 413 self.tb_offset = tb_offset
393 414 self.long_header = long_header
394 415 self.include_vars = include_vars
395 416
396 417 def text(self, etype, evalue, etb, context=5):
397 418 """Return a nice text document describing the traceback."""
398 419
399 420 # some locals
400 421 Colors = self.Colors # just a shorthand + quicker name lookup
401 422 ColorsNormal = Colors.Normal # used a lot
402 423 indent = ' '*INDENT_SIZE
403 424 exc = '%s%s%s' % (Colors.excName, str(etype), ColorsNormal)
404 425 em_normal = '%s\n%s%s' % (Colors.valEm, indent,ColorsNormal)
405 426 undefined = '%sundefined%s' % (Colors.em, ColorsNormal)
406 427
407 428 # some internal-use functions
408 429 def text_repr(value):
409 430 """Hopefully pretty robust repr equivalent."""
410 431 # this is pretty horrible but should always return *something*
411 432 try:
412 433 return pydoc.text.repr(value)
413 434 except KeyboardInterrupt:
414 435 raise
415 436 except:
416 437 try:
417 438 return repr(value)
418 439 except KeyboardInterrupt:
419 440 raise
420 441 except:
421 442 try:
422 443 # all still in an except block so we catch
423 444 # getattr raising
424 445 name = getattr(value, '__name__', None)
425 446 if name:
426 447 # ick, recursion
427 448 return text_repr(name)
428 449 klass = getattr(value, '__class__', None)
429 450 if klass:
430 451 return '%s instance' % text_repr(klass)
431 452 except KeyboardInterrupt:
432 453 raise
433 454 except:
434 455 return 'UNRECOVERABLE REPR FAILURE'
435 456 def eqrepr(value, repr=text_repr): return '=%s' % repr(value)
436 457 def nullrepr(value, repr=text_repr): return ''
437 458
438 459 # meat of the code begins
439 460 if type(etype) is types.ClassType:
440 461 etype = etype.__name__
441 462
442 463 if self.long_header:
443 464 # Header with the exception type, python version, and date
444 465 pyver = 'Python ' + string.split(sys.version)[0] + ': ' + sys.executable
445 466 date = time.ctime(time.time())
446 467
447 468 head = '%s%s%s\n%s%s%s\n%s' % (Colors.topline, '-'*75, ColorsNormal,
448 469 exc, ' '*(75-len(str(etype))-len(pyver)),
449 470 pyver, string.rjust(date, 75) )
450 471 head += "\nA problem occured executing Python code. Here is the sequence of function"\
451 472 "\ncalls leading up to the error, with the most recent (innermost) call last."
452 473 else:
453 474 # Simplified header
454 475 head = '%s%s%s\n%s%s' % (Colors.topline, '-'*75, ColorsNormal,exc,
455 476 string.rjust('Traceback (most recent call last)',
456 477 75 - len(str(etype)) ) )
457 478 frames = []
458 479 # Flush cache before calling inspect. This helps alleviate some of the
459 480 # problems with python 2.3's inspect.py.
460 481 linecache.checkcache()
461 482 # Drop topmost frames if requested
462 483 try:
463 484 # Try the default getinnerframes and Alex's: Alex's fixes some
464 485 # problems, but it generates empty tracebacks for console errors
465 486 # (5 blanks lines) where none should be returned.
466 487 #records = inspect.getinnerframes(etb, context)[self.tb_offset:]
467 488 #print 'python records:', records # dbg
468 489 records = _fixed_getinnerframes(etb, context,self.tb_offset)
469 490 #print 'alex records:', records # dbg
470 491 except:
471 492
472 493 # FIXME: I've been getting many crash reports from python 2.3
473 494 # users, traceable to inspect.py. If I can find a small test-case
474 495 # to reproduce this, I should either write a better workaround or
475 496 # file a bug report against inspect (if that's the real problem).
476 497 # So far, I haven't been able to find an isolated example to
477 498 # reproduce the problem.
478 499 inspect_error()
479 500 traceback.print_exc(file=Term.cerr)
480 501 info('\nUnfortunately, your original traceback can not be constructed.\n')
481 502 return ''
482 503
483 504 # build some color string templates outside these nested loops
484 505 tpl_link = '%s%%s%s' % (Colors.filenameEm,ColorsNormal)
485 506 tpl_call = 'in %s%%s%s%%s%s' % (Colors.vName, Colors.valEm,
486 507 ColorsNormal)
487 508 tpl_call_fail = 'in %s%%s%s(***failed resolving arguments***)%s' % \
488 509 (Colors.vName, Colors.valEm, ColorsNormal)
489 510 tpl_local_var = '%s%%s%s' % (Colors.vName, ColorsNormal)
490 511 tpl_global_var = '%sglobal%s %s%%s%s' % (Colors.em, ColorsNormal,
491 512 Colors.vName, ColorsNormal)
492 513 tpl_name_val = '%%s %s= %%s%s' % (Colors.valEm, ColorsNormal)
493 514 tpl_line = '%s%%s%s %%s' % (Colors.lineno, ColorsNormal)
494 515 tpl_line_em = '%s%%s%s %%s%s' % (Colors.linenoEm,Colors.line,
495 516 ColorsNormal)
496 517
497 518 # now, loop over all records printing context and info
498 519 abspath = os.path.abspath
499 520 for frame, file, lnum, func, lines, index in records:
500 521 #print '*** record:',file,lnum,func,lines,index # dbg
501 522 try:
502 523 file = file and abspath(file) or '?'
503 524 except OSError:
504 525 # if file is '<console>' or something not in the filesystem,
505 526 # the abspath call will throw an OSError. Just ignore it and
506 527 # keep the original file string.
507 528 pass
508 529 link = tpl_link % file
509 530 try:
510 531 args, varargs, varkw, locals = inspect.getargvalues(frame)
511 532 except:
512 533 # This can happen due to a bug in python2.3. We should be
513 534 # able to remove this try/except when 2.4 becomes a
514 535 # requirement. Bug details at http://python.org/sf/1005466
515 536 inspect_error()
516 537 traceback.print_exc(file=Term.cerr)
517 538 info("\nIPython's exception reporting continues...\n")
518 539
519 540 if func == '?':
520 541 call = ''
521 542 else:
522 543 # Decide whether to include variable details or not
523 544 var_repr = self.include_vars and eqrepr or nullrepr
524 545 try:
525 546 call = tpl_call % (func,inspect.formatargvalues(args,
526 547 varargs, varkw,
527 548 locals,formatvalue=var_repr))
528 549 except KeyError:
529 550 # Very odd crash from inspect.formatargvalues(). The
530 551 # scenario under which it appeared was a call to
531 552 # view(array,scale) in NumTut.view.view(), where scale had
532 553 # been defined as a scalar (it should be a tuple). Somehow
533 554 # inspect messes up resolving the argument list of view()
534 555 # and barfs out. At some point I should dig into this one
535 556 # and file a bug report about it.
536 557 inspect_error()
537 558 traceback.print_exc(file=Term.cerr)
538 559 info("\nIPython's exception reporting continues...\n")
539 560 call = tpl_call_fail % func
540 561
541 562 # Initialize a list of names on the current line, which the
542 563 # tokenizer below will populate.
543 564 names = []
544 565
545 566 def tokeneater(token_type, token, start, end, line):
546 567 """Stateful tokeneater which builds dotted names.
547 568
548 569 The list of names it appends to (from the enclosing scope) can
549 570 contain repeated composite names. This is unavoidable, since
550 571 there is no way to disambguate partial dotted structures until
551 572 the full list is known. The caller is responsible for pruning
552 573 the final list of duplicates before using it."""
553 574
554 575 # build composite names
555 576 if token == '.':
556 577 try:
557 578 names[-1] += '.'
558 579 # store state so the next token is added for x.y.z names
559 580 tokeneater.name_cont = True
560 581 return
561 582 except IndexError:
562 583 pass
563 584 if token_type == tokenize.NAME and token not in keyword.kwlist:
564 585 if tokeneater.name_cont:
565 586 # Dotted names
566 587 names[-1] += token
567 588 tokeneater.name_cont = False
568 589 else:
569 590 # Regular new names. We append everything, the caller
570 591 # will be responsible for pruning the list later. It's
571 592 # very tricky to try to prune as we go, b/c composite
572 593 # names can fool us. The pruning at the end is easy
573 594 # to do (or the caller can print a list with repeated
574 595 # names if so desired.
575 596 names.append(token)
576 597 elif token_type == tokenize.NEWLINE:
577 598 raise IndexError
578 599 # we need to store a bit of state in the tokenizer to build
579 600 # dotted names
580 601 tokeneater.name_cont = False
581 602
582 603 def linereader(file=file, lnum=[lnum], getline=linecache.getline):
583 604 line = getline(file, lnum[0])
584 605 lnum[0] += 1
585 606 return line
586 607
587 608 # Build the list of names on this line of code where the exception
588 609 # occurred.
589 610 try:
590 611 # This builds the names list in-place by capturing it from the
591 612 # enclosing scope.
592 613 tokenize.tokenize(linereader, tokeneater)
593 614 except IndexError:
594 615 # signals exit of tokenizer
595 616 pass
596 617 except tokenize.TokenError,msg:
597 618 _m = ("An unexpected error occurred while tokenizing input\n"
598 619 "The following traceback may be corrupted or invalid\n"
599 620 "The error message is: %s\n" % msg)
600 621 error(_m)
601 622
602 623 # prune names list of duplicates, but keep the right order
603 624 unique_names = uniq_stable(names)
604 625
605 626 # Start loop over vars
606 627 lvals = []
607 628 if self.include_vars:
608 629 for name_full in unique_names:
609 630 name_base = name_full.split('.',1)[0]
610 631 if name_base in frame.f_code.co_varnames:
611 632 if locals.has_key(name_base):
612 633 try:
613 634 value = repr(eval(name_full,locals))
614 635 except:
615 636 value = undefined
616 637 else:
617 638 value = undefined
618 639 name = tpl_local_var % name_full
619 640 else:
620 641 if frame.f_globals.has_key(name_base):
621 642 try:
622 643 value = repr(eval(name_full,frame.f_globals))
623 644 except:
624 645 value = undefined
625 646 else:
626 647 value = undefined
627 648 name = tpl_global_var % name_full
628 649 lvals.append(tpl_name_val % (name,value))
629 650 if lvals:
630 651 lvals = '%s%s' % (indent,em_normal.join(lvals))
631 652 else:
632 653 lvals = ''
633 654
634 655 level = '%s %s\n' % (link,call)
635 656
636 657 if index is None:
637 658 frames.append(level)
638 659 else:
639 660 frames.append('%s%s' % (level,''.join(
640 661 _formatTracebackLines(lnum,index,lines,self.Colors,lvals))))
641 662
642 663 # Get (safely) a string form of the exception info
643 664 try:
644 665 etype_str,evalue_str = map(str,(etype,evalue))
645 666 except:
646 667 # User exception is improperly defined.
647 668 etype,evalue = str,sys.exc_info()[:2]
648 669 etype_str,evalue_str = map(str,(etype,evalue))
649 670 # ... and format it
650 671 exception = ['%s%s%s: %s' % (Colors.excName, etype_str,
651 672 ColorsNormal, evalue_str)]
652 673 if type(evalue) is types.InstanceType:
653 674 try:
654 675 names = [w for w in dir(evalue) if isinstance(w, basestring)]
655 676 except:
656 677 # Every now and then, an object with funny inernals blows up
657 678 # when dir() is called on it. We do the best we can to report
658 679 # the problem and continue
659 680 _m = '%sException reporting error (object with broken dir())%s:'
660 681 exception.append(_m % (Colors.excName,ColorsNormal))
661 682 etype_str,evalue_str = map(str,sys.exc_info()[:2])
662 683 exception.append('%s%s%s: %s' % (Colors.excName,etype_str,
663 684 ColorsNormal, evalue_str))
664 685 names = []
665 686 for name in names:
666 687 value = text_repr(getattr(evalue, name))
667 688 exception.append('\n%s%s = %s' % (indent, name, value))
668 689 # return all our info assembled as a single string
669 690 return '%s\n\n%s\n%s' % (head,'\n'.join(frames),''.join(exception[0]) )
670 691
671 692 def debugger(self,force=False):
672 693 """Call up the pdb debugger if desired, always clean up the tb
673 694 reference.
674 695
675 696 Keywords:
676 697
677 698 - force(False): by default, this routine checks the instance call_pdb
678 699 flag and does not actually invoke the debugger if the flag is false.
679 700 The 'force' option forces the debugger to activate even if the flag
680 701 is false.
681 702
682 703 If the call_pdb flag is set, the pdb interactive debugger is
683 704 invoked. In all cases, the self.tb reference to the current traceback
684 705 is deleted to prevent lingering references which hamper memory
685 706 management.
686 707
687 708 Note that each call to pdb() does an 'import readline', so if your app
688 709 requires a special setup for the readline completers, you'll have to
689 710 fix that by hand after invoking the exception handler."""
690 711
691 712 if force or self.call_pdb:
692 713 if self.pdb is None:
693 714 self.pdb = Debugger.Pdb(
694 715 self.color_scheme_table.active_scheme_name)
695 716 # the system displayhook may have changed, restore the original
696 717 # for pdb
697 718 dhook = sys.displayhook
698 719 sys.displayhook = sys.__displayhook__
699 720 self.pdb.reset()
700 721 # Find the right frame so we don't pop up inside ipython itself
701 722 if hasattr(self,'tb'):
702 723 etb = self.tb
703 724 else:
704 725 etb = self.tb = sys.last_traceback
705 726 while self.tb.tb_next is not None:
706 727 self.tb = self.tb.tb_next
707 728 try:
708 729 if etb and etb.tb_next:
709 730 etb = etb.tb_next
710 731 self.pdb.botframe = etb.tb_frame
711 732 self.pdb.interaction(self.tb.tb_frame, self.tb)
712 733 finally:
713 734 sys.displayhook = dhook
714 735
715 736 if hasattr(self,'tb'):
716 737 del self.tb
717 738
718 739 def handler(self, info=None):
719 740 (etype, evalue, etb) = info or sys.exc_info()
720 741 self.tb = etb
721 742 Term.cout.flush()
722 743 Term.cerr.flush()
723 744 print >> Term.cerr, self.text(etype, evalue, etb)
724 745
725 746 # Changed so an instance can just be called as VerboseTB_inst() and print
726 747 # out the right info on its own.
727 748 def __call__(self, etype=None, evalue=None, etb=None):
728 749 """This hook can replace sys.excepthook (for Python 2.1 or higher)."""
729 750 if etb is None:
730 751 self.handler()
731 752 else:
732 753 self.handler((etype, evalue, etb))
733 754 self.debugger()
734 755
735 756 #----------------------------------------------------------------------------
736 757 class FormattedTB(VerboseTB,ListTB):
737 758 """Subclass ListTB but allow calling with a traceback.
738 759
739 760 It can thus be used as a sys.excepthook for Python > 2.1.
740 761
741 762 Also adds 'Context' and 'Verbose' modes, not available in ListTB.
742 763
743 764 Allows a tb_offset to be specified. This is useful for situations where
744 765 one needs to remove a number of topmost frames from the traceback (such as
745 766 occurs with python programs that themselves execute other python code,
746 767 like Python shells). """
747 768
748 769 def __init__(self, mode = 'Plain', color_scheme='Linux',
749 770 tb_offset = 0,long_header=0,call_pdb=0,include_vars=0):
750 771
751 772 # NEVER change the order of this list. Put new modes at the end:
752 773 self.valid_modes = ['Plain','Context','Verbose']
753 774 self.verbose_modes = self.valid_modes[1:3]
754 775
755 776 VerboseTB.__init__(self,color_scheme,tb_offset,long_header,
756 777 call_pdb=call_pdb,include_vars=include_vars)
757 778 self.set_mode(mode)
758 779
759 780 def _extract_tb(self,tb):
760 781 if tb:
761 782 return traceback.extract_tb(tb)
762 783 else:
763 784 return None
764 785
765 786 def text(self, etype, value, tb,context=5,mode=None):
766 787 """Return formatted traceback.
767 788
768 789 If the optional mode parameter is given, it overrides the current
769 790 mode."""
770 791
771 792 if mode is None:
772 793 mode = self.mode
773 794 if mode in self.verbose_modes:
774 795 # verbose modes need a full traceback
775 796 return VerboseTB.text(self,etype, value, tb,context=5)
776 797 else:
777 798 # We must check the source cache because otherwise we can print
778 799 # out-of-date source code.
779 800 linecache.checkcache()
780 801 # Now we can extract and format the exception
781 802 elist = self._extract_tb(tb)
782 803 if len(elist) > self.tb_offset:
783 804 del elist[:self.tb_offset]
784 805 return ListTB.text(self,etype,value,elist)
785 806
786 807 def set_mode(self,mode=None):
787 808 """Switch to the desired mode.
788 809
789 810 If mode is not specified, cycles through the available modes."""
790 811
791 812 if not mode:
792 813 new_idx = ( self.valid_modes.index(self.mode) + 1 ) % \
793 814 len(self.valid_modes)
794 815 self.mode = self.valid_modes[new_idx]
795 816 elif mode not in self.valid_modes:
796 817 raise ValueError, 'Unrecognized mode in FormattedTB: <'+mode+'>\n'\
797 818 'Valid modes: '+str(self.valid_modes)
798 819 else:
799 820 self.mode = mode
800 821 # include variable details only in 'Verbose' mode
801 822 self.include_vars = (self.mode == self.valid_modes[2])
802 823
803 824 # some convenient shorcuts
804 825 def plain(self):
805 826 self.set_mode(self.valid_modes[0])
806 827
807 828 def context(self):
808 829 self.set_mode(self.valid_modes[1])
809 830
810 831 def verbose(self):
811 832 self.set_mode(self.valid_modes[2])
812 833
813 834 #----------------------------------------------------------------------------
814 835 class AutoFormattedTB(FormattedTB):
815 836 """A traceback printer which can be called on the fly.
816 837
817 838 It will find out about exceptions by itself.
818 839
819 840 A brief example:
820 841
821 842 AutoTB = AutoFormattedTB(mode = 'Verbose',color_scheme='Linux')
822 843 try:
823 844 ...
824 845 except:
825 846 AutoTB() # or AutoTB(out=logfile) where logfile is an open file object
826 847 """
827 848 def __call__(self,etype=None,evalue=None,etb=None,
828 849 out=None,tb_offset=None):
829 850 """Print out a formatted exception traceback.
830 851
831 852 Optional arguments:
832 853 - out: an open file-like object to direct output to.
833 854
834 855 - tb_offset: the number of frames to skip over in the stack, on a
835 856 per-call basis (this overrides temporarily the instance's tb_offset
836 857 given at initialization time. """
837 858
838 859 if out is None:
839 860 out = Term.cerr
840 861 Term.cout.flush()
841 862 out.flush()
842 863 if tb_offset is not None:
843 864 tb_offset, self.tb_offset = self.tb_offset, tb_offset
844 865 print >> out, self.text(etype, evalue, etb)
845 866 self.tb_offset = tb_offset
846 867 else:
847 868 print >> out, self.text(etype, evalue, etb)
848 869 self.debugger()
849 870
850 871 def text(self,etype=None,value=None,tb=None,context=5,mode=None):
851 872 if etype is None:
852 873 etype,value,tb = sys.exc_info()
853 874 self.tb = tb
854 875 return FormattedTB.text(self,etype,value,tb,context=5,mode=mode)
855 876
856 877 #---------------------------------------------------------------------------
857 878 # A simple class to preserve Nathan's original functionality.
858 879 class ColorTB(FormattedTB):
859 880 """Shorthand to initialize a FormattedTB in Linux colors mode."""
860 881 def __init__(self,color_scheme='Linux',call_pdb=0):
861 882 FormattedTB.__init__(self,color_scheme=color_scheme,
862 883 call_pdb=call_pdb)
863 884
864 885 #----------------------------------------------------------------------------
865 886 # module testing (minimal)
866 887 if __name__ == "__main__":
867 888 def spam(c, (d, e)):
868 889 x = c + d
869 890 y = c * d
870 891 foo(x, y)
871 892
872 893 def foo(a, b, bar=1):
873 894 eggs(a, b + bar)
874 895
875 896 def eggs(f, g, z=globals()):
876 897 h = f + g
877 898 i = f - g
878 899 return h / i
879 900
880 901 print ''
881 902 print '*** Before ***'
882 903 try:
883 904 print spam(1, (2, 3))
884 905 except:
885 906 traceback.print_exc()
886 907 print ''
887 908
888 909 handler = ColorTB()
889 910 print '*** ColorTB ***'
890 911 try:
891 912 print spam(1, (2, 3))
892 913 except:
893 914 apply(handler, sys.exc_info() )
894 915 print ''
895 916
896 917 handler = VerboseTB()
897 918 print '*** VerboseTB ***'
898 919 try:
899 920 print spam(1, (2, 3))
900 921 except:
901 922 apply(handler, sys.exc_info() )
902 923 print ''
903 924
@@ -1,6343 +1,6351 b''
1 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 11 * IPython/genutils.py (IOStream.close): small patch by
4 12 R. Bernstein for improved pydb support.
5 13
6 14 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
7 15 DaveS <davls@telus.net> to improve support of debugging under
8 16 NTEmacs, including improved pydb behavior.
9 17
10 18 * IPython/Magic.py (magic_prun): Fix saving of profile info for
11 19 Python 2.5, where the stats object API changed a little. Thanks
12 20 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
13 21
14 22 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
15 23 Pernetty's patch to improve support for (X)Emacs under Win32.
16 24
17 25 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
18 26
19 27 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
20 28 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
21 29 a report by Nik Tautenhahn.
22 30
23 31 2007-03-16 Walter Doerwald <walter@livinglogic.de>
24 32
25 33 * setup.py: Add the igrid help files to the list of data files
26 34 to be installed alongside igrid.
27 35 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
28 36 Show the input object of the igrid browser as the window tile.
29 37 Show the object the cursor is on in the statusbar.
30 38
31 39 2007-03-15 Ville Vainio <vivainio@gmail.com>
32 40
33 41 * Extensions/ipy_stock_completers.py: Fixed exception
34 42 on mismatching quotes in %run completer. Patch by
35 43 JοΏ½rgen Stenarson. Closes #127.
36 44
37 45 2007-03-14 Ville Vainio <vivainio@gmail.com>
38 46
39 47 * Extensions/ext_rehashdir.py: Do not do auto_alias
40 48 in %rehashdir, it clobbers %store'd aliases.
41 49
42 50 * UserConfig/ipy_profile_sh.py: envpersist.py extension
43 51 (beefed up %env) imported for sh profile.
44 52
45 53 2007-03-10 Walter Doerwald <walter@livinglogic.de>
46 54
47 55 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
48 56 as the default browser.
49 57 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
50 58 As igrid displays all attributes it ever encounters, fetch() (which has
51 59 been renamed to _fetch()) doesn't have to recalculate the display attributes
52 60 every time a new item is fetched. This should speed up scrolling.
53 61
54 62 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
55 63
56 64 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
57 65 Schmolck's recently reported tab-completion bug (my previous one
58 66 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
59 67
60 68 2007-03-09 Walter Doerwald <walter@livinglogic.de>
61 69
62 70 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
63 71 Close help window if exiting igrid.
64 72
65 73 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
66 74
67 75 * IPython/Extensions/ipy_defaults.py: Check if readline is available
68 76 before calling functions from readline.
69 77
70 78 2007-03-02 Walter Doerwald <walter@livinglogic.de>
71 79
72 80 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
73 81 igrid is a wxPython-based display object for ipipe. If your system has
74 82 wx installed igrid will be the default display. Without wx ipipe falls
75 83 back to ibrowse (which needs curses). If no curses is installed ipipe
76 84 falls back to idump.
77 85
78 86 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
79 87
80 88 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
81 89 my changes from yesterday, they introduced bugs. Will reactivate
82 90 once I get a correct solution, which will be much easier thanks to
83 91 Dan Milstein's new prefilter test suite.
84 92
85 93 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
86 94
87 95 * IPython/iplib.py (split_user_input): fix input splitting so we
88 96 don't attempt attribute accesses on things that can't possibly be
89 97 valid Python attributes. After a bug report by Alex Schmolck.
90 98 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
91 99 %magic with explicit % prefix.
92 100
93 101 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
94 102
95 103 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
96 104 avoid a DeprecationWarning from GTK.
97 105
98 106 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
99 107
100 108 * IPython/genutils.py (clock): I modified clock() to return total
101 109 time, user+system. This is a more commonly needed metric. I also
102 110 introduced the new clocku/clocks to get only user/system time if
103 111 one wants those instead.
104 112
105 113 ***WARNING: API CHANGE*** clock() used to return only user time,
106 114 so if you want exactly the same results as before, use clocku
107 115 instead.
108 116
109 117 2007-02-22 Ville Vainio <vivainio@gmail.com>
110 118
111 119 * IPython/Extensions/ipy_p4.py: Extension for improved
112 120 p4 (perforce version control system) experience.
113 121 Adds %p4 magic with p4 command completion and
114 122 automatic -G argument (marshall output as python dict)
115 123
116 124 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
117 125
118 126 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
119 127 stop marks.
120 128 (ClearingMixin): a simple mixin to easily make a Demo class clear
121 129 the screen in between blocks and have empty marquees. The
122 130 ClearDemo and ClearIPDemo classes that use it are included.
123 131
124 132 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
125 133
126 134 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
127 135 protect against exceptions at Python shutdown time. Patch
128 136 sumbmitted to upstream.
129 137
130 138 2007-02-14 Walter Doerwald <walter@livinglogic.de>
131 139
132 140 * IPython/Extensions/ibrowse.py: If entering the first object level
133 141 (i.e. the object for which the browser has been started) fails,
134 142 now the error is raised directly (aborting the browser) instead of
135 143 running into an empty levels list later.
136 144
137 145 2007-02-03 Walter Doerwald <walter@livinglogic.de>
138 146
139 147 * IPython/Extensions/ipipe.py: Add an xrepr implementation
140 148 for the noitem object.
141 149
142 150 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
143 151
144 152 * IPython/completer.py (Completer.attr_matches): Fix small
145 153 tab-completion bug with Enthought Traits objects with units.
146 154 Thanks to a bug report by Tom Denniston
147 155 <tom.denniston-AT-alum.dartmouth.org>.
148 156
149 157 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
150 158
151 159 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
152 160 bug where only .ipy or .py would be completed. Once the first
153 161 argument to %run has been given, all completions are valid because
154 162 they are the arguments to the script, which may well be non-python
155 163 filenames.
156 164
157 165 * IPython/irunner.py (InteractiveRunner.run_source): major updates
158 166 to irunner to allow it to correctly support real doctesting of
159 167 out-of-process ipython code.
160 168
161 169 * IPython/Magic.py (magic_cd): Make the setting of the terminal
162 170 title an option (-noterm_title) because it completely breaks
163 171 doctesting.
164 172
165 173 * IPython/demo.py: fix IPythonDemo class that was not actually working.
166 174
167 175 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
168 176
169 177 * IPython/irunner.py (main): fix small bug where extensions were
170 178 not being correctly recognized.
171 179
172 180 2007-01-23 Walter Doerwald <walter@livinglogic.de>
173 181
174 182 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
175 183 a string containing a single line yields the string itself as the
176 184 only item.
177 185
178 186 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
179 187 object if it's the same as the one on the last level (This avoids
180 188 infinite recursion for one line strings).
181 189
182 190 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
183 191
184 192 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
185 193 all output streams before printing tracebacks. This ensures that
186 194 user output doesn't end up interleaved with traceback output.
187 195
188 196 2007-01-10 Ville Vainio <vivainio@gmail.com>
189 197
190 198 * Extensions/envpersist.py: Turbocharged %env that remembers
191 199 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
192 200 "%env VISUAL=jed".
193 201
194 202 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
195 203
196 204 * IPython/iplib.py (showtraceback): ensure that we correctly call
197 205 custom handlers in all cases (some with pdb were slipping through,
198 206 but I'm not exactly sure why).
199 207
200 208 * IPython/Debugger.py (Tracer.__init__): added new class to
201 209 support set_trace-like usage of IPython's enhanced debugger.
202 210
203 211 2006-12-24 Ville Vainio <vivainio@gmail.com>
204 212
205 213 * ipmaker.py: more informative message when ipy_user_conf
206 214 import fails (suggest running %upgrade).
207 215
208 216 * tools/run_ipy_in_profiler.py: Utility to see where
209 217 the time during IPython startup is spent.
210 218
211 219 2006-12-20 Ville Vainio <vivainio@gmail.com>
212 220
213 221 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
214 222
215 223 * ipapi.py: Add new ipapi method, expand_alias.
216 224
217 225 * Release.py: Bump up version to 0.7.4.svn
218 226
219 227 2006-12-17 Ville Vainio <vivainio@gmail.com>
220 228
221 229 * Extensions/jobctrl.py: Fixed &cmd arg arg...
222 230 to work properly on posix too
223 231
224 232 * Release.py: Update revnum (version is still just 0.7.3).
225 233
226 234 2006-12-15 Ville Vainio <vivainio@gmail.com>
227 235
228 236 * scripts/ipython_win_post_install: create ipython.py in
229 237 prefix + "/scripts".
230 238
231 239 * Release.py: Update version to 0.7.3.
232 240
233 241 2006-12-14 Ville Vainio <vivainio@gmail.com>
234 242
235 243 * scripts/ipython_win_post_install: Overwrite old shortcuts
236 244 if they already exist
237 245
238 246 * Release.py: release 0.7.3rc2
239 247
240 248 2006-12-13 Ville Vainio <vivainio@gmail.com>
241 249
242 250 * Branch and update Release.py for 0.7.3rc1
243 251
244 252 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
245 253
246 254 * IPython/Shell.py (IPShellWX): update for current WX naming
247 255 conventions, to avoid a deprecation warning with current WX
248 256 versions. Thanks to a report by Danny Shevitz.
249 257
250 258 2006-12-12 Ville Vainio <vivainio@gmail.com>
251 259
252 260 * ipmaker.py: apply david cournapeau's patch to make
253 261 import_some work properly even when ipythonrc does
254 262 import_some on empty list (it was an old bug!).
255 263
256 264 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
257 265 Add deprecation note to ipythonrc and a url to wiki
258 266 in ipy_user_conf.py
259 267
260 268
261 269 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
262 270 as if it was typed on IPython command prompt, i.e.
263 271 as IPython script.
264 272
265 273 * example-magic.py, magic_grepl.py: remove outdated examples
266 274
267 275 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
268 276
269 277 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
270 278 is called before any exception has occurred.
271 279
272 280 2006-12-08 Ville Vainio <vivainio@gmail.com>
273 281
274 282 * Extensions/ipy_stock_completers.py: fix cd completer
275 283 to translate /'s to \'s again.
276 284
277 285 * completer.py: prevent traceback on file completions w/
278 286 backslash.
279 287
280 288 * Release.py: Update release number to 0.7.3b3 for release
281 289
282 290 2006-12-07 Ville Vainio <vivainio@gmail.com>
283 291
284 292 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
285 293 while executing external code. Provides more shell-like behaviour
286 294 and overall better response to ctrl + C / ctrl + break.
287 295
288 296 * tools/make_tarball.py: new script to create tarball straight from svn
289 297 (setup.py sdist doesn't work on win32).
290 298
291 299 * Extensions/ipy_stock_completers.py: fix cd completer to give up
292 300 on dirnames with spaces and use the default completer instead.
293 301
294 302 * Revision.py: Change version to 0.7.3b2 for release.
295 303
296 304 2006-12-05 Ville Vainio <vivainio@gmail.com>
297 305
298 306 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
299 307 pydb patch 4 (rm debug printing, py 2.5 checking)
300 308
301 309 2006-11-30 Walter Doerwald <walter@livinglogic.de>
302 310 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
303 311 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
304 312 "refreshfind" (mapped to "R") does the same but tries to go back to the same
305 313 object the cursor was on before the refresh. The command "markrange" is
306 314 mapped to "%" now.
307 315 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
308 316
309 317 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
310 318
311 319 * IPython/Magic.py (magic_debug): new %debug magic to activate the
312 320 interactive debugger on the last traceback, without having to call
313 321 %pdb and rerun your code. Made minor changes in various modules,
314 322 should automatically recognize pydb if available.
315 323
316 324 2006-11-28 Ville Vainio <vivainio@gmail.com>
317 325
318 326 * completer.py: If the text start with !, show file completions
319 327 properly. This helps when trying to complete command name
320 328 for shell escapes.
321 329
322 330 2006-11-27 Ville Vainio <vivainio@gmail.com>
323 331
324 332 * ipy_stock_completers.py: bzr completer submitted by Stefan van
325 333 der Walt. Clean up svn and hg completers by using a common
326 334 vcs_completer.
327 335
328 336 2006-11-26 Ville Vainio <vivainio@gmail.com>
329 337
330 338 * Remove ipconfig and %config; you should use _ip.options structure
331 339 directly instead!
332 340
333 341 * genutils.py: add wrap_deprecated function for deprecating callables
334 342
335 343 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
336 344 _ip.system instead. ipalias is redundant.
337 345
338 346 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
339 347 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
340 348 explicit.
341 349
342 350 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
343 351 completer. Try it by entering 'hg ' and pressing tab.
344 352
345 353 * macro.py: Give Macro a useful __repr__ method
346 354
347 355 * Magic.py: %whos abbreviates the typename of Macro for brevity.
348 356
349 357 2006-11-24 Walter Doerwald <walter@livinglogic.de>
350 358 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
351 359 we don't get a duplicate ipipe module, where registration of the xrepr
352 360 implementation for Text is useless.
353 361
354 362 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
355 363
356 364 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
357 365
358 366 2006-11-24 Ville Vainio <vivainio@gmail.com>
359 367
360 368 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
361 369 try to use "cProfile" instead of the slower pure python
362 370 "profile"
363 371
364 372 2006-11-23 Ville Vainio <vivainio@gmail.com>
365 373
366 374 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
367 375 Qt+IPython+Designer link in documentation.
368 376
369 377 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
370 378 correct Pdb object to %pydb.
371 379
372 380
373 381 2006-11-22 Walter Doerwald <walter@livinglogic.de>
374 382 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
375 383 generic xrepr(), otherwise the list implementation would kick in.
376 384
377 385 2006-11-21 Ville Vainio <vivainio@gmail.com>
378 386
379 387 * upgrade_dir.py: Now actually overwrites a nonmodified user file
380 388 with one from UserConfig.
381 389
382 390 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
383 391 it was missing which broke the sh profile.
384 392
385 393 * completer.py: file completer now uses explicit '/' instead
386 394 of os.path.join, expansion of 'foo' was broken on win32
387 395 if there was one directory with name 'foobar'.
388 396
389 397 * A bunch of patches from Kirill Smelkov:
390 398
391 399 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
392 400
393 401 * [patch 7/9] Implement %page -r (page in raw mode) -
394 402
395 403 * [patch 5/9] ScientificPython webpage has moved
396 404
397 405 * [patch 4/9] The manual mentions %ds, should be %dhist
398 406
399 407 * [patch 3/9] Kill old bits from %prun doc.
400 408
401 409 * [patch 1/9] Fix typos here and there.
402 410
403 411 2006-11-08 Ville Vainio <vivainio@gmail.com>
404 412
405 413 * completer.py (attr_matches): catch all exceptions raised
406 414 by eval of expr with dots.
407 415
408 416 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
409 417
410 418 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
411 419 input if it starts with whitespace. This allows you to paste
412 420 indented input from any editor without manually having to type in
413 421 the 'if 1:', which is convenient when working interactively.
414 422 Slightly modifed version of a patch by Bo Peng
415 423 <bpeng-AT-rice.edu>.
416 424
417 425 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
418 426
419 427 * IPython/irunner.py (main): modified irunner so it automatically
420 428 recognizes the right runner to use based on the extension (.py for
421 429 python, .ipy for ipython and .sage for sage).
422 430
423 431 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
424 432 visible in ipapi as ip.config(), to programatically control the
425 433 internal rc object. There's an accompanying %config magic for
426 434 interactive use, which has been enhanced to match the
427 435 funtionality in ipconfig.
428 436
429 437 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
430 438 so it's not just a toggle, it now takes an argument. Add support
431 439 for a customizable header when making system calls, as the new
432 440 system_header variable in the ipythonrc file.
433 441
434 442 2006-11-03 Walter Doerwald <walter@livinglogic.de>
435 443
436 444 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
437 445 generic functions (using Philip J. Eby's simplegeneric package).
438 446 This makes it possible to customize the display of third-party classes
439 447 without having to monkeypatch them. xiter() no longer supports a mode
440 448 argument and the XMode class has been removed. The same functionality can
441 449 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
442 450 One consequence of the switch to generic functions is that xrepr() and
443 451 xattrs() implementation must define the default value for the mode
444 452 argument themselves and xattrs() implementations must return real
445 453 descriptors.
446 454
447 455 * IPython/external: This new subpackage will contain all third-party
448 456 packages that are bundled with IPython. (The first one is simplegeneric).
449 457
450 458 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
451 459 directory which as been dropped in r1703.
452 460
453 461 * IPython/Extensions/ipipe.py (iless): Fixed.
454 462
455 463 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
456 464
457 465 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
458 466
459 467 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
460 468 handling in variable expansion so that shells and magics recognize
461 469 function local scopes correctly. Bug reported by Brian.
462 470
463 471 * scripts/ipython: remove the very first entry in sys.path which
464 472 Python auto-inserts for scripts, so that sys.path under IPython is
465 473 as similar as possible to that under plain Python.
466 474
467 475 * IPython/completer.py (IPCompleter.file_matches): Fix
468 476 tab-completion so that quotes are not closed unless the completion
469 477 is unambiguous. After a request by Stefan. Minor cleanups in
470 478 ipy_stock_completers.
471 479
472 480 2006-11-02 Ville Vainio <vivainio@gmail.com>
473 481
474 482 * ipy_stock_completers.py: Add %run and %cd completers.
475 483
476 484 * completer.py: Try running custom completer for both
477 485 "foo" and "%foo" if the command is just "foo". Ignore case
478 486 when filtering possible completions.
479 487
480 488 * UserConfig/ipy_user_conf.py: install stock completers as default
481 489
482 490 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
483 491 simplified readline history save / restore through a wrapper
484 492 function
485 493
486 494
487 495 2006-10-31 Ville Vainio <vivainio@gmail.com>
488 496
489 497 * strdispatch.py, completer.py, ipy_stock_completers.py:
490 498 Allow str_key ("command") in completer hooks. Implement
491 499 trivial completer for 'import' (stdlib modules only). Rename
492 500 ipy_linux_package_managers.py to ipy_stock_completers.py.
493 501 SVN completer.
494 502
495 503 * Extensions/ledit.py: %magic line editor for easily and
496 504 incrementally manipulating lists of strings. The magic command
497 505 name is %led.
498 506
499 507 2006-10-30 Ville Vainio <vivainio@gmail.com>
500 508
501 509 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
502 510 Bernsteins's patches for pydb integration.
503 511 http://bashdb.sourceforge.net/pydb/
504 512
505 513 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
506 514 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
507 515 custom completer hook to allow the users to implement their own
508 516 completers. See ipy_linux_package_managers.py for example. The
509 517 hook name is 'complete_command'.
510 518
511 519 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
512 520
513 521 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
514 522 Numeric leftovers.
515 523
516 524 * ipython.el (py-execute-region): apply Stefan's patch to fix
517 525 garbled results if the python shell hasn't been previously started.
518 526
519 527 * IPython/genutils.py (arg_split): moved to genutils, since it's a
520 528 pretty generic function and useful for other things.
521 529
522 530 * IPython/OInspect.py (getsource): Add customizable source
523 531 extractor. After a request/patch form W. Stein (SAGE).
524 532
525 533 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
526 534 window size to a more reasonable value from what pexpect does,
527 535 since their choice causes wrapping bugs with long input lines.
528 536
529 537 2006-10-28 Ville Vainio <vivainio@gmail.com>
530 538
531 539 * Magic.py (%run): Save and restore the readline history from
532 540 file around %run commands to prevent side effects from
533 541 %runned programs that might use readline (e.g. pydb).
534 542
535 543 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
536 544 invoking the pydb enhanced debugger.
537 545
538 546 2006-10-23 Walter Doerwald <walter@livinglogic.de>
539 547
540 548 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
541 549 call the base class method and propagate the return value to
542 550 ifile. This is now done by path itself.
543 551
544 552 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
545 553
546 554 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
547 555 api: set_crash_handler(), to expose the ability to change the
548 556 internal crash handler.
549 557
550 558 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
551 559 the various parameters of the crash handler so that apps using
552 560 IPython as their engine can customize crash handling. Ipmlemented
553 561 at the request of SAGE.
554 562
555 563 2006-10-14 Ville Vainio <vivainio@gmail.com>
556 564
557 565 * Magic.py, ipython.el: applied first "safe" part of Rocky
558 566 Bernstein's patch set for pydb integration.
559 567
560 568 * Magic.py (%unalias, %alias): %store'd aliases can now be
561 569 removed with '%unalias'. %alias w/o args now shows most
562 570 interesting (stored / manually defined) aliases last
563 571 where they catch the eye w/o scrolling.
564 572
565 573 * Magic.py (%rehashx), ext_rehashdir.py: files with
566 574 'py' extension are always considered executable, even
567 575 when not in PATHEXT environment variable.
568 576
569 577 2006-10-12 Ville Vainio <vivainio@gmail.com>
570 578
571 579 * jobctrl.py: Add new "jobctrl" extension for spawning background
572 580 processes with "&find /". 'import jobctrl' to try it out. Requires
573 581 'subprocess' module, standard in python 2.4+.
574 582
575 583 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
576 584 so if foo -> bar and bar -> baz, then foo -> baz.
577 585
578 586 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
579 587
580 588 * IPython/Magic.py (Magic.parse_options): add a new posix option
581 589 to allow parsing of input args in magics that doesn't strip quotes
582 590 (if posix=False). This also closes %timeit bug reported by
583 591 Stefan.
584 592
585 593 2006-10-03 Ville Vainio <vivainio@gmail.com>
586 594
587 595 * iplib.py (raw_input, interact): Return ValueError catching for
588 596 raw_input. Fixes infinite loop for sys.stdin.close() or
589 597 sys.stdout.close().
590 598
591 599 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
592 600
593 601 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
594 602 to help in handling doctests. irunner is now pretty useful for
595 603 running standalone scripts and simulate a full interactive session
596 604 in a format that can be then pasted as a doctest.
597 605
598 606 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
599 607 on top of the default (useless) ones. This also fixes the nasty
600 608 way in which 2.5's Quitter() exits (reverted [1785]).
601 609
602 610 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
603 611 2.5.
604 612
605 613 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
606 614 color scheme is updated as well when color scheme is changed
607 615 interactively.
608 616
609 617 2006-09-27 Ville Vainio <vivainio@gmail.com>
610 618
611 619 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
612 620 infinite loop and just exit. It's a hack, but will do for a while.
613 621
614 622 2006-08-25 Walter Doerwald <walter@livinglogic.de>
615 623
616 624 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
617 625 the constructor, this makes it possible to get a list of only directories
618 626 or only files.
619 627
620 628 2006-08-12 Ville Vainio <vivainio@gmail.com>
621 629
622 630 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
623 631 they broke unittest
624 632
625 633 2006-08-11 Ville Vainio <vivainio@gmail.com>
626 634
627 635 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
628 636 by resolving issue properly, i.e. by inheriting FakeModule
629 637 from types.ModuleType. Pickling ipython interactive data
630 638 should still work as usual (testing appreciated).
631 639
632 640 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
633 641
634 642 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
635 643 running under python 2.3 with code from 2.4 to fix a bug with
636 644 help(). Reported by the Debian maintainers, Norbert Tretkowski
637 645 <norbert-AT-tretkowski.de> and Alexandre Fayolle
638 646 <afayolle-AT-debian.org>.
639 647
640 648 2006-08-04 Walter Doerwald <walter@livinglogic.de>
641 649
642 650 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
643 651 (which was displaying "quit" twice).
644 652
645 653 2006-07-28 Walter Doerwald <walter@livinglogic.de>
646 654
647 655 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
648 656 the mode argument).
649 657
650 658 2006-07-27 Walter Doerwald <walter@livinglogic.de>
651 659
652 660 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
653 661 not running under IPython.
654 662
655 663 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
656 664 and make it iterable (iterating over the attribute itself). Add two new
657 665 magic strings for __xattrs__(): If the string starts with "-", the attribute
658 666 will not be displayed in ibrowse's detail view (but it can still be
659 667 iterated over). This makes it possible to add attributes that are large
660 668 lists or generator methods to the detail view. Replace magic attribute names
661 669 and _attrname() and _getattr() with "descriptors": For each type of magic
662 670 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
663 671 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
664 672 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
665 673 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
666 674 are still supported.
667 675
668 676 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
669 677 fails in ibrowse.fetch(), the exception object is added as the last item
670 678 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
671 679 a generator throws an exception midway through execution.
672 680
673 681 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
674 682 encoding into methods.
675 683
676 684 2006-07-26 Ville Vainio <vivainio@gmail.com>
677 685
678 686 * iplib.py: history now stores multiline input as single
679 687 history entries. Patch by Jorgen Cederlof.
680 688
681 689 2006-07-18 Walter Doerwald <walter@livinglogic.de>
682 690
683 691 * IPython/Extensions/ibrowse.py: Make cursor visible over
684 692 non existing attributes.
685 693
686 694 2006-07-14 Walter Doerwald <walter@livinglogic.de>
687 695
688 696 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
689 697 error output of the running command doesn't mess up the screen.
690 698
691 699 2006-07-13 Walter Doerwald <walter@livinglogic.de>
692 700
693 701 * IPython/Extensions/ipipe.py (isort): Make isort usable without
694 702 argument. This sorts the items themselves.
695 703
696 704 2006-07-12 Walter Doerwald <walter@livinglogic.de>
697 705
698 706 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
699 707 Compile expression strings into code objects. This should speed
700 708 up ifilter and friends somewhat.
701 709
702 710 2006-07-08 Ville Vainio <vivainio@gmail.com>
703 711
704 712 * Magic.py: %cpaste now strips > from the beginning of lines
705 713 to ease pasting quoted code from emails. Contributed by
706 714 Stefan van der Walt.
707 715
708 716 2006-06-29 Ville Vainio <vivainio@gmail.com>
709 717
710 718 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
711 719 mode, patch contributed by Darren Dale. NEEDS TESTING!
712 720
713 721 2006-06-28 Walter Doerwald <walter@livinglogic.de>
714 722
715 723 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
716 724 a blue background. Fix fetching new display rows when the browser
717 725 scrolls more than a screenful (e.g. by using the goto command).
718 726
719 727 2006-06-27 Ville Vainio <vivainio@gmail.com>
720 728
721 729 * Magic.py (_inspect, _ofind) Apply David Huard's
722 730 patch for displaying the correct docstring for 'property'
723 731 attributes.
724 732
725 733 2006-06-23 Walter Doerwald <walter@livinglogic.de>
726 734
727 735 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
728 736 commands into the methods implementing them.
729 737
730 738 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
731 739
732 740 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
733 741 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
734 742 autoindent support was authored by Jin Liu.
735 743
736 744 2006-06-22 Walter Doerwald <walter@livinglogic.de>
737 745
738 746 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
739 747 for keymaps with a custom class that simplifies handling.
740 748
741 749 2006-06-19 Walter Doerwald <walter@livinglogic.de>
742 750
743 751 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
744 752 resizing. This requires Python 2.5 to work.
745 753
746 754 2006-06-16 Walter Doerwald <walter@livinglogic.de>
747 755
748 756 * IPython/Extensions/ibrowse.py: Add two new commands to
749 757 ibrowse: "hideattr" (mapped to "h") hides the attribute under
750 758 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
751 759 attributes again. Remapped the help command to "?". Display
752 760 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
753 761 as keys for the "home" and "end" commands. Add three new commands
754 762 to the input mode for "find" and friends: "delend" (CTRL-K)
755 763 deletes to the end of line. "incsearchup" searches upwards in the
756 764 command history for an input that starts with the text before the cursor.
757 765 "incsearchdown" does the same downwards. Removed a bogus mapping of
758 766 the x key to "delete".
759 767
760 768 2006-06-15 Ville Vainio <vivainio@gmail.com>
761 769
762 770 * iplib.py, hooks.py: Added new generate_prompt hook that can be
763 771 used to create prompts dynamically, instead of the "old" way of
764 772 assigning "magic" strings to prompt_in1 and prompt_in2. The old
765 773 way still works (it's invoked by the default hook), of course.
766 774
767 775 * Prompts.py: added generate_output_prompt hook for altering output
768 776 prompt
769 777
770 778 * Release.py: Changed version string to 0.7.3.svn.
771 779
772 780 2006-06-15 Walter Doerwald <walter@livinglogic.de>
773 781
774 782 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
775 783 the call to fetch() always tries to fetch enough data for at least one
776 784 full screen. This makes it possible to simply call moveto(0,0,True) in
777 785 the constructor. Fix typos and removed the obsolete goto attribute.
778 786
779 787 2006-06-12 Ville Vainio <vivainio@gmail.com>
780 788
781 789 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
782 790 allowing $variable interpolation within multiline statements,
783 791 though so far only with "sh" profile for a testing period.
784 792 The patch also enables splitting long commands with \ but it
785 793 doesn't work properly yet.
786 794
787 795 2006-06-12 Walter Doerwald <walter@livinglogic.de>
788 796
789 797 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
790 798 input history and the position of the cursor in the input history for
791 799 the find, findbackwards and goto command.
792 800
793 801 2006-06-10 Walter Doerwald <walter@livinglogic.de>
794 802
795 803 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
796 804 implements the basic functionality of browser commands that require
797 805 input. Reimplement the goto, find and findbackwards commands as
798 806 subclasses of _CommandInput. Add an input history and keymaps to those
799 807 commands. Add "\r" as a keyboard shortcut for the enterdefault and
800 808 execute commands.
801 809
802 810 2006-06-07 Ville Vainio <vivainio@gmail.com>
803 811
804 812 * iplib.py: ipython mybatch.ipy exits ipython immediately after
805 813 running the batch files instead of leaving the session open.
806 814
807 815 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
808 816
809 817 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
810 818 the original fix was incomplete. Patch submitted by W. Maier.
811 819
812 820 2006-06-07 Ville Vainio <vivainio@gmail.com>
813 821
814 822 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
815 823 Confirmation prompts can be supressed by 'quiet' option.
816 824 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
817 825
818 826 2006-06-06 *** Released version 0.7.2
819 827
820 828 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
821 829
822 830 * IPython/Release.py (version): Made 0.7.2 final for release.
823 831 Repo tagged and release cut.
824 832
825 833 2006-06-05 Ville Vainio <vivainio@gmail.com>
826 834
827 835 * Magic.py (magic_rehashx): Honor no_alias list earlier in
828 836 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
829 837
830 838 * upgrade_dir.py: try import 'path' module a bit harder
831 839 (for %upgrade)
832 840
833 841 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
834 842
835 843 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
836 844 instead of looping 20 times.
837 845
838 846 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
839 847 correctly at initialization time. Bug reported by Krishna Mohan
840 848 Gundu <gkmohan-AT-gmail.com> on the user list.
841 849
842 850 * IPython/Release.py (version): Mark 0.7.2 version to start
843 851 testing for release on 06/06.
844 852
845 853 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
846 854
847 855 * scripts/irunner: thin script interface so users don't have to
848 856 find the module and call it as an executable, since modules rarely
849 857 live in people's PATH.
850 858
851 859 * IPython/irunner.py (InteractiveRunner.__init__): added
852 860 delaybeforesend attribute to control delays with newer versions of
853 861 pexpect. Thanks to detailed help from pexpect's author, Noah
854 862 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
855 863 correctly (it works in NoColor mode).
856 864
857 865 * IPython/iplib.py (handle_normal): fix nasty crash reported on
858 866 SAGE list, from improper log() calls.
859 867
860 868 2006-05-31 Ville Vainio <vivainio@gmail.com>
861 869
862 870 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
863 871 with args in parens to work correctly with dirs that have spaces.
864 872
865 873 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
866 874
867 875 * IPython/Logger.py (Logger.logstart): add option to log raw input
868 876 instead of the processed one. A -r flag was added to the
869 877 %logstart magic used for controlling logging.
870 878
871 879 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
872 880
873 881 * IPython/iplib.py (InteractiveShell.__init__): add check for the
874 882 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
875 883 recognize the option. After a bug report by Will Maier. This
876 884 closes #64 (will do it after confirmation from W. Maier).
877 885
878 886 * IPython/irunner.py: New module to run scripts as if manually
879 887 typed into an interactive environment, based on pexpect. After a
880 888 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
881 889 ipython-user list. Simple unittests in the tests/ directory.
882 890
883 891 * tools/release: add Will Maier, OpenBSD port maintainer, to
884 892 recepients list. We are now officially part of the OpenBSD ports:
885 893 http://www.openbsd.org/ports.html ! Many thanks to Will for the
886 894 work.
887 895
888 896 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
889 897
890 898 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
891 899 so that it doesn't break tkinter apps.
892 900
893 901 * IPython/iplib.py (_prefilter): fix bug where aliases would
894 902 shadow variables when autocall was fully off. Reported by SAGE
895 903 author William Stein.
896 904
897 905 * IPython/OInspect.py (Inspector.__init__): add a flag to control
898 906 at what detail level strings are computed when foo? is requested.
899 907 This allows users to ask for example that the string form of an
900 908 object is only computed when foo?? is called, or even never, by
901 909 setting the object_info_string_level >= 2 in the configuration
902 910 file. This new option has been added and documented. After a
903 911 request by SAGE to be able to control the printing of very large
904 912 objects more easily.
905 913
906 914 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
907 915
908 916 * IPython/ipmaker.py (make_IPython): remove the ipython call path
909 917 from sys.argv, to be 100% consistent with how Python itself works
910 918 (as seen for example with python -i file.py). After a bug report
911 919 by Jeffrey Collins.
912 920
913 921 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
914 922 nasty bug which was preventing custom namespaces with -pylab,
915 923 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
916 924 compatibility (long gone from mpl).
917 925
918 926 * IPython/ipapi.py (make_session): name change: create->make. We
919 927 use make in other places (ipmaker,...), it's shorter and easier to
920 928 type and say, etc. I'm trying to clean things before 0.7.2 so
921 929 that I can keep things stable wrt to ipapi in the chainsaw branch.
922 930
923 931 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
924 932 python-mode recognizes our debugger mode. Add support for
925 933 autoindent inside (X)emacs. After a patch sent in by Jin Liu
926 934 <m.liu.jin-AT-gmail.com> originally written by
927 935 doxgen-AT-newsmth.net (with minor modifications for xemacs
928 936 compatibility)
929 937
930 938 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
931 939 tracebacks when walking the stack so that the stack tracking system
932 940 in emacs' python-mode can identify the frames correctly.
933 941
934 942 * IPython/ipmaker.py (make_IPython): make the internal (and
935 943 default config) autoedit_syntax value false by default. Too many
936 944 users have complained to me (both on and off-list) about problems
937 945 with this option being on by default, so I'm making it default to
938 946 off. It can still be enabled by anyone via the usual mechanisms.
939 947
940 948 * IPython/completer.py (Completer.attr_matches): add support for
941 949 PyCrust-style _getAttributeNames magic method. Patch contributed
942 950 by <mscott-AT-goldenspud.com>. Closes #50.
943 951
944 952 * IPython/iplib.py (InteractiveShell.__init__): remove the
945 953 deletion of exit/quit from __builtin__, which can break
946 954 third-party tools like the Zope debugging console. The
947 955 %exit/%quit magics remain. In general, it's probably a good idea
948 956 not to delete anything from __builtin__, since we never know what
949 957 that will break. In any case, python now (for 2.5) will support
950 958 'real' exit/quit, so this issue is moot. Closes #55.
951 959
952 960 * IPython/genutils.py (with_obj): rename the 'with' function to
953 961 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
954 962 becomes a language keyword. Closes #53.
955 963
956 964 * IPython/FakeModule.py (FakeModule.__init__): add a proper
957 965 __file__ attribute to this so it fools more things into thinking
958 966 it is a real module. Closes #59.
959 967
960 968 * IPython/Magic.py (magic_edit): add -n option to open the editor
961 969 at a specific line number. After a patch by Stefan van der Walt.
962 970
963 971 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
964 972
965 973 * IPython/iplib.py (edit_syntax_error): fix crash when for some
966 974 reason the file could not be opened. After automatic crash
967 975 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
968 976 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
969 977 (_should_recompile): Don't fire editor if using %bg, since there
970 978 is no file in the first place. From the same report as above.
971 979 (raw_input): protect against faulty third-party prefilters. After
972 980 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
973 981 while running under SAGE.
974 982
975 983 2006-05-23 Ville Vainio <vivainio@gmail.com>
976 984
977 985 * ipapi.py: Stripped down ip.to_user_ns() to work only as
978 986 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
979 987 now returns None (again), unless dummy is specifically allowed by
980 988 ipapi.get(allow_dummy=True).
981 989
982 990 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
983 991
984 992 * IPython: remove all 2.2-compatibility objects and hacks from
985 993 everywhere, since we only support 2.3 at this point. Docs
986 994 updated.
987 995
988 996 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
989 997 Anything requiring extra validation can be turned into a Python
990 998 property in the future. I used a property for the db one b/c
991 999 there was a nasty circularity problem with the initialization
992 1000 order, which right now I don't have time to clean up.
993 1001
994 1002 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
995 1003 another locking bug reported by Jorgen. I'm not 100% sure though,
996 1004 so more testing is needed...
997 1005
998 1006 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
999 1007
1000 1008 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1001 1009 local variables from any routine in user code (typically executed
1002 1010 with %run) directly into the interactive namespace. Very useful
1003 1011 when doing complex debugging.
1004 1012 (IPythonNotRunning): Changed the default None object to a dummy
1005 1013 whose attributes can be queried as well as called without
1006 1014 exploding, to ease writing code which works transparently both in
1007 1015 and out of ipython and uses some of this API.
1008 1016
1009 1017 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1010 1018
1011 1019 * IPython/hooks.py (result_display): Fix the fact that our display
1012 1020 hook was using str() instead of repr(), as the default python
1013 1021 console does. This had gone unnoticed b/c it only happened if
1014 1022 %Pprint was off, but the inconsistency was there.
1015 1023
1016 1024 2006-05-15 Ville Vainio <vivainio@gmail.com>
1017 1025
1018 1026 * Oinspect.py: Only show docstring for nonexisting/binary files
1019 1027 when doing object??, closing ticket #62
1020 1028
1021 1029 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1022 1030
1023 1031 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1024 1032 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1025 1033 was being released in a routine which hadn't checked if it had
1026 1034 been the one to acquire it.
1027 1035
1028 1036 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1029 1037
1030 1038 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1031 1039
1032 1040 2006-04-11 Ville Vainio <vivainio@gmail.com>
1033 1041
1034 1042 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1035 1043 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1036 1044 prefilters, allowing stuff like magics and aliases in the file.
1037 1045
1038 1046 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1039 1047 added. Supported now are "%clear in" and "%clear out" (clear input and
1040 1048 output history, respectively). Also fixed CachedOutput.flush to
1041 1049 properly flush the output cache.
1042 1050
1043 1051 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1044 1052 half-success (and fail explicitly).
1045 1053
1046 1054 2006-03-28 Ville Vainio <vivainio@gmail.com>
1047 1055
1048 1056 * iplib.py: Fix quoting of aliases so that only argless ones
1049 1057 are quoted
1050 1058
1051 1059 2006-03-28 Ville Vainio <vivainio@gmail.com>
1052 1060
1053 1061 * iplib.py: Quote aliases with spaces in the name.
1054 1062 "c:\program files\blah\bin" is now legal alias target.
1055 1063
1056 1064 * ext_rehashdir.py: Space no longer allowed as arg
1057 1065 separator, since space is legal in path names.
1058 1066
1059 1067 2006-03-16 Ville Vainio <vivainio@gmail.com>
1060 1068
1061 1069 * upgrade_dir.py: Take path.py from Extensions, correcting
1062 1070 %upgrade magic
1063 1071
1064 1072 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1065 1073
1066 1074 * hooks.py: Only enclose editor binary in quotes if legal and
1067 1075 necessary (space in the name, and is an existing file). Fixes a bug
1068 1076 reported by Zachary Pincus.
1069 1077
1070 1078 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1071 1079
1072 1080 * Manual: thanks to a tip on proper color handling for Emacs, by
1073 1081 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1074 1082
1075 1083 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1076 1084 by applying the provided patch. Thanks to Liu Jin
1077 1085 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1078 1086 XEmacs/Linux, I'm trusting the submitter that it actually helps
1079 1087 under win32/GNU Emacs. Will revisit if any problems are reported.
1080 1088
1081 1089 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1082 1090
1083 1091 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1084 1092 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1085 1093
1086 1094 2006-03-12 Ville Vainio <vivainio@gmail.com>
1087 1095
1088 1096 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1089 1097 Torsten Marek.
1090 1098
1091 1099 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1092 1100
1093 1101 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1094 1102 line ranges works again.
1095 1103
1096 1104 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1097 1105
1098 1106 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1099 1107 and friends, after a discussion with Zach Pincus on ipython-user.
1100 1108 I'm not 100% sure, but after thinking about it quite a bit, it may
1101 1109 be OK. Testing with the multithreaded shells didn't reveal any
1102 1110 problems, but let's keep an eye out.
1103 1111
1104 1112 In the process, I fixed a few things which were calling
1105 1113 self.InteractiveTB() directly (like safe_execfile), which is a
1106 1114 mistake: ALL exception reporting should be done by calling
1107 1115 self.showtraceback(), which handles state and tab-completion and
1108 1116 more.
1109 1117
1110 1118 2006-03-01 Ville Vainio <vivainio@gmail.com>
1111 1119
1112 1120 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1113 1121 To use, do "from ipipe import *".
1114 1122
1115 1123 2006-02-24 Ville Vainio <vivainio@gmail.com>
1116 1124
1117 1125 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1118 1126 "cleanly" and safely than the older upgrade mechanism.
1119 1127
1120 1128 2006-02-21 Ville Vainio <vivainio@gmail.com>
1121 1129
1122 1130 * Magic.py: %save works again.
1123 1131
1124 1132 2006-02-15 Ville Vainio <vivainio@gmail.com>
1125 1133
1126 1134 * Magic.py: %Pprint works again
1127 1135
1128 1136 * Extensions/ipy_sane_defaults.py: Provide everything provided
1129 1137 in default ipythonrc, to make it possible to have a completely empty
1130 1138 ipythonrc (and thus completely rc-file free configuration)
1131 1139
1132 1140 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1133 1141
1134 1142 * IPython/hooks.py (editor): quote the call to the editor command,
1135 1143 to allow commands with spaces in them. Problem noted by watching
1136 1144 Ian Oswald's video about textpad under win32 at
1137 1145 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1138 1146
1139 1147 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1140 1148 describing magics (we haven't used @ for a loong time).
1141 1149
1142 1150 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1143 1151 contributed by marienz to close
1144 1152 http://www.scipy.net/roundup/ipython/issue53.
1145 1153
1146 1154 2006-02-10 Ville Vainio <vivainio@gmail.com>
1147 1155
1148 1156 * genutils.py: getoutput now works in win32 too
1149 1157
1150 1158 * completer.py: alias and magic completion only invoked
1151 1159 at the first "item" in the line, to avoid "cd %store"
1152 1160 nonsense.
1153 1161
1154 1162 2006-02-09 Ville Vainio <vivainio@gmail.com>
1155 1163
1156 1164 * test/*: Added a unit testing framework (finally).
1157 1165 '%run runtests.py' to run test_*.
1158 1166
1159 1167 * ipapi.py: Exposed runlines and set_custom_exc
1160 1168
1161 1169 2006-02-07 Ville Vainio <vivainio@gmail.com>
1162 1170
1163 1171 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1164 1172 instead use "f(1 2)" as before.
1165 1173
1166 1174 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1167 1175
1168 1176 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1169 1177 facilities, for demos processed by the IPython input filter
1170 1178 (IPythonDemo), and for running a script one-line-at-a-time as a
1171 1179 demo, both for pure Python (LineDemo) and for IPython-processed
1172 1180 input (IPythonLineDemo). After a request by Dave Kohel, from the
1173 1181 SAGE team.
1174 1182 (Demo.edit): added an edit() method to the demo objects, to edit
1175 1183 the in-memory copy of the last executed block.
1176 1184
1177 1185 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1178 1186 processing to %edit, %macro and %save. These commands can now be
1179 1187 invoked on the unprocessed input as it was typed by the user
1180 1188 (without any prefilters applied). After requests by the SAGE team
1181 1189 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1182 1190
1183 1191 2006-02-01 Ville Vainio <vivainio@gmail.com>
1184 1192
1185 1193 * setup.py, eggsetup.py: easy_install ipython==dev works
1186 1194 correctly now (on Linux)
1187 1195
1188 1196 * ipy_user_conf,ipmaker: user config changes, removed spurious
1189 1197 warnings
1190 1198
1191 1199 * iplib: if rc.banner is string, use it as is.
1192 1200
1193 1201 * Magic: %pycat accepts a string argument and pages it's contents.
1194 1202
1195 1203
1196 1204 2006-01-30 Ville Vainio <vivainio@gmail.com>
1197 1205
1198 1206 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1199 1207 Now %store and bookmarks work through PickleShare, meaning that
1200 1208 concurrent access is possible and all ipython sessions see the
1201 1209 same database situation all the time, instead of snapshot of
1202 1210 the situation when the session was started. Hence, %bookmark
1203 1211 results are immediately accessible from othes sessions. The database
1204 1212 is also available for use by user extensions. See:
1205 1213 http://www.python.org/pypi/pickleshare
1206 1214
1207 1215 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1208 1216
1209 1217 * aliases can now be %store'd
1210 1218
1211 1219 * path.py moved to Extensions so that pickleshare does not need
1212 1220 IPython-specific import. Extensions added to pythonpath right
1213 1221 at __init__.
1214 1222
1215 1223 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1216 1224 called with _ip.system and the pre-transformed command string.
1217 1225
1218 1226 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1219 1227
1220 1228 * IPython/iplib.py (interact): Fix that we were not catching
1221 1229 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1222 1230 logic here had to change, but it's fixed now.
1223 1231
1224 1232 2006-01-29 Ville Vainio <vivainio@gmail.com>
1225 1233
1226 1234 * iplib.py: Try to import pyreadline on Windows.
1227 1235
1228 1236 2006-01-27 Ville Vainio <vivainio@gmail.com>
1229 1237
1230 1238 * iplib.py: Expose ipapi as _ip in builtin namespace.
1231 1239 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1232 1240 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1233 1241 syntax now produce _ip.* variant of the commands.
1234 1242
1235 1243 * "_ip.options().autoedit_syntax = 2" automatically throws
1236 1244 user to editor for syntax error correction without prompting.
1237 1245
1238 1246 2006-01-27 Ville Vainio <vivainio@gmail.com>
1239 1247
1240 1248 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1241 1249 'ipython' at argv[0]) executed through command line.
1242 1250 NOTE: this DEPRECATES calling ipython with multiple scripts
1243 1251 ("ipython a.py b.py c.py")
1244 1252
1245 1253 * iplib.py, hooks.py: Added configurable input prefilter,
1246 1254 named 'input_prefilter'. See ext_rescapture.py for example
1247 1255 usage.
1248 1256
1249 1257 * ext_rescapture.py, Magic.py: Better system command output capture
1250 1258 through 'var = !ls' (deprecates user-visible %sc). Same notation
1251 1259 applies for magics, 'var = %alias' assigns alias list to var.
1252 1260
1253 1261 * ipapi.py: added meta() for accessing extension-usable data store.
1254 1262
1255 1263 * iplib.py: added InteractiveShell.getapi(). New magics should be
1256 1264 written doing self.getapi() instead of using the shell directly.
1257 1265
1258 1266 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1259 1267 %store foo >> ~/myfoo.txt to store variables to files (in clean
1260 1268 textual form, not a restorable pickle).
1261 1269
1262 1270 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
1263 1271
1264 1272 * usage.py, Magic.py: added %quickref
1265 1273
1266 1274 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
1267 1275
1268 1276 * GetoptErrors when invoking magics etc. with wrong args
1269 1277 are now more helpful:
1270 1278 GetoptError: option -l not recognized (allowed: "qb" )
1271 1279
1272 1280 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
1273 1281
1274 1282 * IPython/demo.py (Demo.show): Flush stdout after each block, so
1275 1283 computationally intensive blocks don't appear to stall the demo.
1276 1284
1277 1285 2006-01-24 Ville Vainio <vivainio@gmail.com>
1278 1286
1279 1287 * iplib.py, hooks.py: 'result_display' hook can return a non-None
1280 1288 value to manipulate resulting history entry.
1281 1289
1282 1290 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
1283 1291 to instance methods of IPApi class, to make extending an embedded
1284 1292 IPython feasible. See ext_rehashdir.py for example usage.
1285 1293
1286 1294 * Merged 1071-1076 from branches/0.7.1
1287 1295
1288 1296
1289 1297 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
1290 1298
1291 1299 * tools/release (daystamp): Fix build tools to use the new
1292 1300 eggsetup.py script to build lightweight eggs.
1293 1301
1294 1302 * Applied changesets 1062 and 1064 before 0.7.1 release.
1295 1303
1296 1304 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
1297 1305 see the raw input history (without conversions like %ls ->
1298 1306 ipmagic("ls")). After a request from W. Stein, SAGE
1299 1307 (http://modular.ucsd.edu/sage) developer. This information is
1300 1308 stored in the input_hist_raw attribute of the IPython instance, so
1301 1309 developers can access it if needed (it's an InputList instance).
1302 1310
1303 1311 * Versionstring = 0.7.2.svn
1304 1312
1305 1313 * eggsetup.py: A separate script for constructing eggs, creates
1306 1314 proper launch scripts even on Windows (an .exe file in
1307 1315 \python24\scripts).
1308 1316
1309 1317 * ipapi.py: launch_new_instance, launch entry point needed for the
1310 1318 egg.
1311 1319
1312 1320 2006-01-23 Ville Vainio <vivainio@gmail.com>
1313 1321
1314 1322 * Added %cpaste magic for pasting python code
1315 1323
1316 1324 2006-01-22 Ville Vainio <vivainio@gmail.com>
1317 1325
1318 1326 * Merge from branches/0.7.1 into trunk, revs 1052-1057
1319 1327
1320 1328 * Versionstring = 0.7.2.svn
1321 1329
1322 1330 * eggsetup.py: A separate script for constructing eggs, creates
1323 1331 proper launch scripts even on Windows (an .exe file in
1324 1332 \python24\scripts).
1325 1333
1326 1334 * ipapi.py: launch_new_instance, launch entry point needed for the
1327 1335 egg.
1328 1336
1329 1337 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
1330 1338
1331 1339 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
1332 1340 %pfile foo would print the file for foo even if it was a binary.
1333 1341 Now, extensions '.so' and '.dll' are skipped.
1334 1342
1335 1343 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
1336 1344 bug, where macros would fail in all threaded modes. I'm not 100%
1337 1345 sure, so I'm going to put out an rc instead of making a release
1338 1346 today, and wait for feedback for at least a few days.
1339 1347
1340 1348 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
1341 1349 it...) the handling of pasting external code with autoindent on.
1342 1350 To get out of a multiline input, the rule will appear for most
1343 1351 users unchanged: two blank lines or change the indent level
1344 1352 proposed by IPython. But there is a twist now: you can
1345 1353 add/subtract only *one or two spaces*. If you add/subtract three
1346 1354 or more (unless you completely delete the line), IPython will
1347 1355 accept that line, and you'll need to enter a second one of pure
1348 1356 whitespace. I know it sounds complicated, but I can't find a
1349 1357 different solution that covers all the cases, with the right
1350 1358 heuristics. Hopefully in actual use, nobody will really notice
1351 1359 all these strange rules and things will 'just work'.
1352 1360
1353 1361 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
1354 1362
1355 1363 * IPython/iplib.py (interact): catch exceptions which can be
1356 1364 triggered asynchronously by signal handlers. Thanks to an
1357 1365 automatic crash report, submitted by Colin Kingsley
1358 1366 <tercel-AT-gentoo.org>.
1359 1367
1360 1368 2006-01-20 Ville Vainio <vivainio@gmail.com>
1361 1369
1362 1370 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
1363 1371 (%rehashdir, very useful, try it out) of how to extend ipython
1364 1372 with new magics. Also added Extensions dir to pythonpath to make
1365 1373 importing extensions easy.
1366 1374
1367 1375 * %store now complains when trying to store interactively declared
1368 1376 classes / instances of those classes.
1369 1377
1370 1378 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
1371 1379 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
1372 1380 if they exist, and ipy_user_conf.py with some defaults is created for
1373 1381 the user.
1374 1382
1375 1383 * Startup rehashing done by the config file, not InterpreterExec.
1376 1384 This means system commands are available even without selecting the
1377 1385 pysh profile. It's the sensible default after all.
1378 1386
1379 1387 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
1380 1388
1381 1389 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
1382 1390 multiline code with autoindent on working. But I am really not
1383 1391 sure, so this needs more testing. Will commit a debug-enabled
1384 1392 version for now, while I test it some more, so that Ville and
1385 1393 others may also catch any problems. Also made
1386 1394 self.indent_current_str() a method, to ensure that there's no
1387 1395 chance of the indent space count and the corresponding string
1388 1396 falling out of sync. All code needing the string should just call
1389 1397 the method.
1390 1398
1391 1399 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
1392 1400
1393 1401 * IPython/Magic.py (magic_edit): fix check for when users don't
1394 1402 save their output files, the try/except was in the wrong section.
1395 1403
1396 1404 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1397 1405
1398 1406 * IPython/Magic.py (magic_run): fix __file__ global missing from
1399 1407 script's namespace when executed via %run. After a report by
1400 1408 Vivian.
1401 1409
1402 1410 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
1403 1411 when using python 2.4. The parent constructor changed in 2.4, and
1404 1412 we need to track it directly (we can't call it, as it messes up
1405 1413 readline and tab-completion inside our pdb would stop working).
1406 1414 After a bug report by R. Bernstein <rocky-AT-panix.com>.
1407 1415
1408 1416 2006-01-16 Ville Vainio <vivainio@gmail.com>
1409 1417
1410 1418 * Ipython/magic.py: Reverted back to old %edit functionality
1411 1419 that returns file contents on exit.
1412 1420
1413 1421 * IPython/path.py: Added Jason Orendorff's "path" module to
1414 1422 IPython tree, http://www.jorendorff.com/articles/python/path/.
1415 1423 You can get path objects conveniently through %sc, and !!, e.g.:
1416 1424 sc files=ls
1417 1425 for p in files.paths: # or files.p
1418 1426 print p,p.mtime
1419 1427
1420 1428 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
1421 1429 now work again without considering the exclusion regexp -
1422 1430 hence, things like ',foo my/path' turn to 'foo("my/path")'
1423 1431 instead of syntax error.
1424 1432
1425 1433
1426 1434 2006-01-14 Ville Vainio <vivainio@gmail.com>
1427 1435
1428 1436 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
1429 1437 ipapi decorators for python 2.4 users, options() provides access to rc
1430 1438 data.
1431 1439
1432 1440 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
1433 1441 as path separators (even on Linux ;-). Space character after
1434 1442 backslash (as yielded by tab completer) is still space;
1435 1443 "%cd long\ name" works as expected.
1436 1444
1437 1445 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
1438 1446 as "chain of command", with priority. API stays the same,
1439 1447 TryNext exception raised by a hook function signals that
1440 1448 current hook failed and next hook should try handling it, as
1441 1449 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
1442 1450 requested configurable display hook, which is now implemented.
1443 1451
1444 1452 2006-01-13 Ville Vainio <vivainio@gmail.com>
1445 1453
1446 1454 * IPython/platutils*.py: platform specific utility functions,
1447 1455 so far only set_term_title is implemented (change terminal
1448 1456 label in windowing systems). %cd now changes the title to
1449 1457 current dir.
1450 1458
1451 1459 * IPython/Release.py: Added myself to "authors" list,
1452 1460 had to create new files.
1453 1461
1454 1462 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
1455 1463 shell escape; not a known bug but had potential to be one in the
1456 1464 future.
1457 1465
1458 1466 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
1459 1467 extension API for IPython! See the module for usage example. Fix
1460 1468 OInspect for docstring-less magic functions.
1461 1469
1462 1470
1463 1471 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
1464 1472
1465 1473 * IPython/iplib.py (raw_input): temporarily deactivate all
1466 1474 attempts at allowing pasting of code with autoindent on. It
1467 1475 introduced bugs (reported by Prabhu) and I can't seem to find a
1468 1476 robust combination which works in all cases. Will have to revisit
1469 1477 later.
1470 1478
1471 1479 * IPython/genutils.py: remove isspace() function. We've dropped
1472 1480 2.2 compatibility, so it's OK to use the string method.
1473 1481
1474 1482 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1475 1483
1476 1484 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
1477 1485 matching what NOT to autocall on, to include all python binary
1478 1486 operators (including things like 'and', 'or', 'is' and 'in').
1479 1487 Prompted by a bug report on 'foo & bar', but I realized we had
1480 1488 many more potential bug cases with other operators. The regexp is
1481 1489 self.re_exclude_auto, it's fairly commented.
1482 1490
1483 1491 2006-01-12 Ville Vainio <vivainio@gmail.com>
1484 1492
1485 1493 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
1486 1494 Prettified and hardened string/backslash quoting with ipsystem(),
1487 1495 ipalias() and ipmagic(). Now even \ characters are passed to
1488 1496 %magics, !shell escapes and aliases exactly as they are in the
1489 1497 ipython command line. Should improve backslash experience,
1490 1498 particularly in Windows (path delimiter for some commands that
1491 1499 won't understand '/'), but Unix benefits as well (regexps). %cd
1492 1500 magic still doesn't support backslash path delimiters, though. Also
1493 1501 deleted all pretense of supporting multiline command strings in
1494 1502 !system or %magic commands. Thanks to Jerry McRae for suggestions.
1495 1503
1496 1504 * doc/build_doc_instructions.txt added. Documentation on how to
1497 1505 use doc/update_manual.py, added yesterday. Both files contributed
1498 1506 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
1499 1507 doc/*.sh for deprecation at a later date.
1500 1508
1501 1509 * /ipython.py Added ipython.py to root directory for
1502 1510 zero-installation (tar xzvf ipython.tgz; cd ipython; python
1503 1511 ipython.py) and development convenience (no need to keep doing
1504 1512 "setup.py install" between changes).
1505 1513
1506 1514 * Made ! and !! shell escapes work (again) in multiline expressions:
1507 1515 if 1:
1508 1516 !ls
1509 1517 !!ls
1510 1518
1511 1519 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1512 1520
1513 1521 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
1514 1522 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
1515 1523 module in case-insensitive installation. Was causing crashes
1516 1524 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
1517 1525
1518 1526 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
1519 1527 <marienz-AT-gentoo.org>, closes
1520 1528 http://www.scipy.net/roundup/ipython/issue51.
1521 1529
1522 1530 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
1523 1531
1524 1532 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
1525 1533 problem of excessive CPU usage under *nix and keyboard lag under
1526 1534 win32.
1527 1535
1528 1536 2006-01-10 *** Released version 0.7.0
1529 1537
1530 1538 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
1531 1539
1532 1540 * IPython/Release.py (revision): tag version number to 0.7.0,
1533 1541 ready for release.
1534 1542
1535 1543 * IPython/Magic.py (magic_edit): Add print statement to %edit so
1536 1544 it informs the user of the name of the temp. file used. This can
1537 1545 help if you decide later to reuse that same file, so you know
1538 1546 where to copy the info from.
1539 1547
1540 1548 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
1541 1549
1542 1550 * setup_bdist_egg.py: little script to build an egg. Added
1543 1551 support in the release tools as well.
1544 1552
1545 1553 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
1546 1554
1547 1555 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
1548 1556 version selection (new -wxversion command line and ipythonrc
1549 1557 parameter). Patch contributed by Arnd Baecker
1550 1558 <arnd.baecker-AT-web.de>.
1551 1559
1552 1560 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1553 1561 embedded instances, for variables defined at the interactive
1554 1562 prompt of the embedded ipython. Reported by Arnd.
1555 1563
1556 1564 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
1557 1565 it can be used as a (stateful) toggle, or with a direct parameter.
1558 1566
1559 1567 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
1560 1568 could be triggered in certain cases and cause the traceback
1561 1569 printer not to work.
1562 1570
1563 1571 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
1564 1572
1565 1573 * IPython/iplib.py (_should_recompile): Small fix, closes
1566 1574 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
1567 1575
1568 1576 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
1569 1577
1570 1578 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
1571 1579 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
1572 1580 Moad for help with tracking it down.
1573 1581
1574 1582 * IPython/iplib.py (handle_auto): fix autocall handling for
1575 1583 objects which support BOTH __getitem__ and __call__ (so that f [x]
1576 1584 is left alone, instead of becoming f([x]) automatically).
1577 1585
1578 1586 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
1579 1587 Ville's patch.
1580 1588
1581 1589 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
1582 1590
1583 1591 * IPython/iplib.py (handle_auto): changed autocall semantics to
1584 1592 include 'smart' mode, where the autocall transformation is NOT
1585 1593 applied if there are no arguments on the line. This allows you to
1586 1594 just type 'foo' if foo is a callable to see its internal form,
1587 1595 instead of having it called with no arguments (typically a
1588 1596 mistake). The old 'full' autocall still exists: for that, you
1589 1597 need to set the 'autocall' parameter to 2 in your ipythonrc file.
1590 1598
1591 1599 * IPython/completer.py (Completer.attr_matches): add
1592 1600 tab-completion support for Enthoughts' traits. After a report by
1593 1601 Arnd and a patch by Prabhu.
1594 1602
1595 1603 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
1596 1604
1597 1605 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
1598 1606 Schmolck's patch to fix inspect.getinnerframes().
1599 1607
1600 1608 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
1601 1609 for embedded instances, regarding handling of namespaces and items
1602 1610 added to the __builtin__ one. Multiple embedded instances and
1603 1611 recursive embeddings should work better now (though I'm not sure
1604 1612 I've got all the corner cases fixed, that code is a bit of a brain
1605 1613 twister).
1606 1614
1607 1615 * IPython/Magic.py (magic_edit): added support to edit in-memory
1608 1616 macros (automatically creates the necessary temp files). %edit
1609 1617 also doesn't return the file contents anymore, it's just noise.
1610 1618
1611 1619 * IPython/completer.py (Completer.attr_matches): revert change to
1612 1620 complete only on attributes listed in __all__. I realized it
1613 1621 cripples the tab-completion system as a tool for exploring the
1614 1622 internals of unknown libraries (it renders any non-__all__
1615 1623 attribute off-limits). I got bit by this when trying to see
1616 1624 something inside the dis module.
1617 1625
1618 1626 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
1619 1627
1620 1628 * IPython/iplib.py (InteractiveShell.__init__): add .meta
1621 1629 namespace for users and extension writers to hold data in. This
1622 1630 follows the discussion in
1623 1631 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
1624 1632
1625 1633 * IPython/completer.py (IPCompleter.complete): small patch to help
1626 1634 tab-completion under Emacs, after a suggestion by John Barnard
1627 1635 <barnarj-AT-ccf.org>.
1628 1636
1629 1637 * IPython/Magic.py (Magic.extract_input_slices): added support for
1630 1638 the slice notation in magics to use N-M to represent numbers N...M
1631 1639 (closed endpoints). This is used by %macro and %save.
1632 1640
1633 1641 * IPython/completer.py (Completer.attr_matches): for modules which
1634 1642 define __all__, complete only on those. After a patch by Jeffrey
1635 1643 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
1636 1644 speed up this routine.
1637 1645
1638 1646 * IPython/Logger.py (Logger.log): fix a history handling bug. I
1639 1647 don't know if this is the end of it, but the behavior now is
1640 1648 certainly much more correct. Note that coupled with macros,
1641 1649 slightly surprising (at first) behavior may occur: a macro will in
1642 1650 general expand to multiple lines of input, so upon exiting, the
1643 1651 in/out counters will both be bumped by the corresponding amount
1644 1652 (as if the macro's contents had been typed interactively). Typing
1645 1653 %hist will reveal the intermediate (silently processed) lines.
1646 1654
1647 1655 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
1648 1656 pickle to fail (%run was overwriting __main__ and not restoring
1649 1657 it, but pickle relies on __main__ to operate).
1650 1658
1651 1659 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
1652 1660 using properties, but forgot to make the main InteractiveShell
1653 1661 class a new-style class. Properties fail silently, and
1654 1662 mysteriously, with old-style class (getters work, but
1655 1663 setters don't do anything).
1656 1664
1657 1665 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
1658 1666
1659 1667 * IPython/Magic.py (magic_history): fix history reporting bug (I
1660 1668 know some nasties are still there, I just can't seem to find a
1661 1669 reproducible test case to track them down; the input history is
1662 1670 falling out of sync...)
1663 1671
1664 1672 * IPython/iplib.py (handle_shell_escape): fix bug where both
1665 1673 aliases and system accesses where broken for indented code (such
1666 1674 as loops).
1667 1675
1668 1676 * IPython/genutils.py (shell): fix small but critical bug for
1669 1677 win32 system access.
1670 1678
1671 1679 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
1672 1680
1673 1681 * IPython/iplib.py (showtraceback): remove use of the
1674 1682 sys.last_{type/value/traceback} structures, which are non
1675 1683 thread-safe.
1676 1684 (_prefilter): change control flow to ensure that we NEVER
1677 1685 introspect objects when autocall is off. This will guarantee that
1678 1686 having an input line of the form 'x.y', where access to attribute
1679 1687 'y' has side effects, doesn't trigger the side effect TWICE. It
1680 1688 is important to note that, with autocall on, these side effects
1681 1689 can still happen.
1682 1690 (ipsystem): new builtin, to complete the ip{magic/alias/system}
1683 1691 trio. IPython offers these three kinds of special calls which are
1684 1692 not python code, and it's a good thing to have their call method
1685 1693 be accessible as pure python functions (not just special syntax at
1686 1694 the command line). It gives us a better internal implementation
1687 1695 structure, as well as exposing these for user scripting more
1688 1696 cleanly.
1689 1697
1690 1698 * IPython/macro.py (Macro.__init__): moved macros to a standalone
1691 1699 file. Now that they'll be more likely to be used with the
1692 1700 persistance system (%store), I want to make sure their module path
1693 1701 doesn't change in the future, so that we don't break things for
1694 1702 users' persisted data.
1695 1703
1696 1704 * IPython/iplib.py (autoindent_update): move indentation
1697 1705 management into the _text_ processing loop, not the keyboard
1698 1706 interactive one. This is necessary to correctly process non-typed
1699 1707 multiline input (such as macros).
1700 1708
1701 1709 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
1702 1710 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
1703 1711 which was producing problems in the resulting manual.
1704 1712 (magic_whos): improve reporting of instances (show their class,
1705 1713 instead of simply printing 'instance' which isn't terribly
1706 1714 informative).
1707 1715
1708 1716 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
1709 1717 (minor mods) to support network shares under win32.
1710 1718
1711 1719 * IPython/winconsole.py (get_console_size): add new winconsole
1712 1720 module and fixes to page_dumb() to improve its behavior under
1713 1721 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
1714 1722
1715 1723 * IPython/Magic.py (Macro): simplified Macro class to just
1716 1724 subclass list. We've had only 2.2 compatibility for a very long
1717 1725 time, yet I was still avoiding subclassing the builtin types. No
1718 1726 more (I'm also starting to use properties, though I won't shift to
1719 1727 2.3-specific features quite yet).
1720 1728 (magic_store): added Ville's patch for lightweight variable
1721 1729 persistence, after a request on the user list by Matt Wilkie
1722 1730 <maphew-AT-gmail.com>. The new %store magic's docstring has full
1723 1731 details.
1724 1732
1725 1733 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1726 1734 changed the default logfile name from 'ipython.log' to
1727 1735 'ipython_log.py'. These logs are real python files, and now that
1728 1736 we have much better multiline support, people are more likely to
1729 1737 want to use them as such. Might as well name them correctly.
1730 1738
1731 1739 * IPython/Magic.py: substantial cleanup. While we can't stop
1732 1740 using magics as mixins, due to the existing customizations 'out
1733 1741 there' which rely on the mixin naming conventions, at least I
1734 1742 cleaned out all cross-class name usage. So once we are OK with
1735 1743 breaking compatibility, the two systems can be separated.
1736 1744
1737 1745 * IPython/Logger.py: major cleanup. This one is NOT a mixin
1738 1746 anymore, and the class is a fair bit less hideous as well. New
1739 1747 features were also introduced: timestamping of input, and logging
1740 1748 of output results. These are user-visible with the -t and -o
1741 1749 options to %logstart. Closes
1742 1750 http://www.scipy.net/roundup/ipython/issue11 and a request by
1743 1751 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
1744 1752
1745 1753 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
1746 1754
1747 1755 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
1748 1756 better handle backslashes in paths. See the thread 'More Windows
1749 1757 questions part 2 - \/ characters revisited' on the iypthon user
1750 1758 list:
1751 1759 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
1752 1760
1753 1761 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
1754 1762
1755 1763 (InteractiveShell.__init__): change threaded shells to not use the
1756 1764 ipython crash handler. This was causing more problems than not,
1757 1765 as exceptions in the main thread (GUI code, typically) would
1758 1766 always show up as a 'crash', when they really weren't.
1759 1767
1760 1768 The colors and exception mode commands (%colors/%xmode) have been
1761 1769 synchronized to also take this into account, so users can get
1762 1770 verbose exceptions for their threaded code as well. I also added
1763 1771 support for activating pdb inside this exception handler as well,
1764 1772 so now GUI authors can use IPython's enhanced pdb at runtime.
1765 1773
1766 1774 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
1767 1775 true by default, and add it to the shipped ipythonrc file. Since
1768 1776 this asks the user before proceeding, I think it's OK to make it
1769 1777 true by default.
1770 1778
1771 1779 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
1772 1780 of the previous special-casing of input in the eval loop. I think
1773 1781 this is cleaner, as they really are commands and shouldn't have
1774 1782 a special role in the middle of the core code.
1775 1783
1776 1784 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
1777 1785
1778 1786 * IPython/iplib.py (edit_syntax_error): added support for
1779 1787 automatically reopening the editor if the file had a syntax error
1780 1788 in it. Thanks to scottt who provided the patch at:
1781 1789 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
1782 1790 version committed).
1783 1791
1784 1792 * IPython/iplib.py (handle_normal): add suport for multi-line
1785 1793 input with emtpy lines. This fixes
1786 1794 http://www.scipy.net/roundup/ipython/issue43 and a similar
1787 1795 discussion on the user list.
1788 1796
1789 1797 WARNING: a behavior change is necessarily introduced to support
1790 1798 blank lines: now a single blank line with whitespace does NOT
1791 1799 break the input loop, which means that when autoindent is on, by
1792 1800 default hitting return on the next (indented) line does NOT exit.
1793 1801
1794 1802 Instead, to exit a multiline input you can either have:
1795 1803
1796 1804 - TWO whitespace lines (just hit return again), or
1797 1805 - a single whitespace line of a different length than provided
1798 1806 by the autoindent (add or remove a space).
1799 1807
1800 1808 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
1801 1809 module to better organize all readline-related functionality.
1802 1810 I've deleted FlexCompleter and put all completion clases here.
1803 1811
1804 1812 * IPython/iplib.py (raw_input): improve indentation management.
1805 1813 It is now possible to paste indented code with autoindent on, and
1806 1814 the code is interpreted correctly (though it still looks bad on
1807 1815 screen, due to the line-oriented nature of ipython).
1808 1816 (MagicCompleter.complete): change behavior so that a TAB key on an
1809 1817 otherwise empty line actually inserts a tab, instead of completing
1810 1818 on the entire global namespace. This makes it easier to use the
1811 1819 TAB key for indentation. After a request by Hans Meine
1812 1820 <hans_meine-AT-gmx.net>
1813 1821 (_prefilter): add support so that typing plain 'exit' or 'quit'
1814 1822 does a sensible thing. Originally I tried to deviate as little as
1815 1823 possible from the default python behavior, but even that one may
1816 1824 change in this direction (thread on python-dev to that effect).
1817 1825 Regardless, ipython should do the right thing even if CPython's
1818 1826 '>>>' prompt doesn't.
1819 1827 (InteractiveShell): removed subclassing code.InteractiveConsole
1820 1828 class. By now we'd overridden just about all of its methods: I've
1821 1829 copied the remaining two over, and now ipython is a standalone
1822 1830 class. This will provide a clearer picture for the chainsaw
1823 1831 branch refactoring.
1824 1832
1825 1833 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
1826 1834
1827 1835 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
1828 1836 failures for objects which break when dir() is called on them.
1829 1837
1830 1838 * IPython/FlexCompleter.py (Completer.__init__): Added support for
1831 1839 distinct local and global namespaces in the completer API. This
1832 1840 change allows us to properly handle completion with distinct
1833 1841 scopes, including in embedded instances (this had never really
1834 1842 worked correctly).
1835 1843
1836 1844 Note: this introduces a change in the constructor for
1837 1845 MagicCompleter, as a new global_namespace parameter is now the
1838 1846 second argument (the others were bumped one position).
1839 1847
1840 1848 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
1841 1849
1842 1850 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1843 1851 embedded instances (which can be done now thanks to Vivian's
1844 1852 frame-handling fixes for pdb).
1845 1853 (InteractiveShell.__init__): Fix namespace handling problem in
1846 1854 embedded instances. We were overwriting __main__ unconditionally,
1847 1855 and this should only be done for 'full' (non-embedded) IPython;
1848 1856 embedded instances must respect the caller's __main__. Thanks to
1849 1857 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
1850 1858
1851 1859 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
1852 1860
1853 1861 * setup.py: added download_url to setup(). This registers the
1854 1862 download address at PyPI, which is not only useful to humans
1855 1863 browsing the site, but is also picked up by setuptools (the Eggs
1856 1864 machinery). Thanks to Ville and R. Kern for the info/discussion
1857 1865 on this.
1858 1866
1859 1867 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
1860 1868
1861 1869 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
1862 1870 This brings a lot of nice functionality to the pdb mode, which now
1863 1871 has tab-completion, syntax highlighting, and better stack handling
1864 1872 than before. Many thanks to Vivian De Smedt
1865 1873 <vivian-AT-vdesmedt.com> for the original patches.
1866 1874
1867 1875 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
1868 1876
1869 1877 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
1870 1878 sequence to consistently accept the banner argument. The
1871 1879 inconsistency was tripping SAGE, thanks to Gary Zablackis
1872 1880 <gzabl-AT-yahoo.com> for the report.
1873 1881
1874 1882 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1875 1883
1876 1884 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1877 1885 Fix bug where a naked 'alias' call in the ipythonrc file would
1878 1886 cause a crash. Bug reported by Jorgen Stenarson.
1879 1887
1880 1888 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1881 1889
1882 1890 * IPython/ipmaker.py (make_IPython): cleanups which should improve
1883 1891 startup time.
1884 1892
1885 1893 * IPython/iplib.py (runcode): my globals 'fix' for embedded
1886 1894 instances had introduced a bug with globals in normal code. Now
1887 1895 it's working in all cases.
1888 1896
1889 1897 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
1890 1898 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
1891 1899 has been introduced to set the default case sensitivity of the
1892 1900 searches. Users can still select either mode at runtime on a
1893 1901 per-search basis.
1894 1902
1895 1903 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
1896 1904
1897 1905 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
1898 1906 attributes in wildcard searches for subclasses. Modified version
1899 1907 of a patch by Jorgen.
1900 1908
1901 1909 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
1902 1910
1903 1911 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
1904 1912 embedded instances. I added a user_global_ns attribute to the
1905 1913 InteractiveShell class to handle this.
1906 1914
1907 1915 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
1908 1916
1909 1917 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
1910 1918 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
1911 1919 (reported under win32, but may happen also in other platforms).
1912 1920 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
1913 1921
1914 1922 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1915 1923
1916 1924 * IPython/Magic.py (magic_psearch): new support for wildcard
1917 1925 patterns. Now, typing ?a*b will list all names which begin with a
1918 1926 and end in b, for example. The %psearch magic has full
1919 1927 docstrings. Many thanks to JΓΆrgen Stenarson
1920 1928 <jorgen.stenarson-AT-bostream.nu>, author of the patches
1921 1929 implementing this functionality.
1922 1930
1923 1931 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1924 1932
1925 1933 * Manual: fixed long-standing annoyance of double-dashes (as in
1926 1934 --prefix=~, for example) being stripped in the HTML version. This
1927 1935 is a latex2html bug, but a workaround was provided. Many thanks
1928 1936 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
1929 1937 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
1930 1938 rolling. This seemingly small issue had tripped a number of users
1931 1939 when first installing, so I'm glad to see it gone.
1932 1940
1933 1941 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1934 1942
1935 1943 * IPython/Extensions/numeric_formats.py: fix missing import,
1936 1944 reported by Stephen Walton.
1937 1945
1938 1946 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
1939 1947
1940 1948 * IPython/demo.py: finish demo module, fully documented now.
1941 1949
1942 1950 * IPython/genutils.py (file_read): simple little utility to read a
1943 1951 file and ensure it's closed afterwards.
1944 1952
1945 1953 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
1946 1954
1947 1955 * IPython/demo.py (Demo.__init__): added support for individually
1948 1956 tagging blocks for automatic execution.
1949 1957
1950 1958 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
1951 1959 syntax-highlighted python sources, requested by John.
1952 1960
1953 1961 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
1954 1962
1955 1963 * IPython/demo.py (Demo.again): fix bug where again() blocks after
1956 1964 finishing.
1957 1965
1958 1966 * IPython/genutils.py (shlex_split): moved from Magic to here,
1959 1967 where all 2.2 compatibility stuff lives. I needed it for demo.py.
1960 1968
1961 1969 * IPython/demo.py (Demo.__init__): added support for silent
1962 1970 blocks, improved marks as regexps, docstrings written.
1963 1971 (Demo.__init__): better docstring, added support for sys.argv.
1964 1972
1965 1973 * IPython/genutils.py (marquee): little utility used by the demo
1966 1974 code, handy in general.
1967 1975
1968 1976 * IPython/demo.py (Demo.__init__): new class for interactive
1969 1977 demos. Not documented yet, I just wrote it in a hurry for
1970 1978 scipy'05. Will docstring later.
1971 1979
1972 1980 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
1973 1981
1974 1982 * IPython/Shell.py (sigint_handler): Drastic simplification which
1975 1983 also seems to make Ctrl-C work correctly across threads! This is
1976 1984 so simple, that I can't beleive I'd missed it before. Needs more
1977 1985 testing, though.
1978 1986 (KBINT): Never mind, revert changes. I'm sure I'd tried something
1979 1987 like this before...
1980 1988
1981 1989 * IPython/genutils.py (get_home_dir): add protection against
1982 1990 non-dirs in win32 registry.
1983 1991
1984 1992 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
1985 1993 bug where dict was mutated while iterating (pysh crash).
1986 1994
1987 1995 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
1988 1996
1989 1997 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
1990 1998 spurious newlines added by this routine. After a report by
1991 1999 F. Mantegazza.
1992 2000
1993 2001 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
1994 2002
1995 2003 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
1996 2004 calls. These were a leftover from the GTK 1.x days, and can cause
1997 2005 problems in certain cases (after a report by John Hunter).
1998 2006
1999 2007 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2000 2008 os.getcwd() fails at init time. Thanks to patch from David Remahl
2001 2009 <chmod007-AT-mac.com>.
2002 2010 (InteractiveShell.__init__): prevent certain special magics from
2003 2011 being shadowed by aliases. Closes
2004 2012 http://www.scipy.net/roundup/ipython/issue41.
2005 2013
2006 2014 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2007 2015
2008 2016 * IPython/iplib.py (InteractiveShell.complete): Added new
2009 2017 top-level completion method to expose the completion mechanism
2010 2018 beyond readline-based environments.
2011 2019
2012 2020 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2013 2021
2014 2022 * tools/ipsvnc (svnversion): fix svnversion capture.
2015 2023
2016 2024 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2017 2025 attribute to self, which was missing. Before, it was set by a
2018 2026 routine which in certain cases wasn't being called, so the
2019 2027 instance could end up missing the attribute. This caused a crash.
2020 2028 Closes http://www.scipy.net/roundup/ipython/issue40.
2021 2029
2022 2030 2005-08-16 Fernando Perez <fperez@colorado.edu>
2023 2031
2024 2032 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2025 2033 contains non-string attribute. Closes
2026 2034 http://www.scipy.net/roundup/ipython/issue38.
2027 2035
2028 2036 2005-08-14 Fernando Perez <fperez@colorado.edu>
2029 2037
2030 2038 * tools/ipsvnc: Minor improvements, to add changeset info.
2031 2039
2032 2040 2005-08-12 Fernando Perez <fperez@colorado.edu>
2033 2041
2034 2042 * IPython/iplib.py (runsource): remove self.code_to_run_src
2035 2043 attribute. I realized this is nothing more than
2036 2044 '\n'.join(self.buffer), and having the same data in two different
2037 2045 places is just asking for synchronization bugs. This may impact
2038 2046 people who have custom exception handlers, so I need to warn
2039 2047 ipython-dev about it (F. Mantegazza may use them).
2040 2048
2041 2049 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2042 2050
2043 2051 * IPython/genutils.py: fix 2.2 compatibility (generators)
2044 2052
2045 2053 2005-07-18 Fernando Perez <fperez@colorado.edu>
2046 2054
2047 2055 * IPython/genutils.py (get_home_dir): fix to help users with
2048 2056 invalid $HOME under win32.
2049 2057
2050 2058 2005-07-17 Fernando Perez <fperez@colorado.edu>
2051 2059
2052 2060 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2053 2061 some old hacks and clean up a bit other routines; code should be
2054 2062 simpler and a bit faster.
2055 2063
2056 2064 * IPython/iplib.py (interact): removed some last-resort attempts
2057 2065 to survive broken stdout/stderr. That code was only making it
2058 2066 harder to abstract out the i/o (necessary for gui integration),
2059 2067 and the crashes it could prevent were extremely rare in practice
2060 2068 (besides being fully user-induced in a pretty violent manner).
2061 2069
2062 2070 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2063 2071 Nothing major yet, but the code is simpler to read; this should
2064 2072 make it easier to do more serious modifications in the future.
2065 2073
2066 2074 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2067 2075 which broke in .15 (thanks to a report by Ville).
2068 2076
2069 2077 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2070 2078 be quite correct, I know next to nothing about unicode). This
2071 2079 will allow unicode strings to be used in prompts, amongst other
2072 2080 cases. It also will prevent ipython from crashing when unicode
2073 2081 shows up unexpectedly in many places. If ascii encoding fails, we
2074 2082 assume utf_8. Currently the encoding is not a user-visible
2075 2083 setting, though it could be made so if there is demand for it.
2076 2084
2077 2085 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2078 2086
2079 2087 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2080 2088
2081 2089 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2082 2090
2083 2091 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2084 2092 code can work transparently for 2.2/2.3.
2085 2093
2086 2094 2005-07-16 Fernando Perez <fperez@colorado.edu>
2087 2095
2088 2096 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2089 2097 out of the color scheme table used for coloring exception
2090 2098 tracebacks. This allows user code to add new schemes at runtime.
2091 2099 This is a minimally modified version of the patch at
2092 2100 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2093 2101 for the contribution.
2094 2102
2095 2103 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2096 2104 slightly modified version of the patch in
2097 2105 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2098 2106 to remove the previous try/except solution (which was costlier).
2099 2107 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2100 2108
2101 2109 2005-06-08 Fernando Perez <fperez@colorado.edu>
2102 2110
2103 2111 * IPython/iplib.py (write/write_err): Add methods to abstract all
2104 2112 I/O a bit more.
2105 2113
2106 2114 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2107 2115 warning, reported by Aric Hagberg, fix by JD Hunter.
2108 2116
2109 2117 2005-06-02 *** Released version 0.6.15
2110 2118
2111 2119 2005-06-01 Fernando Perez <fperez@colorado.edu>
2112 2120
2113 2121 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2114 2122 tab-completion of filenames within open-quoted strings. Note that
2115 2123 this requires that in ~/.ipython/ipythonrc, users change the
2116 2124 readline delimiters configuration to read:
2117 2125
2118 2126 readline_remove_delims -/~
2119 2127
2120 2128
2121 2129 2005-05-31 *** Released version 0.6.14
2122 2130
2123 2131 2005-05-29 Fernando Perez <fperez@colorado.edu>
2124 2132
2125 2133 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2126 2134 with files not on the filesystem. Reported by Eliyahu Sandler
2127 2135 <eli@gondolin.net>
2128 2136
2129 2137 2005-05-22 Fernando Perez <fperez@colorado.edu>
2130 2138
2131 2139 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2132 2140 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2133 2141
2134 2142 2005-05-19 Fernando Perez <fperez@colorado.edu>
2135 2143
2136 2144 * IPython/iplib.py (safe_execfile): close a file which could be
2137 2145 left open (causing problems in win32, which locks open files).
2138 2146 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2139 2147
2140 2148 2005-05-18 Fernando Perez <fperez@colorado.edu>
2141 2149
2142 2150 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2143 2151 keyword arguments correctly to safe_execfile().
2144 2152
2145 2153 2005-05-13 Fernando Perez <fperez@colorado.edu>
2146 2154
2147 2155 * ipython.1: Added info about Qt to manpage, and threads warning
2148 2156 to usage page (invoked with --help).
2149 2157
2150 2158 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2151 2159 new matcher (it goes at the end of the priority list) to do
2152 2160 tab-completion on named function arguments. Submitted by George
2153 2161 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2154 2162 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2155 2163 for more details.
2156 2164
2157 2165 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2158 2166 SystemExit exceptions in the script being run. Thanks to a report
2159 2167 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2160 2168 producing very annoying behavior when running unit tests.
2161 2169
2162 2170 2005-05-12 Fernando Perez <fperez@colorado.edu>
2163 2171
2164 2172 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2165 2173 which I'd broken (again) due to a changed regexp. In the process,
2166 2174 added ';' as an escape to auto-quote the whole line without
2167 2175 splitting its arguments. Thanks to a report by Jerry McRae
2168 2176 <qrs0xyc02-AT-sneakemail.com>.
2169 2177
2170 2178 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2171 2179 possible crashes caused by a TokenError. Reported by Ed Schofield
2172 2180 <schofield-AT-ftw.at>.
2173 2181
2174 2182 2005-05-06 Fernando Perez <fperez@colorado.edu>
2175 2183
2176 2184 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2177 2185
2178 2186 2005-04-29 Fernando Perez <fperez@colorado.edu>
2179 2187
2180 2188 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2181 2189 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2182 2190 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2183 2191 which provides support for Qt interactive usage (similar to the
2184 2192 existing one for WX and GTK). This had been often requested.
2185 2193
2186 2194 2005-04-14 *** Released version 0.6.13
2187 2195
2188 2196 2005-04-08 Fernando Perez <fperez@colorado.edu>
2189 2197
2190 2198 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2191 2199 from _ofind, which gets called on almost every input line. Now,
2192 2200 we only try to get docstrings if they are actually going to be
2193 2201 used (the overhead of fetching unnecessary docstrings can be
2194 2202 noticeable for certain objects, such as Pyro proxies).
2195 2203
2196 2204 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2197 2205 for completers. For some reason I had been passing them the state
2198 2206 variable, which completers never actually need, and was in
2199 2207 conflict with the rlcompleter API. Custom completers ONLY need to
2200 2208 take the text parameter.
2201 2209
2202 2210 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2203 2211 work correctly in pysh. I've also moved all the logic which used
2204 2212 to be in pysh.py here, which will prevent problems with future
2205 2213 upgrades. However, this time I must warn users to update their
2206 2214 pysh profile to include the line
2207 2215
2208 2216 import_all IPython.Extensions.InterpreterExec
2209 2217
2210 2218 because otherwise things won't work for them. They MUST also
2211 2219 delete pysh.py and the line
2212 2220
2213 2221 execfile pysh.py
2214 2222
2215 2223 from their ipythonrc-pysh.
2216 2224
2217 2225 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2218 2226 robust in the face of objects whose dir() returns non-strings
2219 2227 (which it shouldn't, but some broken libs like ITK do). Thanks to
2220 2228 a patch by John Hunter (implemented differently, though). Also
2221 2229 minor improvements by using .extend instead of + on lists.
2222 2230
2223 2231 * pysh.py:
2224 2232
2225 2233 2005-04-06 Fernando Perez <fperez@colorado.edu>
2226 2234
2227 2235 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2228 2236 by default, so that all users benefit from it. Those who don't
2229 2237 want it can still turn it off.
2230 2238
2231 2239 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2232 2240 config file, I'd forgotten about this, so users were getting it
2233 2241 off by default.
2234 2242
2235 2243 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2236 2244 consistency. Now magics can be called in multiline statements,
2237 2245 and python variables can be expanded in magic calls via $var.
2238 2246 This makes the magic system behave just like aliases or !system
2239 2247 calls.
2240 2248
2241 2249 2005-03-28 Fernando Perez <fperez@colorado.edu>
2242 2250
2243 2251 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2244 2252 expensive string additions for building command. Add support for
2245 2253 trailing ';' when autocall is used.
2246 2254
2247 2255 2005-03-26 Fernando Perez <fperez@colorado.edu>
2248 2256
2249 2257 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2250 2258 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2251 2259 ipython.el robust against prompts with any number of spaces
2252 2260 (including 0) after the ':' character.
2253 2261
2254 2262 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2255 2263 continuation prompt, which misled users to think the line was
2256 2264 already indented. Closes debian Bug#300847, reported to me by
2257 2265 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2258 2266
2259 2267 2005-03-23 Fernando Perez <fperez@colorado.edu>
2260 2268
2261 2269 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
2262 2270 properly aligned if they have embedded newlines.
2263 2271
2264 2272 * IPython/iplib.py (runlines): Add a public method to expose
2265 2273 IPython's code execution machinery, so that users can run strings
2266 2274 as if they had been typed at the prompt interactively.
2267 2275 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
2268 2276 methods which can call the system shell, but with python variable
2269 2277 expansion. The three such methods are: __IPYTHON__.system,
2270 2278 .getoutput and .getoutputerror. These need to be documented in a
2271 2279 'public API' section (to be written) of the manual.
2272 2280
2273 2281 2005-03-20 Fernando Perez <fperez@colorado.edu>
2274 2282
2275 2283 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
2276 2284 for custom exception handling. This is quite powerful, and it
2277 2285 allows for user-installable exception handlers which can trap
2278 2286 custom exceptions at runtime and treat them separately from
2279 2287 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
2280 2288 Mantegazza <mantegazza-AT-ill.fr>.
2281 2289 (InteractiveShell.set_custom_completer): public API function to
2282 2290 add new completers at runtime.
2283 2291
2284 2292 2005-03-19 Fernando Perez <fperez@colorado.edu>
2285 2293
2286 2294 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
2287 2295 allow objects which provide their docstrings via non-standard
2288 2296 mechanisms (like Pyro proxies) to still be inspected by ipython's
2289 2297 ? system.
2290 2298
2291 2299 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
2292 2300 automatic capture system. I tried quite hard to make it work
2293 2301 reliably, and simply failed. I tried many combinations with the
2294 2302 subprocess module, but eventually nothing worked in all needed
2295 2303 cases (not blocking stdin for the child, duplicating stdout
2296 2304 without blocking, etc). The new %sc/%sx still do capture to these
2297 2305 magical list/string objects which make shell use much more
2298 2306 conveninent, so not all is lost.
2299 2307
2300 2308 XXX - FIX MANUAL for the change above!
2301 2309
2302 2310 (runsource): I copied code.py's runsource() into ipython to modify
2303 2311 it a bit. Now the code object and source to be executed are
2304 2312 stored in ipython. This makes this info accessible to third-party
2305 2313 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
2306 2314 Mantegazza <mantegazza-AT-ill.fr>.
2307 2315
2308 2316 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
2309 2317 history-search via readline (like C-p/C-n). I'd wanted this for a
2310 2318 long time, but only recently found out how to do it. For users
2311 2319 who already have their ipythonrc files made and want this, just
2312 2320 add:
2313 2321
2314 2322 readline_parse_and_bind "\e[A": history-search-backward
2315 2323 readline_parse_and_bind "\e[B": history-search-forward
2316 2324
2317 2325 2005-03-18 Fernando Perez <fperez@colorado.edu>
2318 2326
2319 2327 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
2320 2328 LSString and SList classes which allow transparent conversions
2321 2329 between list mode and whitespace-separated string.
2322 2330 (magic_r): Fix recursion problem in %r.
2323 2331
2324 2332 * IPython/genutils.py (LSString): New class to be used for
2325 2333 automatic storage of the results of all alias/system calls in _o
2326 2334 and _e (stdout/err). These provide a .l/.list attribute which
2327 2335 does automatic splitting on newlines. This means that for most
2328 2336 uses, you'll never need to do capturing of output with %sc/%sx
2329 2337 anymore, since ipython keeps this always done for you. Note that
2330 2338 only the LAST results are stored, the _o/e variables are
2331 2339 overwritten on each call. If you need to save their contents
2332 2340 further, simply bind them to any other name.
2333 2341
2334 2342 2005-03-17 Fernando Perez <fperez@colorado.edu>
2335 2343
2336 2344 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
2337 2345 prompt namespace handling.
2338 2346
2339 2347 2005-03-16 Fernando Perez <fperez@colorado.edu>
2340 2348
2341 2349 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
2342 2350 classic prompts to be '>>> ' (final space was missing, and it
2343 2351 trips the emacs python mode).
2344 2352 (BasePrompt.__str__): Added safe support for dynamic prompt
2345 2353 strings. Now you can set your prompt string to be '$x', and the
2346 2354 value of x will be printed from your interactive namespace. The
2347 2355 interpolation syntax includes the full Itpl support, so
2348 2356 ${foo()+x+bar()} is a valid prompt string now, and the function
2349 2357 calls will be made at runtime.
2350 2358
2351 2359 2005-03-15 Fernando Perez <fperez@colorado.edu>
2352 2360
2353 2361 * IPython/Magic.py (magic_history): renamed %hist to %history, to
2354 2362 avoid name clashes in pylab. %hist still works, it just forwards
2355 2363 the call to %history.
2356 2364
2357 2365 2005-03-02 *** Released version 0.6.12
2358 2366
2359 2367 2005-03-02 Fernando Perez <fperez@colorado.edu>
2360 2368
2361 2369 * IPython/iplib.py (handle_magic): log magic calls properly as
2362 2370 ipmagic() function calls.
2363 2371
2364 2372 * IPython/Magic.py (magic_time): Improved %time to support
2365 2373 statements and provide wall-clock as well as CPU time.
2366 2374
2367 2375 2005-02-27 Fernando Perez <fperez@colorado.edu>
2368 2376
2369 2377 * IPython/hooks.py: New hooks module, to expose user-modifiable
2370 2378 IPython functionality in a clean manner. For now only the editor
2371 2379 hook is actually written, and other thigns which I intend to turn
2372 2380 into proper hooks aren't yet there. The display and prefilter
2373 2381 stuff, for example, should be hooks. But at least now the
2374 2382 framework is in place, and the rest can be moved here with more
2375 2383 time later. IPython had had a .hooks variable for a long time for
2376 2384 this purpose, but I'd never actually used it for anything.
2377 2385
2378 2386 2005-02-26 Fernando Perez <fperez@colorado.edu>
2379 2387
2380 2388 * IPython/ipmaker.py (make_IPython): make the default ipython
2381 2389 directory be called _ipython under win32, to follow more the
2382 2390 naming peculiarities of that platform (where buggy software like
2383 2391 Visual Sourcesafe breaks with .named directories). Reported by
2384 2392 Ville Vainio.
2385 2393
2386 2394 2005-02-23 Fernando Perez <fperez@colorado.edu>
2387 2395
2388 2396 * IPython/iplib.py (InteractiveShell.__init__): removed a few
2389 2397 auto_aliases for win32 which were causing problems. Users can
2390 2398 define the ones they personally like.
2391 2399
2392 2400 2005-02-21 Fernando Perez <fperez@colorado.edu>
2393 2401
2394 2402 * IPython/Magic.py (magic_time): new magic to time execution of
2395 2403 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
2396 2404
2397 2405 2005-02-19 Fernando Perez <fperez@colorado.edu>
2398 2406
2399 2407 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
2400 2408 into keys (for prompts, for example).
2401 2409
2402 2410 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
2403 2411 prompts in case users want them. This introduces a small behavior
2404 2412 change: ipython does not automatically add a space to all prompts
2405 2413 anymore. To get the old prompts with a space, users should add it
2406 2414 manually to their ipythonrc file, so for example prompt_in1 should
2407 2415 now read 'In [\#]: ' instead of 'In [\#]:'.
2408 2416 (BasePrompt.__init__): New option prompts_pad_left (only in rc
2409 2417 file) to control left-padding of secondary prompts.
2410 2418
2411 2419 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
2412 2420 the profiler can't be imported. Fix for Debian, which removed
2413 2421 profile.py because of License issues. I applied a slightly
2414 2422 modified version of the original Debian patch at
2415 2423 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
2416 2424
2417 2425 2005-02-17 Fernando Perez <fperez@colorado.edu>
2418 2426
2419 2427 * IPython/genutils.py (native_line_ends): Fix bug which would
2420 2428 cause improper line-ends under win32 b/c I was not opening files
2421 2429 in binary mode. Bug report and fix thanks to Ville.
2422 2430
2423 2431 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
2424 2432 trying to catch spurious foo[1] autocalls. My fix actually broke
2425 2433 ',/' autoquote/call with explicit escape (bad regexp).
2426 2434
2427 2435 2005-02-15 *** Released version 0.6.11
2428 2436
2429 2437 2005-02-14 Fernando Perez <fperez@colorado.edu>
2430 2438
2431 2439 * IPython/background_jobs.py: New background job management
2432 2440 subsystem. This is implemented via a new set of classes, and
2433 2441 IPython now provides a builtin 'jobs' object for background job
2434 2442 execution. A convenience %bg magic serves as a lightweight
2435 2443 frontend for starting the more common type of calls. This was
2436 2444 inspired by discussions with B. Granger and the BackgroundCommand
2437 2445 class described in the book Python Scripting for Computational
2438 2446 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
2439 2447 (although ultimately no code from this text was used, as IPython's
2440 2448 system is a separate implementation).
2441 2449
2442 2450 * IPython/iplib.py (MagicCompleter.python_matches): add new option
2443 2451 to control the completion of single/double underscore names
2444 2452 separately. As documented in the example ipytonrc file, the
2445 2453 readline_omit__names variable can now be set to 2, to omit even
2446 2454 single underscore names. Thanks to a patch by Brian Wong
2447 2455 <BrianWong-AT-AirgoNetworks.Com>.
2448 2456 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
2449 2457 be autocalled as foo([1]) if foo were callable. A problem for
2450 2458 things which are both callable and implement __getitem__.
2451 2459 (init_readline): Fix autoindentation for win32. Thanks to a patch
2452 2460 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
2453 2461
2454 2462 2005-02-12 Fernando Perez <fperez@colorado.edu>
2455 2463
2456 2464 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
2457 2465 which I had written long ago to sort out user error messages which
2458 2466 may occur during startup. This seemed like a good idea initially,
2459 2467 but it has proven a disaster in retrospect. I don't want to
2460 2468 change much code for now, so my fix is to set the internal 'debug'
2461 2469 flag to true everywhere, whose only job was precisely to control
2462 2470 this subsystem. This closes issue 28 (as well as avoiding all
2463 2471 sorts of strange hangups which occur from time to time).
2464 2472
2465 2473 2005-02-07 Fernando Perez <fperez@colorado.edu>
2466 2474
2467 2475 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
2468 2476 previous call produced a syntax error.
2469 2477
2470 2478 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2471 2479 classes without constructor.
2472 2480
2473 2481 2005-02-06 Fernando Perez <fperez@colorado.edu>
2474 2482
2475 2483 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
2476 2484 completions with the results of each matcher, so we return results
2477 2485 to the user from all namespaces. This breaks with ipython
2478 2486 tradition, but I think it's a nicer behavior. Now you get all
2479 2487 possible completions listed, from all possible namespaces (python,
2480 2488 filesystem, magics...) After a request by John Hunter
2481 2489 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2482 2490
2483 2491 2005-02-05 Fernando Perez <fperez@colorado.edu>
2484 2492
2485 2493 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
2486 2494 the call had quote characters in it (the quotes were stripped).
2487 2495
2488 2496 2005-01-31 Fernando Perez <fperez@colorado.edu>
2489 2497
2490 2498 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
2491 2499 Itpl.itpl() to make the code more robust against psyco
2492 2500 optimizations.
2493 2501
2494 2502 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
2495 2503 of causing an exception. Quicker, cleaner.
2496 2504
2497 2505 2005-01-28 Fernando Perez <fperez@colorado.edu>
2498 2506
2499 2507 * scripts/ipython_win_post_install.py (install): hardcode
2500 2508 sys.prefix+'python.exe' as the executable path. It turns out that
2501 2509 during the post-installation run, sys.executable resolves to the
2502 2510 name of the binary installer! I should report this as a distutils
2503 2511 bug, I think. I updated the .10 release with this tiny fix, to
2504 2512 avoid annoying the lists further.
2505 2513
2506 2514 2005-01-27 *** Released version 0.6.10
2507 2515
2508 2516 2005-01-27 Fernando Perez <fperez@colorado.edu>
2509 2517
2510 2518 * IPython/numutils.py (norm): Added 'inf' as optional name for
2511 2519 L-infinity norm, included references to mathworld.com for vector
2512 2520 norm definitions.
2513 2521 (amin/amax): added amin/amax for array min/max. Similar to what
2514 2522 pylab ships with after the recent reorganization of names.
2515 2523 (spike/spike_odd): removed deprecated spike/spike_odd functions.
2516 2524
2517 2525 * ipython.el: committed Alex's recent fixes and improvements.
2518 2526 Tested with python-mode from CVS, and it looks excellent. Since
2519 2527 python-mode hasn't released anything in a while, I'm temporarily
2520 2528 putting a copy of today's CVS (v 4.70) of python-mode in:
2521 2529 http://ipython.scipy.org/tmp/python-mode.el
2522 2530
2523 2531 * scripts/ipython_win_post_install.py (install): Win32 fix to use
2524 2532 sys.executable for the executable name, instead of assuming it's
2525 2533 called 'python.exe' (the post-installer would have produced broken
2526 2534 setups on systems with a differently named python binary).
2527 2535
2528 2536 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
2529 2537 references to os.linesep, to make the code more
2530 2538 platform-independent. This is also part of the win32 coloring
2531 2539 fixes.
2532 2540
2533 2541 * IPython/genutils.py (page_dumb): Remove attempts to chop long
2534 2542 lines, which actually cause coloring bugs because the length of
2535 2543 the line is very difficult to correctly compute with embedded
2536 2544 escapes. This was the source of all the coloring problems under
2537 2545 Win32. I think that _finally_, Win32 users have a properly
2538 2546 working ipython in all respects. This would never have happened
2539 2547 if not for Gary Bishop and Viktor Ransmayr's great help and work.
2540 2548
2541 2549 2005-01-26 *** Released version 0.6.9
2542 2550
2543 2551 2005-01-25 Fernando Perez <fperez@colorado.edu>
2544 2552
2545 2553 * setup.py: finally, we have a true Windows installer, thanks to
2546 2554 the excellent work of Viktor Ransmayr
2547 2555 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
2548 2556 Windows users. The setup routine is quite a bit cleaner thanks to
2549 2557 this, and the post-install script uses the proper functions to
2550 2558 allow a clean de-installation using the standard Windows Control
2551 2559 Panel.
2552 2560
2553 2561 * IPython/genutils.py (get_home_dir): changed to use the $HOME
2554 2562 environment variable under all OSes (including win32) if
2555 2563 available. This will give consistency to win32 users who have set
2556 2564 this variable for any reason. If os.environ['HOME'] fails, the
2557 2565 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
2558 2566
2559 2567 2005-01-24 Fernando Perez <fperez@colorado.edu>
2560 2568
2561 2569 * IPython/numutils.py (empty_like): add empty_like(), similar to
2562 2570 zeros_like() but taking advantage of the new empty() Numeric routine.
2563 2571
2564 2572 2005-01-23 *** Released version 0.6.8
2565 2573
2566 2574 2005-01-22 Fernando Perez <fperez@colorado.edu>
2567 2575
2568 2576 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
2569 2577 automatic show() calls. After discussing things with JDH, it
2570 2578 turns out there are too many corner cases where this can go wrong.
2571 2579 It's best not to try to be 'too smart', and simply have ipython
2572 2580 reproduce as much as possible the default behavior of a normal
2573 2581 python shell.
2574 2582
2575 2583 * IPython/iplib.py (InteractiveShell.__init__): Modified the
2576 2584 line-splitting regexp and _prefilter() to avoid calling getattr()
2577 2585 on assignments. This closes
2578 2586 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
2579 2587 readline uses getattr(), so a simple <TAB> keypress is still
2580 2588 enough to trigger getattr() calls on an object.
2581 2589
2582 2590 2005-01-21 Fernando Perez <fperez@colorado.edu>
2583 2591
2584 2592 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
2585 2593 docstring under pylab so it doesn't mask the original.
2586 2594
2587 2595 2005-01-21 *** Released version 0.6.7
2588 2596
2589 2597 2005-01-21 Fernando Perez <fperez@colorado.edu>
2590 2598
2591 2599 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
2592 2600 signal handling for win32 users in multithreaded mode.
2593 2601
2594 2602 2005-01-17 Fernando Perez <fperez@colorado.edu>
2595 2603
2596 2604 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2597 2605 instances with no __init__. After a crash report by Norbert Nemec
2598 2606 <Norbert-AT-nemec-online.de>.
2599 2607
2600 2608 2005-01-14 Fernando Perez <fperez@colorado.edu>
2601 2609
2602 2610 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
2603 2611 names for verbose exceptions, when multiple dotted names and the
2604 2612 'parent' object were present on the same line.
2605 2613
2606 2614 2005-01-11 Fernando Perez <fperez@colorado.edu>
2607 2615
2608 2616 * IPython/genutils.py (flag_calls): new utility to trap and flag
2609 2617 calls in functions. I need it to clean up matplotlib support.
2610 2618 Also removed some deprecated code in genutils.
2611 2619
2612 2620 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
2613 2621 that matplotlib scripts called with %run, which don't call show()
2614 2622 themselves, still have their plotting windows open.
2615 2623
2616 2624 2005-01-05 Fernando Perez <fperez@colorado.edu>
2617 2625
2618 2626 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
2619 2627 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
2620 2628
2621 2629 2004-12-19 Fernando Perez <fperez@colorado.edu>
2622 2630
2623 2631 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
2624 2632 parent_runcode, which was an eyesore. The same result can be
2625 2633 obtained with Python's regular superclass mechanisms.
2626 2634
2627 2635 2004-12-17 Fernando Perez <fperez@colorado.edu>
2628 2636
2629 2637 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
2630 2638 reported by Prabhu.
2631 2639 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
2632 2640 sys.stderr) instead of explicitly calling sys.stderr. This helps
2633 2641 maintain our I/O abstractions clean, for future GUI embeddings.
2634 2642
2635 2643 * IPython/genutils.py (info): added new utility for sys.stderr
2636 2644 unified info message handling (thin wrapper around warn()).
2637 2645
2638 2646 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
2639 2647 composite (dotted) names on verbose exceptions.
2640 2648 (VerboseTB.nullrepr): harden against another kind of errors which
2641 2649 Python's inspect module can trigger, and which were crashing
2642 2650 IPython. Thanks to a report by Marco Lombardi
2643 2651 <mlombard-AT-ma010192.hq.eso.org>.
2644 2652
2645 2653 2004-12-13 *** Released version 0.6.6
2646 2654
2647 2655 2004-12-12 Fernando Perez <fperez@colorado.edu>
2648 2656
2649 2657 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
2650 2658 generated by pygtk upon initialization if it was built without
2651 2659 threads (for matplotlib users). After a crash reported by
2652 2660 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
2653 2661
2654 2662 * IPython/ipmaker.py (make_IPython): fix small bug in the
2655 2663 import_some parameter for multiple imports.
2656 2664
2657 2665 * IPython/iplib.py (ipmagic): simplified the interface of
2658 2666 ipmagic() to take a single string argument, just as it would be
2659 2667 typed at the IPython cmd line.
2660 2668 (ipalias): Added new ipalias() with an interface identical to
2661 2669 ipmagic(). This completes exposing a pure python interface to the
2662 2670 alias and magic system, which can be used in loops or more complex
2663 2671 code where IPython's automatic line mangling is not active.
2664 2672
2665 2673 * IPython/genutils.py (timing): changed interface of timing to
2666 2674 simply run code once, which is the most common case. timings()
2667 2675 remains unchanged, for the cases where you want multiple runs.
2668 2676
2669 2677 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
2670 2678 bug where Python2.2 crashes with exec'ing code which does not end
2671 2679 in a single newline. Python 2.3 is OK, so I hadn't noticed this
2672 2680 before.
2673 2681
2674 2682 2004-12-10 Fernando Perez <fperez@colorado.edu>
2675 2683
2676 2684 * IPython/Magic.py (Magic.magic_prun): changed name of option from
2677 2685 -t to -T, to accomodate the new -t flag in %run (the %run and
2678 2686 %prun options are kind of intermixed, and it's not easy to change
2679 2687 this with the limitations of python's getopt).
2680 2688
2681 2689 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
2682 2690 the execution of scripts. It's not as fine-tuned as timeit.py,
2683 2691 but it works from inside ipython (and under 2.2, which lacks
2684 2692 timeit.py). Optionally a number of runs > 1 can be given for
2685 2693 timing very short-running code.
2686 2694
2687 2695 * IPython/genutils.py (uniq_stable): new routine which returns a
2688 2696 list of unique elements in any iterable, but in stable order of
2689 2697 appearance. I needed this for the ultraTB fixes, and it's a handy
2690 2698 utility.
2691 2699
2692 2700 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
2693 2701 dotted names in Verbose exceptions. This had been broken since
2694 2702 the very start, now x.y will properly be printed in a Verbose
2695 2703 traceback, instead of x being shown and y appearing always as an
2696 2704 'undefined global'. Getting this to work was a bit tricky,
2697 2705 because by default python tokenizers are stateless. Saved by
2698 2706 python's ability to easily add a bit of state to an arbitrary
2699 2707 function (without needing to build a full-blown callable object).
2700 2708
2701 2709 Also big cleanup of this code, which had horrendous runtime
2702 2710 lookups of zillions of attributes for colorization. Moved all
2703 2711 this code into a few templates, which make it cleaner and quicker.
2704 2712
2705 2713 Printout quality was also improved for Verbose exceptions: one
2706 2714 variable per line, and memory addresses are printed (this can be
2707 2715 quite handy in nasty debugging situations, which is what Verbose
2708 2716 is for).
2709 2717
2710 2718 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
2711 2719 the command line as scripts to be loaded by embedded instances.
2712 2720 Doing so has the potential for an infinite recursion if there are
2713 2721 exceptions thrown in the process. This fixes a strange crash
2714 2722 reported by Philippe MULLER <muller-AT-irit.fr>.
2715 2723
2716 2724 2004-12-09 Fernando Perez <fperez@colorado.edu>
2717 2725
2718 2726 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
2719 2727 to reflect new names in matplotlib, which now expose the
2720 2728 matlab-compatible interface via a pylab module instead of the
2721 2729 'matlab' name. The new code is backwards compatible, so users of
2722 2730 all matplotlib versions are OK. Patch by J. Hunter.
2723 2731
2724 2732 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
2725 2733 of __init__ docstrings for instances (class docstrings are already
2726 2734 automatically printed). Instances with customized docstrings
2727 2735 (indep. of the class) are also recognized and all 3 separate
2728 2736 docstrings are printed (instance, class, constructor). After some
2729 2737 comments/suggestions by J. Hunter.
2730 2738
2731 2739 2004-12-05 Fernando Perez <fperez@colorado.edu>
2732 2740
2733 2741 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
2734 2742 warnings when tab-completion fails and triggers an exception.
2735 2743
2736 2744 2004-12-03 Fernando Perez <fperez@colorado.edu>
2737 2745
2738 2746 * IPython/Magic.py (magic_prun): Fix bug where an exception would
2739 2747 be triggered when using 'run -p'. An incorrect option flag was
2740 2748 being set ('d' instead of 'D').
2741 2749 (manpage): fix missing escaped \- sign.
2742 2750
2743 2751 2004-11-30 *** Released version 0.6.5
2744 2752
2745 2753 2004-11-30 Fernando Perez <fperez@colorado.edu>
2746 2754
2747 2755 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
2748 2756 setting with -d option.
2749 2757
2750 2758 * setup.py (docfiles): Fix problem where the doc glob I was using
2751 2759 was COMPLETELY BROKEN. It was giving the right files by pure
2752 2760 accident, but failed once I tried to include ipython.el. Note:
2753 2761 glob() does NOT allow you to do exclusion on multiple endings!
2754 2762
2755 2763 2004-11-29 Fernando Perez <fperez@colorado.edu>
2756 2764
2757 2765 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
2758 2766 the manpage as the source. Better formatting & consistency.
2759 2767
2760 2768 * IPython/Magic.py (magic_run): Added new -d option, to run
2761 2769 scripts under the control of the python pdb debugger. Note that
2762 2770 this required changing the %prun option -d to -D, to avoid a clash
2763 2771 (since %run must pass options to %prun, and getopt is too dumb to
2764 2772 handle options with string values with embedded spaces). Thanks
2765 2773 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
2766 2774 (magic_who_ls): added type matching to %who and %whos, so that one
2767 2775 can filter their output to only include variables of certain
2768 2776 types. Another suggestion by Matthew.
2769 2777 (magic_whos): Added memory summaries in kb and Mb for arrays.
2770 2778 (magic_who): Improve formatting (break lines every 9 vars).
2771 2779
2772 2780 2004-11-28 Fernando Perez <fperez@colorado.edu>
2773 2781
2774 2782 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
2775 2783 cache when empty lines were present.
2776 2784
2777 2785 2004-11-24 Fernando Perez <fperez@colorado.edu>
2778 2786
2779 2787 * IPython/usage.py (__doc__): document the re-activated threading
2780 2788 options for WX and GTK.
2781 2789
2782 2790 2004-11-23 Fernando Perez <fperez@colorado.edu>
2783 2791
2784 2792 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
2785 2793 the -wthread and -gthread options, along with a new -tk one to try
2786 2794 and coordinate Tk threading with wx/gtk. The tk support is very
2787 2795 platform dependent, since it seems to require Tcl and Tk to be
2788 2796 built with threads (Fedora1/2 appears NOT to have it, but in
2789 2797 Prabhu's Debian boxes it works OK). But even with some Tk
2790 2798 limitations, this is a great improvement.
2791 2799
2792 2800 * IPython/Prompts.py (prompt_specials_color): Added \t for time
2793 2801 info in user prompts. Patch by Prabhu.
2794 2802
2795 2803 2004-11-18 Fernando Perez <fperez@colorado.edu>
2796 2804
2797 2805 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
2798 2806 EOFErrors and bail, to avoid infinite loops if a non-terminating
2799 2807 file is fed into ipython. Patch submitted in issue 19 by user,
2800 2808 many thanks.
2801 2809
2802 2810 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
2803 2811 autoquote/parens in continuation prompts, which can cause lots of
2804 2812 problems. Closes roundup issue 20.
2805 2813
2806 2814 2004-11-17 Fernando Perez <fperez@colorado.edu>
2807 2815
2808 2816 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
2809 2817 reported as debian bug #280505. I'm not sure my local changelog
2810 2818 entry has the proper debian format (Jack?).
2811 2819
2812 2820 2004-11-08 *** Released version 0.6.4
2813 2821
2814 2822 2004-11-08 Fernando Perez <fperez@colorado.edu>
2815 2823
2816 2824 * IPython/iplib.py (init_readline): Fix exit message for Windows
2817 2825 when readline is active. Thanks to a report by Eric Jones
2818 2826 <eric-AT-enthought.com>.
2819 2827
2820 2828 2004-11-07 Fernando Perez <fperez@colorado.edu>
2821 2829
2822 2830 * IPython/genutils.py (page): Add a trap for OSError exceptions,
2823 2831 sometimes seen by win2k/cygwin users.
2824 2832
2825 2833 2004-11-06 Fernando Perez <fperez@colorado.edu>
2826 2834
2827 2835 * IPython/iplib.py (interact): Change the handling of %Exit from
2828 2836 trying to propagate a SystemExit to an internal ipython flag.
2829 2837 This is less elegant than using Python's exception mechanism, but
2830 2838 I can't get that to work reliably with threads, so under -pylab
2831 2839 %Exit was hanging IPython. Cross-thread exception handling is
2832 2840 really a bitch. Thaks to a bug report by Stephen Walton
2833 2841 <stephen.walton-AT-csun.edu>.
2834 2842
2835 2843 2004-11-04 Fernando Perez <fperez@colorado.edu>
2836 2844
2837 2845 * IPython/iplib.py (raw_input_original): store a pointer to the
2838 2846 true raw_input to harden against code which can modify it
2839 2847 (wx.py.PyShell does this and would otherwise crash ipython).
2840 2848 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
2841 2849
2842 2850 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
2843 2851 Ctrl-C problem, which does not mess up the input line.
2844 2852
2845 2853 2004-11-03 Fernando Perez <fperez@colorado.edu>
2846 2854
2847 2855 * IPython/Release.py: Changed licensing to BSD, in all files.
2848 2856 (name): lowercase name for tarball/RPM release.
2849 2857
2850 2858 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
2851 2859 use throughout ipython.
2852 2860
2853 2861 * IPython/Magic.py (Magic._ofind): Switch to using the new
2854 2862 OInspect.getdoc() function.
2855 2863
2856 2864 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
2857 2865 of the line currently being canceled via Ctrl-C. It's extremely
2858 2866 ugly, but I don't know how to do it better (the problem is one of
2859 2867 handling cross-thread exceptions).
2860 2868
2861 2869 2004-10-28 Fernando Perez <fperez@colorado.edu>
2862 2870
2863 2871 * IPython/Shell.py (signal_handler): add signal handlers to trap
2864 2872 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
2865 2873 report by Francesc Alted.
2866 2874
2867 2875 2004-10-21 Fernando Perez <fperez@colorado.edu>
2868 2876
2869 2877 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
2870 2878 to % for pysh syntax extensions.
2871 2879
2872 2880 2004-10-09 Fernando Perez <fperez@colorado.edu>
2873 2881
2874 2882 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
2875 2883 arrays to print a more useful summary, without calling str(arr).
2876 2884 This avoids the problem of extremely lengthy computations which
2877 2885 occur if arr is large, and appear to the user as a system lockup
2878 2886 with 100% cpu activity. After a suggestion by Kristian Sandberg
2879 2887 <Kristian.Sandberg@colorado.edu>.
2880 2888 (Magic.__init__): fix bug in global magic escapes not being
2881 2889 correctly set.
2882 2890
2883 2891 2004-10-08 Fernando Perez <fperez@colorado.edu>
2884 2892
2885 2893 * IPython/Magic.py (__license__): change to absolute imports of
2886 2894 ipython's own internal packages, to start adapting to the absolute
2887 2895 import requirement of PEP-328.
2888 2896
2889 2897 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
2890 2898 files, and standardize author/license marks through the Release
2891 2899 module instead of having per/file stuff (except for files with
2892 2900 particular licenses, like the MIT/PSF-licensed codes).
2893 2901
2894 2902 * IPython/Debugger.py: remove dead code for python 2.1
2895 2903
2896 2904 2004-10-04 Fernando Perez <fperez@colorado.edu>
2897 2905
2898 2906 * IPython/iplib.py (ipmagic): New function for accessing magics
2899 2907 via a normal python function call.
2900 2908
2901 2909 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
2902 2910 from '@' to '%', to accomodate the new @decorator syntax of python
2903 2911 2.4.
2904 2912
2905 2913 2004-09-29 Fernando Perez <fperez@colorado.edu>
2906 2914
2907 2915 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
2908 2916 matplotlib.use to prevent running scripts which try to switch
2909 2917 interactive backends from within ipython. This will just crash
2910 2918 the python interpreter, so we can't allow it (but a detailed error
2911 2919 is given to the user).
2912 2920
2913 2921 2004-09-28 Fernando Perez <fperez@colorado.edu>
2914 2922
2915 2923 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
2916 2924 matplotlib-related fixes so that using @run with non-matplotlib
2917 2925 scripts doesn't pop up spurious plot windows. This requires
2918 2926 matplotlib >= 0.63, where I had to make some changes as well.
2919 2927
2920 2928 * IPython/ipmaker.py (make_IPython): update version requirement to
2921 2929 python 2.2.
2922 2930
2923 2931 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
2924 2932 banner arg for embedded customization.
2925 2933
2926 2934 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
2927 2935 explicit uses of __IP as the IPython's instance name. Now things
2928 2936 are properly handled via the shell.name value. The actual code
2929 2937 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
2930 2938 is much better than before. I'll clean things completely when the
2931 2939 magic stuff gets a real overhaul.
2932 2940
2933 2941 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
2934 2942 minor changes to debian dir.
2935 2943
2936 2944 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
2937 2945 pointer to the shell itself in the interactive namespace even when
2938 2946 a user-supplied dict is provided. This is needed for embedding
2939 2947 purposes (found by tests with Michel Sanner).
2940 2948
2941 2949 2004-09-27 Fernando Perez <fperez@colorado.edu>
2942 2950
2943 2951 * IPython/UserConfig/ipythonrc: remove []{} from
2944 2952 readline_remove_delims, so that things like [modname.<TAB> do
2945 2953 proper completion. This disables [].TAB, but that's a less common
2946 2954 case than module names in list comprehensions, for example.
2947 2955 Thanks to a report by Andrea Riciputi.
2948 2956
2949 2957 2004-09-09 Fernando Perez <fperez@colorado.edu>
2950 2958
2951 2959 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
2952 2960 blocking problems in win32 and osx. Fix by John.
2953 2961
2954 2962 2004-09-08 Fernando Perez <fperez@colorado.edu>
2955 2963
2956 2964 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
2957 2965 for Win32 and OSX. Fix by John Hunter.
2958 2966
2959 2967 2004-08-30 *** Released version 0.6.3
2960 2968
2961 2969 2004-08-30 Fernando Perez <fperez@colorado.edu>
2962 2970
2963 2971 * setup.py (isfile): Add manpages to list of dependent files to be
2964 2972 updated.
2965 2973
2966 2974 2004-08-27 Fernando Perez <fperez@colorado.edu>
2967 2975
2968 2976 * IPython/Shell.py (start): I've disabled -wthread and -gthread
2969 2977 for now. They don't really work with standalone WX/GTK code
2970 2978 (though matplotlib IS working fine with both of those backends).
2971 2979 This will neeed much more testing. I disabled most things with
2972 2980 comments, so turning it back on later should be pretty easy.
2973 2981
2974 2982 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
2975 2983 autocalling of expressions like r'foo', by modifying the line
2976 2984 split regexp. Closes
2977 2985 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
2978 2986 Riley <ipythonbugs-AT-sabi.net>.
2979 2987 (InteractiveShell.mainloop): honor --nobanner with banner
2980 2988 extensions.
2981 2989
2982 2990 * IPython/Shell.py: Significant refactoring of all classes, so
2983 2991 that we can really support ALL matplotlib backends and threading
2984 2992 models (John spotted a bug with Tk which required this). Now we
2985 2993 should support single-threaded, WX-threads and GTK-threads, both
2986 2994 for generic code and for matplotlib.
2987 2995
2988 2996 * IPython/ipmaker.py (__call__): Changed -mpthread option to
2989 2997 -pylab, to simplify things for users. Will also remove the pylab
2990 2998 profile, since now all of matplotlib configuration is directly
2991 2999 handled here. This also reduces startup time.
2992 3000
2993 3001 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
2994 3002 shell wasn't being correctly called. Also in IPShellWX.
2995 3003
2996 3004 * IPython/iplib.py (InteractiveShell.__init__): Added option to
2997 3005 fine-tune banner.
2998 3006
2999 3007 * IPython/numutils.py (spike): Deprecate these spike functions,
3000 3008 delete (long deprecated) gnuplot_exec handler.
3001 3009
3002 3010 2004-08-26 Fernando Perez <fperez@colorado.edu>
3003 3011
3004 3012 * ipython.1: Update for threading options, plus some others which
3005 3013 were missing.
3006 3014
3007 3015 * IPython/ipmaker.py (__call__): Added -wthread option for
3008 3016 wxpython thread handling. Make sure threading options are only
3009 3017 valid at the command line.
3010 3018
3011 3019 * scripts/ipython: moved shell selection into a factory function
3012 3020 in Shell.py, to keep the starter script to a minimum.
3013 3021
3014 3022 2004-08-25 Fernando Perez <fperez@colorado.edu>
3015 3023
3016 3024 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3017 3025 John. Along with some recent changes he made to matplotlib, the
3018 3026 next versions of both systems should work very well together.
3019 3027
3020 3028 2004-08-24 Fernando Perez <fperez@colorado.edu>
3021 3029
3022 3030 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3023 3031 tried to switch the profiling to using hotshot, but I'm getting
3024 3032 strange errors from prof.runctx() there. I may be misreading the
3025 3033 docs, but it looks weird. For now the profiling code will
3026 3034 continue to use the standard profiler.
3027 3035
3028 3036 2004-08-23 Fernando Perez <fperez@colorado.edu>
3029 3037
3030 3038 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3031 3039 threaded shell, by John Hunter. It's not quite ready yet, but
3032 3040 close.
3033 3041
3034 3042 2004-08-22 Fernando Perez <fperez@colorado.edu>
3035 3043
3036 3044 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3037 3045 in Magic and ultraTB.
3038 3046
3039 3047 * ipython.1: document threading options in manpage.
3040 3048
3041 3049 * scripts/ipython: Changed name of -thread option to -gthread,
3042 3050 since this is GTK specific. I want to leave the door open for a
3043 3051 -wthread option for WX, which will most likely be necessary. This
3044 3052 change affects usage and ipmaker as well.
3045 3053
3046 3054 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3047 3055 handle the matplotlib shell issues. Code by John Hunter
3048 3056 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3049 3057 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3050 3058 broken (and disabled for end users) for now, but it puts the
3051 3059 infrastructure in place.
3052 3060
3053 3061 2004-08-21 Fernando Perez <fperez@colorado.edu>
3054 3062
3055 3063 * ipythonrc-pylab: Add matplotlib support.
3056 3064
3057 3065 * matplotlib_config.py: new files for matplotlib support, part of
3058 3066 the pylab profile.
3059 3067
3060 3068 * IPython/usage.py (__doc__): documented the threading options.
3061 3069
3062 3070 2004-08-20 Fernando Perez <fperez@colorado.edu>
3063 3071
3064 3072 * ipython: Modified the main calling routine to handle the -thread
3065 3073 and -mpthread options. This needs to be done as a top-level hack,
3066 3074 because it determines which class to instantiate for IPython
3067 3075 itself.
3068 3076
3069 3077 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3070 3078 classes to support multithreaded GTK operation without blocking,
3071 3079 and matplotlib with all backends. This is a lot of still very
3072 3080 experimental code, and threads are tricky. So it may still have a
3073 3081 few rough edges... This code owes a lot to
3074 3082 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3075 3083 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3076 3084 to John Hunter for all the matplotlib work.
3077 3085
3078 3086 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3079 3087 options for gtk thread and matplotlib support.
3080 3088
3081 3089 2004-08-16 Fernando Perez <fperez@colorado.edu>
3082 3090
3083 3091 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3084 3092 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3085 3093 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3086 3094
3087 3095 2004-08-11 Fernando Perez <fperez@colorado.edu>
3088 3096
3089 3097 * setup.py (isfile): Fix build so documentation gets updated for
3090 3098 rpms (it was only done for .tgz builds).
3091 3099
3092 3100 2004-08-10 Fernando Perez <fperez@colorado.edu>
3093 3101
3094 3102 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3095 3103
3096 3104 * iplib.py : Silence syntax error exceptions in tab-completion.
3097 3105
3098 3106 2004-08-05 Fernando Perez <fperez@colorado.edu>
3099 3107
3100 3108 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3101 3109 'color off' mark for continuation prompts. This was causing long
3102 3110 continuation lines to mis-wrap.
3103 3111
3104 3112 2004-08-01 Fernando Perez <fperez@colorado.edu>
3105 3113
3106 3114 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3107 3115 for building ipython to be a parameter. All this is necessary
3108 3116 right now to have a multithreaded version, but this insane
3109 3117 non-design will be cleaned up soon. For now, it's a hack that
3110 3118 works.
3111 3119
3112 3120 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3113 3121 args in various places. No bugs so far, but it's a dangerous
3114 3122 practice.
3115 3123
3116 3124 2004-07-31 Fernando Perez <fperez@colorado.edu>
3117 3125
3118 3126 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3119 3127 fix completion of files with dots in their names under most
3120 3128 profiles (pysh was OK because the completion order is different).
3121 3129
3122 3130 2004-07-27 Fernando Perez <fperez@colorado.edu>
3123 3131
3124 3132 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3125 3133 keywords manually, b/c the one in keyword.py was removed in python
3126 3134 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3127 3135 This is NOT a bug under python 2.3 and earlier.
3128 3136
3129 3137 2004-07-26 Fernando Perez <fperez@colorado.edu>
3130 3138
3131 3139 * IPython/ultraTB.py (VerboseTB.text): Add another
3132 3140 linecache.checkcache() call to try to prevent inspect.py from
3133 3141 crashing under python 2.3. I think this fixes
3134 3142 http://www.scipy.net/roundup/ipython/issue17.
3135 3143
3136 3144 2004-07-26 *** Released version 0.6.2
3137 3145
3138 3146 2004-07-26 Fernando Perez <fperez@colorado.edu>
3139 3147
3140 3148 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3141 3149 fail for any number.
3142 3150 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3143 3151 empty bookmarks.
3144 3152
3145 3153 2004-07-26 *** Released version 0.6.1
3146 3154
3147 3155 2004-07-26 Fernando Perez <fperez@colorado.edu>
3148 3156
3149 3157 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3150 3158
3151 3159 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3152 3160 escaping '()[]{}' in filenames.
3153 3161
3154 3162 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3155 3163 Python 2.2 users who lack a proper shlex.split.
3156 3164
3157 3165 2004-07-19 Fernando Perez <fperez@colorado.edu>
3158 3166
3159 3167 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3160 3168 for reading readline's init file. I follow the normal chain:
3161 3169 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3162 3170 report by Mike Heeter. This closes
3163 3171 http://www.scipy.net/roundup/ipython/issue16.
3164 3172
3165 3173 2004-07-18 Fernando Perez <fperez@colorado.edu>
3166 3174
3167 3175 * IPython/iplib.py (__init__): Add better handling of '\' under
3168 3176 Win32 for filenames. After a patch by Ville.
3169 3177
3170 3178 2004-07-17 Fernando Perez <fperez@colorado.edu>
3171 3179
3172 3180 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3173 3181 autocalling would be triggered for 'foo is bar' if foo is
3174 3182 callable. I also cleaned up the autocall detection code to use a
3175 3183 regexp, which is faster. Bug reported by Alexander Schmolck.
3176 3184
3177 3185 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3178 3186 '?' in them would confuse the help system. Reported by Alex
3179 3187 Schmolck.
3180 3188
3181 3189 2004-07-16 Fernando Perez <fperez@colorado.edu>
3182 3190
3183 3191 * IPython/GnuplotInteractive.py (__all__): added plot2.
3184 3192
3185 3193 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3186 3194 plotting dictionaries, lists or tuples of 1d arrays.
3187 3195
3188 3196 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3189 3197 optimizations.
3190 3198
3191 3199 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3192 3200 the information which was there from Janko's original IPP code:
3193 3201
3194 3202 03.05.99 20:53 porto.ifm.uni-kiel.de
3195 3203 --Started changelog.
3196 3204 --make clear do what it say it does
3197 3205 --added pretty output of lines from inputcache
3198 3206 --Made Logger a mixin class, simplifies handling of switches
3199 3207 --Added own completer class. .string<TAB> expands to last history
3200 3208 line which starts with string. The new expansion is also present
3201 3209 with Ctrl-r from the readline library. But this shows, who this
3202 3210 can be done for other cases.
3203 3211 --Added convention that all shell functions should accept a
3204 3212 parameter_string This opens the door for different behaviour for
3205 3213 each function. @cd is a good example of this.
3206 3214
3207 3215 04.05.99 12:12 porto.ifm.uni-kiel.de
3208 3216 --added logfile rotation
3209 3217 --added new mainloop method which freezes first the namespace
3210 3218
3211 3219 07.05.99 21:24 porto.ifm.uni-kiel.de
3212 3220 --added the docreader classes. Now there is a help system.
3213 3221 -This is only a first try. Currently it's not easy to put new
3214 3222 stuff in the indices. But this is the way to go. Info would be
3215 3223 better, but HTML is every where and not everybody has an info
3216 3224 system installed and it's not so easy to change html-docs to info.
3217 3225 --added global logfile option
3218 3226 --there is now a hook for object inspection method pinfo needs to
3219 3227 be provided for this. Can be reached by two '??'.
3220 3228
3221 3229 08.05.99 20:51 porto.ifm.uni-kiel.de
3222 3230 --added a README
3223 3231 --bug in rc file. Something has changed so functions in the rc
3224 3232 file need to reference the shell and not self. Not clear if it's a
3225 3233 bug or feature.
3226 3234 --changed rc file for new behavior
3227 3235
3228 3236 2004-07-15 Fernando Perez <fperez@colorado.edu>
3229 3237
3230 3238 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3231 3239 cache was falling out of sync in bizarre manners when multi-line
3232 3240 input was present. Minor optimizations and cleanup.
3233 3241
3234 3242 (Logger): Remove old Changelog info for cleanup. This is the
3235 3243 information which was there from Janko's original code:
3236 3244
3237 3245 Changes to Logger: - made the default log filename a parameter
3238 3246
3239 3247 - put a check for lines beginning with !@? in log(). Needed
3240 3248 (even if the handlers properly log their lines) for mid-session
3241 3249 logging activation to work properly. Without this, lines logged
3242 3250 in mid session, which get read from the cache, would end up
3243 3251 'bare' (with !@? in the open) in the log. Now they are caught
3244 3252 and prepended with a #.
3245 3253
3246 3254 * IPython/iplib.py (InteractiveShell.init_readline): added check
3247 3255 in case MagicCompleter fails to be defined, so we don't crash.
3248 3256
3249 3257 2004-07-13 Fernando Perez <fperez@colorado.edu>
3250 3258
3251 3259 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3252 3260 of EPS if the requested filename ends in '.eps'.
3253 3261
3254 3262 2004-07-04 Fernando Perez <fperez@colorado.edu>
3255 3263
3256 3264 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3257 3265 escaping of quotes when calling the shell.
3258 3266
3259 3267 2004-07-02 Fernando Perez <fperez@colorado.edu>
3260 3268
3261 3269 * IPython/Prompts.py (CachedOutput.update): Fix problem with
3262 3270 gettext not working because we were clobbering '_'. Fixes
3263 3271 http://www.scipy.net/roundup/ipython/issue6.
3264 3272
3265 3273 2004-07-01 Fernando Perez <fperez@colorado.edu>
3266 3274
3267 3275 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
3268 3276 into @cd. Patch by Ville.
3269 3277
3270 3278 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3271 3279 new function to store things after ipmaker runs. Patch by Ville.
3272 3280 Eventually this will go away once ipmaker is removed and the class
3273 3281 gets cleaned up, but for now it's ok. Key functionality here is
3274 3282 the addition of the persistent storage mechanism, a dict for
3275 3283 keeping data across sessions (for now just bookmarks, but more can
3276 3284 be implemented later).
3277 3285
3278 3286 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
3279 3287 persistent across sections. Patch by Ville, I modified it
3280 3288 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
3281 3289 added a '-l' option to list all bookmarks.
3282 3290
3283 3291 * IPython/iplib.py (InteractiveShell.atexit_operations): new
3284 3292 center for cleanup. Registered with atexit.register(). I moved
3285 3293 here the old exit_cleanup(). After a patch by Ville.
3286 3294
3287 3295 * IPython/Magic.py (get_py_filename): added '~' to the accepted
3288 3296 characters in the hacked shlex_split for python 2.2.
3289 3297
3290 3298 * IPython/iplib.py (file_matches): more fixes to filenames with
3291 3299 whitespace in them. It's not perfect, but limitations in python's
3292 3300 readline make it impossible to go further.
3293 3301
3294 3302 2004-06-29 Fernando Perez <fperez@colorado.edu>
3295 3303
3296 3304 * IPython/iplib.py (file_matches): escape whitespace correctly in
3297 3305 filename completions. Bug reported by Ville.
3298 3306
3299 3307 2004-06-28 Fernando Perez <fperez@colorado.edu>
3300 3308
3301 3309 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
3302 3310 the history file will be called 'history-PROFNAME' (or just
3303 3311 'history' if no profile is loaded). I was getting annoyed at
3304 3312 getting my Numerical work history clobbered by pysh sessions.
3305 3313
3306 3314 * IPython/iplib.py (InteractiveShell.__init__): Internal
3307 3315 getoutputerror() function so that we can honor the system_verbose
3308 3316 flag for _all_ system calls. I also added escaping of #
3309 3317 characters here to avoid confusing Itpl.
3310 3318
3311 3319 * IPython/Magic.py (shlex_split): removed call to shell in
3312 3320 parse_options and replaced it with shlex.split(). The annoying
3313 3321 part was that in Python 2.2, shlex.split() doesn't exist, so I had
3314 3322 to backport it from 2.3, with several frail hacks (the shlex
3315 3323 module is rather limited in 2.2). Thanks to a suggestion by Ville
3316 3324 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
3317 3325 problem.
3318 3326
3319 3327 (Magic.magic_system_verbose): new toggle to print the actual
3320 3328 system calls made by ipython. Mainly for debugging purposes.
3321 3329
3322 3330 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
3323 3331 doesn't support persistence. Reported (and fix suggested) by
3324 3332 Travis Caldwell <travis_caldwell2000@yahoo.com>.
3325 3333
3326 3334 2004-06-26 Fernando Perez <fperez@colorado.edu>
3327 3335
3328 3336 * IPython/Logger.py (Logger.log): fix to handle correctly empty
3329 3337 continue prompts.
3330 3338
3331 3339 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
3332 3340 function (basically a big docstring) and a few more things here to
3333 3341 speedup startup. pysh.py is now very lightweight. We want because
3334 3342 it gets execfile'd, while InterpreterExec gets imported, so
3335 3343 byte-compilation saves time.
3336 3344
3337 3345 2004-06-25 Fernando Perez <fperez@colorado.edu>
3338 3346
3339 3347 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
3340 3348 -NUM', which was recently broken.
3341 3349
3342 3350 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
3343 3351 in multi-line input (but not !!, which doesn't make sense there).
3344 3352
3345 3353 * IPython/UserConfig/ipythonrc: made autoindent on by default.
3346 3354 It's just too useful, and people can turn it off in the less
3347 3355 common cases where it's a problem.
3348 3356
3349 3357 2004-06-24 Fernando Perez <fperez@colorado.edu>
3350 3358
3351 3359 * IPython/iplib.py (InteractiveShell._prefilter): big change -
3352 3360 special syntaxes (like alias calling) is now allied in multi-line
3353 3361 input. This is still _very_ experimental, but it's necessary for
3354 3362 efficient shell usage combining python looping syntax with system
3355 3363 calls. For now it's restricted to aliases, I don't think it
3356 3364 really even makes sense to have this for magics.
3357 3365
3358 3366 2004-06-23 Fernando Perez <fperez@colorado.edu>
3359 3367
3360 3368 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
3361 3369 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
3362 3370
3363 3371 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
3364 3372 extensions under Windows (after code sent by Gary Bishop). The
3365 3373 extensions considered 'executable' are stored in IPython's rc
3366 3374 structure as win_exec_ext.
3367 3375
3368 3376 * IPython/genutils.py (shell): new function, like system() but
3369 3377 without return value. Very useful for interactive shell work.
3370 3378
3371 3379 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
3372 3380 delete aliases.
3373 3381
3374 3382 * IPython/iplib.py (InteractiveShell.alias_table_update): make
3375 3383 sure that the alias table doesn't contain python keywords.
3376 3384
3377 3385 2004-06-21 Fernando Perez <fperez@colorado.edu>
3378 3386
3379 3387 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
3380 3388 non-existent items are found in $PATH. Reported by Thorsten.
3381 3389
3382 3390 2004-06-20 Fernando Perez <fperez@colorado.edu>
3383 3391
3384 3392 * IPython/iplib.py (complete): modified the completer so that the
3385 3393 order of priorities can be easily changed at runtime.
3386 3394
3387 3395 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
3388 3396 Modified to auto-execute all lines beginning with '~', '/' or '.'.
3389 3397
3390 3398 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
3391 3399 expand Python variables prepended with $ in all system calls. The
3392 3400 same was done to InteractiveShell.handle_shell_escape. Now all
3393 3401 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
3394 3402 expansion of python variables and expressions according to the
3395 3403 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
3396 3404
3397 3405 Though PEP-215 has been rejected, a similar (but simpler) one
3398 3406 seems like it will go into Python 2.4, PEP-292 -
3399 3407 http://www.python.org/peps/pep-0292.html.
3400 3408
3401 3409 I'll keep the full syntax of PEP-215, since IPython has since the
3402 3410 start used Ka-Ping Yee's reference implementation discussed there
3403 3411 (Itpl), and I actually like the powerful semantics it offers.
3404 3412
3405 3413 In order to access normal shell variables, the $ has to be escaped
3406 3414 via an extra $. For example:
3407 3415
3408 3416 In [7]: PATH='a python variable'
3409 3417
3410 3418 In [8]: !echo $PATH
3411 3419 a python variable
3412 3420
3413 3421 In [9]: !echo $$PATH
3414 3422 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
3415 3423
3416 3424 (Magic.parse_options): escape $ so the shell doesn't evaluate
3417 3425 things prematurely.
3418 3426
3419 3427 * IPython/iplib.py (InteractiveShell.call_alias): added the
3420 3428 ability for aliases to expand python variables via $.
3421 3429
3422 3430 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
3423 3431 system, now there's a @rehash/@rehashx pair of magics. These work
3424 3432 like the csh rehash command, and can be invoked at any time. They
3425 3433 build a table of aliases to everything in the user's $PATH
3426 3434 (@rehash uses everything, @rehashx is slower but only adds
3427 3435 executable files). With this, the pysh.py-based shell profile can
3428 3436 now simply call rehash upon startup, and full access to all
3429 3437 programs in the user's path is obtained.
3430 3438
3431 3439 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
3432 3440 functionality is now fully in place. I removed the old dynamic
3433 3441 code generation based approach, in favor of a much lighter one
3434 3442 based on a simple dict. The advantage is that this allows me to
3435 3443 now have thousands of aliases with negligible cost (unthinkable
3436 3444 with the old system).
3437 3445
3438 3446 2004-06-19 Fernando Perez <fperez@colorado.edu>
3439 3447
3440 3448 * IPython/iplib.py (__init__): extended MagicCompleter class to
3441 3449 also complete (last in priority) on user aliases.
3442 3450
3443 3451 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
3444 3452 call to eval.
3445 3453 (ItplNS.__init__): Added a new class which functions like Itpl,
3446 3454 but allows configuring the namespace for the evaluation to occur
3447 3455 in.
3448 3456
3449 3457 2004-06-18 Fernando Perez <fperez@colorado.edu>
3450 3458
3451 3459 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
3452 3460 better message when 'exit' or 'quit' are typed (a common newbie
3453 3461 confusion).
3454 3462
3455 3463 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
3456 3464 check for Windows users.
3457 3465
3458 3466 * IPython/iplib.py (InteractiveShell.user_setup): removed
3459 3467 disabling of colors for Windows. I'll test at runtime and issue a
3460 3468 warning if Gary's readline isn't found, as to nudge users to
3461 3469 download it.
3462 3470
3463 3471 2004-06-16 Fernando Perez <fperez@colorado.edu>
3464 3472
3465 3473 * IPython/genutils.py (Stream.__init__): changed to print errors
3466 3474 to sys.stderr. I had a circular dependency here. Now it's
3467 3475 possible to run ipython as IDLE's shell (consider this pre-alpha,
3468 3476 since true stdout things end up in the starting terminal instead
3469 3477 of IDLE's out).
3470 3478
3471 3479 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
3472 3480 users who haven't # updated their prompt_in2 definitions. Remove
3473 3481 eventually.
3474 3482 (multiple_replace): added credit to original ASPN recipe.
3475 3483
3476 3484 2004-06-15 Fernando Perez <fperez@colorado.edu>
3477 3485
3478 3486 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
3479 3487 list of auto-defined aliases.
3480 3488
3481 3489 2004-06-13 Fernando Perez <fperez@colorado.edu>
3482 3490
3483 3491 * setup.py (scriptfiles): Don't trigger win_post_install unless an
3484 3492 install was really requested (so setup.py can be used for other
3485 3493 things under Windows).
3486 3494
3487 3495 2004-06-10 Fernando Perez <fperez@colorado.edu>
3488 3496
3489 3497 * IPython/Logger.py (Logger.create_log): Manually remove any old
3490 3498 backup, since os.remove may fail under Windows. Fixes bug
3491 3499 reported by Thorsten.
3492 3500
3493 3501 2004-06-09 Fernando Perez <fperez@colorado.edu>
3494 3502
3495 3503 * examples/example-embed.py: fixed all references to %n (replaced
3496 3504 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
3497 3505 for all examples and the manual as well.
3498 3506
3499 3507 2004-06-08 Fernando Perez <fperez@colorado.edu>
3500 3508
3501 3509 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
3502 3510 alignment and color management. All 3 prompt subsystems now
3503 3511 inherit from BasePrompt.
3504 3512
3505 3513 * tools/release: updates for windows installer build and tag rpms
3506 3514 with python version (since paths are fixed).
3507 3515
3508 3516 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
3509 3517 which will become eventually obsolete. Also fixed the default
3510 3518 prompt_in2 to use \D, so at least new users start with the correct
3511 3519 defaults.
3512 3520 WARNING: Users with existing ipythonrc files will need to apply
3513 3521 this fix manually!
3514 3522
3515 3523 * setup.py: make windows installer (.exe). This is finally the
3516 3524 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
3517 3525 which I hadn't included because it required Python 2.3 (or recent
3518 3526 distutils).
3519 3527
3520 3528 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
3521 3529 usage of new '\D' escape.
3522 3530
3523 3531 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
3524 3532 lacks os.getuid())
3525 3533 (CachedOutput.set_colors): Added the ability to turn coloring
3526 3534 on/off with @colors even for manually defined prompt colors. It
3527 3535 uses a nasty global, but it works safely and via the generic color
3528 3536 handling mechanism.
3529 3537 (Prompt2.__init__): Introduced new escape '\D' for continuation
3530 3538 prompts. It represents the counter ('\#') as dots.
3531 3539 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
3532 3540 need to update their ipythonrc files and replace '%n' with '\D' in
3533 3541 their prompt_in2 settings everywhere. Sorry, but there's
3534 3542 otherwise no clean way to get all prompts to properly align. The
3535 3543 ipythonrc shipped with IPython has been updated.
3536 3544
3537 3545 2004-06-07 Fernando Perez <fperez@colorado.edu>
3538 3546
3539 3547 * setup.py (isfile): Pass local_icons option to latex2html, so the
3540 3548 resulting HTML file is self-contained. Thanks to
3541 3549 dryice-AT-liu.com.cn for the tip.
3542 3550
3543 3551 * pysh.py: I created a new profile 'shell', which implements a
3544 3552 _rudimentary_ IPython-based shell. This is in NO WAY a realy
3545 3553 system shell, nor will it become one anytime soon. It's mainly
3546 3554 meant to illustrate the use of the new flexible bash-like prompts.
3547 3555 I guess it could be used by hardy souls for true shell management,
3548 3556 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
3549 3557 profile. This uses the InterpreterExec extension provided by
3550 3558 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
3551 3559
3552 3560 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
3553 3561 auto-align itself with the length of the previous input prompt
3554 3562 (taking into account the invisible color escapes).
3555 3563 (CachedOutput.__init__): Large restructuring of this class. Now
3556 3564 all three prompts (primary1, primary2, output) are proper objects,
3557 3565 managed by the 'parent' CachedOutput class. The code is still a
3558 3566 bit hackish (all prompts share state via a pointer to the cache),
3559 3567 but it's overall far cleaner than before.
3560 3568
3561 3569 * IPython/genutils.py (getoutputerror): modified to add verbose,
3562 3570 debug and header options. This makes the interface of all getout*
3563 3571 functions uniform.
3564 3572 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
3565 3573
3566 3574 * IPython/Magic.py (Magic.default_option): added a function to
3567 3575 allow registering default options for any magic command. This
3568 3576 makes it easy to have profiles which customize the magics globally
3569 3577 for a certain use. The values set through this function are
3570 3578 picked up by the parse_options() method, which all magics should
3571 3579 use to parse their options.
3572 3580
3573 3581 * IPython/genutils.py (warn): modified the warnings framework to
3574 3582 use the Term I/O class. I'm trying to slowly unify all of
3575 3583 IPython's I/O operations to pass through Term.
3576 3584
3577 3585 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
3578 3586 the secondary prompt to correctly match the length of the primary
3579 3587 one for any prompt. Now multi-line code will properly line up
3580 3588 even for path dependent prompts, such as the new ones available
3581 3589 via the prompt_specials.
3582 3590
3583 3591 2004-06-06 Fernando Perez <fperez@colorado.edu>
3584 3592
3585 3593 * IPython/Prompts.py (prompt_specials): Added the ability to have
3586 3594 bash-like special sequences in the prompts, which get
3587 3595 automatically expanded. Things like hostname, current working
3588 3596 directory and username are implemented already, but it's easy to
3589 3597 add more in the future. Thanks to a patch by W.J. van der Laan
3590 3598 <gnufnork-AT-hetdigitalegat.nl>
3591 3599 (prompt_specials): Added color support for prompt strings, so
3592 3600 users can define arbitrary color setups for their prompts.
3593 3601
3594 3602 2004-06-05 Fernando Perez <fperez@colorado.edu>
3595 3603
3596 3604 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
3597 3605 code to load Gary Bishop's readline and configure it
3598 3606 automatically. Thanks to Gary for help on this.
3599 3607
3600 3608 2004-06-01 Fernando Perez <fperez@colorado.edu>
3601 3609
3602 3610 * IPython/Logger.py (Logger.create_log): fix bug for logging
3603 3611 with no filename (previous fix was incomplete).
3604 3612
3605 3613 2004-05-25 Fernando Perez <fperez@colorado.edu>
3606 3614
3607 3615 * IPython/Magic.py (Magic.parse_options): fix bug where naked
3608 3616 parens would get passed to the shell.
3609 3617
3610 3618 2004-05-20 Fernando Perez <fperez@colorado.edu>
3611 3619
3612 3620 * IPython/Magic.py (Magic.magic_prun): changed default profile
3613 3621 sort order to 'time' (the more common profiling need).
3614 3622
3615 3623 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
3616 3624 so that source code shown is guaranteed in sync with the file on
3617 3625 disk (also changed in psource). Similar fix to the one for
3618 3626 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
3619 3627 <yann.ledu-AT-noos.fr>.
3620 3628
3621 3629 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
3622 3630 with a single option would not be correctly parsed. Closes
3623 3631 http://www.scipy.net/roundup/ipython/issue14. This bug had been
3624 3632 introduced in 0.6.0 (on 2004-05-06).
3625 3633
3626 3634 2004-05-13 *** Released version 0.6.0
3627 3635
3628 3636 2004-05-13 Fernando Perez <fperez@colorado.edu>
3629 3637
3630 3638 * debian/: Added debian/ directory to CVS, so that debian support
3631 3639 is publicly accessible. The debian package is maintained by Jack
3632 3640 Moffit <jack-AT-xiph.org>.
3633 3641
3634 3642 * Documentation: included the notes about an ipython-based system
3635 3643 shell (the hypothetical 'pysh') into the new_design.pdf document,
3636 3644 so that these ideas get distributed to users along with the
3637 3645 official documentation.
3638 3646
3639 3647 2004-05-10 Fernando Perez <fperez@colorado.edu>
3640 3648
3641 3649 * IPython/Logger.py (Logger.create_log): fix recently introduced
3642 3650 bug (misindented line) where logstart would fail when not given an
3643 3651 explicit filename.
3644 3652
3645 3653 2004-05-09 Fernando Perez <fperez@colorado.edu>
3646 3654
3647 3655 * IPython/Magic.py (Magic.parse_options): skip system call when
3648 3656 there are no options to look for. Faster, cleaner for the common
3649 3657 case.
3650 3658
3651 3659 * Documentation: many updates to the manual: describing Windows
3652 3660 support better, Gnuplot updates, credits, misc small stuff. Also
3653 3661 updated the new_design doc a bit.
3654 3662
3655 3663 2004-05-06 *** Released version 0.6.0.rc1
3656 3664
3657 3665 2004-05-06 Fernando Perez <fperez@colorado.edu>
3658 3666
3659 3667 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
3660 3668 operations to use the vastly more efficient list/''.join() method.
3661 3669 (FormattedTB.text): Fix
3662 3670 http://www.scipy.net/roundup/ipython/issue12 - exception source
3663 3671 extract not updated after reload. Thanks to Mike Salib
3664 3672 <msalib-AT-mit.edu> for pinning the source of the problem.
3665 3673 Fortunately, the solution works inside ipython and doesn't require
3666 3674 any changes to python proper.
3667 3675
3668 3676 * IPython/Magic.py (Magic.parse_options): Improved to process the
3669 3677 argument list as a true shell would (by actually using the
3670 3678 underlying system shell). This way, all @magics automatically get
3671 3679 shell expansion for variables. Thanks to a comment by Alex
3672 3680 Schmolck.
3673 3681
3674 3682 2004-04-04 Fernando Perez <fperez@colorado.edu>
3675 3683
3676 3684 * IPython/iplib.py (InteractiveShell.interact): Added a special
3677 3685 trap for a debugger quit exception, which is basically impossible
3678 3686 to handle by normal mechanisms, given what pdb does to the stack.
3679 3687 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
3680 3688
3681 3689 2004-04-03 Fernando Perez <fperez@colorado.edu>
3682 3690
3683 3691 * IPython/genutils.py (Term): Standardized the names of the Term
3684 3692 class streams to cin/cout/cerr, following C++ naming conventions
3685 3693 (I can't use in/out/err because 'in' is not a valid attribute
3686 3694 name).
3687 3695
3688 3696 * IPython/iplib.py (InteractiveShell.interact): don't increment
3689 3697 the prompt if there's no user input. By Daniel 'Dang' Griffith
3690 3698 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
3691 3699 Francois Pinard.
3692 3700
3693 3701 2004-04-02 Fernando Perez <fperez@colorado.edu>
3694 3702
3695 3703 * IPython/genutils.py (Stream.__init__): Modified to survive at
3696 3704 least importing in contexts where stdin/out/err aren't true file
3697 3705 objects, such as PyCrust (they lack fileno() and mode). However,
3698 3706 the recovery facilities which rely on these things existing will
3699 3707 not work.
3700 3708
3701 3709 2004-04-01 Fernando Perez <fperez@colorado.edu>
3702 3710
3703 3711 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
3704 3712 use the new getoutputerror() function, so it properly
3705 3713 distinguishes stdout/err.
3706 3714
3707 3715 * IPython/genutils.py (getoutputerror): added a function to
3708 3716 capture separately the standard output and error of a command.
3709 3717 After a comment from dang on the mailing lists. This code is
3710 3718 basically a modified version of commands.getstatusoutput(), from
3711 3719 the standard library.
3712 3720
3713 3721 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
3714 3722 '!!' as a special syntax (shorthand) to access @sx.
3715 3723
3716 3724 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
3717 3725 command and return its output as a list split on '\n'.
3718 3726
3719 3727 2004-03-31 Fernando Perez <fperez@colorado.edu>
3720 3728
3721 3729 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
3722 3730 method to dictionaries used as FakeModule instances if they lack
3723 3731 it. At least pydoc in python2.3 breaks for runtime-defined
3724 3732 functions without this hack. At some point I need to _really_
3725 3733 understand what FakeModule is doing, because it's a gross hack.
3726 3734 But it solves Arnd's problem for now...
3727 3735
3728 3736 2004-02-27 Fernando Perez <fperez@colorado.edu>
3729 3737
3730 3738 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
3731 3739 mode would behave erratically. Also increased the number of
3732 3740 possible logs in rotate mod to 999. Thanks to Rod Holland
3733 3741 <rhh@StructureLABS.com> for the report and fixes.
3734 3742
3735 3743 2004-02-26 Fernando Perez <fperez@colorado.edu>
3736 3744
3737 3745 * IPython/genutils.py (page): Check that the curses module really
3738 3746 has the initscr attribute before trying to use it. For some
3739 3747 reason, the Solaris curses module is missing this. I think this
3740 3748 should be considered a Solaris python bug, but I'm not sure.
3741 3749
3742 3750 2004-01-17 Fernando Perez <fperez@colorado.edu>
3743 3751
3744 3752 * IPython/genutils.py (Stream.__init__): Changes to try to make
3745 3753 ipython robust against stdin/out/err being closed by the user.
3746 3754 This is 'user error' (and blocks a normal python session, at least
3747 3755 the stdout case). However, Ipython should be able to survive such
3748 3756 instances of abuse as gracefully as possible. To simplify the
3749 3757 coding and maintain compatibility with Gary Bishop's Term
3750 3758 contributions, I've made use of classmethods for this. I think
3751 3759 this introduces a dependency on python 2.2.
3752 3760
3753 3761 2004-01-13 Fernando Perez <fperez@colorado.edu>
3754 3762
3755 3763 * IPython/numutils.py (exp_safe): simplified the code a bit and
3756 3764 removed the need for importing the kinds module altogether.
3757 3765
3758 3766 2004-01-06 Fernando Perez <fperez@colorado.edu>
3759 3767
3760 3768 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
3761 3769 a magic function instead, after some community feedback. No
3762 3770 special syntax will exist for it, but its name is deliberately
3763 3771 very short.
3764 3772
3765 3773 2003-12-20 Fernando Perez <fperez@colorado.edu>
3766 3774
3767 3775 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
3768 3776 new functionality, to automagically assign the result of a shell
3769 3777 command to a variable. I'll solicit some community feedback on
3770 3778 this before making it permanent.
3771 3779
3772 3780 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
3773 3781 requested about callables for which inspect couldn't obtain a
3774 3782 proper argspec. Thanks to a crash report sent by Etienne
3775 3783 Posthumus <etienne-AT-apple01.cs.vu.nl>.
3776 3784
3777 3785 2003-12-09 Fernando Perez <fperez@colorado.edu>
3778 3786
3779 3787 * IPython/genutils.py (page): patch for the pager to work across
3780 3788 various versions of Windows. By Gary Bishop.
3781 3789
3782 3790 2003-12-04 Fernando Perez <fperez@colorado.edu>
3783 3791
3784 3792 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
3785 3793 Gnuplot.py version 1.7, whose internal names changed quite a bit.
3786 3794 While I tested this and it looks ok, there may still be corner
3787 3795 cases I've missed.
3788 3796
3789 3797 2003-12-01 Fernando Perez <fperez@colorado.edu>
3790 3798
3791 3799 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
3792 3800 where a line like 'p,q=1,2' would fail because the automagic
3793 3801 system would be triggered for @p.
3794 3802
3795 3803 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
3796 3804 cleanups, code unmodified.
3797 3805
3798 3806 * IPython/genutils.py (Term): added a class for IPython to handle
3799 3807 output. In most cases it will just be a proxy for stdout/err, but
3800 3808 having this allows modifications to be made for some platforms,
3801 3809 such as handling color escapes under Windows. All of this code
3802 3810 was contributed by Gary Bishop, with minor modifications by me.
3803 3811 The actual changes affect many files.
3804 3812
3805 3813 2003-11-30 Fernando Perez <fperez@colorado.edu>
3806 3814
3807 3815 * IPython/iplib.py (file_matches): new completion code, courtesy
3808 3816 of Jeff Collins. This enables filename completion again under
3809 3817 python 2.3, which disabled it at the C level.
3810 3818
3811 3819 2003-11-11 Fernando Perez <fperez@colorado.edu>
3812 3820
3813 3821 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
3814 3822 for Numeric.array(map(...)), but often convenient.
3815 3823
3816 3824 2003-11-05 Fernando Perez <fperez@colorado.edu>
3817 3825
3818 3826 * IPython/numutils.py (frange): Changed a call from int() to
3819 3827 int(round()) to prevent a problem reported with arange() in the
3820 3828 numpy list.
3821 3829
3822 3830 2003-10-06 Fernando Perez <fperez@colorado.edu>
3823 3831
3824 3832 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
3825 3833 prevent crashes if sys lacks an argv attribute (it happens with
3826 3834 embedded interpreters which build a bare-bones sys module).
3827 3835 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
3828 3836
3829 3837 2003-09-24 Fernando Perez <fperez@colorado.edu>
3830 3838
3831 3839 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
3832 3840 to protect against poorly written user objects where __getattr__
3833 3841 raises exceptions other than AttributeError. Thanks to a bug
3834 3842 report by Oliver Sander <osander-AT-gmx.de>.
3835 3843
3836 3844 * IPython/FakeModule.py (FakeModule.__repr__): this method was
3837 3845 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
3838 3846
3839 3847 2003-09-09 Fernando Perez <fperez@colorado.edu>
3840 3848
3841 3849 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3842 3850 unpacking a list whith a callable as first element would
3843 3851 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
3844 3852 Collins.
3845 3853
3846 3854 2003-08-25 *** Released version 0.5.0
3847 3855
3848 3856 2003-08-22 Fernando Perez <fperez@colorado.edu>
3849 3857
3850 3858 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
3851 3859 improperly defined user exceptions. Thanks to feedback from Mark
3852 3860 Russell <mrussell-AT-verio.net>.
3853 3861
3854 3862 2003-08-20 Fernando Perez <fperez@colorado.edu>
3855 3863
3856 3864 * IPython/OInspect.py (Inspector.pinfo): changed String Form
3857 3865 printing so that it would print multi-line string forms starting
3858 3866 with a new line. This way the formatting is better respected for
3859 3867 objects which work hard to make nice string forms.
3860 3868
3861 3869 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
3862 3870 autocall would overtake data access for objects with both
3863 3871 __getitem__ and __call__.
3864 3872
3865 3873 2003-08-19 *** Released version 0.5.0-rc1
3866 3874
3867 3875 2003-08-19 Fernando Perez <fperez@colorado.edu>
3868 3876
3869 3877 * IPython/deep_reload.py (load_tail): single tiny change here
3870 3878 seems to fix the long-standing bug of dreload() failing to work
3871 3879 for dotted names. But this module is pretty tricky, so I may have
3872 3880 missed some subtlety. Needs more testing!.
3873 3881
3874 3882 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
3875 3883 exceptions which have badly implemented __str__ methods.
3876 3884 (VerboseTB.text): harden against inspect.getinnerframes crashing,
3877 3885 which I've been getting reports about from Python 2.3 users. I
3878 3886 wish I had a simple test case to reproduce the problem, so I could
3879 3887 either write a cleaner workaround or file a bug report if
3880 3888 necessary.
3881 3889
3882 3890 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
3883 3891 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
3884 3892 a bug report by Tjabo Kloppenburg.
3885 3893
3886 3894 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
3887 3895 crashes. Wrapped the pdb call in a blanket try/except, since pdb
3888 3896 seems rather unstable. Thanks to a bug report by Tjabo
3889 3897 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
3890 3898
3891 3899 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
3892 3900 this out soon because of the critical fixes in the inner loop for
3893 3901 generators.
3894 3902
3895 3903 * IPython/Magic.py (Magic.getargspec): removed. This (and
3896 3904 _get_def) have been obsoleted by OInspect for a long time, I
3897 3905 hadn't noticed that they were dead code.
3898 3906 (Magic._ofind): restored _ofind functionality for a few literals
3899 3907 (those in ["''",'""','[]','{}','()']). But it won't work anymore
3900 3908 for things like "hello".capitalize?, since that would require a
3901 3909 potentially dangerous eval() again.
3902 3910
3903 3911 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
3904 3912 logic a bit more to clean up the escapes handling and minimize the
3905 3913 use of _ofind to only necessary cases. The interactive 'feel' of
3906 3914 IPython should have improved quite a bit with the changes in
3907 3915 _prefilter and _ofind (besides being far safer than before).
3908 3916
3909 3917 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
3910 3918 obscure, never reported). Edit would fail to find the object to
3911 3919 edit under some circumstances.
3912 3920 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
3913 3921 which were causing double-calling of generators. Those eval calls
3914 3922 were _very_ dangerous, since code with side effects could be
3915 3923 triggered. As they say, 'eval is evil'... These were the
3916 3924 nastiest evals in IPython. Besides, _ofind is now far simpler,
3917 3925 and it should also be quite a bit faster. Its use of inspect is
3918 3926 also safer, so perhaps some of the inspect-related crashes I've
3919 3927 seen lately with Python 2.3 might be taken care of. That will
3920 3928 need more testing.
3921 3929
3922 3930 2003-08-17 Fernando Perez <fperez@colorado.edu>
3923 3931
3924 3932 * IPython/iplib.py (InteractiveShell._prefilter): significant
3925 3933 simplifications to the logic for handling user escapes. Faster
3926 3934 and simpler code.
3927 3935
3928 3936 2003-08-14 Fernando Perez <fperez@colorado.edu>
3929 3937
3930 3938 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
3931 3939 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
3932 3940 but it should be quite a bit faster. And the recursive version
3933 3941 generated O(log N) intermediate storage for all rank>1 arrays,
3934 3942 even if they were contiguous.
3935 3943 (l1norm): Added this function.
3936 3944 (norm): Added this function for arbitrary norms (including
3937 3945 l-infinity). l1 and l2 are still special cases for convenience
3938 3946 and speed.
3939 3947
3940 3948 2003-08-03 Fernando Perez <fperez@colorado.edu>
3941 3949
3942 3950 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
3943 3951 exceptions, which now raise PendingDeprecationWarnings in Python
3944 3952 2.3. There were some in Magic and some in Gnuplot2.
3945 3953
3946 3954 2003-06-30 Fernando Perez <fperez@colorado.edu>
3947 3955
3948 3956 * IPython/genutils.py (page): modified to call curses only for
3949 3957 terminals where TERM=='xterm'. After problems under many other
3950 3958 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
3951 3959
3952 3960 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
3953 3961 would be triggered when readline was absent. This was just an old
3954 3962 debugging statement I'd forgotten to take out.
3955 3963
3956 3964 2003-06-20 Fernando Perez <fperez@colorado.edu>
3957 3965
3958 3966 * IPython/genutils.py (clock): modified to return only user time
3959 3967 (not counting system time), after a discussion on scipy. While
3960 3968 system time may be a useful quantity occasionally, it may much
3961 3969 more easily be skewed by occasional swapping or other similar
3962 3970 activity.
3963 3971
3964 3972 2003-06-05 Fernando Perez <fperez@colorado.edu>
3965 3973
3966 3974 * IPython/numutils.py (identity): new function, for building
3967 3975 arbitrary rank Kronecker deltas (mostly backwards compatible with
3968 3976 Numeric.identity)
3969 3977
3970 3978 2003-06-03 Fernando Perez <fperez@colorado.edu>
3971 3979
3972 3980 * IPython/iplib.py (InteractiveShell.handle_magic): protect
3973 3981 arguments passed to magics with spaces, to allow trailing '\' to
3974 3982 work normally (mainly for Windows users).
3975 3983
3976 3984 2003-05-29 Fernando Perez <fperez@colorado.edu>
3977 3985
3978 3986 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
3979 3987 instead of pydoc.help. This fixes a bizarre behavior where
3980 3988 printing '%s' % locals() would trigger the help system. Now
3981 3989 ipython behaves like normal python does.
3982 3990
3983 3991 Note that if one does 'from pydoc import help', the bizarre
3984 3992 behavior returns, but this will also happen in normal python, so
3985 3993 it's not an ipython bug anymore (it has to do with how pydoc.help
3986 3994 is implemented).
3987 3995
3988 3996 2003-05-22 Fernando Perez <fperez@colorado.edu>
3989 3997
3990 3998 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
3991 3999 return [] instead of None when nothing matches, also match to end
3992 4000 of line. Patch by Gary Bishop.
3993 4001
3994 4002 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
3995 4003 protection as before, for files passed on the command line. This
3996 4004 prevents the CrashHandler from kicking in if user files call into
3997 4005 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
3998 4006 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
3999 4007
4000 4008 2003-05-20 *** Released version 0.4.0
4001 4009
4002 4010 2003-05-20 Fernando Perez <fperez@colorado.edu>
4003 4011
4004 4012 * setup.py: added support for manpages. It's a bit hackish b/c of
4005 4013 a bug in the way the bdist_rpm distutils target handles gzipped
4006 4014 manpages, but it works. After a patch by Jack.
4007 4015
4008 4016 2003-05-19 Fernando Perez <fperez@colorado.edu>
4009 4017
4010 4018 * IPython/numutils.py: added a mockup of the kinds module, since
4011 4019 it was recently removed from Numeric. This way, numutils will
4012 4020 work for all users even if they are missing kinds.
4013 4021
4014 4022 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4015 4023 failure, which can occur with SWIG-wrapped extensions. After a
4016 4024 crash report from Prabhu.
4017 4025
4018 4026 2003-05-16 Fernando Perez <fperez@colorado.edu>
4019 4027
4020 4028 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4021 4029 protect ipython from user code which may call directly
4022 4030 sys.excepthook (this looks like an ipython crash to the user, even
4023 4031 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4024 4032 This is especially important to help users of WxWindows, but may
4025 4033 also be useful in other cases.
4026 4034
4027 4035 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4028 4036 an optional tb_offset to be specified, and to preserve exception
4029 4037 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4030 4038
4031 4039 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4032 4040
4033 4041 2003-05-15 Fernando Perez <fperez@colorado.edu>
4034 4042
4035 4043 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4036 4044 installing for a new user under Windows.
4037 4045
4038 4046 2003-05-12 Fernando Perez <fperez@colorado.edu>
4039 4047
4040 4048 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4041 4049 handler for Emacs comint-based lines. Currently it doesn't do
4042 4050 much (but importantly, it doesn't update the history cache). In
4043 4051 the future it may be expanded if Alex needs more functionality
4044 4052 there.
4045 4053
4046 4054 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4047 4055 info to crash reports.
4048 4056
4049 4057 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4050 4058 just like Python's -c. Also fixed crash with invalid -color
4051 4059 option value at startup. Thanks to Will French
4052 4060 <wfrench-AT-bestweb.net> for the bug report.
4053 4061
4054 4062 2003-05-09 Fernando Perez <fperez@colorado.edu>
4055 4063
4056 4064 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4057 4065 to EvalDict (it's a mapping, after all) and simplified its code
4058 4066 quite a bit, after a nice discussion on c.l.py where Gustavo
4059 4067 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4060 4068
4061 4069 2003-04-30 Fernando Perez <fperez@colorado.edu>
4062 4070
4063 4071 * IPython/genutils.py (timings_out): modified it to reduce its
4064 4072 overhead in the common reps==1 case.
4065 4073
4066 4074 2003-04-29 Fernando Perez <fperez@colorado.edu>
4067 4075
4068 4076 * IPython/genutils.py (timings_out): Modified to use the resource
4069 4077 module, which avoids the wraparound problems of time.clock().
4070 4078
4071 4079 2003-04-17 *** Released version 0.2.15pre4
4072 4080
4073 4081 2003-04-17 Fernando Perez <fperez@colorado.edu>
4074 4082
4075 4083 * setup.py (scriptfiles): Split windows-specific stuff over to a
4076 4084 separate file, in an attempt to have a Windows GUI installer.
4077 4085 That didn't work, but part of the groundwork is done.
4078 4086
4079 4087 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4080 4088 indent/unindent with 4 spaces. Particularly useful in combination
4081 4089 with the new auto-indent option.
4082 4090
4083 4091 2003-04-16 Fernando Perez <fperez@colorado.edu>
4084 4092
4085 4093 * IPython/Magic.py: various replacements of self.rc for
4086 4094 self.shell.rc. A lot more remains to be done to fully disentangle
4087 4095 this class from the main Shell class.
4088 4096
4089 4097 * IPython/GnuplotRuntime.py: added checks for mouse support so
4090 4098 that we don't try to enable it if the current gnuplot doesn't
4091 4099 really support it. Also added checks so that we don't try to
4092 4100 enable persist under Windows (where Gnuplot doesn't recognize the
4093 4101 option).
4094 4102
4095 4103 * IPython/iplib.py (InteractiveShell.interact): Added optional
4096 4104 auto-indenting code, after a patch by King C. Shu
4097 4105 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4098 4106 get along well with pasting indented code. If I ever figure out
4099 4107 how to make that part go well, it will become on by default.
4100 4108
4101 4109 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4102 4110 crash ipython if there was an unmatched '%' in the user's prompt
4103 4111 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4104 4112
4105 4113 * IPython/iplib.py (InteractiveShell.interact): removed the
4106 4114 ability to ask the user whether he wants to crash or not at the
4107 4115 'last line' exception handler. Calling functions at that point
4108 4116 changes the stack, and the error reports would have incorrect
4109 4117 tracebacks.
4110 4118
4111 4119 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4112 4120 pass through a peger a pretty-printed form of any object. After a
4113 4121 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4114 4122
4115 4123 2003-04-14 Fernando Perez <fperez@colorado.edu>
4116 4124
4117 4125 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4118 4126 all files in ~ would be modified at first install (instead of
4119 4127 ~/.ipython). This could be potentially disastrous, as the
4120 4128 modification (make line-endings native) could damage binary files.
4121 4129
4122 4130 2003-04-10 Fernando Perez <fperez@colorado.edu>
4123 4131
4124 4132 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4125 4133 handle only lines which are invalid python. This now means that
4126 4134 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4127 4135 for the bug report.
4128 4136
4129 4137 2003-04-01 Fernando Perez <fperez@colorado.edu>
4130 4138
4131 4139 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4132 4140 where failing to set sys.last_traceback would crash pdb.pm().
4133 4141 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4134 4142 report.
4135 4143
4136 4144 2003-03-25 Fernando Perez <fperez@colorado.edu>
4137 4145
4138 4146 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4139 4147 before printing it (it had a lot of spurious blank lines at the
4140 4148 end).
4141 4149
4142 4150 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4143 4151 output would be sent 21 times! Obviously people don't use this
4144 4152 too often, or I would have heard about it.
4145 4153
4146 4154 2003-03-24 Fernando Perez <fperez@colorado.edu>
4147 4155
4148 4156 * setup.py (scriptfiles): renamed the data_files parameter from
4149 4157 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4150 4158 for the patch.
4151 4159
4152 4160 2003-03-20 Fernando Perez <fperez@colorado.edu>
4153 4161
4154 4162 * IPython/genutils.py (error): added error() and fatal()
4155 4163 functions.
4156 4164
4157 4165 2003-03-18 *** Released version 0.2.15pre3
4158 4166
4159 4167 2003-03-18 Fernando Perez <fperez@colorado.edu>
4160 4168
4161 4169 * setupext/install_data_ext.py
4162 4170 (install_data_ext.initialize_options): Class contributed by Jack
4163 4171 Moffit for fixing the old distutils hack. He is sending this to
4164 4172 the distutils folks so in the future we may not need it as a
4165 4173 private fix.
4166 4174
4167 4175 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4168 4176 changes for Debian packaging. See his patch for full details.
4169 4177 The old distutils hack of making the ipythonrc* files carry a
4170 4178 bogus .py extension is gone, at last. Examples were moved to a
4171 4179 separate subdir under doc/, and the separate executable scripts
4172 4180 now live in their own directory. Overall a great cleanup. The
4173 4181 manual was updated to use the new files, and setup.py has been
4174 4182 fixed for this setup.
4175 4183
4176 4184 * IPython/PyColorize.py (Parser.usage): made non-executable and
4177 4185 created a pycolor wrapper around it to be included as a script.
4178 4186
4179 4187 2003-03-12 *** Released version 0.2.15pre2
4180 4188
4181 4189 2003-03-12 Fernando Perez <fperez@colorado.edu>
4182 4190
4183 4191 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4184 4192 long-standing problem with garbage characters in some terminals.
4185 4193 The issue was really that the \001 and \002 escapes must _only_ be
4186 4194 passed to input prompts (which call readline), but _never_ to
4187 4195 normal text to be printed on screen. I changed ColorANSI to have
4188 4196 two classes: TermColors and InputTermColors, each with the
4189 4197 appropriate escapes for input prompts or normal text. The code in
4190 4198 Prompts.py got slightly more complicated, but this very old and
4191 4199 annoying bug is finally fixed.
4192 4200
4193 4201 All the credit for nailing down the real origin of this problem
4194 4202 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4195 4203 *Many* thanks to him for spending quite a bit of effort on this.
4196 4204
4197 4205 2003-03-05 *** Released version 0.2.15pre1
4198 4206
4199 4207 2003-03-03 Fernando Perez <fperez@colorado.edu>
4200 4208
4201 4209 * IPython/FakeModule.py: Moved the former _FakeModule to a
4202 4210 separate file, because it's also needed by Magic (to fix a similar
4203 4211 pickle-related issue in @run).
4204 4212
4205 4213 2003-03-02 Fernando Perez <fperez@colorado.edu>
4206 4214
4207 4215 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4208 4216 the autocall option at runtime.
4209 4217 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4210 4218 across Magic.py to start separating Magic from InteractiveShell.
4211 4219 (Magic._ofind): Fixed to return proper namespace for dotted
4212 4220 names. Before, a dotted name would always return 'not currently
4213 4221 defined', because it would find the 'parent'. s.x would be found,
4214 4222 but since 'x' isn't defined by itself, it would get confused.
4215 4223 (Magic.magic_run): Fixed pickling problems reported by Ralf
4216 4224 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4217 4225 that I'd used when Mike Heeter reported similar issues at the
4218 4226 top-level, but now for @run. It boils down to injecting the
4219 4227 namespace where code is being executed with something that looks
4220 4228 enough like a module to fool pickle.dump(). Since a pickle stores
4221 4229 a named reference to the importing module, we need this for
4222 4230 pickles to save something sensible.
4223 4231
4224 4232 * IPython/ipmaker.py (make_IPython): added an autocall option.
4225 4233
4226 4234 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4227 4235 the auto-eval code. Now autocalling is an option, and the code is
4228 4236 also vastly safer. There is no more eval() involved at all.
4229 4237
4230 4238 2003-03-01 Fernando Perez <fperez@colorado.edu>
4231 4239
4232 4240 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4233 4241 dict with named keys instead of a tuple.
4234 4242
4235 4243 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4236 4244
4237 4245 * setup.py (make_shortcut): Fixed message about directories
4238 4246 created during Windows installation (the directories were ok, just
4239 4247 the printed message was misleading). Thanks to Chris Liechti
4240 4248 <cliechti-AT-gmx.net> for the heads up.
4241 4249
4242 4250 2003-02-21 Fernando Perez <fperez@colorado.edu>
4243 4251
4244 4252 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4245 4253 of ValueError exception when checking for auto-execution. This
4246 4254 one is raised by things like Numeric arrays arr.flat when the
4247 4255 array is non-contiguous.
4248 4256
4249 4257 2003-01-31 Fernando Perez <fperez@colorado.edu>
4250 4258
4251 4259 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4252 4260 not return any value at all (even though the command would get
4253 4261 executed).
4254 4262 (xsys): Flush stdout right after printing the command to ensure
4255 4263 proper ordering of commands and command output in the total
4256 4264 output.
4257 4265 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4258 4266 system/getoutput as defaults. The old ones are kept for
4259 4267 compatibility reasons, so no code which uses this library needs
4260 4268 changing.
4261 4269
4262 4270 2003-01-27 *** Released version 0.2.14
4263 4271
4264 4272 2003-01-25 Fernando Perez <fperez@colorado.edu>
4265 4273
4266 4274 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
4267 4275 functions defined in previous edit sessions could not be re-edited
4268 4276 (because the temp files were immediately removed). Now temp files
4269 4277 are removed only at IPython's exit.
4270 4278 (Magic.magic_run): Improved @run to perform shell-like expansions
4271 4279 on its arguments (~users and $VARS). With this, @run becomes more
4272 4280 like a normal command-line.
4273 4281
4274 4282 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
4275 4283 bugs related to embedding and cleaned up that code. A fairly
4276 4284 important one was the impossibility to access the global namespace
4277 4285 through the embedded IPython (only local variables were visible).
4278 4286
4279 4287 2003-01-14 Fernando Perez <fperez@colorado.edu>
4280 4288
4281 4289 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
4282 4290 auto-calling to be a bit more conservative. Now it doesn't get
4283 4291 triggered if any of '!=()<>' are in the rest of the input line, to
4284 4292 allow comparing callables. Thanks to Alex for the heads up.
4285 4293
4286 4294 2003-01-07 Fernando Perez <fperez@colorado.edu>
4287 4295
4288 4296 * IPython/genutils.py (page): fixed estimation of the number of
4289 4297 lines in a string to be paged to simply count newlines. This
4290 4298 prevents over-guessing due to embedded escape sequences. A better
4291 4299 long-term solution would involve stripping out the control chars
4292 4300 for the count, but it's potentially so expensive I just don't
4293 4301 think it's worth doing.
4294 4302
4295 4303 2002-12-19 *** Released version 0.2.14pre50
4296 4304
4297 4305 2002-12-19 Fernando Perez <fperez@colorado.edu>
4298 4306
4299 4307 * tools/release (version): Changed release scripts to inform
4300 4308 Andrea and build a NEWS file with a list of recent changes.
4301 4309
4302 4310 * IPython/ColorANSI.py (__all__): changed terminal detection
4303 4311 code. Seems to work better for xterms without breaking
4304 4312 konsole. Will need more testing to determine if WinXP and Mac OSX
4305 4313 also work ok.
4306 4314
4307 4315 2002-12-18 *** Released version 0.2.14pre49
4308 4316
4309 4317 2002-12-18 Fernando Perez <fperez@colorado.edu>
4310 4318
4311 4319 * Docs: added new info about Mac OSX, from Andrea.
4312 4320
4313 4321 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
4314 4322 allow direct plotting of python strings whose format is the same
4315 4323 of gnuplot data files.
4316 4324
4317 4325 2002-12-16 Fernando Perez <fperez@colorado.edu>
4318 4326
4319 4327 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
4320 4328 value of exit question to be acknowledged.
4321 4329
4322 4330 2002-12-03 Fernando Perez <fperez@colorado.edu>
4323 4331
4324 4332 * IPython/ipmaker.py: removed generators, which had been added
4325 4333 by mistake in an earlier debugging run. This was causing trouble
4326 4334 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
4327 4335 for pointing this out.
4328 4336
4329 4337 2002-11-17 Fernando Perez <fperez@colorado.edu>
4330 4338
4331 4339 * Manual: updated the Gnuplot section.
4332 4340
4333 4341 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
4334 4342 a much better split of what goes in Runtime and what goes in
4335 4343 Interactive.
4336 4344
4337 4345 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
4338 4346 being imported from iplib.
4339 4347
4340 4348 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
4341 4349 for command-passing. Now the global Gnuplot instance is called
4342 4350 'gp' instead of 'g', which was really a far too fragile and
4343 4351 common name.
4344 4352
4345 4353 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
4346 4354 bounding boxes generated by Gnuplot for square plots.
4347 4355
4348 4356 * IPython/genutils.py (popkey): new function added. I should
4349 4357 suggest this on c.l.py as a dict method, it seems useful.
4350 4358
4351 4359 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
4352 4360 to transparently handle PostScript generation. MUCH better than
4353 4361 the previous plot_eps/replot_eps (which I removed now). The code
4354 4362 is also fairly clean and well documented now (including
4355 4363 docstrings).
4356 4364
4357 4365 2002-11-13 Fernando Perez <fperez@colorado.edu>
4358 4366
4359 4367 * IPython/Magic.py (Magic.magic_edit): fixed docstring
4360 4368 (inconsistent with options).
4361 4369
4362 4370 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
4363 4371 manually disabled, I don't know why. Fixed it.
4364 4372 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
4365 4373 eps output.
4366 4374
4367 4375 2002-11-12 Fernando Perez <fperez@colorado.edu>
4368 4376
4369 4377 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
4370 4378 don't propagate up to caller. Fixes crash reported by François
4371 4379 Pinard.
4372 4380
4373 4381 2002-11-09 Fernando Perez <fperez@colorado.edu>
4374 4382
4375 4383 * IPython/ipmaker.py (make_IPython): fixed problem with writing
4376 4384 history file for new users.
4377 4385 (make_IPython): fixed bug where initial install would leave the
4378 4386 user running in the .ipython dir.
4379 4387 (make_IPython): fixed bug where config dir .ipython would be
4380 4388 created regardless of the given -ipythondir option. Thanks to Cory
4381 4389 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
4382 4390
4383 4391 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
4384 4392 type confirmations. Will need to use it in all of IPython's code
4385 4393 consistently.
4386 4394
4387 4395 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
4388 4396 context to print 31 lines instead of the default 5. This will make
4389 4397 the crash reports extremely detailed in case the problem is in
4390 4398 libraries I don't have access to.
4391 4399
4392 4400 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
4393 4401 line of defense' code to still crash, but giving users fair
4394 4402 warning. I don't want internal errors to go unreported: if there's
4395 4403 an internal problem, IPython should crash and generate a full
4396 4404 report.
4397 4405
4398 4406 2002-11-08 Fernando Perez <fperez@colorado.edu>
4399 4407
4400 4408 * IPython/iplib.py (InteractiveShell.interact): added code to trap
4401 4409 otherwise uncaught exceptions which can appear if people set
4402 4410 sys.stdout to something badly broken. Thanks to a crash report
4403 4411 from henni-AT-mail.brainbot.com.
4404 4412
4405 4413 2002-11-04 Fernando Perez <fperez@colorado.edu>
4406 4414
4407 4415 * IPython/iplib.py (InteractiveShell.interact): added
4408 4416 __IPYTHON__active to the builtins. It's a flag which goes on when
4409 4417 the interaction starts and goes off again when it stops. This
4410 4418 allows embedding code to detect being inside IPython. Before this
4411 4419 was done via __IPYTHON__, but that only shows that an IPython
4412 4420 instance has been created.
4413 4421
4414 4422 * IPython/Magic.py (Magic.magic_env): I realized that in a
4415 4423 UserDict, instance.data holds the data as a normal dict. So I
4416 4424 modified @env to return os.environ.data instead of rebuilding a
4417 4425 dict by hand.
4418 4426
4419 4427 2002-11-02 Fernando Perez <fperez@colorado.edu>
4420 4428
4421 4429 * IPython/genutils.py (warn): changed so that level 1 prints no
4422 4430 header. Level 2 is now the default (with 'WARNING' header, as
4423 4431 before). I think I tracked all places where changes were needed in
4424 4432 IPython, but outside code using the old level numbering may have
4425 4433 broken.
4426 4434
4427 4435 * IPython/iplib.py (InteractiveShell.runcode): added this to
4428 4436 handle the tracebacks in SystemExit traps correctly. The previous
4429 4437 code (through interact) was printing more of the stack than
4430 4438 necessary, showing IPython internal code to the user.
4431 4439
4432 4440 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
4433 4441 default. Now that the default at the confirmation prompt is yes,
4434 4442 it's not so intrusive. François' argument that ipython sessions
4435 4443 tend to be complex enough not to lose them from an accidental C-d,
4436 4444 is a valid one.
4437 4445
4438 4446 * IPython/iplib.py (InteractiveShell.interact): added a
4439 4447 showtraceback() call to the SystemExit trap, and modified the exit
4440 4448 confirmation to have yes as the default.
4441 4449
4442 4450 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
4443 4451 this file. It's been gone from the code for a long time, this was
4444 4452 simply leftover junk.
4445 4453
4446 4454 2002-11-01 Fernando Perez <fperez@colorado.edu>
4447 4455
4448 4456 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
4449 4457 added. If set, IPython now traps EOF and asks for
4450 4458 confirmation. After a request by François Pinard.
4451 4459
4452 4460 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
4453 4461 of @abort, and with a new (better) mechanism for handling the
4454 4462 exceptions.
4455 4463
4456 4464 2002-10-27 Fernando Perez <fperez@colorado.edu>
4457 4465
4458 4466 * IPython/usage.py (__doc__): updated the --help information and
4459 4467 the ipythonrc file to indicate that -log generates
4460 4468 ./ipython.log. Also fixed the corresponding info in @logstart.
4461 4469 This and several other fixes in the manuals thanks to reports by
4462 4470 François Pinard <pinard-AT-iro.umontreal.ca>.
4463 4471
4464 4472 * IPython/Logger.py (Logger.switch_log): Fixed error message to
4465 4473 refer to @logstart (instead of @log, which doesn't exist).
4466 4474
4467 4475 * IPython/iplib.py (InteractiveShell._prefilter): fixed
4468 4476 AttributeError crash. Thanks to Christopher Armstrong
4469 4477 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
4470 4478 introduced recently (in 0.2.14pre37) with the fix to the eval
4471 4479 problem mentioned below.
4472 4480
4473 4481 2002-10-17 Fernando Perez <fperez@colorado.edu>
4474 4482
4475 4483 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
4476 4484 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
4477 4485
4478 4486 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
4479 4487 this function to fix a problem reported by Alex Schmolck. He saw
4480 4488 it with list comprehensions and generators, which were getting
4481 4489 called twice. The real problem was an 'eval' call in testing for
4482 4490 automagic which was evaluating the input line silently.
4483 4491
4484 4492 This is a potentially very nasty bug, if the input has side
4485 4493 effects which must not be repeated. The code is much cleaner now,
4486 4494 without any blanket 'except' left and with a regexp test for
4487 4495 actual function names.
4488 4496
4489 4497 But an eval remains, which I'm not fully comfortable with. I just
4490 4498 don't know how to find out if an expression could be a callable in
4491 4499 the user's namespace without doing an eval on the string. However
4492 4500 that string is now much more strictly checked so that no code
4493 4501 slips by, so the eval should only happen for things that can
4494 4502 really be only function/method names.
4495 4503
4496 4504 2002-10-15 Fernando Perez <fperez@colorado.edu>
4497 4505
4498 4506 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
4499 4507 OSX information to main manual, removed README_Mac_OSX file from
4500 4508 distribution. Also updated credits for recent additions.
4501 4509
4502 4510 2002-10-10 Fernando Perez <fperez@colorado.edu>
4503 4511
4504 4512 * README_Mac_OSX: Added a README for Mac OSX users for fixing
4505 4513 terminal-related issues. Many thanks to Andrea Riciputi
4506 4514 <andrea.riciputi-AT-libero.it> for writing it.
4507 4515
4508 4516 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
4509 4517 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4510 4518
4511 4519 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
4512 4520 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
4513 4521 <syver-en-AT-online.no> who both submitted patches for this problem.
4514 4522
4515 4523 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
4516 4524 global embedding to make sure that things don't overwrite user
4517 4525 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
4518 4526
4519 4527 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
4520 4528 compatibility. Thanks to Hayden Callow
4521 4529 <h.callow-AT-elec.canterbury.ac.nz>
4522 4530
4523 4531 2002-10-04 Fernando Perez <fperez@colorado.edu>
4524 4532
4525 4533 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
4526 4534 Gnuplot.File objects.
4527 4535
4528 4536 2002-07-23 Fernando Perez <fperez@colorado.edu>
4529 4537
4530 4538 * IPython/genutils.py (timing): Added timings() and timing() for
4531 4539 quick access to the most commonly needed data, the execution
4532 4540 times. Old timing() renamed to timings_out().
4533 4541
4534 4542 2002-07-18 Fernando Perez <fperez@colorado.edu>
4535 4543
4536 4544 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
4537 4545 bug with nested instances disrupting the parent's tab completion.
4538 4546
4539 4547 * IPython/iplib.py (all_completions): Added Alex Schmolck's
4540 4548 all_completions code to begin the emacs integration.
4541 4549
4542 4550 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
4543 4551 argument to allow titling individual arrays when plotting.
4544 4552
4545 4553 2002-07-15 Fernando Perez <fperez@colorado.edu>
4546 4554
4547 4555 * setup.py (make_shortcut): changed to retrieve the value of
4548 4556 'Program Files' directory from the registry (this value changes in
4549 4557 non-english versions of Windows). Thanks to Thomas Fanslau
4550 4558 <tfanslau-AT-gmx.de> for the report.
4551 4559
4552 4560 2002-07-10 Fernando Perez <fperez@colorado.edu>
4553 4561
4554 4562 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
4555 4563 a bug in pdb, which crashes if a line with only whitespace is
4556 4564 entered. Bug report submitted to sourceforge.
4557 4565
4558 4566 2002-07-09 Fernando Perez <fperez@colorado.edu>
4559 4567
4560 4568 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
4561 4569 reporting exceptions (it's a bug in inspect.py, I just set a
4562 4570 workaround).
4563 4571
4564 4572 2002-07-08 Fernando Perez <fperez@colorado.edu>
4565 4573
4566 4574 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
4567 4575 __IPYTHON__ in __builtins__ to show up in user_ns.
4568 4576
4569 4577 2002-07-03 Fernando Perez <fperez@colorado.edu>
4570 4578
4571 4579 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
4572 4580 name from @gp_set_instance to @gp_set_default.
4573 4581
4574 4582 * IPython/ipmaker.py (make_IPython): default editor value set to
4575 4583 '0' (a string), to match the rc file. Otherwise will crash when
4576 4584 .strip() is called on it.
4577 4585
4578 4586
4579 4587 2002-06-28 Fernando Perez <fperez@colorado.edu>
4580 4588
4581 4589 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
4582 4590 of files in current directory when a file is executed via
4583 4591 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
4584 4592
4585 4593 * setup.py (manfiles): fix for rpm builds, submitted by RA
4586 4594 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
4587 4595
4588 4596 * IPython/ipmaker.py (make_IPython): fixed lookup of default
4589 4597 editor when set to '0'. Problem was, '0' evaluates to True (it's a
4590 4598 string!). A. Schmolck caught this one.
4591 4599
4592 4600 2002-06-27 Fernando Perez <fperez@colorado.edu>
4593 4601
4594 4602 * IPython/ipmaker.py (make_IPython): fixed bug when running user
4595 4603 defined files at the cmd line. __name__ wasn't being set to
4596 4604 __main__.
4597 4605
4598 4606 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
4599 4607 regular lists and tuples besides Numeric arrays.
4600 4608
4601 4609 * IPython/Prompts.py (CachedOutput.__call__): Added output
4602 4610 supression for input ending with ';'. Similar to Mathematica and
4603 4611 Matlab. The _* vars and Out[] list are still updated, just like
4604 4612 Mathematica behaves.
4605 4613
4606 4614 2002-06-25 Fernando Perez <fperez@colorado.edu>
4607 4615
4608 4616 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
4609 4617 .ini extensions for profiels under Windows.
4610 4618
4611 4619 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
4612 4620 string form. Fix contributed by Alexander Schmolck
4613 4621 <a.schmolck-AT-gmx.net>
4614 4622
4615 4623 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
4616 4624 pre-configured Gnuplot instance.
4617 4625
4618 4626 2002-06-21 Fernando Perez <fperez@colorado.edu>
4619 4627
4620 4628 * IPython/numutils.py (exp_safe): new function, works around the
4621 4629 underflow problems in Numeric.
4622 4630 (log2): New fn. Safe log in base 2: returns exact integer answer
4623 4631 for exact integer powers of 2.
4624 4632
4625 4633 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
4626 4634 properly.
4627 4635
4628 4636 2002-06-20 Fernando Perez <fperez@colorado.edu>
4629 4637
4630 4638 * IPython/genutils.py (timing): new function like
4631 4639 Mathematica's. Similar to time_test, but returns more info.
4632 4640
4633 4641 2002-06-18 Fernando Perez <fperez@colorado.edu>
4634 4642
4635 4643 * IPython/Magic.py (Magic.magic_save): modified @save and @r
4636 4644 according to Mike Heeter's suggestions.
4637 4645
4638 4646 2002-06-16 Fernando Perez <fperez@colorado.edu>
4639 4647
4640 4648 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
4641 4649 system. GnuplotMagic is gone as a user-directory option. New files
4642 4650 make it easier to use all the gnuplot stuff both from external
4643 4651 programs as well as from IPython. Had to rewrite part of
4644 4652 hardcopy() b/c of a strange bug: often the ps files simply don't
4645 4653 get created, and require a repeat of the command (often several
4646 4654 times).
4647 4655
4648 4656 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
4649 4657 resolve output channel at call time, so that if sys.stderr has
4650 4658 been redirected by user this gets honored.
4651 4659
4652 4660 2002-06-13 Fernando Perez <fperez@colorado.edu>
4653 4661
4654 4662 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
4655 4663 IPShell. Kept a copy with the old names to avoid breaking people's
4656 4664 embedded code.
4657 4665
4658 4666 * IPython/ipython: simplified it to the bare minimum after
4659 4667 Holger's suggestions. Added info about how to use it in
4660 4668 PYTHONSTARTUP.
4661 4669
4662 4670 * IPython/Shell.py (IPythonShell): changed the options passing
4663 4671 from a string with funky %s replacements to a straight list. Maybe
4664 4672 a bit more typing, but it follows sys.argv conventions, so there's
4665 4673 less special-casing to remember.
4666 4674
4667 4675 2002-06-12 Fernando Perez <fperez@colorado.edu>
4668 4676
4669 4677 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
4670 4678 command. Thanks to a suggestion by Mike Heeter.
4671 4679 (Magic.magic_pfile): added behavior to look at filenames if given
4672 4680 arg is not a defined object.
4673 4681 (Magic.magic_save): New @save function to save code snippets. Also
4674 4682 a Mike Heeter idea.
4675 4683
4676 4684 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
4677 4685 plot() and replot(). Much more convenient now, especially for
4678 4686 interactive use.
4679 4687
4680 4688 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
4681 4689 filenames.
4682 4690
4683 4691 2002-06-02 Fernando Perez <fperez@colorado.edu>
4684 4692
4685 4693 * IPython/Struct.py (Struct.__init__): modified to admit
4686 4694 initialization via another struct.
4687 4695
4688 4696 * IPython/genutils.py (SystemExec.__init__): New stateful
4689 4697 interface to xsys and bq. Useful for writing system scripts.
4690 4698
4691 4699 2002-05-30 Fernando Perez <fperez@colorado.edu>
4692 4700
4693 4701 * MANIFEST.in: Changed docfile selection to exclude all the lyx
4694 4702 documents. This will make the user download smaller (it's getting
4695 4703 too big).
4696 4704
4697 4705 2002-05-29 Fernando Perez <fperez@colorado.edu>
4698 4706
4699 4707 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
4700 4708 fix problems with shelve and pickle. Seems to work, but I don't
4701 4709 know if corner cases break it. Thanks to Mike Heeter
4702 4710 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
4703 4711
4704 4712 2002-05-24 Fernando Perez <fperez@colorado.edu>
4705 4713
4706 4714 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
4707 4715 macros having broken.
4708 4716
4709 4717 2002-05-21 Fernando Perez <fperez@colorado.edu>
4710 4718
4711 4719 * IPython/Magic.py (Magic.magic_logstart): fixed recently
4712 4720 introduced logging bug: all history before logging started was
4713 4721 being written one character per line! This came from the redesign
4714 4722 of the input history as a special list which slices to strings,
4715 4723 not to lists.
4716 4724
4717 4725 2002-05-20 Fernando Perez <fperez@colorado.edu>
4718 4726
4719 4727 * IPython/Prompts.py (CachedOutput.__init__): made the color table
4720 4728 be an attribute of all classes in this module. The design of these
4721 4729 classes needs some serious overhauling.
4722 4730
4723 4731 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
4724 4732 which was ignoring '_' in option names.
4725 4733
4726 4734 * IPython/ultraTB.py (FormattedTB.__init__): Changed
4727 4735 'Verbose_novars' to 'Context' and made it the new default. It's a
4728 4736 bit more readable and also safer than verbose.
4729 4737
4730 4738 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
4731 4739 triple-quoted strings.
4732 4740
4733 4741 * IPython/OInspect.py (__all__): new module exposing the object
4734 4742 introspection facilities. Now the corresponding magics are dummy
4735 4743 wrappers around this. Having this module will make it much easier
4736 4744 to put these functions into our modified pdb.
4737 4745 This new object inspector system uses the new colorizing module,
4738 4746 so source code and other things are nicely syntax highlighted.
4739 4747
4740 4748 2002-05-18 Fernando Perez <fperez@colorado.edu>
4741 4749
4742 4750 * IPython/ColorANSI.py: Split the coloring tools into a separate
4743 4751 module so I can use them in other code easier (they were part of
4744 4752 ultraTB).
4745 4753
4746 4754 2002-05-17 Fernando Perez <fperez@colorado.edu>
4747 4755
4748 4756 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4749 4757 fixed it to set the global 'g' also to the called instance, as
4750 4758 long as 'g' was still a gnuplot instance (so it doesn't overwrite
4751 4759 user's 'g' variables).
4752 4760
4753 4761 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
4754 4762 global variables (aliases to _ih,_oh) so that users which expect
4755 4763 In[5] or Out[7] to work aren't unpleasantly surprised.
4756 4764 (InputList.__getslice__): new class to allow executing slices of
4757 4765 input history directly. Very simple class, complements the use of
4758 4766 macros.
4759 4767
4760 4768 2002-05-16 Fernando Perez <fperez@colorado.edu>
4761 4769
4762 4770 * setup.py (docdirbase): make doc directory be just doc/IPython
4763 4771 without version numbers, it will reduce clutter for users.
4764 4772
4765 4773 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
4766 4774 execfile call to prevent possible memory leak. See for details:
4767 4775 http://mail.python.org/pipermail/python-list/2002-February/088476.html
4768 4776
4769 4777 2002-05-15 Fernando Perez <fperez@colorado.edu>
4770 4778
4771 4779 * IPython/Magic.py (Magic.magic_psource): made the object
4772 4780 introspection names be more standard: pdoc, pdef, pfile and
4773 4781 psource. They all print/page their output, and it makes
4774 4782 remembering them easier. Kept old names for compatibility as
4775 4783 aliases.
4776 4784
4777 4785 2002-05-14 Fernando Perez <fperez@colorado.edu>
4778 4786
4779 4787 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
4780 4788 what the mouse problem was. The trick is to use gnuplot with temp
4781 4789 files and NOT with pipes (for data communication), because having
4782 4790 both pipes and the mouse on is bad news.
4783 4791
4784 4792 2002-05-13 Fernando Perez <fperez@colorado.edu>
4785 4793
4786 4794 * IPython/Magic.py (Magic._ofind): fixed namespace order search
4787 4795 bug. Information would be reported about builtins even when
4788 4796 user-defined functions overrode them.
4789 4797
4790 4798 2002-05-11 Fernando Perez <fperez@colorado.edu>
4791 4799
4792 4800 * IPython/__init__.py (__all__): removed FlexCompleter from
4793 4801 __all__ so that things don't fail in platforms without readline.
4794 4802
4795 4803 2002-05-10 Fernando Perez <fperez@colorado.edu>
4796 4804
4797 4805 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
4798 4806 it requires Numeric, effectively making Numeric a dependency for
4799 4807 IPython.
4800 4808
4801 4809 * Released 0.2.13
4802 4810
4803 4811 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
4804 4812 profiler interface. Now all the major options from the profiler
4805 4813 module are directly supported in IPython, both for single
4806 4814 expressions (@prun) and for full programs (@run -p).
4807 4815
4808 4816 2002-05-09 Fernando Perez <fperez@colorado.edu>
4809 4817
4810 4818 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
4811 4819 magic properly formatted for screen.
4812 4820
4813 4821 * setup.py (make_shortcut): Changed things to put pdf version in
4814 4822 doc/ instead of doc/manual (had to change lyxport a bit).
4815 4823
4816 4824 * IPython/Magic.py (Profile.string_stats): made profile runs go
4817 4825 through pager (they are long and a pager allows searching, saving,
4818 4826 etc.)
4819 4827
4820 4828 2002-05-08 Fernando Perez <fperez@colorado.edu>
4821 4829
4822 4830 * Released 0.2.12
4823 4831
4824 4832 2002-05-06 Fernando Perez <fperez@colorado.edu>
4825 4833
4826 4834 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
4827 4835 introduced); 'hist n1 n2' was broken.
4828 4836 (Magic.magic_pdb): added optional on/off arguments to @pdb
4829 4837 (Magic.magic_run): added option -i to @run, which executes code in
4830 4838 the IPython namespace instead of a clean one. Also added @irun as
4831 4839 an alias to @run -i.
4832 4840
4833 4841 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4834 4842 fixed (it didn't really do anything, the namespaces were wrong).
4835 4843
4836 4844 * IPython/Debugger.py (__init__): Added workaround for python 2.1
4837 4845
4838 4846 * IPython/__init__.py (__all__): Fixed package namespace, now
4839 4847 'import IPython' does give access to IPython.<all> as
4840 4848 expected. Also renamed __release__ to Release.
4841 4849
4842 4850 * IPython/Debugger.py (__license__): created new Pdb class which
4843 4851 functions like a drop-in for the normal pdb.Pdb but does NOT
4844 4852 import readline by default. This way it doesn't muck up IPython's
4845 4853 readline handling, and now tab-completion finally works in the
4846 4854 debugger -- sort of. It completes things globally visible, but the
4847 4855 completer doesn't track the stack as pdb walks it. That's a bit
4848 4856 tricky, and I'll have to implement it later.
4849 4857
4850 4858 2002-05-05 Fernando Perez <fperez@colorado.edu>
4851 4859
4852 4860 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
4853 4861 magic docstrings when printed via ? (explicit \'s were being
4854 4862 printed).
4855 4863
4856 4864 * IPython/ipmaker.py (make_IPython): fixed namespace
4857 4865 identification bug. Now variables loaded via logs or command-line
4858 4866 files are recognized in the interactive namespace by @who.
4859 4867
4860 4868 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
4861 4869 log replay system stemming from the string form of Structs.
4862 4870
4863 4871 * IPython/Magic.py (Macro.__init__): improved macros to properly
4864 4872 handle magic commands in them.
4865 4873 (Magic.magic_logstart): usernames are now expanded so 'logstart
4866 4874 ~/mylog' now works.
4867 4875
4868 4876 * IPython/iplib.py (complete): fixed bug where paths starting with
4869 4877 '/' would be completed as magic names.
4870 4878
4871 4879 2002-05-04 Fernando Perez <fperez@colorado.edu>
4872 4880
4873 4881 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
4874 4882 allow running full programs under the profiler's control.
4875 4883
4876 4884 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
4877 4885 mode to report exceptions verbosely but without formatting
4878 4886 variables. This addresses the issue of ipython 'freezing' (it's
4879 4887 not frozen, but caught in an expensive formatting loop) when huge
4880 4888 variables are in the context of an exception.
4881 4889 (VerboseTB.text): Added '--->' markers at line where exception was
4882 4890 triggered. Much clearer to read, especially in NoColor modes.
4883 4891
4884 4892 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
4885 4893 implemented in reverse when changing to the new parse_options().
4886 4894
4887 4895 2002-05-03 Fernando Perez <fperez@colorado.edu>
4888 4896
4889 4897 * IPython/Magic.py (Magic.parse_options): new function so that
4890 4898 magics can parse options easier.
4891 4899 (Magic.magic_prun): new function similar to profile.run(),
4892 4900 suggested by Chris Hart.
4893 4901 (Magic.magic_cd): fixed behavior so that it only changes if
4894 4902 directory actually is in history.
4895 4903
4896 4904 * IPython/usage.py (__doc__): added information about potential
4897 4905 slowness of Verbose exception mode when there are huge data
4898 4906 structures to be formatted (thanks to Archie Paulson).
4899 4907
4900 4908 * IPython/ipmaker.py (make_IPython): Changed default logging
4901 4909 (when simply called with -log) to use curr_dir/ipython.log in
4902 4910 rotate mode. Fixed crash which was occuring with -log before
4903 4911 (thanks to Jim Boyle).
4904 4912
4905 4913 2002-05-01 Fernando Perez <fperez@colorado.edu>
4906 4914
4907 4915 * Released 0.2.11 for these fixes (mainly the ultraTB one which
4908 4916 was nasty -- though somewhat of a corner case).
4909 4917
4910 4918 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
4911 4919 text (was a bug).
4912 4920
4913 4921 2002-04-30 Fernando Perez <fperez@colorado.edu>
4914 4922
4915 4923 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
4916 4924 a print after ^D or ^C from the user so that the In[] prompt
4917 4925 doesn't over-run the gnuplot one.
4918 4926
4919 4927 2002-04-29 Fernando Perez <fperez@colorado.edu>
4920 4928
4921 4929 * Released 0.2.10
4922 4930
4923 4931 * IPython/__release__.py (version): get date dynamically.
4924 4932
4925 4933 * Misc. documentation updates thanks to Arnd's comments. Also ran
4926 4934 a full spellcheck on the manual (hadn't been done in a while).
4927 4935
4928 4936 2002-04-27 Fernando Perez <fperez@colorado.edu>
4929 4937
4930 4938 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
4931 4939 starting a log in mid-session would reset the input history list.
4932 4940
4933 4941 2002-04-26 Fernando Perez <fperez@colorado.edu>
4934 4942
4935 4943 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
4936 4944 all files were being included in an update. Now anything in
4937 4945 UserConfig that matches [A-Za-z]*.py will go (this excludes
4938 4946 __init__.py)
4939 4947
4940 4948 2002-04-25 Fernando Perez <fperez@colorado.edu>
4941 4949
4942 4950 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
4943 4951 to __builtins__ so that any form of embedded or imported code can
4944 4952 test for being inside IPython.
4945 4953
4946 4954 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
4947 4955 changed to GnuplotMagic because it's now an importable module,
4948 4956 this makes the name follow that of the standard Gnuplot module.
4949 4957 GnuplotMagic can now be loaded at any time in mid-session.
4950 4958
4951 4959 2002-04-24 Fernando Perez <fperez@colorado.edu>
4952 4960
4953 4961 * IPython/numutils.py: removed SIUnits. It doesn't properly set
4954 4962 the globals (IPython has its own namespace) and the
4955 4963 PhysicalQuantity stuff is much better anyway.
4956 4964
4957 4965 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
4958 4966 embedding example to standard user directory for
4959 4967 distribution. Also put it in the manual.
4960 4968
4961 4969 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
4962 4970 instance as first argument (so it doesn't rely on some obscure
4963 4971 hidden global).
4964 4972
4965 4973 * IPython/UserConfig/ipythonrc.py: put () back in accepted
4966 4974 delimiters. While it prevents ().TAB from working, it allows
4967 4975 completions in open (... expressions. This is by far a more common
4968 4976 case.
4969 4977
4970 4978 2002-04-23 Fernando Perez <fperez@colorado.edu>
4971 4979
4972 4980 * IPython/Extensions/InterpreterPasteInput.py: new
4973 4981 syntax-processing module for pasting lines with >>> or ... at the
4974 4982 start.
4975 4983
4976 4984 * IPython/Extensions/PhysicalQ_Interactive.py
4977 4985 (PhysicalQuantityInteractive.__int__): fixed to work with either
4978 4986 Numeric or math.
4979 4987
4980 4988 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
4981 4989 provided profiles. Now we have:
4982 4990 -math -> math module as * and cmath with its own namespace.
4983 4991 -numeric -> Numeric as *, plus gnuplot & grace
4984 4992 -physics -> same as before
4985 4993
4986 4994 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
4987 4995 user-defined magics wouldn't be found by @magic if they were
4988 4996 defined as class methods. Also cleaned up the namespace search
4989 4997 logic and the string building (to use %s instead of many repeated
4990 4998 string adds).
4991 4999
4992 5000 * IPython/UserConfig/example-magic.py (magic_foo): updated example
4993 5001 of user-defined magics to operate with class methods (cleaner, in
4994 5002 line with the gnuplot code).
4995 5003
4996 5004 2002-04-22 Fernando Perez <fperez@colorado.edu>
4997 5005
4998 5006 * setup.py: updated dependency list so that manual is updated when
4999 5007 all included files change.
5000 5008
5001 5009 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5002 5010 the delimiter removal option (the fix is ugly right now).
5003 5011
5004 5012 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5005 5013 all of the math profile (quicker loading, no conflict between
5006 5014 g-9.8 and g-gnuplot).
5007 5015
5008 5016 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5009 5017 name of post-mortem files to IPython_crash_report.txt.
5010 5018
5011 5019 * Cleanup/update of the docs. Added all the new readline info and
5012 5020 formatted all lists as 'real lists'.
5013 5021
5014 5022 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5015 5023 tab-completion options, since the full readline parse_and_bind is
5016 5024 now accessible.
5017 5025
5018 5026 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5019 5027 handling of readline options. Now users can specify any string to
5020 5028 be passed to parse_and_bind(), as well as the delimiters to be
5021 5029 removed.
5022 5030 (InteractiveShell.__init__): Added __name__ to the global
5023 5031 namespace so that things like Itpl which rely on its existence
5024 5032 don't crash.
5025 5033 (InteractiveShell._prefilter): Defined the default with a _ so
5026 5034 that prefilter() is easier to override, while the default one
5027 5035 remains available.
5028 5036
5029 5037 2002-04-18 Fernando Perez <fperez@colorado.edu>
5030 5038
5031 5039 * Added information about pdb in the docs.
5032 5040
5033 5041 2002-04-17 Fernando Perez <fperez@colorado.edu>
5034 5042
5035 5043 * IPython/ipmaker.py (make_IPython): added rc_override option to
5036 5044 allow passing config options at creation time which may override
5037 5045 anything set in the config files or command line. This is
5038 5046 particularly useful for configuring embedded instances.
5039 5047
5040 5048 2002-04-15 Fernando Perez <fperez@colorado.edu>
5041 5049
5042 5050 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5043 5051 crash embedded instances because of the input cache falling out of
5044 5052 sync with the output counter.
5045 5053
5046 5054 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5047 5055 mode which calls pdb after an uncaught exception in IPython itself.
5048 5056
5049 5057 2002-04-14 Fernando Perez <fperez@colorado.edu>
5050 5058
5051 5059 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5052 5060 readline, fix it back after each call.
5053 5061
5054 5062 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5055 5063 method to force all access via __call__(), which guarantees that
5056 5064 traceback references are properly deleted.
5057 5065
5058 5066 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5059 5067 improve printing when pprint is in use.
5060 5068
5061 5069 2002-04-13 Fernando Perez <fperez@colorado.edu>
5062 5070
5063 5071 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5064 5072 exceptions aren't caught anymore. If the user triggers one, he
5065 5073 should know why he's doing it and it should go all the way up,
5066 5074 just like any other exception. So now @abort will fully kill the
5067 5075 embedded interpreter and the embedding code (unless that happens
5068 5076 to catch SystemExit).
5069 5077
5070 5078 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5071 5079 and a debugger() method to invoke the interactive pdb debugger
5072 5080 after printing exception information. Also added the corresponding
5073 5081 -pdb option and @pdb magic to control this feature, and updated
5074 5082 the docs. After a suggestion from Christopher Hart
5075 5083 (hart-AT-caltech.edu).
5076 5084
5077 5085 2002-04-12 Fernando Perez <fperez@colorado.edu>
5078 5086
5079 5087 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5080 5088 the exception handlers defined by the user (not the CrashHandler)
5081 5089 so that user exceptions don't trigger an ipython bug report.
5082 5090
5083 5091 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5084 5092 configurable (it should have always been so).
5085 5093
5086 5094 2002-03-26 Fernando Perez <fperez@colorado.edu>
5087 5095
5088 5096 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5089 5097 and there to fix embedding namespace issues. This should all be
5090 5098 done in a more elegant way.
5091 5099
5092 5100 2002-03-25 Fernando Perez <fperez@colorado.edu>
5093 5101
5094 5102 * IPython/genutils.py (get_home_dir): Try to make it work under
5095 5103 win9x also.
5096 5104
5097 5105 2002-03-20 Fernando Perez <fperez@colorado.edu>
5098 5106
5099 5107 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5100 5108 sys.displayhook untouched upon __init__.
5101 5109
5102 5110 2002-03-19 Fernando Perez <fperez@colorado.edu>
5103 5111
5104 5112 * Released 0.2.9 (for embedding bug, basically).
5105 5113
5106 5114 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5107 5115 exceptions so that enclosing shell's state can be restored.
5108 5116
5109 5117 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5110 5118 naming conventions in the .ipython/ dir.
5111 5119
5112 5120 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5113 5121 from delimiters list so filenames with - in them get expanded.
5114 5122
5115 5123 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5116 5124 sys.displayhook not being properly restored after an embedded call.
5117 5125
5118 5126 2002-03-18 Fernando Perez <fperez@colorado.edu>
5119 5127
5120 5128 * Released 0.2.8
5121 5129
5122 5130 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5123 5131 some files weren't being included in a -upgrade.
5124 5132 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5125 5133 on' so that the first tab completes.
5126 5134 (InteractiveShell.handle_magic): fixed bug with spaces around
5127 5135 quotes breaking many magic commands.
5128 5136
5129 5137 * setup.py: added note about ignoring the syntax error messages at
5130 5138 installation.
5131 5139
5132 5140 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5133 5141 streamlining the gnuplot interface, now there's only one magic @gp.
5134 5142
5135 5143 2002-03-17 Fernando Perez <fperez@colorado.edu>
5136 5144
5137 5145 * IPython/UserConfig/magic_gnuplot.py: new name for the
5138 5146 example-magic_pm.py file. Much enhanced system, now with a shell
5139 5147 for communicating directly with gnuplot, one command at a time.
5140 5148
5141 5149 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5142 5150 setting __name__=='__main__'.
5143 5151
5144 5152 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5145 5153 mini-shell for accessing gnuplot from inside ipython. Should
5146 5154 extend it later for grace access too. Inspired by Arnd's
5147 5155 suggestion.
5148 5156
5149 5157 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5150 5158 calling magic functions with () in their arguments. Thanks to Arnd
5151 5159 Baecker for pointing this to me.
5152 5160
5153 5161 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5154 5162 infinitely for integer or complex arrays (only worked with floats).
5155 5163
5156 5164 2002-03-16 Fernando Perez <fperez@colorado.edu>
5157 5165
5158 5166 * setup.py: Merged setup and setup_windows into a single script
5159 5167 which properly handles things for windows users.
5160 5168
5161 5169 2002-03-15 Fernando Perez <fperez@colorado.edu>
5162 5170
5163 5171 * Big change to the manual: now the magics are all automatically
5164 5172 documented. This information is generated from their docstrings
5165 5173 and put in a latex file included by the manual lyx file. This way
5166 5174 we get always up to date information for the magics. The manual
5167 5175 now also has proper version information, also auto-synced.
5168 5176
5169 5177 For this to work, an undocumented --magic_docstrings option was added.
5170 5178
5171 5179 2002-03-13 Fernando Perez <fperez@colorado.edu>
5172 5180
5173 5181 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5174 5182 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5175 5183
5176 5184 2002-03-12 Fernando Perez <fperez@colorado.edu>
5177 5185
5178 5186 * IPython/ultraTB.py (TermColors): changed color escapes again to
5179 5187 fix the (old, reintroduced) line-wrapping bug. Basically, if
5180 5188 \001..\002 aren't given in the color escapes, lines get wrapped
5181 5189 weirdly. But giving those screws up old xterms and emacs terms. So
5182 5190 I added some logic for emacs terms to be ok, but I can't identify old
5183 5191 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5184 5192
5185 5193 2002-03-10 Fernando Perez <fperez@colorado.edu>
5186 5194
5187 5195 * IPython/usage.py (__doc__): Various documentation cleanups and
5188 5196 updates, both in usage docstrings and in the manual.
5189 5197
5190 5198 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5191 5199 handling of caching. Set minimum acceptabe value for having a
5192 5200 cache at 20 values.
5193 5201
5194 5202 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5195 5203 install_first_time function to a method, renamed it and added an
5196 5204 'upgrade' mode. Now people can update their config directory with
5197 5205 a simple command line switch (-upgrade, also new).
5198 5206
5199 5207 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5200 5208 @file (convenient for automagic users under Python >= 2.2).
5201 5209 Removed @files (it seemed more like a plural than an abbrev. of
5202 5210 'file show').
5203 5211
5204 5212 * IPython/iplib.py (install_first_time): Fixed crash if there were
5205 5213 backup files ('~') in .ipython/ install directory.
5206 5214
5207 5215 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5208 5216 system. Things look fine, but these changes are fairly
5209 5217 intrusive. Test them for a few days.
5210 5218
5211 5219 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5212 5220 the prompts system. Now all in/out prompt strings are user
5213 5221 controllable. This is particularly useful for embedding, as one
5214 5222 can tag embedded instances with particular prompts.
5215 5223
5216 5224 Also removed global use of sys.ps1/2, which now allows nested
5217 5225 embeddings without any problems. Added command-line options for
5218 5226 the prompt strings.
5219 5227
5220 5228 2002-03-08 Fernando Perez <fperez@colorado.edu>
5221 5229
5222 5230 * IPython/UserConfig/example-embed-short.py (ipshell): added
5223 5231 example file with the bare minimum code for embedding.
5224 5232
5225 5233 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5226 5234 functionality for the embeddable shell to be activated/deactivated
5227 5235 either globally or at each call.
5228 5236
5229 5237 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5230 5238 rewriting the prompt with '--->' for auto-inputs with proper
5231 5239 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5232 5240 this is handled by the prompts class itself, as it should.
5233 5241
5234 5242 2002-03-05 Fernando Perez <fperez@colorado.edu>
5235 5243
5236 5244 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5237 5245 @logstart to avoid name clashes with the math log function.
5238 5246
5239 5247 * Big updates to X/Emacs section of the manual.
5240 5248
5241 5249 * Removed ipython_emacs. Milan explained to me how to pass
5242 5250 arguments to ipython through Emacs. Some day I'm going to end up
5243 5251 learning some lisp...
5244 5252
5245 5253 2002-03-04 Fernando Perez <fperez@colorado.edu>
5246 5254
5247 5255 * IPython/ipython_emacs: Created script to be used as the
5248 5256 py-python-command Emacs variable so we can pass IPython
5249 5257 parameters. I can't figure out how to tell Emacs directly to pass
5250 5258 parameters to IPython, so a dummy shell script will do it.
5251 5259
5252 5260 Other enhancements made for things to work better under Emacs'
5253 5261 various types of terminals. Many thanks to Milan Zamazal
5254 5262 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5255 5263
5256 5264 2002-03-01 Fernando Perez <fperez@colorado.edu>
5257 5265
5258 5266 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5259 5267 that loading of readline is now optional. This gives better
5260 5268 control to emacs users.
5261 5269
5262 5270 * IPython/ultraTB.py (__date__): Modified color escape sequences
5263 5271 and now things work fine under xterm and in Emacs' term buffers
5264 5272 (though not shell ones). Well, in emacs you get colors, but all
5265 5273 seem to be 'light' colors (no difference between dark and light
5266 5274 ones). But the garbage chars are gone, and also in xterms. It
5267 5275 seems that now I'm using 'cleaner' ansi sequences.
5268 5276
5269 5277 2002-02-21 Fernando Perez <fperez@colorado.edu>
5270 5278
5271 5279 * Released 0.2.7 (mainly to publish the scoping fix).
5272 5280
5273 5281 * IPython/Logger.py (Logger.logstate): added. A corresponding
5274 5282 @logstate magic was created.
5275 5283
5276 5284 * IPython/Magic.py: fixed nested scoping problem under Python
5277 5285 2.1.x (automagic wasn't working).
5278 5286
5279 5287 2002-02-20 Fernando Perez <fperez@colorado.edu>
5280 5288
5281 5289 * Released 0.2.6.
5282 5290
5283 5291 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
5284 5292 option so that logs can come out without any headers at all.
5285 5293
5286 5294 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
5287 5295 SciPy.
5288 5296
5289 5297 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
5290 5298 that embedded IPython calls don't require vars() to be explicitly
5291 5299 passed. Now they are extracted from the caller's frame (code
5292 5300 snatched from Eric Jones' weave). Added better documentation to
5293 5301 the section on embedding and the example file.
5294 5302
5295 5303 * IPython/genutils.py (page): Changed so that under emacs, it just
5296 5304 prints the string. You can then page up and down in the emacs
5297 5305 buffer itself. This is how the builtin help() works.
5298 5306
5299 5307 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
5300 5308 macro scoping: macros need to be executed in the user's namespace
5301 5309 to work as if they had been typed by the user.
5302 5310
5303 5311 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
5304 5312 execute automatically (no need to type 'exec...'). They then
5305 5313 behave like 'true macros'. The printing system was also modified
5306 5314 for this to work.
5307 5315
5308 5316 2002-02-19 Fernando Perez <fperez@colorado.edu>
5309 5317
5310 5318 * IPython/genutils.py (page_file): new function for paging files
5311 5319 in an OS-independent way. Also necessary for file viewing to work
5312 5320 well inside Emacs buffers.
5313 5321 (page): Added checks for being in an emacs buffer.
5314 5322 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
5315 5323 same bug in iplib.
5316 5324
5317 5325 2002-02-18 Fernando Perez <fperez@colorado.edu>
5318 5326
5319 5327 * IPython/iplib.py (InteractiveShell.init_readline): modified use
5320 5328 of readline so that IPython can work inside an Emacs buffer.
5321 5329
5322 5330 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
5323 5331 method signatures (they weren't really bugs, but it looks cleaner
5324 5332 and keeps PyChecker happy).
5325 5333
5326 5334 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
5327 5335 for implementing various user-defined hooks. Currently only
5328 5336 display is done.
5329 5337
5330 5338 * IPython/Prompts.py (CachedOutput._display): changed display
5331 5339 functions so that they can be dynamically changed by users easily.
5332 5340
5333 5341 * IPython/Extensions/numeric_formats.py (num_display): added an
5334 5342 extension for printing NumPy arrays in flexible manners. It
5335 5343 doesn't do anything yet, but all the structure is in
5336 5344 place. Ultimately the plan is to implement output format control
5337 5345 like in Octave.
5338 5346
5339 5347 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
5340 5348 methods are found at run-time by all the automatic machinery.
5341 5349
5342 5350 2002-02-17 Fernando Perez <fperez@colorado.edu>
5343 5351
5344 5352 * setup_Windows.py (make_shortcut): documented. Cleaned up the
5345 5353 whole file a little.
5346 5354
5347 5355 * ToDo: closed this document. Now there's a new_design.lyx
5348 5356 document for all new ideas. Added making a pdf of it for the
5349 5357 end-user distro.
5350 5358
5351 5359 * IPython/Logger.py (Logger.switch_log): Created this to replace
5352 5360 logon() and logoff(). It also fixes a nasty crash reported by
5353 5361 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
5354 5362
5355 5363 * IPython/iplib.py (complete): got auto-completion to work with
5356 5364 automagic (I had wanted this for a long time).
5357 5365
5358 5366 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
5359 5367 to @file, since file() is now a builtin and clashes with automagic
5360 5368 for @file.
5361 5369
5362 5370 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
5363 5371 of this was previously in iplib, which had grown to more than 2000
5364 5372 lines, way too long. No new functionality, but it makes managing
5365 5373 the code a bit easier.
5366 5374
5367 5375 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
5368 5376 information to crash reports.
5369 5377
5370 5378 2002-02-12 Fernando Perez <fperez@colorado.edu>
5371 5379
5372 5380 * Released 0.2.5.
5373 5381
5374 5382 2002-02-11 Fernando Perez <fperez@colorado.edu>
5375 5383
5376 5384 * Wrote a relatively complete Windows installer. It puts
5377 5385 everything in place, creates Start Menu entries and fixes the
5378 5386 color issues. Nothing fancy, but it works.
5379 5387
5380 5388 2002-02-10 Fernando Perez <fperez@colorado.edu>
5381 5389
5382 5390 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
5383 5391 os.path.expanduser() call so that we can type @run ~/myfile.py and
5384 5392 have thigs work as expected.
5385 5393
5386 5394 * IPython/genutils.py (page): fixed exception handling so things
5387 5395 work both in Unix and Windows correctly. Quitting a pager triggers
5388 5396 an IOError/broken pipe in Unix, and in windows not finding a pager
5389 5397 is also an IOError, so I had to actually look at the return value
5390 5398 of the exception, not just the exception itself. Should be ok now.
5391 5399
5392 5400 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
5393 5401 modified to allow case-insensitive color scheme changes.
5394 5402
5395 5403 2002-02-09 Fernando Perez <fperez@colorado.edu>
5396 5404
5397 5405 * IPython/genutils.py (native_line_ends): new function to leave
5398 5406 user config files with os-native line-endings.
5399 5407
5400 5408 * README and manual updates.
5401 5409
5402 5410 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
5403 5411 instead of StringType to catch Unicode strings.
5404 5412
5405 5413 * IPython/genutils.py (filefind): fixed bug for paths with
5406 5414 embedded spaces (very common in Windows).
5407 5415
5408 5416 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
5409 5417 files under Windows, so that they get automatically associated
5410 5418 with a text editor. Windows makes it a pain to handle
5411 5419 extension-less files.
5412 5420
5413 5421 * IPython/iplib.py (InteractiveShell.init_readline): Made the
5414 5422 warning about readline only occur for Posix. In Windows there's no
5415 5423 way to get readline, so why bother with the warning.
5416 5424
5417 5425 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
5418 5426 for __str__ instead of dir(self), since dir() changed in 2.2.
5419 5427
5420 5428 * Ported to Windows! Tested on XP, I suspect it should work fine
5421 5429 on NT/2000, but I don't think it will work on 98 et al. That
5422 5430 series of Windows is such a piece of junk anyway that I won't try
5423 5431 porting it there. The XP port was straightforward, showed a few
5424 5432 bugs here and there (fixed all), in particular some string
5425 5433 handling stuff which required considering Unicode strings (which
5426 5434 Windows uses). This is good, but hasn't been too tested :) No
5427 5435 fancy installer yet, I'll put a note in the manual so people at
5428 5436 least make manually a shortcut.
5429 5437
5430 5438 * IPython/iplib.py (Magic.magic_colors): Unified the color options
5431 5439 into a single one, "colors". This now controls both prompt and
5432 5440 exception color schemes, and can be changed both at startup
5433 5441 (either via command-line switches or via ipythonrc files) and at
5434 5442 runtime, with @colors.
5435 5443 (Magic.magic_run): renamed @prun to @run and removed the old
5436 5444 @run. The two were too similar to warrant keeping both.
5437 5445
5438 5446 2002-02-03 Fernando Perez <fperez@colorado.edu>
5439 5447
5440 5448 * IPython/iplib.py (install_first_time): Added comment on how to
5441 5449 configure the color options for first-time users. Put a <return>
5442 5450 request at the end so that small-terminal users get a chance to
5443 5451 read the startup info.
5444 5452
5445 5453 2002-01-23 Fernando Perez <fperez@colorado.edu>
5446 5454
5447 5455 * IPython/iplib.py (CachedOutput.update): Changed output memory
5448 5456 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
5449 5457 input history we still use _i. Did this b/c these variable are
5450 5458 very commonly used in interactive work, so the less we need to
5451 5459 type the better off we are.
5452 5460 (Magic.magic_prun): updated @prun to better handle the namespaces
5453 5461 the file will run in, including a fix for __name__ not being set
5454 5462 before.
5455 5463
5456 5464 2002-01-20 Fernando Perez <fperez@colorado.edu>
5457 5465
5458 5466 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
5459 5467 extra garbage for Python 2.2. Need to look more carefully into
5460 5468 this later.
5461 5469
5462 5470 2002-01-19 Fernando Perez <fperez@colorado.edu>
5463 5471
5464 5472 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
5465 5473 display SyntaxError exceptions properly formatted when they occur
5466 5474 (they can be triggered by imported code).
5467 5475
5468 5476 2002-01-18 Fernando Perez <fperez@colorado.edu>
5469 5477
5470 5478 * IPython/iplib.py (InteractiveShell.safe_execfile): now
5471 5479 SyntaxError exceptions are reported nicely formatted, instead of
5472 5480 spitting out only offset information as before.
5473 5481 (Magic.magic_prun): Added the @prun function for executing
5474 5482 programs with command line args inside IPython.
5475 5483
5476 5484 2002-01-16 Fernando Perez <fperez@colorado.edu>
5477 5485
5478 5486 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
5479 5487 to *not* include the last item given in a range. This brings their
5480 5488 behavior in line with Python's slicing:
5481 5489 a[n1:n2] -> a[n1]...a[n2-1]
5482 5490 It may be a bit less convenient, but I prefer to stick to Python's
5483 5491 conventions *everywhere*, so users never have to wonder.
5484 5492 (Magic.magic_macro): Added @macro function to ease the creation of
5485 5493 macros.
5486 5494
5487 5495 2002-01-05 Fernando Perez <fperez@colorado.edu>
5488 5496
5489 5497 * Released 0.2.4.
5490 5498
5491 5499 * IPython/iplib.py (Magic.magic_pdef):
5492 5500 (InteractiveShell.safe_execfile): report magic lines and error
5493 5501 lines without line numbers so one can easily copy/paste them for
5494 5502 re-execution.
5495 5503
5496 5504 * Updated manual with recent changes.
5497 5505
5498 5506 * IPython/iplib.py (Magic.magic_oinfo): added constructor
5499 5507 docstring printing when class? is called. Very handy for knowing
5500 5508 how to create class instances (as long as __init__ is well
5501 5509 documented, of course :)
5502 5510 (Magic.magic_doc): print both class and constructor docstrings.
5503 5511 (Magic.magic_pdef): give constructor info if passed a class and
5504 5512 __call__ info for callable object instances.
5505 5513
5506 5514 2002-01-04 Fernando Perez <fperez@colorado.edu>
5507 5515
5508 5516 * Made deep_reload() off by default. It doesn't always work
5509 5517 exactly as intended, so it's probably safer to have it off. It's
5510 5518 still available as dreload() anyway, so nothing is lost.
5511 5519
5512 5520 2002-01-02 Fernando Perez <fperez@colorado.edu>
5513 5521
5514 5522 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
5515 5523 so I wanted an updated release).
5516 5524
5517 5525 2001-12-27 Fernando Perez <fperez@colorado.edu>
5518 5526
5519 5527 * IPython/iplib.py (InteractiveShell.interact): Added the original
5520 5528 code from 'code.py' for this module in order to change the
5521 5529 handling of a KeyboardInterrupt. This was necessary b/c otherwise
5522 5530 the history cache would break when the user hit Ctrl-C, and
5523 5531 interact() offers no way to add any hooks to it.
5524 5532
5525 5533 2001-12-23 Fernando Perez <fperez@colorado.edu>
5526 5534
5527 5535 * setup.py: added check for 'MANIFEST' before trying to remove
5528 5536 it. Thanks to Sean Reifschneider.
5529 5537
5530 5538 2001-12-22 Fernando Perez <fperez@colorado.edu>
5531 5539
5532 5540 * Released 0.2.2.
5533 5541
5534 5542 * Finished (reasonably) writing the manual. Later will add the
5535 5543 python-standard navigation stylesheets, but for the time being
5536 5544 it's fairly complete. Distribution will include html and pdf
5537 5545 versions.
5538 5546
5539 5547 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
5540 5548 (MayaVi author).
5541 5549
5542 5550 2001-12-21 Fernando Perez <fperez@colorado.edu>
5543 5551
5544 5552 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
5545 5553 good public release, I think (with the manual and the distutils
5546 5554 installer). The manual can use some work, but that can go
5547 5555 slowly. Otherwise I think it's quite nice for end users. Next
5548 5556 summer, rewrite the guts of it...
5549 5557
5550 5558 * Changed format of ipythonrc files to use whitespace as the
5551 5559 separator instead of an explicit '='. Cleaner.
5552 5560
5553 5561 2001-12-20 Fernando Perez <fperez@colorado.edu>
5554 5562
5555 5563 * Started a manual in LyX. For now it's just a quick merge of the
5556 5564 various internal docstrings and READMEs. Later it may grow into a
5557 5565 nice, full-blown manual.
5558 5566
5559 5567 * Set up a distutils based installer. Installation should now be
5560 5568 trivially simple for end-users.
5561 5569
5562 5570 2001-12-11 Fernando Perez <fperez@colorado.edu>
5563 5571
5564 5572 * Released 0.2.0. First public release, announced it at
5565 5573 comp.lang.python. From now on, just bugfixes...
5566 5574
5567 5575 * Went through all the files, set copyright/license notices and
5568 5576 cleaned up things. Ready for release.
5569 5577
5570 5578 2001-12-10 Fernando Perez <fperez@colorado.edu>
5571 5579
5572 5580 * Changed the first-time installer not to use tarfiles. It's more
5573 5581 robust now and less unix-dependent. Also makes it easier for
5574 5582 people to later upgrade versions.
5575 5583
5576 5584 * Changed @exit to @abort to reflect the fact that it's pretty
5577 5585 brutal (a sys.exit()). The difference between @abort and Ctrl-D
5578 5586 becomes significant only when IPyhton is embedded: in that case,
5579 5587 C-D closes IPython only, but @abort kills the enclosing program
5580 5588 too (unless it had called IPython inside a try catching
5581 5589 SystemExit).
5582 5590
5583 5591 * Created Shell module which exposes the actuall IPython Shell
5584 5592 classes, currently the normal and the embeddable one. This at
5585 5593 least offers a stable interface we won't need to change when
5586 5594 (later) the internals are rewritten. That rewrite will be confined
5587 5595 to iplib and ipmaker, but the Shell interface should remain as is.
5588 5596
5589 5597 * Added embed module which offers an embeddable IPShell object,
5590 5598 useful to fire up IPython *inside* a running program. Great for
5591 5599 debugging or dynamical data analysis.
5592 5600
5593 5601 2001-12-08 Fernando Perez <fperez@colorado.edu>
5594 5602
5595 5603 * Fixed small bug preventing seeing info from methods of defined
5596 5604 objects (incorrect namespace in _ofind()).
5597 5605
5598 5606 * Documentation cleanup. Moved the main usage docstrings to a
5599 5607 separate file, usage.py (cleaner to maintain, and hopefully in the
5600 5608 future some perlpod-like way of producing interactive, man and
5601 5609 html docs out of it will be found).
5602 5610
5603 5611 * Added @profile to see your profile at any time.
5604 5612
5605 5613 * Added @p as an alias for 'print'. It's especially convenient if
5606 5614 using automagic ('p x' prints x).
5607 5615
5608 5616 * Small cleanups and fixes after a pychecker run.
5609 5617
5610 5618 * Changed the @cd command to handle @cd - and @cd -<n> for
5611 5619 visiting any directory in _dh.
5612 5620
5613 5621 * Introduced _dh, a history of visited directories. @dhist prints
5614 5622 it out with numbers.
5615 5623
5616 5624 2001-12-07 Fernando Perez <fperez@colorado.edu>
5617 5625
5618 5626 * Released 0.1.22
5619 5627
5620 5628 * Made initialization a bit more robust against invalid color
5621 5629 options in user input (exit, not traceback-crash).
5622 5630
5623 5631 * Changed the bug crash reporter to write the report only in the
5624 5632 user's .ipython directory. That way IPython won't litter people's
5625 5633 hard disks with crash files all over the place. Also print on
5626 5634 screen the necessary mail command.
5627 5635
5628 5636 * With the new ultraTB, implemented LightBG color scheme for light
5629 5637 background terminals. A lot of people like white backgrounds, so I
5630 5638 guess we should at least give them something readable.
5631 5639
5632 5640 2001-12-06 Fernando Perez <fperez@colorado.edu>
5633 5641
5634 5642 * Modified the structure of ultraTB. Now there's a proper class
5635 5643 for tables of color schemes which allow adding schemes easily and
5636 5644 switching the active scheme without creating a new instance every
5637 5645 time (which was ridiculous). The syntax for creating new schemes
5638 5646 is also cleaner. I think ultraTB is finally done, with a clean
5639 5647 class structure. Names are also much cleaner (now there's proper
5640 5648 color tables, no need for every variable to also have 'color' in
5641 5649 its name).
5642 5650
5643 5651 * Broke down genutils into separate files. Now genutils only
5644 5652 contains utility functions, and classes have been moved to their
5645 5653 own files (they had enough independent functionality to warrant
5646 5654 it): ConfigLoader, OutputTrap, Struct.
5647 5655
5648 5656 2001-12-05 Fernando Perez <fperez@colorado.edu>
5649 5657
5650 5658 * IPython turns 21! Released version 0.1.21, as a candidate for
5651 5659 public consumption. If all goes well, release in a few days.
5652 5660
5653 5661 * Fixed path bug (files in Extensions/ directory wouldn't be found
5654 5662 unless IPython/ was explicitly in sys.path).
5655 5663
5656 5664 * Extended the FlexCompleter class as MagicCompleter to allow
5657 5665 completion of @-starting lines.
5658 5666
5659 5667 * Created __release__.py file as a central repository for release
5660 5668 info that other files can read from.
5661 5669
5662 5670 * Fixed small bug in logging: when logging was turned on in
5663 5671 mid-session, old lines with special meanings (!@?) were being
5664 5672 logged without the prepended comment, which is necessary since
5665 5673 they are not truly valid python syntax. This should make session
5666 5674 restores produce less errors.
5667 5675
5668 5676 * The namespace cleanup forced me to make a FlexCompleter class
5669 5677 which is nothing but a ripoff of rlcompleter, but with selectable
5670 5678 namespace (rlcompleter only works in __main__.__dict__). I'll try
5671 5679 to submit a note to the authors to see if this change can be
5672 5680 incorporated in future rlcompleter releases (Dec.6: done)
5673 5681
5674 5682 * More fixes to namespace handling. It was a mess! Now all
5675 5683 explicit references to __main__.__dict__ are gone (except when
5676 5684 really needed) and everything is handled through the namespace
5677 5685 dicts in the IPython instance. We seem to be getting somewhere
5678 5686 with this, finally...
5679 5687
5680 5688 * Small documentation updates.
5681 5689
5682 5690 * Created the Extensions directory under IPython (with an
5683 5691 __init__.py). Put the PhysicalQ stuff there. This directory should
5684 5692 be used for all special-purpose extensions.
5685 5693
5686 5694 * File renaming:
5687 5695 ipythonlib --> ipmaker
5688 5696 ipplib --> iplib
5689 5697 This makes a bit more sense in terms of what these files actually do.
5690 5698
5691 5699 * Moved all the classes and functions in ipythonlib to ipplib, so
5692 5700 now ipythonlib only has make_IPython(). This will ease up its
5693 5701 splitting in smaller functional chunks later.
5694 5702
5695 5703 * Cleaned up (done, I think) output of @whos. Better column
5696 5704 formatting, and now shows str(var) for as much as it can, which is
5697 5705 typically what one gets with a 'print var'.
5698 5706
5699 5707 2001-12-04 Fernando Perez <fperez@colorado.edu>
5700 5708
5701 5709 * Fixed namespace problems. Now builtin/IPyhton/user names get
5702 5710 properly reported in their namespace. Internal namespace handling
5703 5711 is finally getting decent (not perfect yet, but much better than
5704 5712 the ad-hoc mess we had).
5705 5713
5706 5714 * Removed -exit option. If people just want to run a python
5707 5715 script, that's what the normal interpreter is for. Less
5708 5716 unnecessary options, less chances for bugs.
5709 5717
5710 5718 * Added a crash handler which generates a complete post-mortem if
5711 5719 IPython crashes. This will help a lot in tracking bugs down the
5712 5720 road.
5713 5721
5714 5722 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
5715 5723 which were boud to functions being reassigned would bypass the
5716 5724 logger, breaking the sync of _il with the prompt counter. This
5717 5725 would then crash IPython later when a new line was logged.
5718 5726
5719 5727 2001-12-02 Fernando Perez <fperez@colorado.edu>
5720 5728
5721 5729 * Made IPython a package. This means people don't have to clutter
5722 5730 their sys.path with yet another directory. Changed the INSTALL
5723 5731 file accordingly.
5724 5732
5725 5733 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
5726 5734 sorts its output (so @who shows it sorted) and @whos formats the
5727 5735 table according to the width of the first column. Nicer, easier to
5728 5736 read. Todo: write a generic table_format() which takes a list of
5729 5737 lists and prints it nicely formatted, with optional row/column
5730 5738 separators and proper padding and justification.
5731 5739
5732 5740 * Released 0.1.20
5733 5741
5734 5742 * Fixed bug in @log which would reverse the inputcache list (a
5735 5743 copy operation was missing).
5736 5744
5737 5745 * Code cleanup. @config was changed to use page(). Better, since
5738 5746 its output is always quite long.
5739 5747
5740 5748 * Itpl is back as a dependency. I was having too many problems
5741 5749 getting the parametric aliases to work reliably, and it's just
5742 5750 easier to code weird string operations with it than playing %()s
5743 5751 games. It's only ~6k, so I don't think it's too big a deal.
5744 5752
5745 5753 * Found (and fixed) a very nasty bug with history. !lines weren't
5746 5754 getting cached, and the out of sync caches would crash
5747 5755 IPython. Fixed it by reorganizing the prefilter/handlers/logger
5748 5756 division of labor a bit better. Bug fixed, cleaner structure.
5749 5757
5750 5758 2001-12-01 Fernando Perez <fperez@colorado.edu>
5751 5759
5752 5760 * Released 0.1.19
5753 5761
5754 5762 * Added option -n to @hist to prevent line number printing. Much
5755 5763 easier to copy/paste code this way.
5756 5764
5757 5765 * Created global _il to hold the input list. Allows easy
5758 5766 re-execution of blocks of code by slicing it (inspired by Janko's
5759 5767 comment on 'macros').
5760 5768
5761 5769 * Small fixes and doc updates.
5762 5770
5763 5771 * Rewrote @history function (was @h). Renamed it to @hist, @h is
5764 5772 much too fragile with automagic. Handles properly multi-line
5765 5773 statements and takes parameters.
5766 5774
5767 5775 2001-11-30 Fernando Perez <fperez@colorado.edu>
5768 5776
5769 5777 * Version 0.1.18 released.
5770 5778
5771 5779 * Fixed nasty namespace bug in initial module imports.
5772 5780
5773 5781 * Added copyright/license notes to all code files (except
5774 5782 DPyGetOpt). For the time being, LGPL. That could change.
5775 5783
5776 5784 * Rewrote a much nicer README, updated INSTALL, cleaned up
5777 5785 ipythonrc-* samples.
5778 5786
5779 5787 * Overall code/documentation cleanup. Basically ready for
5780 5788 release. Only remaining thing: licence decision (LGPL?).
5781 5789
5782 5790 * Converted load_config to a class, ConfigLoader. Now recursion
5783 5791 control is better organized. Doesn't include the same file twice.
5784 5792
5785 5793 2001-11-29 Fernando Perez <fperez@colorado.edu>
5786 5794
5787 5795 * Got input history working. Changed output history variables from
5788 5796 _p to _o so that _i is for input and _o for output. Just cleaner
5789 5797 convention.
5790 5798
5791 5799 * Implemented parametric aliases. This pretty much allows the
5792 5800 alias system to offer full-blown shell convenience, I think.
5793 5801
5794 5802 * Version 0.1.17 released, 0.1.18 opened.
5795 5803
5796 5804 * dot_ipython/ipythonrc (alias): added documentation.
5797 5805 (xcolor): Fixed small bug (xcolors -> xcolor)
5798 5806
5799 5807 * Changed the alias system. Now alias is a magic command to define
5800 5808 aliases just like the shell. Rationale: the builtin magics should
5801 5809 be there for things deeply connected to IPython's
5802 5810 architecture. And this is a much lighter system for what I think
5803 5811 is the really important feature: allowing users to define quickly
5804 5812 magics that will do shell things for them, so they can customize
5805 5813 IPython easily to match their work habits. If someone is really
5806 5814 desperate to have another name for a builtin alias, they can
5807 5815 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
5808 5816 works.
5809 5817
5810 5818 2001-11-28 Fernando Perez <fperez@colorado.edu>
5811 5819
5812 5820 * Changed @file so that it opens the source file at the proper
5813 5821 line. Since it uses less, if your EDITOR environment is
5814 5822 configured, typing v will immediately open your editor of choice
5815 5823 right at the line where the object is defined. Not as quick as
5816 5824 having a direct @edit command, but for all intents and purposes it
5817 5825 works. And I don't have to worry about writing @edit to deal with
5818 5826 all the editors, less does that.
5819 5827
5820 5828 * Version 0.1.16 released, 0.1.17 opened.
5821 5829
5822 5830 * Fixed some nasty bugs in the page/page_dumb combo that could
5823 5831 crash IPython.
5824 5832
5825 5833 2001-11-27 Fernando Perez <fperez@colorado.edu>
5826 5834
5827 5835 * Version 0.1.15 released, 0.1.16 opened.
5828 5836
5829 5837 * Finally got ? and ?? to work for undefined things: now it's
5830 5838 possible to type {}.get? and get information about the get method
5831 5839 of dicts, or os.path? even if only os is defined (so technically
5832 5840 os.path isn't). Works at any level. For example, after import os,
5833 5841 os?, os.path?, os.path.abspath? all work. This is great, took some
5834 5842 work in _ofind.
5835 5843
5836 5844 * Fixed more bugs with logging. The sanest way to do it was to add
5837 5845 to @log a 'mode' parameter. Killed two in one shot (this mode
5838 5846 option was a request of Janko's). I think it's finally clean
5839 5847 (famous last words).
5840 5848
5841 5849 * Added a page_dumb() pager which does a decent job of paging on
5842 5850 screen, if better things (like less) aren't available. One less
5843 5851 unix dependency (someday maybe somebody will port this to
5844 5852 windows).
5845 5853
5846 5854 * Fixed problem in magic_log: would lock of logging out if log
5847 5855 creation failed (because it would still think it had succeeded).
5848 5856
5849 5857 * Improved the page() function using curses to auto-detect screen
5850 5858 size. Now it can make a much better decision on whether to print
5851 5859 or page a string. Option screen_length was modified: a value 0
5852 5860 means auto-detect, and that's the default now.
5853 5861
5854 5862 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
5855 5863 go out. I'll test it for a few days, then talk to Janko about
5856 5864 licences and announce it.
5857 5865
5858 5866 * Fixed the length of the auto-generated ---> prompt which appears
5859 5867 for auto-parens and auto-quotes. Getting this right isn't trivial,
5860 5868 with all the color escapes, different prompt types and optional
5861 5869 separators. But it seems to be working in all the combinations.
5862 5870
5863 5871 2001-11-26 Fernando Perez <fperez@colorado.edu>
5864 5872
5865 5873 * Wrote a regexp filter to get option types from the option names
5866 5874 string. This eliminates the need to manually keep two duplicate
5867 5875 lists.
5868 5876
5869 5877 * Removed the unneeded check_option_names. Now options are handled
5870 5878 in a much saner manner and it's easy to visually check that things
5871 5879 are ok.
5872 5880
5873 5881 * Updated version numbers on all files I modified to carry a
5874 5882 notice so Janko and Nathan have clear version markers.
5875 5883
5876 5884 * Updated docstring for ultraTB with my changes. I should send
5877 5885 this to Nathan.
5878 5886
5879 5887 * Lots of small fixes. Ran everything through pychecker again.
5880 5888
5881 5889 * Made loading of deep_reload an cmd line option. If it's not too
5882 5890 kosher, now people can just disable it. With -nodeep_reload it's
5883 5891 still available as dreload(), it just won't overwrite reload().
5884 5892
5885 5893 * Moved many options to the no| form (-opt and -noopt
5886 5894 accepted). Cleaner.
5887 5895
5888 5896 * Changed magic_log so that if called with no parameters, it uses
5889 5897 'rotate' mode. That way auto-generated logs aren't automatically
5890 5898 over-written. For normal logs, now a backup is made if it exists
5891 5899 (only 1 level of backups). A new 'backup' mode was added to the
5892 5900 Logger class to support this. This was a request by Janko.
5893 5901
5894 5902 * Added @logoff/@logon to stop/restart an active log.
5895 5903
5896 5904 * Fixed a lot of bugs in log saving/replay. It was pretty
5897 5905 broken. Now special lines (!@,/) appear properly in the command
5898 5906 history after a log replay.
5899 5907
5900 5908 * Tried and failed to implement full session saving via pickle. My
5901 5909 idea was to pickle __main__.__dict__, but modules can't be
5902 5910 pickled. This would be a better alternative to replaying logs, but
5903 5911 seems quite tricky to get to work. Changed -session to be called
5904 5912 -logplay, which more accurately reflects what it does. And if we
5905 5913 ever get real session saving working, -session is now available.
5906 5914
5907 5915 * Implemented color schemes for prompts also. As for tracebacks,
5908 5916 currently only NoColor and Linux are supported. But now the
5909 5917 infrastructure is in place, based on a generic ColorScheme
5910 5918 class. So writing and activating new schemes both for the prompts
5911 5919 and the tracebacks should be straightforward.
5912 5920
5913 5921 * Version 0.1.13 released, 0.1.14 opened.
5914 5922
5915 5923 * Changed handling of options for output cache. Now counter is
5916 5924 hardwired starting at 1 and one specifies the maximum number of
5917 5925 entries *in the outcache* (not the max prompt counter). This is
5918 5926 much better, since many statements won't increase the cache
5919 5927 count. It also eliminated some confusing options, now there's only
5920 5928 one: cache_size.
5921 5929
5922 5930 * Added 'alias' magic function and magic_alias option in the
5923 5931 ipythonrc file. Now the user can easily define whatever names he
5924 5932 wants for the magic functions without having to play weird
5925 5933 namespace games. This gives IPython a real shell-like feel.
5926 5934
5927 5935 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
5928 5936 @ or not).
5929 5937
5930 5938 This was one of the last remaining 'visible' bugs (that I know
5931 5939 of). I think if I can clean up the session loading so it works
5932 5940 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
5933 5941 about licensing).
5934 5942
5935 5943 2001-11-25 Fernando Perez <fperez@colorado.edu>
5936 5944
5937 5945 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
5938 5946 there's a cleaner distinction between what ? and ?? show.
5939 5947
5940 5948 * Added screen_length option. Now the user can define his own
5941 5949 screen size for page() operations.
5942 5950
5943 5951 * Implemented magic shell-like functions with automatic code
5944 5952 generation. Now adding another function is just a matter of adding
5945 5953 an entry to a dict, and the function is dynamically generated at
5946 5954 run-time. Python has some really cool features!
5947 5955
5948 5956 * Renamed many options to cleanup conventions a little. Now all
5949 5957 are lowercase, and only underscores where needed. Also in the code
5950 5958 option name tables are clearer.
5951 5959
5952 5960 * Changed prompts a little. Now input is 'In [n]:' instead of
5953 5961 'In[n]:='. This allows it the numbers to be aligned with the
5954 5962 Out[n] numbers, and removes usage of ':=' which doesn't exist in
5955 5963 Python (it was a Mathematica thing). The '...' continuation prompt
5956 5964 was also changed a little to align better.
5957 5965
5958 5966 * Fixed bug when flushing output cache. Not all _p<n> variables
5959 5967 exist, so their deletion needs to be wrapped in a try:
5960 5968
5961 5969 * Figured out how to properly use inspect.formatargspec() (it
5962 5970 requires the args preceded by *). So I removed all the code from
5963 5971 _get_pdef in Magic, which was just replicating that.
5964 5972
5965 5973 * Added test to prefilter to allow redefining magic function names
5966 5974 as variables. This is ok, since the @ form is always available,
5967 5975 but whe should allow the user to define a variable called 'ls' if
5968 5976 he needs it.
5969 5977
5970 5978 * Moved the ToDo information from README into a separate ToDo.
5971 5979
5972 5980 * General code cleanup and small bugfixes. I think it's close to a
5973 5981 state where it can be released, obviously with a big 'beta'
5974 5982 warning on it.
5975 5983
5976 5984 * Got the magic function split to work. Now all magics are defined
5977 5985 in a separate class. It just organizes things a bit, and now
5978 5986 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
5979 5987 was too long).
5980 5988
5981 5989 * Changed @clear to @reset to avoid potential confusions with
5982 5990 the shell command clear. Also renamed @cl to @clear, which does
5983 5991 exactly what people expect it to from their shell experience.
5984 5992
5985 5993 Added a check to the @reset command (since it's so
5986 5994 destructive, it's probably a good idea to ask for confirmation).
5987 5995 But now reset only works for full namespace resetting. Since the
5988 5996 del keyword is already there for deleting a few specific
5989 5997 variables, I don't see the point of having a redundant magic
5990 5998 function for the same task.
5991 5999
5992 6000 2001-11-24 Fernando Perez <fperez@colorado.edu>
5993 6001
5994 6002 * Updated the builtin docs (esp. the ? ones).
5995 6003
5996 6004 * Ran all the code through pychecker. Not terribly impressed with
5997 6005 it: lots of spurious warnings and didn't really find anything of
5998 6006 substance (just a few modules being imported and not used).
5999 6007
6000 6008 * Implemented the new ultraTB functionality into IPython. New
6001 6009 option: xcolors. This chooses color scheme. xmode now only selects
6002 6010 between Plain and Verbose. Better orthogonality.
6003 6011
6004 6012 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6005 6013 mode and color scheme for the exception handlers. Now it's
6006 6014 possible to have the verbose traceback with no coloring.
6007 6015
6008 6016 2001-11-23 Fernando Perez <fperez@colorado.edu>
6009 6017
6010 6018 * Version 0.1.12 released, 0.1.13 opened.
6011 6019
6012 6020 * Removed option to set auto-quote and auto-paren escapes by
6013 6021 user. The chances of breaking valid syntax are just too high. If
6014 6022 someone *really* wants, they can always dig into the code.
6015 6023
6016 6024 * Made prompt separators configurable.
6017 6025
6018 6026 2001-11-22 Fernando Perez <fperez@colorado.edu>
6019 6027
6020 6028 * Small bugfixes in many places.
6021 6029
6022 6030 * Removed the MyCompleter class from ipplib. It seemed redundant
6023 6031 with the C-p,C-n history search functionality. Less code to
6024 6032 maintain.
6025 6033
6026 6034 * Moved all the original ipython.py code into ipythonlib.py. Right
6027 6035 now it's just one big dump into a function called make_IPython, so
6028 6036 no real modularity has been gained. But at least it makes the
6029 6037 wrapper script tiny, and since ipythonlib is a module, it gets
6030 6038 compiled and startup is much faster.
6031 6039
6032 6040 This is a reasobably 'deep' change, so we should test it for a
6033 6041 while without messing too much more with the code.
6034 6042
6035 6043 2001-11-21 Fernando Perez <fperez@colorado.edu>
6036 6044
6037 6045 * Version 0.1.11 released, 0.1.12 opened for further work.
6038 6046
6039 6047 * Removed dependency on Itpl. It was only needed in one place. It
6040 6048 would be nice if this became part of python, though. It makes life
6041 6049 *a lot* easier in some cases.
6042 6050
6043 6051 * Simplified the prefilter code a bit. Now all handlers are
6044 6052 expected to explicitly return a value (at least a blank string).
6045 6053
6046 6054 * Heavy edits in ipplib. Removed the help system altogether. Now
6047 6055 obj?/?? is used for inspecting objects, a magic @doc prints
6048 6056 docstrings, and full-blown Python help is accessed via the 'help'
6049 6057 keyword. This cleans up a lot of code (less to maintain) and does
6050 6058 the job. Since 'help' is now a standard Python component, might as
6051 6059 well use it and remove duplicate functionality.
6052 6060
6053 6061 Also removed the option to use ipplib as a standalone program. By
6054 6062 now it's too dependent on other parts of IPython to function alone.
6055 6063
6056 6064 * Fixed bug in genutils.pager. It would crash if the pager was
6057 6065 exited immediately after opening (broken pipe).
6058 6066
6059 6067 * Trimmed down the VerboseTB reporting a little. The header is
6060 6068 much shorter now and the repeated exception arguments at the end
6061 6069 have been removed. For interactive use the old header seemed a bit
6062 6070 excessive.
6063 6071
6064 6072 * Fixed small bug in output of @whos for variables with multi-word
6065 6073 types (only first word was displayed).
6066 6074
6067 6075 2001-11-17 Fernando Perez <fperez@colorado.edu>
6068 6076
6069 6077 * Version 0.1.10 released, 0.1.11 opened for further work.
6070 6078
6071 6079 * Modified dirs and friends. dirs now *returns* the stack (not
6072 6080 prints), so one can manipulate it as a variable. Convenient to
6073 6081 travel along many directories.
6074 6082
6075 6083 * Fixed bug in magic_pdef: would only work with functions with
6076 6084 arguments with default values.
6077 6085
6078 6086 2001-11-14 Fernando Perez <fperez@colorado.edu>
6079 6087
6080 6088 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6081 6089 example with IPython. Various other minor fixes and cleanups.
6082 6090
6083 6091 * Version 0.1.9 released, 0.1.10 opened for further work.
6084 6092
6085 6093 * Added sys.path to the list of directories searched in the
6086 6094 execfile= option. It used to be the current directory and the
6087 6095 user's IPYTHONDIR only.
6088 6096
6089 6097 2001-11-13 Fernando Perez <fperez@colorado.edu>
6090 6098
6091 6099 * Reinstated the raw_input/prefilter separation that Janko had
6092 6100 initially. This gives a more convenient setup for extending the
6093 6101 pre-processor from the outside: raw_input always gets a string,
6094 6102 and prefilter has to process it. We can then redefine prefilter
6095 6103 from the outside and implement extensions for special
6096 6104 purposes.
6097 6105
6098 6106 Today I got one for inputting PhysicalQuantity objects
6099 6107 (from Scientific) without needing any function calls at
6100 6108 all. Extremely convenient, and it's all done as a user-level
6101 6109 extension (no IPython code was touched). Now instead of:
6102 6110 a = PhysicalQuantity(4.2,'m/s**2')
6103 6111 one can simply say
6104 6112 a = 4.2 m/s**2
6105 6113 or even
6106 6114 a = 4.2 m/s^2
6107 6115
6108 6116 I use this, but it's also a proof of concept: IPython really is
6109 6117 fully user-extensible, even at the level of the parsing of the
6110 6118 command line. It's not trivial, but it's perfectly doable.
6111 6119
6112 6120 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6113 6121 the problem of modules being loaded in the inverse order in which
6114 6122 they were defined in
6115 6123
6116 6124 * Version 0.1.8 released, 0.1.9 opened for further work.
6117 6125
6118 6126 * Added magics pdef, source and file. They respectively show the
6119 6127 definition line ('prototype' in C), source code and full python
6120 6128 file for any callable object. The object inspector oinfo uses
6121 6129 these to show the same information.
6122 6130
6123 6131 * Version 0.1.7 released, 0.1.8 opened for further work.
6124 6132
6125 6133 * Separated all the magic functions into a class called Magic. The
6126 6134 InteractiveShell class was becoming too big for Xemacs to handle
6127 6135 (de-indenting a line would lock it up for 10 seconds while it
6128 6136 backtracked on the whole class!)
6129 6137
6130 6138 FIXME: didn't work. It can be done, but right now namespaces are
6131 6139 all messed up. Do it later (reverted it for now, so at least
6132 6140 everything works as before).
6133 6141
6134 6142 * Got the object introspection system (magic_oinfo) working! I
6135 6143 think this is pretty much ready for release to Janko, so he can
6136 6144 test it for a while and then announce it. Pretty much 100% of what
6137 6145 I wanted for the 'phase 1' release is ready. Happy, tired.
6138 6146
6139 6147 2001-11-12 Fernando Perez <fperez@colorado.edu>
6140 6148
6141 6149 * Version 0.1.6 released, 0.1.7 opened for further work.
6142 6150
6143 6151 * Fixed bug in printing: it used to test for truth before
6144 6152 printing, so 0 wouldn't print. Now checks for None.
6145 6153
6146 6154 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6147 6155 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6148 6156 reaches by hand into the outputcache. Think of a better way to do
6149 6157 this later.
6150 6158
6151 6159 * Various small fixes thanks to Nathan's comments.
6152 6160
6153 6161 * Changed magic_pprint to magic_Pprint. This way it doesn't
6154 6162 collide with pprint() and the name is consistent with the command
6155 6163 line option.
6156 6164
6157 6165 * Changed prompt counter behavior to be fully like
6158 6166 Mathematica's. That is, even input that doesn't return a result
6159 6167 raises the prompt counter. The old behavior was kind of confusing
6160 6168 (getting the same prompt number several times if the operation
6161 6169 didn't return a result).
6162 6170
6163 6171 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6164 6172
6165 6173 * Fixed -Classic mode (wasn't working anymore).
6166 6174
6167 6175 * Added colored prompts using Nathan's new code. Colors are
6168 6176 currently hardwired, they can be user-configurable. For
6169 6177 developers, they can be chosen in file ipythonlib.py, at the
6170 6178 beginning of the CachedOutput class def.
6171 6179
6172 6180 2001-11-11 Fernando Perez <fperez@colorado.edu>
6173 6181
6174 6182 * Version 0.1.5 released, 0.1.6 opened for further work.
6175 6183
6176 6184 * Changed magic_env to *return* the environment as a dict (not to
6177 6185 print it). This way it prints, but it can also be processed.
6178 6186
6179 6187 * Added Verbose exception reporting to interactive
6180 6188 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6181 6189 traceback. Had to make some changes to the ultraTB file. This is
6182 6190 probably the last 'big' thing in my mental todo list. This ties
6183 6191 in with the next entry:
6184 6192
6185 6193 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6186 6194 has to specify is Plain, Color or Verbose for all exception
6187 6195 handling.
6188 6196
6189 6197 * Removed ShellServices option. All this can really be done via
6190 6198 the magic system. It's easier to extend, cleaner and has automatic
6191 6199 namespace protection and documentation.
6192 6200
6193 6201 2001-11-09 Fernando Perez <fperez@colorado.edu>
6194 6202
6195 6203 * Fixed bug in output cache flushing (missing parameter to
6196 6204 __init__). Other small bugs fixed (found using pychecker).
6197 6205
6198 6206 * Version 0.1.4 opened for bugfixing.
6199 6207
6200 6208 2001-11-07 Fernando Perez <fperez@colorado.edu>
6201 6209
6202 6210 * Version 0.1.3 released, mainly because of the raw_input bug.
6203 6211
6204 6212 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6205 6213 and when testing for whether things were callable, a call could
6206 6214 actually be made to certain functions. They would get called again
6207 6215 once 'really' executed, with a resulting double call. A disaster
6208 6216 in many cases (list.reverse() would never work!).
6209 6217
6210 6218 * Removed prefilter() function, moved its code to raw_input (which
6211 6219 after all was just a near-empty caller for prefilter). This saves
6212 6220 a function call on every prompt, and simplifies the class a tiny bit.
6213 6221
6214 6222 * Fix _ip to __ip name in magic example file.
6215 6223
6216 6224 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6217 6225 work with non-gnu versions of tar.
6218 6226
6219 6227 2001-11-06 Fernando Perez <fperez@colorado.edu>
6220 6228
6221 6229 * Version 0.1.2. Just to keep track of the recent changes.
6222 6230
6223 6231 * Fixed nasty bug in output prompt routine. It used to check 'if
6224 6232 arg != None...'. Problem is, this fails if arg implements a
6225 6233 special comparison (__cmp__) which disallows comparing to
6226 6234 None. Found it when trying to use the PhysicalQuantity module from
6227 6235 ScientificPython.
6228 6236
6229 6237 2001-11-05 Fernando Perez <fperez@colorado.edu>
6230 6238
6231 6239 * Also added dirs. Now the pushd/popd/dirs family functions
6232 6240 basically like the shell, with the added convenience of going home
6233 6241 when called with no args.
6234 6242
6235 6243 * pushd/popd slightly modified to mimic shell behavior more
6236 6244 closely.
6237 6245
6238 6246 * Added env,pushd,popd from ShellServices as magic functions. I
6239 6247 think the cleanest will be to port all desired functions from
6240 6248 ShellServices as magics and remove ShellServices altogether. This
6241 6249 will provide a single, clean way of adding functionality
6242 6250 (shell-type or otherwise) to IP.
6243 6251
6244 6252 2001-11-04 Fernando Perez <fperez@colorado.edu>
6245 6253
6246 6254 * Added .ipython/ directory to sys.path. This way users can keep
6247 6255 customizations there and access them via import.
6248 6256
6249 6257 2001-11-03 Fernando Perez <fperez@colorado.edu>
6250 6258
6251 6259 * Opened version 0.1.1 for new changes.
6252 6260
6253 6261 * Changed version number to 0.1.0: first 'public' release, sent to
6254 6262 Nathan and Janko.
6255 6263
6256 6264 * Lots of small fixes and tweaks.
6257 6265
6258 6266 * Minor changes to whos format. Now strings are shown, snipped if
6259 6267 too long.
6260 6268
6261 6269 * Changed ShellServices to work on __main__ so they show up in @who
6262 6270
6263 6271 * Help also works with ? at the end of a line:
6264 6272 ?sin and sin?
6265 6273 both produce the same effect. This is nice, as often I use the
6266 6274 tab-complete to find the name of a method, but I used to then have
6267 6275 to go to the beginning of the line to put a ? if I wanted more
6268 6276 info. Now I can just add the ? and hit return. Convenient.
6269 6277
6270 6278 2001-11-02 Fernando Perez <fperez@colorado.edu>
6271 6279
6272 6280 * Python version check (>=2.1) added.
6273 6281
6274 6282 * Added LazyPython documentation. At this point the docs are quite
6275 6283 a mess. A cleanup is in order.
6276 6284
6277 6285 * Auto-installer created. For some bizarre reason, the zipfiles
6278 6286 module isn't working on my system. So I made a tar version
6279 6287 (hopefully the command line options in various systems won't kill
6280 6288 me).
6281 6289
6282 6290 * Fixes to Struct in genutils. Now all dictionary-like methods are
6283 6291 protected (reasonably).
6284 6292
6285 6293 * Added pager function to genutils and changed ? to print usage
6286 6294 note through it (it was too long).
6287 6295
6288 6296 * Added the LazyPython functionality. Works great! I changed the
6289 6297 auto-quote escape to ';', it's on home row and next to '. But
6290 6298 both auto-quote and auto-paren (still /) escapes are command-line
6291 6299 parameters.
6292 6300
6293 6301
6294 6302 2001-11-01 Fernando Perez <fperez@colorado.edu>
6295 6303
6296 6304 * Version changed to 0.0.7. Fairly large change: configuration now
6297 6305 is all stored in a directory, by default .ipython. There, all
6298 6306 config files have normal looking names (not .names)
6299 6307
6300 6308 * Version 0.0.6 Released first to Lucas and Archie as a test
6301 6309 run. Since it's the first 'semi-public' release, change version to
6302 6310 > 0.0.6 for any changes now.
6303 6311
6304 6312 * Stuff I had put in the ipplib.py changelog:
6305 6313
6306 6314 Changes to InteractiveShell:
6307 6315
6308 6316 - Made the usage message a parameter.
6309 6317
6310 6318 - Require the name of the shell variable to be given. It's a bit
6311 6319 of a hack, but allows the name 'shell' not to be hardwired in the
6312 6320 magic (@) handler, which is problematic b/c it requires
6313 6321 polluting the global namespace with 'shell'. This in turn is
6314 6322 fragile: if a user redefines a variable called shell, things
6315 6323 break.
6316 6324
6317 6325 - magic @: all functions available through @ need to be defined
6318 6326 as magic_<name>, even though they can be called simply as
6319 6327 @<name>. This allows the special command @magic to gather
6320 6328 information automatically about all existing magic functions,
6321 6329 even if they are run-time user extensions, by parsing the shell
6322 6330 instance __dict__ looking for special magic_ names.
6323 6331
6324 6332 - mainloop: added *two* local namespace parameters. This allows
6325 6333 the class to differentiate between parameters which were there
6326 6334 before and after command line initialization was processed. This
6327 6335 way, later @who can show things loaded at startup by the
6328 6336 user. This trick was necessary to make session saving/reloading
6329 6337 really work: ideally after saving/exiting/reloading a session,
6330 6338 *everything* should look the same, including the output of @who. I
6331 6339 was only able to make this work with this double namespace
6332 6340 trick.
6333 6341
6334 6342 - added a header to the logfile which allows (almost) full
6335 6343 session restoring.
6336 6344
6337 6345 - prepend lines beginning with @ or !, with a and log
6338 6346 them. Why? !lines: may be useful to know what you did @lines:
6339 6347 they may affect session state. So when restoring a session, at
6340 6348 least inform the user of their presence. I couldn't quite get
6341 6349 them to properly re-execute, but at least the user is warned.
6342 6350
6343 6351 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now