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