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