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