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