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