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