##// END OF EJS Templates
Fully disable -twisted option (though the twshell code remains
Fernando Perez -
Show More
@@ -1,1235 +1,1225 b''
1 1 # -*- coding: utf-8 -*-
2 2 """IPython Shell classes.
3 3
4 4 All the matplotlib support code was co-developed with John Hunter,
5 5 matplotlib's author.
6 6
7 7 $Id: Shell.py 3024 2008-02-07 15:34:42Z darren.dale $"""
8 8
9 9 #*****************************************************************************
10 10 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
11 11 #
12 12 # Distributed under the terms of the BSD License. The full license is in
13 13 # the file COPYING, distributed as part of this software.
14 14 #*****************************************************************************
15 15
16 16 from IPython import Release
17 17 __author__ = '%s <%s>' % Release.authors['Fernando']
18 18 __license__ = Release.license
19 19
20 20 # Code begins
21 21 # Stdlib imports
22 22 import __builtin__
23 23 import __main__
24 24 import Queue
25 25 import inspect
26 26 import os
27 27 import sys
28 28 import thread
29 29 import threading
30 30 import time
31 31
32 32 from signal import signal, SIGINT
33 33
34 34 try:
35 35 import ctypes
36 36 HAS_CTYPES = True
37 37 except ImportError:
38 38 HAS_CTYPES = False
39 39
40 40 # IPython imports
41 41 import IPython
42 42 from IPython import ultraTB, ipapi
43 43 from IPython.genutils import Term,warn,error,flag_calls, ask_yes_no
44 44 from IPython.iplib import InteractiveShell
45 45 from IPython.ipmaker import make_IPython
46 46 from IPython.Magic import Magic
47 47 from IPython.ipstruct import Struct
48 48
49 49 try: # Python 2.3 compatibility
50 50 set
51 51 except NameError:
52 52 import sets
53 53 set = sets.Set
54 54
55 55
56 56 # Globals
57 57 # global flag to pass around information about Ctrl-C without exceptions
58 58 KBINT = False
59 59
60 60 # global flag to turn on/off Tk support.
61 61 USE_TK = False
62 62
63 63 # ID for the main thread, used for cross-thread exceptions
64 64 MAIN_THREAD_ID = thread.get_ident()
65 65
66 66 # Tag when runcode() is active, for exception handling
67 67 CODE_RUN = None
68 68
69 69 #-----------------------------------------------------------------------------
70 70 # This class is trivial now, but I want to have it in to publish a clean
71 71 # interface. Later when the internals are reorganized, code that uses this
72 72 # shouldn't have to change.
73 73
74 74 class IPShell:
75 75 """Create an IPython instance."""
76 76
77 77 def __init__(self,argv=None,user_ns=None,user_global_ns=None,
78 78 debug=1,shell_class=InteractiveShell):
79 79 self.IP = make_IPython(argv,user_ns=user_ns,
80 80 user_global_ns=user_global_ns,
81 81 debug=debug,shell_class=shell_class)
82 82
83 83 def mainloop(self,sys_exit=0,banner=None):
84 84 self.IP.mainloop(banner)
85 85 if sys_exit:
86 86 sys.exit()
87 87
88 88 #-----------------------------------------------------------------------------
89 89 def kill_embedded(self,parameter_s=''):
90 90 """%kill_embedded : deactivate for good the current embedded IPython.
91 91
92 92 This function (after asking for confirmation) sets an internal flag so that
93 93 an embedded IPython will never activate again. This is useful to
94 94 permanently disable a shell that is being called inside a loop: once you've
95 95 figured out what you needed from it, you may then kill it and the program
96 96 will then continue to run without the interactive shell interfering again.
97 97 """
98 98
99 99 kill = ask_yes_no("Are you sure you want to kill this embedded instance "
100 100 "(y/n)? [y/N] ",'n')
101 101 if kill:
102 102 self.shell.embedded_active = False
103 103 print "This embedded IPython will not reactivate anymore once you exit."
104 104
105 105 class IPShellEmbed:
106 106 """Allow embedding an IPython shell into a running program.
107 107
108 108 Instances of this class are callable, with the __call__ method being an
109 109 alias to the embed() method of an InteractiveShell instance.
110 110
111 111 Usage (see also the example-embed.py file for a running example):
112 112
113 113 ipshell = IPShellEmbed([argv,banner,exit_msg,rc_override])
114 114
115 115 - argv: list containing valid command-line options for IPython, as they
116 116 would appear in sys.argv[1:].
117 117
118 118 For example, the following command-line options:
119 119
120 120 $ ipython -prompt_in1 'Input <\\#>' -colors LightBG
121 121
122 122 would be passed in the argv list as:
123 123
124 124 ['-prompt_in1','Input <\\#>','-colors','LightBG']
125 125
126 126 - banner: string which gets printed every time the interpreter starts.
127 127
128 128 - exit_msg: string which gets printed every time the interpreter exits.
129 129
130 130 - rc_override: a dict or Struct of configuration options such as those
131 131 used by IPython. These options are read from your ~/.ipython/ipythonrc
132 132 file when the Shell object is created. Passing an explicit rc_override
133 133 dict with any options you want allows you to override those values at
134 134 creation time without having to modify the file. This way you can create
135 135 embeddable instances configured in any way you want without editing any
136 136 global files (thus keeping your interactive IPython configuration
137 137 unchanged).
138 138
139 139 Then the ipshell instance can be called anywhere inside your code:
140 140
141 141 ipshell(header='') -> Opens up an IPython shell.
142 142
143 143 - header: string printed by the IPython shell upon startup. This can let
144 144 you know where in your code you are when dropping into the shell. Note
145 145 that 'banner' gets prepended to all calls, so header is used for
146 146 location-specific information.
147 147
148 148 For more details, see the __call__ method below.
149 149
150 150 When the IPython shell is exited with Ctrl-D, normal program execution
151 151 resumes.
152 152
153 153 This functionality was inspired by a posting on comp.lang.python by cmkl
154 154 <cmkleffner@gmx.de> on Dec. 06/01 concerning similar uses of pyrepl, and
155 155 by the IDL stop/continue commands."""
156 156
157 157 def __init__(self,argv=None,banner='',exit_msg=None,rc_override=None,
158 158 user_ns=None):
159 159 """Note that argv here is a string, NOT a list."""
160 160 self.set_banner(banner)
161 161 self.set_exit_msg(exit_msg)
162 162 self.set_dummy_mode(0)
163 163
164 164 # sys.displayhook is a global, we need to save the user's original
165 165 # Don't rely on __displayhook__, as the user may have changed that.
166 166 self.sys_displayhook_ori = sys.displayhook
167 167
168 168 # save readline completer status
169 169 try:
170 170 #print 'Save completer',sys.ipcompleter # dbg
171 171 self.sys_ipcompleter_ori = sys.ipcompleter
172 172 except:
173 173 pass # not nested with IPython
174 174
175 175 self.IP = make_IPython(argv,rc_override=rc_override,
176 176 embedded=True,
177 177 user_ns=user_ns)
178 178
179 179 ip = ipapi.IPApi(self.IP)
180 180 ip.expose_magic("kill_embedded",kill_embedded)
181 181
182 182 # copy our own displayhook also
183 183 self.sys_displayhook_embed = sys.displayhook
184 184 # and leave the system's display hook clean
185 185 sys.displayhook = self.sys_displayhook_ori
186 186 # don't use the ipython crash handler so that user exceptions aren't
187 187 # trapped
188 188 sys.excepthook = ultraTB.FormattedTB(color_scheme = self.IP.rc.colors,
189 189 mode = self.IP.rc.xmode,
190 190 call_pdb = self.IP.rc.pdb)
191 191 self.restore_system_completer()
192 192
193 193 def restore_system_completer(self):
194 194 """Restores the readline completer which was in place.
195 195
196 196 This allows embedded IPython within IPython not to disrupt the
197 197 parent's completion.
198 198 """
199 199
200 200 try:
201 201 self.IP.readline.set_completer(self.sys_ipcompleter_ori)
202 202 sys.ipcompleter = self.sys_ipcompleter_ori
203 203 except:
204 204 pass
205 205
206 206 def __call__(self,header='',local_ns=None,global_ns=None,dummy=None):
207 207 """Activate the interactive interpreter.
208 208
209 209 __call__(self,header='',local_ns=None,global_ns,dummy=None) -> Start
210 210 the interpreter shell with the given local and global namespaces, and
211 211 optionally print a header string at startup.
212 212
213 213 The shell can be globally activated/deactivated using the
214 214 set/get_dummy_mode methods. This allows you to turn off a shell used
215 215 for debugging globally.
216 216
217 217 However, *each* time you call the shell you can override the current
218 218 state of dummy_mode with the optional keyword parameter 'dummy'. For
219 219 example, if you set dummy mode on with IPShell.set_dummy_mode(1), you
220 220 can still have a specific call work by making it as IPShell(dummy=0).
221 221
222 222 The optional keyword parameter dummy controls whether the call
223 223 actually does anything. """
224 224
225 225 # If the user has turned it off, go away
226 226 if not self.IP.embedded_active:
227 227 return
228 228
229 229 # Normal exits from interactive mode set this flag, so the shell can't
230 230 # re-enter (it checks this variable at the start of interactive mode).
231 231 self.IP.exit_now = False
232 232
233 233 # Allow the dummy parameter to override the global __dummy_mode
234 234 if dummy or (dummy != 0 and self.__dummy_mode):
235 235 return
236 236
237 237 # Set global subsystems (display,completions) to our values
238 238 sys.displayhook = self.sys_displayhook_embed
239 239 if self.IP.has_readline:
240 240 self.IP.set_completer()
241 241
242 242 if self.banner and header:
243 243 format = '%s\n%s\n'
244 244 else:
245 245 format = '%s%s\n'
246 246 banner = format % (self.banner,header)
247 247
248 248 # Call the embedding code with a stack depth of 1 so it can skip over
249 249 # our call and get the original caller's namespaces.
250 250 self.IP.embed_mainloop(banner,local_ns,global_ns,stack_depth=1)
251 251
252 252 if self.exit_msg:
253 253 print self.exit_msg
254 254
255 255 # Restore global systems (display, completion)
256 256 sys.displayhook = self.sys_displayhook_ori
257 257 self.restore_system_completer()
258 258
259 259 def set_dummy_mode(self,dummy):
260 260 """Sets the embeddable shell's dummy mode parameter.
261 261
262 262 set_dummy_mode(dummy): dummy = 0 or 1.
263 263
264 264 This parameter is persistent and makes calls to the embeddable shell
265 265 silently return without performing any action. This allows you to
266 266 globally activate or deactivate a shell you're using with a single call.
267 267
268 268 If you need to manually"""
269 269
270 270 if dummy not in [0,1,False,True]:
271 271 raise ValueError,'dummy parameter must be boolean'
272 272 self.__dummy_mode = dummy
273 273
274 274 def get_dummy_mode(self):
275 275 """Return the current value of the dummy mode parameter.
276 276 """
277 277 return self.__dummy_mode
278 278
279 279 def set_banner(self,banner):
280 280 """Sets the global banner.
281 281
282 282 This banner gets prepended to every header printed when the shell
283 283 instance is called."""
284 284
285 285 self.banner = banner
286 286
287 287 def set_exit_msg(self,exit_msg):
288 288 """Sets the global exit_msg.
289 289
290 290 This exit message gets printed upon exiting every time the embedded
291 291 shell is called. It is None by default. """
292 292
293 293 self.exit_msg = exit_msg
294 294
295 295 #-----------------------------------------------------------------------------
296 296 if HAS_CTYPES:
297 297 # Add async exception support. Trick taken from:
298 298 # http://sebulba.wikispaces.com/recipe+thread2
299 299 def _async_raise(tid, exctype):
300 300 """raises the exception, performs cleanup if needed"""
301 301 if not inspect.isclass(exctype):
302 302 raise TypeError("Only types can be raised (not instances)")
303 303 res = ctypes.pythonapi.PyThreadState_SetAsyncExc(tid,
304 304 ctypes.py_object(exctype))
305 305 if res == 0:
306 306 raise ValueError("invalid thread id")
307 307 elif res != 1:
308 308 # """if it returns a number greater than one, you're in trouble,
309 309 # and you should call it again with exc=NULL to revert the effect"""
310 310 ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, 0)
311 311 raise SystemError("PyThreadState_SetAsyncExc failed")
312 312
313 313 def sigint_handler (signum,stack_frame):
314 314 """Sigint handler for threaded apps.
315 315
316 316 This is a horrible hack to pass information about SIGINT _without_
317 317 using exceptions, since I haven't been able to properly manage
318 318 cross-thread exceptions in GTK/WX. In fact, I don't think it can be
319 319 done (or at least that's my understanding from a c.l.py thread where
320 320 this was discussed)."""
321 321
322 322 global KBINT
323 323
324 324 if CODE_RUN:
325 325 _async_raise(MAIN_THREAD_ID,KeyboardInterrupt)
326 326 else:
327 327 KBINT = True
328 328 print '\nKeyboardInterrupt - Press <Enter> to continue.',
329 329 Term.cout.flush()
330 330
331 331 else:
332 332 def sigint_handler (signum,stack_frame):
333 333 """Sigint handler for threaded apps.
334 334
335 335 This is a horrible hack to pass information about SIGINT _without_
336 336 using exceptions, since I haven't been able to properly manage
337 337 cross-thread exceptions in GTK/WX. In fact, I don't think it can be
338 338 done (or at least that's my understanding from a c.l.py thread where
339 339 this was discussed)."""
340 340
341 341 global KBINT
342 342
343 343 print '\nKeyboardInterrupt - Press <Enter> to continue.',
344 344 Term.cout.flush()
345 345 # Set global flag so that runsource can know that Ctrl-C was hit
346 346 KBINT = True
347 347
348 348
349 349 class MTInteractiveShell(InteractiveShell):
350 350 """Simple multi-threaded shell."""
351 351
352 352 # Threading strategy taken from:
353 353 # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by Brian
354 354 # McErlean and John Finlay. Modified with corrections by Antoon Pardon,
355 355 # from the pygtk mailing list, to avoid lockups with system calls.
356 356
357 357 # class attribute to indicate whether the class supports threads or not.
358 358 # Subclasses with thread support should override this as needed.
359 359 isthreaded = True
360 360
361 361 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
362 362 user_ns=None,user_global_ns=None,banner2='',**kw):
363 363 """Similar to the normal InteractiveShell, but with threading control"""
364 364
365 365 InteractiveShell.__init__(self,name,usage,rc,user_ns,
366 366 user_global_ns,banner2)
367 367
368 368
369 369 # A queue to hold the code to be executed.
370 370 self.code_queue = Queue.Queue()
371 371
372 372 # Stuff to do at closing time
373 373 self._kill = None
374 374 on_kill = kw.get('on_kill', [])
375 375 # Check that all things to kill are callable:
376 376 for t in on_kill:
377 377 if not callable(t):
378 378 raise TypeError,'on_kill must be a list of callables'
379 379 self.on_kill = on_kill
380 380 # thread identity of the "worker thread" (that may execute code directly)
381 381 self.worker_ident = None
382 382
383 383 def runsource(self, source, filename="<input>", symbol="single"):
384 384 """Compile and run some source in the interpreter.
385 385
386 386 Modified version of code.py's runsource(), to handle threading issues.
387 387 See the original for full docstring details."""
388 388
389 389 global KBINT
390 390
391 391 # If Ctrl-C was typed, we reset the flag and return right away
392 392 if KBINT:
393 393 KBINT = False
394 394 return False
395 395
396 396 if self._kill:
397 397 # can't queue new code if we are being killed
398 398 return True
399 399
400 400 try:
401 401 code = self.compile(source, filename, symbol)
402 402 except (OverflowError, SyntaxError, ValueError):
403 403 # Case 1
404 404 self.showsyntaxerror(filename)
405 405 return False
406 406
407 407 if code is None:
408 408 # Case 2
409 409 return True
410 410
411 411 # shortcut - if we are in worker thread, or the worker thread is not running,
412 412 # execute directly (to allow recursion and prevent deadlock if code is run early
413 413 # in IPython construction)
414 414
415 415 if (self.worker_ident is None or self.worker_ident == thread.get_ident()):
416 416 InteractiveShell.runcode(self,code)
417 417 return
418 418
419 419 # Case 3
420 420 # Store code in queue, so the execution thread can handle it.
421 421
422 422 completed_ev, received_ev = threading.Event(), threading.Event()
423 423
424 424 self.code_queue.put((code,completed_ev, received_ev))
425 425 # first make sure the message was received, with timeout
426 426 received_ev.wait(5)
427 427 if not received_ev.isSet():
428 428 # the mainloop is dead, start executing code directly
429 429 print "Warning: Timeout for mainloop thread exceeded"
430 430 print "switching to nonthreaded mode (until mainloop wakes up again)"
431 431 self.worker_ident = None
432 432 else:
433 433 completed_ev.wait()
434 434 return False
435 435
436 436 def runcode(self):
437 437 """Execute a code object.
438 438
439 439 Multithreaded wrapper around IPython's runcode()."""
440 440
441 441 global CODE_RUN
442 442
443 443 # we are in worker thread, stash out the id for runsource()
444 444 self.worker_ident = thread.get_ident()
445 445
446 446 if self._kill:
447 447 print >>Term.cout, 'Closing threads...',
448 448 Term.cout.flush()
449 449 for tokill in self.on_kill:
450 450 tokill()
451 451 print >>Term.cout, 'Done.'
452 452 # allow kill() to return
453 453 self._kill.set()
454 454 return True
455 455
456 456 # Install sigint handler. We do it every time to ensure that if user
457 457 # code modifies it, we restore our own handling.
458 458 try:
459 459 signal(SIGINT,sigint_handler)
460 460 except SystemError:
461 461 # This happens under Windows, which seems to have all sorts
462 462 # of problems with signal handling. Oh well...
463 463 pass
464 464
465 465 # Flush queue of pending code by calling the run methood of the parent
466 466 # class with all items which may be in the queue.
467 467 code_to_run = None
468 468 while 1:
469 469 try:
470 470 code_to_run, completed_ev, received_ev = self.code_queue.get_nowait()
471 471 except Queue.Empty:
472 472 break
473 473 received_ev.set()
474 474
475 475 # Exceptions need to be raised differently depending on which
476 476 # thread is active. This convoluted try/except is only there to
477 477 # protect against asynchronous exceptions, to ensure that a KBINT
478 478 # at the wrong time doesn't deadlock everything. The global
479 479 # CODE_TO_RUN is set to true/false as close as possible to the
480 480 # runcode() call, so that the KBINT handler is correctly informed.
481 481 try:
482 482 try:
483 483 CODE_RUN = True
484 484 InteractiveShell.runcode(self,code_to_run)
485 485 except KeyboardInterrupt:
486 486 print "Keyboard interrupted in mainloop"
487 487 while not self.code_queue.empty():
488 488 code, ev1,ev2 = self.code_queue.get_nowait()
489 489 ev1.set()
490 490 ev2.set()
491 491 break
492 492 finally:
493 493 CODE_RUN = False
494 494 # allow runsource() return from wait
495 495 completed_ev.set()
496 496
497 497
498 498 # This MUST return true for gtk threading to work
499 499 return True
500 500
501 501 def kill(self):
502 502 """Kill the thread, returning when it has been shut down."""
503 503 self._kill = threading.Event()
504 504 self._kill.wait()
505 505
506 506 class MatplotlibShellBase:
507 507 """Mixin class to provide the necessary modifications to regular IPython
508 508 shell classes for matplotlib support.
509 509
510 510 Given Python's MRO, this should be used as the FIRST class in the
511 511 inheritance hierarchy, so that it overrides the relevant methods."""
512 512
513 513 def _matplotlib_config(self,name,user_ns):
514 514 """Return items needed to setup the user's shell with matplotlib"""
515 515
516 516 # Initialize matplotlib to interactive mode always
517 517 import matplotlib
518 518 from matplotlib import backends
519 519 matplotlib.interactive(True)
520 520
521 521 def use(arg):
522 522 """IPython wrapper for matplotlib's backend switcher.
523 523
524 524 In interactive use, we can not allow switching to a different
525 525 interactive backend, since thread conflicts will most likely crash
526 526 the python interpreter. This routine does a safety check first,
527 527 and refuses to perform a dangerous switch. It still allows
528 528 switching to non-interactive backends."""
529 529
530 530 if arg in backends.interactive_bk and arg != self.mpl_backend:
531 531 m=('invalid matplotlib backend switch.\n'
532 532 'This script attempted to switch to the interactive '
533 533 'backend: `%s`\n'
534 534 'Your current choice of interactive backend is: `%s`\n\n'
535 535 'Switching interactive matplotlib backends at runtime\n'
536 536 'would crash the python interpreter, '
537 537 'and IPython has blocked it.\n\n'
538 538 'You need to either change your choice of matplotlib backend\n'
539 539 'by editing your .matplotlibrc file, or run this script as a \n'
540 540 'standalone file from the command line, not using IPython.\n' %
541 541 (arg,self.mpl_backend) )
542 542 raise RuntimeError, m
543 543 else:
544 544 self.mpl_use(arg)
545 545 self.mpl_use._called = True
546 546
547 547 self.matplotlib = matplotlib
548 548 self.mpl_backend = matplotlib.rcParams['backend']
549 549
550 550 # we also need to block switching of interactive backends by use()
551 551 self.mpl_use = matplotlib.use
552 552 self.mpl_use._called = False
553 553 # overwrite the original matplotlib.use with our wrapper
554 554 matplotlib.use = use
555 555
556 556 # This must be imported last in the matplotlib series, after
557 557 # backend/interactivity choices have been made
558 558 import matplotlib.pylab as pylab
559 559 self.pylab = pylab
560 560
561 561 self.pylab.show._needmain = False
562 562 # We need to detect at runtime whether show() is called by the user.
563 563 # For this, we wrap it into a decorator which adds a 'called' flag.
564 564 self.pylab.draw_if_interactive = flag_calls(self.pylab.draw_if_interactive)
565 565
566 566 # Build a user namespace initialized with matplotlib/matlab features.
567 567 user_ns = IPython.ipapi.make_user_ns(user_ns)
568 568
569 569 exec ("import matplotlib\n"
570 570 "import matplotlib.pylab as pylab\n") in user_ns
571 571
572 572 # Build matplotlib info banner
573 573 b="""
574 574 Welcome to pylab, a matplotlib-based Python environment.
575 575 For more information, type 'help(pylab)'.
576 576 """
577 577 return user_ns,b
578 578
579 579 def mplot_exec(self,fname,*where,**kw):
580 580 """Execute a matplotlib script.
581 581
582 582 This is a call to execfile(), but wrapped in safeties to properly
583 583 handle interactive rendering and backend switching."""
584 584
585 585 #print '*** Matplotlib runner ***' # dbg
586 586 # turn off rendering until end of script
587 587 isInteractive = self.matplotlib.rcParams['interactive']
588 588 self.matplotlib.interactive(False)
589 589 self.safe_execfile(fname,*where,**kw)
590 590 self.matplotlib.interactive(isInteractive)
591 591 # make rendering call now, if the user tried to do it
592 592 if self.pylab.draw_if_interactive.called:
593 593 self.pylab.draw()
594 594 self.pylab.draw_if_interactive.called = False
595 595
596 596 # if a backend switch was performed, reverse it now
597 597 if self.mpl_use._called:
598 598 self.matplotlib.rcParams['backend'] = self.mpl_backend
599 599
600 600 def magic_run(self,parameter_s=''):
601 601 Magic.magic_run(self,parameter_s,runner=self.mplot_exec)
602 602
603 603 # Fix the docstring so users see the original as well
604 604 magic_run.__doc__ = "%s\n%s" % (Magic.magic_run.__doc__,
605 605 "\n *** Modified %run for Matplotlib,"
606 606 " with proper interactive handling ***")
607 607
608 608 # Now we provide 2 versions of a matplotlib-aware IPython base shells, single
609 609 # and multithreaded. Note that these are meant for internal use, the IPShell*
610 610 # classes below are the ones meant for public consumption.
611 611
612 612 class MatplotlibShell(MatplotlibShellBase,InteractiveShell):
613 613 """Single-threaded shell with matplotlib support."""
614 614
615 615 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
616 616 user_ns=None,user_global_ns=None,**kw):
617 617 user_ns,b2 = self._matplotlib_config(name,user_ns)
618 618 InteractiveShell.__init__(self,name,usage,rc,user_ns,user_global_ns,
619 619 banner2=b2,**kw)
620 620
621 621 class MatplotlibMTShell(MatplotlibShellBase,MTInteractiveShell):
622 622 """Multi-threaded shell with matplotlib support."""
623 623
624 624 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
625 625 user_ns=None,user_global_ns=None, **kw):
626 626 user_ns,b2 = self._matplotlib_config(name,user_ns)
627 627 MTInteractiveShell.__init__(self,name,usage,rc,user_ns,user_global_ns,
628 628 banner2=b2,**kw)
629 629
630 630 #-----------------------------------------------------------------------------
631 631 # Utility functions for the different GUI enabled IPShell* classes.
632 632
633 633 def get_tk():
634 634 """Tries to import Tkinter and returns a withdrawn Tkinter root
635 635 window. If Tkinter is already imported or not available, this
636 636 returns None. This function calls `hijack_tk` underneath.
637 637 """
638 638 if not USE_TK or sys.modules.has_key('Tkinter'):
639 639 return None
640 640 else:
641 641 try:
642 642 import Tkinter
643 643 except ImportError:
644 644 return None
645 645 else:
646 646 hijack_tk()
647 647 r = Tkinter.Tk()
648 648 r.withdraw()
649 649 return r
650 650
651 651 def hijack_tk():
652 652 """Modifies Tkinter's mainloop with a dummy so when a module calls
653 653 mainloop, it does not block.
654 654
655 655 """
656 656 def misc_mainloop(self, n=0):
657 657 pass
658 658 def tkinter_mainloop(n=0):
659 659 pass
660 660
661 661 import Tkinter
662 662 Tkinter.Misc.mainloop = misc_mainloop
663 663 Tkinter.mainloop = tkinter_mainloop
664 664
665 665 def update_tk(tk):
666 666 """Updates the Tkinter event loop. This is typically called from
667 667 the respective WX or GTK mainloops.
668 668 """
669 669 if tk:
670 670 tk.update()
671 671
672 672 def hijack_wx():
673 673 """Modifies wxPython's MainLoop with a dummy so user code does not
674 674 block IPython. The hijacked mainloop function is returned.
675 675 """
676 676 def dummy_mainloop(*args, **kw):
677 677 pass
678 678
679 679 try:
680 680 import wx
681 681 except ImportError:
682 682 # For very old versions of WX
683 683 import wxPython as wx
684 684
685 685 ver = wx.__version__
686 686 orig_mainloop = None
687 687 if ver[:3] >= '2.5':
688 688 import wx
689 689 if hasattr(wx, '_core_'): core = getattr(wx, '_core_')
690 690 elif hasattr(wx, '_core'): core = getattr(wx, '_core')
691 691 else: raise AttributeError('Could not find wx core module')
692 692 orig_mainloop = core.PyApp_MainLoop
693 693 core.PyApp_MainLoop = dummy_mainloop
694 694 elif ver[:3] == '2.4':
695 695 orig_mainloop = wx.wxc.wxPyApp_MainLoop
696 696 wx.wxc.wxPyApp_MainLoop = dummy_mainloop
697 697 else:
698 698 warn("Unable to find either wxPython version 2.4 or >= 2.5.")
699 699 return orig_mainloop
700 700
701 701 def hijack_gtk():
702 702 """Modifies pyGTK's mainloop with a dummy so user code does not
703 703 block IPython. This function returns the original `gtk.mainloop`
704 704 function that has been hijacked.
705 705 """
706 706 def dummy_mainloop(*args, **kw):
707 707 pass
708 708 import gtk
709 709 if gtk.pygtk_version >= (2,4,0): orig_mainloop = gtk.main
710 710 else: orig_mainloop = gtk.mainloop
711 711 gtk.mainloop = dummy_mainloop
712 712 gtk.main = dummy_mainloop
713 713 return orig_mainloop
714 714
715 715 def hijack_qt():
716 716 """Modifies PyQt's mainloop with a dummy so user code does not
717 717 block IPython. This function returns the original
718 718 `qt.qApp.exec_loop` function that has been hijacked.
719 719 """
720 720 def dummy_mainloop(*args, **kw):
721 721 pass
722 722 import qt
723 723 orig_mainloop = qt.qApp.exec_loop
724 724 qt.qApp.exec_loop = dummy_mainloop
725 725 qt.QApplication.exec_loop = dummy_mainloop
726 726 return orig_mainloop
727 727
728 728 def hijack_qt4():
729 729 """Modifies PyQt4's mainloop with a dummy so user code does not
730 730 block IPython. This function returns the original
731 731 `QtGui.qApp.exec_` function that has been hijacked.
732 732 """
733 733 def dummy_mainloop(*args, **kw):
734 734 pass
735 735 from PyQt4 import QtGui, QtCore
736 736 orig_mainloop = QtGui.qApp.exec_
737 737 QtGui.qApp.exec_ = dummy_mainloop
738 738 QtGui.QApplication.exec_ = dummy_mainloop
739 739 QtCore.QCoreApplication.exec_ = dummy_mainloop
740 740 return orig_mainloop
741 741
742 742 #-----------------------------------------------------------------------------
743 743 # The IPShell* classes below are the ones meant to be run by external code as
744 744 # IPython instances. Note that unless a specific threading strategy is
745 745 # desired, the factory function start() below should be used instead (it
746 746 # selects the proper threaded class).
747 747
748 748 class IPThread(threading.Thread):
749 749 def run(self):
750 750 self.IP.mainloop(self._banner)
751 751 self.IP.kill()
752 752
753 753 class IPShellGTK(IPThread):
754 754 """Run a gtk mainloop() in a separate thread.
755 755
756 756 Python commands can be passed to the thread where they will be executed.
757 757 This is implemented by periodically checking for passed code using a
758 758 GTK timeout callback."""
759 759
760 760 TIMEOUT = 100 # Millisecond interval between timeouts.
761 761
762 762 def __init__(self,argv=None,user_ns=None,user_global_ns=None,
763 763 debug=1,shell_class=MTInteractiveShell):
764 764
765 765 import gtk
766 766
767 767 self.gtk = gtk
768 768 self.gtk_mainloop = hijack_gtk()
769 769
770 770 # Allows us to use both Tk and GTK.
771 771 self.tk = get_tk()
772 772
773 773 if gtk.pygtk_version >= (2,4,0): mainquit = self.gtk.main_quit
774 774 else: mainquit = self.gtk.mainquit
775 775
776 776 self.IP = make_IPython(argv,user_ns=user_ns,
777 777 user_global_ns=user_global_ns,
778 778 debug=debug,
779 779 shell_class=shell_class,
780 780 on_kill=[mainquit])
781 781
782 782 # HACK: slot for banner in self; it will be passed to the mainloop
783 783 # method only and .run() needs it. The actual value will be set by
784 784 # .mainloop().
785 785 self._banner = None
786 786
787 787 threading.Thread.__init__(self)
788 788
789 789 def mainloop(self,sys_exit=0,banner=None):
790 790
791 791 self._banner = banner
792 792
793 793 if self.gtk.pygtk_version >= (2,4,0):
794 794 import gobject
795 795 gobject.idle_add(self.on_timer)
796 796 else:
797 797 self.gtk.idle_add(self.on_timer)
798 798
799 799 if sys.platform != 'win32':
800 800 try:
801 801 if self.gtk.gtk_version[0] >= 2:
802 802 self.gtk.gdk.threads_init()
803 803 except AttributeError:
804 804 pass
805 805 except RuntimeError:
806 806 error('Your pyGTK likely has not been compiled with '
807 807 'threading support.\n'
808 808 'The exception printout is below.\n'
809 809 'You can either rebuild pyGTK with threads, or '
810 810 'try using \n'
811 811 'matplotlib with a different backend (like Tk or WX).\n'
812 812 'Note that matplotlib will most likely not work in its '
813 813 'current state!')
814 814 self.IP.InteractiveTB()
815 815
816 816 self.start()
817 817 self.gtk.gdk.threads_enter()
818 818 self.gtk_mainloop()
819 819 self.gtk.gdk.threads_leave()
820 820 self.join()
821 821
822 822 def on_timer(self):
823 823 """Called when GTK is idle.
824 824
825 825 Must return True always, otherwise GTK stops calling it"""
826 826
827 827 update_tk(self.tk)
828 828 self.IP.runcode()
829 829 time.sleep(0.01)
830 830 return True
831 831
832 832
833 833 class IPShellWX(IPThread):
834 834 """Run a wx mainloop() in a separate thread.
835 835
836 836 Python commands can be passed to the thread where they will be executed.
837 837 This is implemented by periodically checking for passed code using a
838 838 GTK timeout callback."""
839 839
840 840 TIMEOUT = 100 # Millisecond interval between timeouts.
841 841
842 842 def __init__(self,argv=None,user_ns=None,user_global_ns=None,
843 843 debug=1,shell_class=MTInteractiveShell):
844 844
845 845 self.IP = make_IPython(argv,user_ns=user_ns,
846 846 user_global_ns=user_global_ns,
847 847 debug=debug,
848 848 shell_class=shell_class,
849 849 on_kill=[self.wxexit])
850 850
851 851 wantedwxversion=self.IP.rc.wxversion
852 852 if wantedwxversion!="0":
853 853 try:
854 854 import wxversion
855 855 except ImportError:
856 856 error('The wxversion module is needed for WX version selection')
857 857 else:
858 858 try:
859 859 wxversion.select(wantedwxversion)
860 860 except:
861 861 self.IP.InteractiveTB()
862 862 error('Requested wxPython version %s could not be loaded' %
863 863 wantedwxversion)
864 864
865 865 import wx
866 866
867 867 threading.Thread.__init__(self)
868 868 self.wx = wx
869 869 self.wx_mainloop = hijack_wx()
870 870
871 871 # Allows us to use both Tk and GTK.
872 872 self.tk = get_tk()
873 873
874 874 # HACK: slot for banner in self; it will be passed to the mainloop
875 875 # method only and .run() needs it. The actual value will be set by
876 876 # .mainloop().
877 877 self._banner = None
878 878
879 879 self.app = None
880 880
881 881 def wxexit(self, *args):
882 882 if self.app is not None:
883 883 self.app.agent.timer.Stop()
884 884 self.app.ExitMainLoop()
885 885
886 886 def mainloop(self,sys_exit=0,banner=None):
887 887
888 888 self._banner = banner
889 889
890 890 self.start()
891 891
892 892 class TimerAgent(self.wx.MiniFrame):
893 893 wx = self.wx
894 894 IP = self.IP
895 895 tk = self.tk
896 896 def __init__(self, parent, interval):
897 897 style = self.wx.DEFAULT_FRAME_STYLE | self.wx.TINY_CAPTION_HORIZ
898 898 self.wx.MiniFrame.__init__(self, parent, -1, ' ', pos=(200, 200),
899 899 size=(100, 100),style=style)
900 900 self.Show(False)
901 901 self.interval = interval
902 902 self.timerId = self.wx.NewId()
903 903
904 904 def StartWork(self):
905 905 self.timer = self.wx.Timer(self, self.timerId)
906 906 self.wx.EVT_TIMER(self, self.timerId, self.OnTimer)
907 907 self.timer.Start(self.interval)
908 908
909 909 def OnTimer(self, event):
910 910 update_tk(self.tk)
911 911 self.IP.runcode()
912 912
913 913 class App(self.wx.App):
914 914 wx = self.wx
915 915 TIMEOUT = self.TIMEOUT
916 916 def OnInit(self):
917 917 'Create the main window and insert the custom frame'
918 918 self.agent = TimerAgent(None, self.TIMEOUT)
919 919 self.agent.Show(False)
920 920 self.agent.StartWork()
921 921 return True
922 922
923 923 self.app = App(redirect=False)
924 924 self.wx_mainloop(self.app)
925 925 self.join()
926 926
927 927
928 928 class IPShellQt(IPThread):
929 929 """Run a Qt event loop in a separate thread.
930 930
931 931 Python commands can be passed to the thread where they will be executed.
932 932 This is implemented by periodically checking for passed code using a
933 933 Qt timer / slot."""
934 934
935 935 TIMEOUT = 100 # Millisecond interval between timeouts.
936 936
937 937 def __init__(self, argv=None, user_ns=None, user_global_ns=None,
938 938 debug=0, shell_class=MTInteractiveShell):
939 939
940 940 import qt
941 941
942 942 self.exec_loop = hijack_qt()
943 943
944 944 # Allows us to use both Tk and QT.
945 945 self.tk = get_tk()
946 946
947 947 self.IP = make_IPython(argv,
948 948 user_ns=user_ns,
949 949 user_global_ns=user_global_ns,
950 950 debug=debug,
951 951 shell_class=shell_class,
952 952 on_kill=[qt.qApp.exit])
953 953
954 954 # HACK: slot for banner in self; it will be passed to the mainloop
955 955 # method only and .run() needs it. The actual value will be set by
956 956 # .mainloop().
957 957 self._banner = None
958 958
959 959 threading.Thread.__init__(self)
960 960
961 961 def mainloop(self, sys_exit=0, banner=None):
962 962
963 963 import qt
964 964
965 965 self._banner = banner
966 966
967 967 if qt.QApplication.startingUp():
968 968 a = qt.QApplication(sys.argv)
969 969
970 970 self.timer = qt.QTimer()
971 971 qt.QObject.connect(self.timer,
972 972 qt.SIGNAL('timeout()'),
973 973 self.on_timer)
974 974
975 975 self.start()
976 976 self.timer.start(self.TIMEOUT, True)
977 977 while True:
978 978 if self.IP._kill: break
979 979 self.exec_loop()
980 980 self.join()
981 981
982 982 def on_timer(self):
983 983 update_tk(self.tk)
984 984 result = self.IP.runcode()
985 985 self.timer.start(self.TIMEOUT, True)
986 986 return result
987 987
988 988
989 989 class IPShellQt4(IPThread):
990 990 """Run a Qt event loop in a separate thread.
991 991
992 992 Python commands can be passed to the thread where they will be executed.
993 993 This is implemented by periodically checking for passed code using a
994 994 Qt timer / slot."""
995 995
996 996 TIMEOUT = 100 # Millisecond interval between timeouts.
997 997
998 998 def __init__(self, argv=None, user_ns=None, user_global_ns=None,
999 999 debug=0, shell_class=MTInteractiveShell):
1000 1000
1001 1001 from PyQt4 import QtCore, QtGui
1002 1002
1003 1003 try:
1004 1004 # present in PyQt4-4.2.1 or later
1005 1005 QtCore.pyqtRemoveInputHook()
1006 1006 except AttributeError:
1007 1007 pass
1008 1008
1009 1009 if QtCore.PYQT_VERSION_STR == '4.3':
1010 1010 warn('''PyQt4 version 4.3 detected.
1011 1011 If you experience repeated threading warnings, please update PyQt4.
1012 1012 ''')
1013 1013
1014 1014 self.exec_ = hijack_qt4()
1015 1015
1016 1016 # Allows us to use both Tk and QT.
1017 1017 self.tk = get_tk()
1018 1018
1019 1019 self.IP = make_IPython(argv,
1020 1020 user_ns=user_ns,
1021 1021 user_global_ns=user_global_ns,
1022 1022 debug=debug,
1023 1023 shell_class=shell_class,
1024 1024 on_kill=[QtGui.qApp.exit])
1025 1025
1026 1026 # HACK: slot for banner in self; it will be passed to the mainloop
1027 1027 # method only and .run() needs it. The actual value will be set by
1028 1028 # .mainloop().
1029 1029 self._banner = None
1030 1030
1031 1031 threading.Thread.__init__(self)
1032 1032
1033 1033 def mainloop(self, sys_exit=0, banner=None):
1034 1034
1035 1035 from PyQt4 import QtCore, QtGui
1036 1036
1037 1037 self._banner = banner
1038 1038
1039 1039 if QtGui.QApplication.startingUp():
1040 1040 a = QtGui.QApplication(sys.argv)
1041 1041
1042 1042 self.timer = QtCore.QTimer()
1043 1043 QtCore.QObject.connect(self.timer,
1044 1044 QtCore.SIGNAL('timeout()'),
1045 1045 self.on_timer)
1046 1046
1047 1047 self.start()
1048 1048 self.timer.start(self.TIMEOUT)
1049 1049 while True:
1050 1050 if self.IP._kill: break
1051 1051 self.exec_()
1052 1052 self.join()
1053 1053
1054 1054 def on_timer(self):
1055 1055 update_tk(self.tk)
1056 1056 result = self.IP.runcode()
1057 1057 self.timer.start(self.TIMEOUT)
1058 1058 return result
1059 1059
1060 1060
1061 1061 # A set of matplotlib public IPython shell classes, for single-threaded (Tk*
1062 1062 # and FLTK*) and multithreaded (GTK*, WX* and Qt*) backends to use.
1063 1063 def _load_pylab(user_ns):
1064 1064 """Allow users to disable pulling all of pylab into the top-level
1065 1065 namespace.
1066 1066
1067 1067 This little utility must be called AFTER the actual ipython instance is
1068 1068 running, since only then will the options file have been fully parsed."""
1069 1069
1070 1070 ip = IPython.ipapi.get()
1071 1071 if ip.options.pylab_import_all:
1072 1072 ip.ex("from matplotlib.pylab import *")
1073 1073 ip.IP.user_config_ns.update(ip.user_ns)
1074 1074
1075 1075
1076 1076 class IPShellMatplotlib(IPShell):
1077 1077 """Subclass IPShell with MatplotlibShell as the internal shell.
1078 1078
1079 1079 Single-threaded class, meant for the Tk* and FLTK* backends.
1080 1080
1081 1081 Having this on a separate class simplifies the external driver code."""
1082 1082
1083 1083 def __init__(self,argv=None,user_ns=None,user_global_ns=None,debug=1):
1084 1084 IPShell.__init__(self,argv,user_ns,user_global_ns,debug,
1085 1085 shell_class=MatplotlibShell)
1086 1086 _load_pylab(self.IP.user_ns)
1087 1087
1088 1088 class IPShellMatplotlibGTK(IPShellGTK):
1089 1089 """Subclass IPShellGTK with MatplotlibMTShell as the internal shell.
1090 1090
1091 1091 Multi-threaded class, meant for the GTK* backends."""
1092 1092
1093 1093 def __init__(self,argv=None,user_ns=None,user_global_ns=None,debug=1):
1094 1094 IPShellGTK.__init__(self,argv,user_ns,user_global_ns,debug,
1095 1095 shell_class=MatplotlibMTShell)
1096 1096 _load_pylab(self.IP.user_ns)
1097 1097
1098 1098 class IPShellMatplotlibWX(IPShellWX):
1099 1099 """Subclass IPShellWX with MatplotlibMTShell as the internal shell.
1100 1100
1101 1101 Multi-threaded class, meant for the WX* backends."""
1102 1102
1103 1103 def __init__(self,argv=None,user_ns=None,user_global_ns=None,debug=1):
1104 1104 IPShellWX.__init__(self,argv,user_ns,user_global_ns,debug,
1105 1105 shell_class=MatplotlibMTShell)
1106 1106 _load_pylab(self.IP.user_ns)
1107 1107
1108 1108 class IPShellMatplotlibQt(IPShellQt):
1109 1109 """Subclass IPShellQt with MatplotlibMTShell as the internal shell.
1110 1110
1111 1111 Multi-threaded class, meant for the Qt* backends."""
1112 1112
1113 1113 def __init__(self,argv=None,user_ns=None,user_global_ns=None,debug=1):
1114 1114 IPShellQt.__init__(self,argv,user_ns,user_global_ns,debug,
1115 1115 shell_class=MatplotlibMTShell)
1116 1116 _load_pylab(self.IP.user_ns)
1117 1117
1118 1118 class IPShellMatplotlibQt4(IPShellQt4):
1119 1119 """Subclass IPShellQt4 with MatplotlibMTShell as the internal shell.
1120 1120
1121 1121 Multi-threaded class, meant for the Qt4* backends."""
1122 1122
1123 1123 def __init__(self,argv=None,user_ns=None,user_global_ns=None,debug=1):
1124 1124 IPShellQt4.__init__(self,argv,user_ns,user_global_ns,debug,
1125 1125 shell_class=MatplotlibMTShell)
1126 1126 _load_pylab(self.IP.user_ns)
1127 1127
1128 1128 #-----------------------------------------------------------------------------
1129 1129 # Factory functions to actually start the proper thread-aware shell
1130 1130
1131 1131 def _select_shell(argv):
1132 1132 """Select a shell from the given argv vector.
1133 1133
1134 1134 This function implements the threading selection policy, allowing runtime
1135 1135 control of the threading mode, both for general users and for matplotlib.
1136 1136
1137 1137 Return:
1138 1138 Shell class to be instantiated for runtime operation.
1139 1139 """
1140 1140
1141 1141 global USE_TK
1142 1142
1143 1143 mpl_shell = {'gthread' : IPShellMatplotlibGTK,
1144 1144 'wthread' : IPShellMatplotlibWX,
1145 1145 'qthread' : IPShellMatplotlibQt,
1146 1146 'q4thread' : IPShellMatplotlibQt4,
1147 1147 'tkthread' : IPShellMatplotlib, # Tk is built-in
1148 1148 }
1149 1149
1150 1150 th_shell = {'gthread' : IPShellGTK,
1151 1151 'wthread' : IPShellWX,
1152 1152 'qthread' : IPShellQt,
1153 1153 'q4thread' : IPShellQt4,
1154 1154 'tkthread' : IPShell, # Tk is built-in
1155 1155 }
1156 1156
1157 1157 backends = {'gthread' : 'GTKAgg',
1158 1158 'wthread' : 'WXAgg',
1159 1159 'qthread' : 'QtAgg',
1160 1160 'q4thread' :'Qt4Agg',
1161 1161 'tkthread' :'TkAgg',
1162 1162 }
1163 1163
1164 1164 all_opts = set(['tk','pylab','gthread','qthread','q4thread','wthread',
1165 'tkthread', 'twisted'])
1165 'tkthread'])
1166 1166 user_opts = set([s.replace('-','') for s in argv[:3]])
1167 special_opts = user_opts & all_opts
1168
1169 if 'twisted' in special_opts:
1170 if sys.platform == 'win32':
1171 import twshell
1172 return twshell.IPShellTwisted
1173 else:
1174 error('-twisted currently only works on win32. Starting normal IPython.')
1175 special_opts.remove('twisted')
1176 return IPShell
1177
1167 special_opts = user_opts & all_opts
1178 1168
1179 1169 if 'tk' in special_opts:
1180 1170 USE_TK = True
1181 1171 special_opts.remove('tk')
1182 1172
1183 1173 if 'pylab' in special_opts:
1184 1174
1185 1175 try:
1186 1176 import matplotlib
1187 1177 except ImportError:
1188 1178 error('matplotlib could NOT be imported! Starting normal IPython.')
1189 1179 return IPShell
1190 1180
1191 1181 special_opts.remove('pylab')
1192 1182 # If there's any option left, it means the user wants to force the
1193 1183 # threading backend, else it's auto-selected from the rc file
1194 1184 if special_opts:
1195 1185 th_mode = special_opts.pop()
1196 1186 matplotlib.rcParams['backend'] = backends[th_mode]
1197 1187 else:
1198 1188 backend = matplotlib.rcParams['backend']
1199 1189 if backend.startswith('GTK'):
1200 1190 th_mode = 'gthread'
1201 1191 elif backend.startswith('WX'):
1202 1192 th_mode = 'wthread'
1203 1193 elif backend.startswith('Qt4'):
1204 1194 th_mode = 'q4thread'
1205 1195 elif backend.startswith('Qt'):
1206 1196 th_mode = 'qthread'
1207 1197 else:
1208 1198 # Any other backend, use plain Tk
1209 1199 th_mode = 'tkthread'
1210 1200
1211 1201 return mpl_shell[th_mode]
1212 1202 else:
1213 1203 # No pylab requested, just plain threads
1214 1204 try:
1215 1205 th_mode = special_opts.pop()
1216 1206 except KeyError:
1217 1207 th_mode = 'tkthread'
1218 1208 return th_shell[th_mode]
1219 1209
1220 1210
1221 1211 # This is the one which should be called by external code.
1222 1212 def start(user_ns = None):
1223 1213 """Return a running shell instance, dealing with threading options.
1224 1214
1225 1215 This is a factory function which will instantiate the proper IPython shell
1226 1216 based on the user's threading choice. Such a selector is needed because
1227 1217 different GUI toolkits require different thread handling details."""
1228 1218
1229 1219 shell = _select_shell(sys.argv)
1230 1220 return shell(user_ns = user_ns)
1231 1221
1232 1222 # Some aliases for backwards compatibility
1233 1223 IPythonShell = IPShell
1234 1224 IPythonShellEmbed = IPShellEmbed
1235 1225 #************************ End of file <Shell.py> ***************************
@@ -1,778 +1,779 b''
1 1 # -*- coding: utf-8 -*-
2 2 """
3 3 IPython -- An enhanced Interactive Python
4 4
5 5 Requires Python 2.1 or better.
6 6
7 7 This file contains the main make_IPython() starter function.
8 8
9 9 $Id: ipmaker.py 2930 2008-01-11 07:03:11Z vivainio $"""
10 10
11 11 #*****************************************************************************
12 12 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
13 13 #
14 14 # Distributed under the terms of the BSD License. The full license is in
15 15 # the file COPYING, distributed as part of this software.
16 16 #*****************************************************************************
17 17
18 18 from IPython import Release
19 19 __author__ = '%s <%s>' % Release.authors['Fernando']
20 20 __license__ = Release.license
21 21 __version__ = Release.version
22 22
23 23 try:
24 24 credits._Printer__data = """
25 25 Python: %s
26 26
27 27 IPython: Fernando Perez, Janko Hauser, Nathan Gray, and many users.
28 28 See http://ipython.scipy.org for more information.""" \
29 29 % credits._Printer__data
30 30
31 31 copyright._Printer__data += """
32 32
33 33 Copyright (c) 2001-2004 Fernando Perez, Janko Hauser, Nathan Gray.
34 34 All Rights Reserved."""
35 35 except NameError:
36 36 # Can happen if ipython was started with 'python -S', so that site.py is
37 37 # not loaded
38 38 pass
39 39
40 40 #****************************************************************************
41 41 # Required modules
42 42
43 43 # From the standard library
44 44 import __main__
45 45 import __builtin__
46 46 import os
47 47 import re
48 48 import sys
49 49 import types
50 50 from pprint import pprint,pformat
51 51
52 52 # Our own
53 53 from IPython import DPyGetOpt
54 54 from IPython.ipstruct import Struct
55 55 from IPython.OutputTrap import OutputTrap
56 56 from IPython.ConfigLoader import ConfigLoader
57 57 from IPython.iplib import InteractiveShell
58 58 from IPython.usage import cmd_line_usage,interactive_usage
59 59 from IPython.genutils import *
60 60
61 61 def force_import(modname):
62 62 if modname in sys.modules:
63 63 print "reload",modname
64 64 reload(sys.modules[modname])
65 65 else:
66 66 __import__(modname)
67 67
68 68
69 69 #-----------------------------------------------------------------------------
70 70 def make_IPython(argv=None,user_ns=None,user_global_ns=None,debug=1,
71 71 rc_override=None,shell_class=InteractiveShell,
72 72 embedded=False,**kw):
73 73 """This is a dump of IPython into a single function.
74 74
75 75 Later it will have to be broken up in a sensible manner.
76 76
77 77 Arguments:
78 78
79 79 - argv: a list similar to sys.argv[1:]. It should NOT contain the desired
80 80 script name, b/c DPyGetOpt strips the first argument only for the real
81 81 sys.argv.
82 82
83 83 - user_ns: a dict to be used as the user's namespace."""
84 84
85 85 #----------------------------------------------------------------------
86 86 # Defaults and initialization
87 87
88 88 # For developer debugging, deactivates crash handler and uses pdb.
89 89 DEVDEBUG = False
90 90
91 91 if argv is None:
92 92 argv = sys.argv
93 93
94 94 # __IP is the main global that lives throughout and represents the whole
95 95 # application. If the user redefines it, all bets are off as to what
96 96 # happens.
97 97
98 98 # __IP is the name of he global which the caller will have accessible as
99 99 # __IP.name. We set its name via the first parameter passed to
100 100 # InteractiveShell:
101 101
102 102 IP = shell_class('__IP',user_ns=user_ns,user_global_ns=user_global_ns,
103 103 embedded=embedded,**kw)
104 104
105 105 # Put 'help' in the user namespace
106 106 try:
107 107 from site import _Helper
108 108 IP.user_ns['help'] = _Helper()
109 109 except ImportError:
110 110 warn('help() not available - check site.py')
111 111 IP.user_config_ns = {}
112 112
113 113
114 114 if DEVDEBUG:
115 115 # For developer debugging only (global flag)
116 116 from IPython import ultraTB
117 117 sys.excepthook = ultraTB.VerboseTB(call_pdb=1)
118 118
119 119 IP.BANNER_PARTS = ['Python %s\n'
120 120 'Type "copyright", "credits" or "license" '
121 121 'for more information.\n'
122 122 % (sys.version.split('\n')[0],),
123 123 "IPython %s -- An enhanced Interactive Python."
124 124 % (__version__,),
125 125 """\
126 126 ? -> Introduction and overview of IPython's features.
127 127 %quickref -> Quick reference.
128 128 help -> Python's own help system.
129 129 object? -> Details about 'object'. ?object also works, ?? prints more.
130 130 """ ]
131 131
132 132 IP.usage = interactive_usage
133 133
134 134 # Platform-dependent suffix and directory names. We use _ipython instead
135 135 # of .ipython under win32 b/c there's software that breaks with .named
136 136 # directories on that platform.
137 137 if os.name == 'posix':
138 138 rc_suffix = ''
139 139 ipdir_def = '.ipython'
140 140 else:
141 141 rc_suffix = '.ini'
142 142 ipdir_def = '_ipython'
143 143
144 144 # default directory for configuration
145 145 ipythondir_def = os.path.abspath(os.environ.get('IPYTHONDIR',
146 146 os.path.join(IP.home_dir,ipdir_def)))
147 147
148 148 sys.path.insert(0, '') # add . to sys.path. Fix from Prabhu Ramachandran
149 149
150 150 # we need the directory where IPython itself is installed
151 151 import IPython
152 152 IPython_dir = os.path.dirname(IPython.__file__)
153 153 del IPython
154 154
155 155 #-------------------------------------------------------------------------
156 156 # Command line handling
157 157
158 158 # Valid command line options (uses DPyGetOpt syntax, like Perl's
159 159 # GetOpt::Long)
160 160
161 161 # Any key not listed here gets deleted even if in the file (like session
162 162 # or profile). That's deliberate, to maintain the rc namespace clean.
163 163
164 164 # Each set of options appears twice: under _conv only the names are
165 165 # listed, indicating which type they must be converted to when reading the
166 166 # ipythonrc file. And under DPyGetOpt they are listed with the regular
167 167 # DPyGetOpt syntax (=s,=i,:f,etc).
168 168
169 169 # Make sure there's a space before each end of line (they get auto-joined!)
170 170 cmdline_opts = ('autocall=i autoindent! automagic! banner! cache_size|cs=i '
171 171 'c=s classic|cl color_info! colors=s confirm_exit! '
172 172 'debug! deep_reload! editor=s log|l messages! nosep '
173 173 'object_info_string_level=i pdb! '
174 174 'pprint! prompt_in1|pi1=s prompt_in2|pi2=s prompt_out|po=s '
175 175 'pydb! '
176 176 'pylab_import_all! '
177 177 'quick screen_length|sl=i prompts_pad_left=i '
178 178 'logfile|lf=s logplay|lp=s profile|p=s '
179 179 'readline! readline_merge_completions! '
180 180 'readline_omit__names! '
181 181 'rcfile=s separate_in|si=s separate_out|so=s '
182 182 'separate_out2|so2=s xmode=s wildcards_case_sensitive! '
183 183 'magic_docstrings system_verbose! '
184 184 'multi_line_specials! '
185 185 'term_title! wxversion=s '
186 186 'autoedit_syntax!')
187 187
188 188 # Options that can *only* appear at the cmd line (not in rcfiles).
189 189
190 190 cmdline_only = ('help interact|i ipythondir=s Version upgrade '
191 191 'gthread! qthread! q4thread! wthread! tkthread! pylab! tk! '
192 'twisted!')
192 # 'twisted!' # disabled for now.
193 )
193 194
194 195 # Build the actual name list to be used by DPyGetOpt
195 196 opts_names = qw(cmdline_opts) + qw(cmdline_only)
196 197
197 198 # Set sensible command line defaults.
198 199 # This should have everything from cmdline_opts and cmdline_only
199 200 opts_def = Struct(autocall = 1,
200 201 autoedit_syntax = 0,
201 202 autoindent = 0,
202 203 automagic = 1,
203 204 autoexec = [],
204 205 banner = 1,
205 206 c = '',
206 207 cache_size = 1000,
207 208 classic = 0,
208 209 color_info = 0,
209 210 colors = 'NoColor',
210 211 confirm_exit = 1,
211 212 debug = 0,
212 213 deep_reload = 0,
213 214 editor = '0',
214 215 gthread = 0,
215 216 help = 0,
216 217 interact = 0,
217 218 ipythondir = ipythondir_def,
218 219 log = 0,
219 220 logfile = '',
220 221 logplay = '',
221 222 messages = 1,
222 223 multi_line_specials = 1,
223 224 nosep = 0,
224 225 object_info_string_level = 0,
225 226 pdb = 0,
226 227 pprint = 0,
227 228 profile = '',
228 229 prompt_in1 = 'In [\\#]: ',
229 230 prompt_in2 = ' .\\D.: ',
230 231 prompt_out = 'Out[\\#]: ',
231 232 prompts_pad_left = 1,
232 233 pylab = 0,
233 234 pylab_import_all = 1,
234 235 q4thread = 0,
235 236 qthread = 0,
236 237 quick = 0,
237 238 quiet = 0,
238 239 rcfile = 'ipythonrc' + rc_suffix,
239 240 readline = 1,
240 241 readline_merge_completions = 1,
241 242 readline_omit__names = 0,
242 243 screen_length = 0,
243 244 separate_in = '\n',
244 245 separate_out = '\n',
245 246 separate_out2 = '',
246 247 system_header = 'IPython system call: ',
247 248 system_verbose = 0,
248 249 term_title = 1,
249 250 tk = 0,
250 twisted= 0,
251 #twisted= 0, # disabled for now
251 252 upgrade = 0,
252 253 Version = 0,
253 254 wildcards_case_sensitive = 1,
254 255 wthread = 0,
255 256 wxversion = '0',
256 257 xmode = 'Context',
257 258 magic_docstrings = 0, # undocumented, for doc generation
258 259 )
259 260
260 261 # Things that will *only* appear in rcfiles (not at the command line).
261 262 # Make sure there's a space before each end of line (they get auto-joined!)
262 263 rcfile_opts = { qwflat: 'include import_mod import_all execfile ',
263 264 qw_lol: 'import_some ',
264 265 # for things with embedded whitespace:
265 266 list_strings:'execute alias readline_parse_and_bind ',
266 267 # Regular strings need no conversion:
267 268 None:'readline_remove_delims ',
268 269 }
269 270 # Default values for these
270 271 rc_def = Struct(include = [],
271 272 import_mod = [],
272 273 import_all = [],
273 274 import_some = [[]],
274 275 execute = [],
275 276 execfile = [],
276 277 alias = [],
277 278 readline_parse_and_bind = [],
278 279 readline_remove_delims = '',
279 280 )
280 281
281 282 # Build the type conversion dictionary from the above tables:
282 283 typeconv = rcfile_opts.copy()
283 284 typeconv.update(optstr2types(cmdline_opts))
284 285
285 286 # FIXME: the None key appears in both, put that back together by hand. Ugly!
286 287 typeconv[None] += ' ' + rcfile_opts[None]
287 288
288 289 # Remove quotes at ends of all strings (used to protect spaces)
289 290 typeconv[unquote_ends] = typeconv[None]
290 291 del typeconv[None]
291 292
292 293 # Build the list we'll use to make all config decisions with defaults:
293 294 opts_all = opts_def.copy()
294 295 opts_all.update(rc_def)
295 296
296 297 # Build conflict resolver for recursive loading of config files:
297 298 # - preserve means the outermost file maintains the value, it is not
298 299 # overwritten if an included file has the same key.
299 300 # - add_flip applies + to the two values, so it better make sense to add
300 301 # those types of keys. But it flips them first so that things loaded
301 302 # deeper in the inclusion chain have lower precedence.
302 303 conflict = {'preserve': ' '.join([ typeconv[int],
303 304 typeconv[unquote_ends] ]),
304 305 'add_flip': ' '.join([ typeconv[qwflat],
305 306 typeconv[qw_lol],
306 307 typeconv[list_strings] ])
307 308 }
308 309
309 310 # Now actually process the command line
310 311 getopt = DPyGetOpt.DPyGetOpt()
311 312 getopt.setIgnoreCase(0)
312 313
313 314 getopt.parseConfiguration(opts_names)
314 315
315 316 try:
316 317 getopt.processArguments(argv)
317 318 except DPyGetOpt.ArgumentError, exc:
318 319 print cmd_line_usage
319 320 warn('\nError in Arguments: "%s"' % exc)
320 321 sys.exit(1)
321 322
322 323 # convert the options dict to a struct for much lighter syntax later
323 324 opts = Struct(getopt.optionValues)
324 325 args = getopt.freeValues
325 326
326 327 # this is the struct (which has default values at this point) with which
327 328 # we make all decisions:
328 329 opts_all.update(opts)
329 330
330 331 # Options that force an immediate exit
331 332 if opts_all.help:
332 333 page(cmd_line_usage)
333 334 sys.exit()
334 335
335 336 if opts_all.Version:
336 337 print __version__
337 338 sys.exit()
338 339
339 340 if opts_all.magic_docstrings:
340 341 IP.magic_magic('-latex')
341 342 sys.exit()
342 343
343 344 # add personal ipythondir to sys.path so that users can put things in
344 345 # there for customization
345 346 sys.path.append(os.path.abspath(opts_all.ipythondir))
346 347
347 348 # Create user config directory if it doesn't exist. This must be done
348 349 # *after* getting the cmd line options.
349 350 if not os.path.isdir(opts_all.ipythondir):
350 351 IP.user_setup(opts_all.ipythondir,rc_suffix,'install')
351 352
352 353 # upgrade user config files while preserving a copy of the originals
353 354 if opts_all.upgrade:
354 355 IP.user_setup(opts_all.ipythondir,rc_suffix,'upgrade')
355 356
356 357 # check mutually exclusive options in the *original* command line
357 358 mutex_opts(opts,[qw('log logfile'),qw('rcfile profile'),
358 359 qw('classic profile'),qw('classic rcfile')])
359 360
360 361 #---------------------------------------------------------------------------
361 362 # Log replay
362 363
363 364 # if -logplay, we need to 'become' the other session. That basically means
364 365 # replacing the current command line environment with that of the old
365 366 # session and moving on.
366 367
367 368 # this is needed so that later we know we're in session reload mode, as
368 369 # opts_all will get overwritten:
369 370 load_logplay = 0
370 371
371 372 if opts_all.logplay:
372 373 load_logplay = opts_all.logplay
373 374 opts_debug_save = opts_all.debug
374 375 try:
375 376 logplay = open(opts_all.logplay)
376 377 except IOError:
377 378 if opts_all.debug: IP.InteractiveTB()
378 379 warn('Could not open logplay file '+`opts_all.logplay`)
379 380 # restore state as if nothing had happened and move on, but make
380 381 # sure that later we don't try to actually load the session file
381 382 logplay = None
382 383 load_logplay = 0
383 384 del opts_all.logplay
384 385 else:
385 386 try:
386 387 logplay.readline()
387 388 logplay.readline();
388 389 # this reloads that session's command line
389 390 cmd = logplay.readline()[6:]
390 391 exec cmd
391 392 # restore the true debug flag given so that the process of
392 393 # session loading itself can be monitored.
393 394 opts.debug = opts_debug_save
394 395 # save the logplay flag so later we don't overwrite the log
395 396 opts.logplay = load_logplay
396 397 # now we must update our own structure with defaults
397 398 opts_all.update(opts)
398 399 # now load args
399 400 cmd = logplay.readline()[6:]
400 401 exec cmd
401 402 logplay.close()
402 403 except:
403 404 logplay.close()
404 405 if opts_all.debug: IP.InteractiveTB()
405 406 warn("Logplay file lacking full configuration information.\n"
406 407 "I'll try to read it, but some things may not work.")
407 408
408 409 #-------------------------------------------------------------------------
409 410 # set up output traps: catch all output from files, being run, modules
410 411 # loaded, etc. Then give it to the user in a clean form at the end.
411 412
412 413 msg_out = 'Output messages. '
413 414 msg_err = 'Error messages. '
414 415 msg_sep = '\n'
415 416 msg = Struct(config = OutputTrap('Configuration Loader',msg_out,
416 417 msg_err,msg_sep,debug,
417 418 quiet_out=1),
418 419 user_exec = OutputTrap('User File Execution',msg_out,
419 420 msg_err,msg_sep,debug),
420 421 logplay = OutputTrap('Log Loader',msg_out,
421 422 msg_err,msg_sep,debug),
422 423 summary = ''
423 424 )
424 425
425 426 #-------------------------------------------------------------------------
426 427 # Process user ipythonrc-type configuration files
427 428
428 429 # turn on output trapping and log to msg.config
429 430 # remember that with debug on, trapping is actually disabled
430 431 msg.config.trap_all()
431 432
432 433 # look for rcfile in current or default directory
433 434 try:
434 435 opts_all.rcfile = filefind(opts_all.rcfile,opts_all.ipythondir)
435 436 except IOError:
436 437 if opts_all.debug: IP.InteractiveTB()
437 438 warn('Configuration file %s not found. Ignoring request.'
438 439 % (opts_all.rcfile) )
439 440
440 441 # 'profiles' are a shorthand notation for config filenames
441 442 profile_handled_by_legacy = False
442 443 if opts_all.profile:
443 444
444 445 try:
445 446 opts_all.rcfile = filefind('ipythonrc-' + opts_all.profile
446 447 + rc_suffix,
447 448 opts_all.ipythondir)
448 449 profile_handled_by_legacy = True
449 450 except IOError:
450 451 if opts_all.debug: IP.InteractiveTB()
451 452 opts.profile = '' # remove profile from options if invalid
452 453 # We won't warn anymore, primary method is ipy_profile_PROFNAME
453 454 # which does trigger a warning.
454 455
455 456 # load the config file
456 457 rcfiledata = None
457 458 if opts_all.quick:
458 459 print 'Launching IPython in quick mode. No config file read.'
459 460 elif opts_all.rcfile:
460 461 try:
461 462 cfg_loader = ConfigLoader(conflict)
462 463 rcfiledata = cfg_loader.load(opts_all.rcfile,typeconv,
463 464 'include',opts_all.ipythondir,
464 465 purge = 1,
465 466 unique = conflict['preserve'])
466 467 except:
467 468 IP.InteractiveTB()
468 469 warn('Problems loading configuration file '+
469 470 `opts_all.rcfile`+
470 471 '\nStarting with default -bare bones- configuration.')
471 472 else:
472 473 warn('No valid configuration file found in either currrent directory\n'+
473 474 'or in the IPython config. directory: '+`opts_all.ipythondir`+
474 475 '\nProceeding with internal defaults.')
475 476
476 477 #------------------------------------------------------------------------
477 478 # Set exception handlers in mode requested by user.
478 479 otrap = OutputTrap(trap_out=1) # trap messages from magic_xmode
479 480 IP.magic_xmode(opts_all.xmode)
480 481 otrap.release_out()
481 482
482 483 #------------------------------------------------------------------------
483 484 # Execute user config
484 485
485 486 # Create a valid config structure with the right precedence order:
486 487 # defaults < rcfile < command line. This needs to be in the instance, so
487 488 # that method calls below that rely on it find it.
488 489 IP.rc = rc_def.copy()
489 490
490 491 # Work with a local alias inside this routine to avoid unnecessary
491 492 # attribute lookups.
492 493 IP_rc = IP.rc
493 494
494 495 IP_rc.update(opts_def)
495 496 if rcfiledata:
496 497 # now we can update
497 498 IP_rc.update(rcfiledata)
498 499 IP_rc.update(opts)
499 500 IP_rc.update(rc_override)
500 501
501 502 # Store the original cmd line for reference:
502 503 IP_rc.opts = opts
503 504 IP_rc.args = args
504 505
505 506 # create a *runtime* Struct like rc for holding parameters which may be
506 507 # created and/or modified by runtime user extensions.
507 508 IP.runtime_rc = Struct()
508 509
509 510 # from this point on, all config should be handled through IP_rc,
510 511 # opts* shouldn't be used anymore.
511 512
512 513
513 514 # update IP_rc with some special things that need manual
514 515 # tweaks. Basically options which affect other options. I guess this
515 516 # should just be written so that options are fully orthogonal and we
516 517 # wouldn't worry about this stuff!
517 518
518 519 if IP_rc.classic:
519 520 IP_rc.quick = 1
520 521 IP_rc.cache_size = 0
521 522 IP_rc.pprint = 0
522 523 IP_rc.prompt_in1 = '>>> '
523 524 IP_rc.prompt_in2 = '... '
524 525 IP_rc.prompt_out = ''
525 526 IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0'
526 527 IP_rc.colors = 'NoColor'
527 528 IP_rc.xmode = 'Plain'
528 529
529 530 IP.pre_config_initialization()
530 531 # configure readline
531 532 # Define the history file for saving commands in between sessions
532 533 if IP_rc.profile:
533 534 histfname = 'history-%s' % IP_rc.profile
534 535 else:
535 536 histfname = 'history'
536 537 IP.histfile = os.path.join(opts_all.ipythondir,histfname)
537 538
538 539 # update exception handlers with rc file status
539 540 otrap.trap_out() # I don't want these messages ever.
540 541 IP.magic_xmode(IP_rc.xmode)
541 542 otrap.release_out()
542 543
543 544 # activate logging if requested and not reloading a log
544 545 if IP_rc.logplay:
545 546 IP.magic_logstart(IP_rc.logplay + ' append')
546 547 elif IP_rc.logfile:
547 548 IP.magic_logstart(IP_rc.logfile)
548 549 elif IP_rc.log:
549 550 IP.magic_logstart()
550 551
551 552 # find user editor so that it we don't have to look it up constantly
552 553 if IP_rc.editor.strip()=='0':
553 554 try:
554 555 ed = os.environ['EDITOR']
555 556 except KeyError:
556 557 if os.name == 'posix':
557 558 ed = 'vi' # the only one guaranteed to be there!
558 559 else:
559 560 ed = 'notepad' # same in Windows!
560 561 IP_rc.editor = ed
561 562
562 563 # Keep track of whether this is an embedded instance or not (useful for
563 564 # post-mortems).
564 565 IP_rc.embedded = IP.embedded
565 566
566 567 # Recursive reload
567 568 try:
568 569 from IPython import deep_reload
569 570 if IP_rc.deep_reload:
570 571 __builtin__.reload = deep_reload.reload
571 572 else:
572 573 __builtin__.dreload = deep_reload.reload
573 574 del deep_reload
574 575 except ImportError:
575 576 pass
576 577
577 578 # Save the current state of our namespace so that the interactive shell
578 579 # can later know which variables have been created by us from config files
579 580 # and loading. This way, loading a file (in any way) is treated just like
580 581 # defining things on the command line, and %who works as expected.
581 582
582 583 # DON'T do anything that affects the namespace beyond this point!
583 584 IP.internal_ns.update(__main__.__dict__)
584 585
585 586 #IP.internal_ns.update(locals()) # so our stuff doesn't show up in %who
586 587
587 588 # Now run through the different sections of the users's config
588 589 if IP_rc.debug:
589 590 print 'Trying to execute the following configuration structure:'
590 591 print '(Things listed first are deeper in the inclusion tree and get'
591 592 print 'loaded first).\n'
592 593 pprint(IP_rc.__dict__)
593 594
594 595 for mod in IP_rc.import_mod:
595 596 try:
596 597 exec 'import '+mod in IP.user_ns
597 598 except :
598 599 IP.InteractiveTB()
599 600 import_fail_info(mod)
600 601
601 602 for mod_fn in IP_rc.import_some:
602 603 if not mod_fn == []:
603 604 mod,fn = mod_fn[0],','.join(mod_fn[1:])
604 605 try:
605 606 exec 'from '+mod+' import '+fn in IP.user_ns
606 607 except :
607 608 IP.InteractiveTB()
608 609 import_fail_info(mod,fn)
609 610
610 611 for mod in IP_rc.import_all:
611 612 try:
612 613 exec 'from '+mod+' import *' in IP.user_ns
613 614 except :
614 615 IP.InteractiveTB()
615 616 import_fail_info(mod)
616 617
617 618 for code in IP_rc.execute:
618 619 try:
619 620 exec code in IP.user_ns
620 621 except:
621 622 IP.InteractiveTB()
622 623 warn('Failure executing code: ' + `code`)
623 624
624 625 # Execute the files the user wants in ipythonrc
625 626 for file in IP_rc.execfile:
626 627 try:
627 628 file = filefind(file,sys.path+[IPython_dir])
628 629 except IOError:
629 630 warn(itpl('File $file not found. Skipping it.'))
630 631 else:
631 632 IP.safe_execfile(os.path.expanduser(file),IP.user_ns)
632 633
633 634 # finally, try importing ipy_*_conf for final configuration
634 635 try:
635 636 import ipy_system_conf
636 637 except ImportError:
637 638 if opts_all.debug: IP.InteractiveTB()
638 639 warn("Could not import 'ipy_system_conf'")
639 640 except:
640 641 IP.InteractiveTB()
641 642 import_fail_info('ipy_system_conf')
642 643
643 644 # only import prof module if ipythonrc-PROF was not found
644 645 if opts_all.profile and not profile_handled_by_legacy:
645 646 profmodname = 'ipy_profile_' + opts_all.profile
646 647 try:
647 648
648 649 force_import(profmodname)
649 650 except:
650 651 IP.InteractiveTB()
651 652 print "Error importing",profmodname,"- perhaps you should run %upgrade?"
652 653 import_fail_info(profmodname)
653 654 else:
654 655 force_import('ipy_profile_none')
655 656 try:
656 657
657 658 force_import('ipy_user_conf')
658 659
659 660 except:
660 661 conf = opts_all.ipythondir + "/ipy_user_conf.py"
661 662 IP.InteractiveTB()
662 663 if not os.path.isfile(conf):
663 664 warn(conf + ' does not exist, please run %upgrade!')
664 665
665 666 import_fail_info("ipy_user_conf")
666 667
667 668 # finally, push the argv to options again to ensure highest priority
668 669 IP_rc.update(opts)
669 670
670 671 # release stdout and stderr and save config log into a global summary
671 672 msg.config.release_all()
672 673 if IP_rc.messages:
673 674 msg.summary += msg.config.summary_all()
674 675
675 676 #------------------------------------------------------------------------
676 677 # Setup interactive session
677 678
678 679 # Now we should be fully configured. We can then execute files or load
679 680 # things only needed for interactive use. Then we'll open the shell.
680 681
681 682 # Take a snapshot of the user namespace before opening the shell. That way
682 683 # we'll be able to identify which things were interactively defined and
683 684 # which were defined through config files.
684 685 IP.user_config_ns.update(IP.user_ns)
685 686
686 687 # Force reading a file as if it were a session log. Slower but safer.
687 688 if load_logplay:
688 689 print 'Replaying log...'
689 690 try:
690 691 if IP_rc.debug:
691 692 logplay_quiet = 0
692 693 else:
693 694 logplay_quiet = 1
694 695
695 696 msg.logplay.trap_all()
696 697 IP.safe_execfile(load_logplay,IP.user_ns,
697 698 islog = 1, quiet = logplay_quiet)
698 699 msg.logplay.release_all()
699 700 if IP_rc.messages:
700 701 msg.summary += msg.logplay.summary_all()
701 702 except:
702 703 warn('Problems replaying logfile %s.' % load_logplay)
703 704 IP.InteractiveTB()
704 705
705 706 # Load remaining files in command line
706 707 msg.user_exec.trap_all()
707 708
708 709 # Do NOT execute files named in the command line as scripts to be loaded
709 710 # by embedded instances. Doing so has the potential for an infinite
710 711 # recursion if there are exceptions thrown in the process.
711 712
712 713 # XXX FIXME: the execution of user files should be moved out to after
713 714 # ipython is fully initialized, just as if they were run via %run at the
714 715 # ipython prompt. This would also give them the benefit of ipython's
715 716 # nice tracebacks.
716 717
717 718 if (not embedded and IP_rc.args and
718 719 not IP_rc.args[0].lower().endswith('.ipy')):
719 720 name_save = IP.user_ns['__name__']
720 721 IP.user_ns['__name__'] = '__main__'
721 722 # Set our own excepthook in case the user code tries to call it
722 723 # directly. This prevents triggering the IPython crash handler.
723 724 old_excepthook,sys.excepthook = sys.excepthook, IP.excepthook
724 725
725 726 save_argv = sys.argv[1:] # save it for later restoring
726 727
727 728 sys.argv = args
728 729
729 730 try:
730 731 IP.safe_execfile(args[0], IP.user_ns)
731 732 finally:
732 733 # Reset our crash handler in place
733 734 sys.excepthook = old_excepthook
734 735 sys.argv[:] = save_argv
735 736 IP.user_ns['__name__'] = name_save
736 737
737 738 msg.user_exec.release_all()
738 739
739 740 if IP_rc.messages:
740 741 msg.summary += msg.user_exec.summary_all()
741 742
742 743 # since we can't specify a null string on the cmd line, 0 is the equivalent:
743 744 if IP_rc.nosep:
744 745 IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0'
745 746 if IP_rc.separate_in == '0': IP_rc.separate_in = ''
746 747 if IP_rc.separate_out == '0': IP_rc.separate_out = ''
747 748 if IP_rc.separate_out2 == '0': IP_rc.separate_out2 = ''
748 749 IP_rc.separate_in = IP_rc.separate_in.replace('\\n','\n')
749 750 IP_rc.separate_out = IP_rc.separate_out.replace('\\n','\n')
750 751 IP_rc.separate_out2 = IP_rc.separate_out2.replace('\\n','\n')
751 752
752 753 # Determine how many lines at the bottom of the screen are needed for
753 754 # showing prompts, so we can know wheter long strings are to be printed or
754 755 # paged:
755 756 num_lines_bot = IP_rc.separate_in.count('\n')+1
756 757 IP_rc.screen_length = IP_rc.screen_length - num_lines_bot
757 758
758 759 # configure startup banner
759 760 if IP_rc.c: # regular python doesn't print the banner with -c
760 761 IP_rc.banner = 0
761 762 if IP_rc.banner:
762 763 BANN_P = IP.BANNER_PARTS
763 764 else:
764 765 BANN_P = []
765 766
766 767 if IP_rc.profile: BANN_P.append('IPython profile: %s\n' % IP_rc.profile)
767 768
768 769 # add message log (possibly empty)
769 770 if msg.summary: BANN_P.append(msg.summary)
770 771 # Final banner is a string
771 772 IP.BANNER = '\n'.join(BANN_P)
772 773
773 774 # Finalize the IPython instance. This assumes the rc structure is fully
774 775 # in place.
775 776 IP.post_config_initialization()
776 777
777 778 return IP
778 779 #************************ end of file <ipmaker.py> **************************
@@ -1,7638 +1,7652 b''
1 2008-05-31 Fernando Perez <Fernando.Perez@berkeley.edu>
2
3 * IPython/ipmaker.py (make_IPython): The -twisted option is fully
4 disabled.
5
6 * IPython/Shell.py (_select_shell): completely disable -twisted.
7 This code is of dubious quality and normal users should not
8 encounter it until we can clarify things further, even under
9 win32. Since we need a quick emergency 0.8.4 release, it is now
10 disabled completely. Users who want to run it can use the
11 following command (it's easy to put it in an alias or script):
12
13 python -c"from IPython import twshell;twshell.IPShellTwisted().mainloop()"
14
1 15 2008-05-30 Ville Vainio <vivainio@gmail.com>
2 16
3 17 * shell.py: disable -twisted on non-win32 platforms.
4 18 import sets module on python 2.3.
5 19
6 20 * ipy_profile_sh.py: disable ipy_signals. Now, ipython
7 21 is verified to work with python 2.3
8 22
9 23 * Release.py: update version to 0.8.4 for quick point fix
10 24
11 25 2008-05-28 *** Released version 0.8.3
12 26
13 27 2008-05-28 Fernando Perez <Fernando.Perez@berkeley.edu>
14 28
15 29 * ../win32_manual_post_install.py (run): Fix the windows installer
16 30 so the links to the docs are correct.
17 31
18 32 * IPython/ultraTB.py: flush stderr after writing to it to fix
19 33 problems with exception traceback ordering in some platforms.
20 34 Thanks to a report/fix by Jie Tang <jietang86-AT-gmail.com>.
21 35
22 36 * IPython/Magic.py (magic_cpaste): add stripping of continuation
23 37 prompts, feature requested by Stefan vdW.
24 38
25 39 * ../setup.py: updates to build and release tools in preparation
26 40 for 0.8.3 release.
27 41
28 42 2008-05-27 Ville Vainio <vivainio@gmail.com>
29 43
30 44 * iplib.py, ipmaker.py: survive lack of doctest and site._Helper
31 45 for minimal environments (e.g. Maemo sdk python)
32 46
33 47 * Magic.py: cpaste strips whitespace before >>> (allow pasting
34 48 doctests)
35 49
36 50 * ipy_completers.py: cd completer now does recursive path expand
37 51 (old behaviour is buggy on some readline versions)
38 52
39 53 2008-05-14 Ville Vainio <vivainio@gmail.com>
40 54
41 55 * Extensions/ipy_greedycompleter.py:
42 56 New extension that enables a bit more "relaxed" tab
43 57 completer that evaluates code without safety checks
44 58 (i.e. there can be side effects like function calls)
45 59
46 60 2008-04-20 Ville Vainio <vivainio@gmail.com>
47 61
48 62 * Extensions/ipy_lookfor.py: add %lookfor magic command
49 63 (search docstrings for words) by Pauli Virtanen. Close #245.
50 64
51 65 * Extension/ipy_jot.py: %jot and %read magics, analogous
52 66 to %store but you can specify some notes. Not read
53 67 in automatically on startup, you need %read.
54 68 Contributed by Yichun Wei.
55 69
56 70 2008-04-18 Fernando Perez <Fernando.Perez@berkeley.edu>
57 71
58 72 * IPython/genutils.py (page): apply workaround to curses bug that
59 73 can leave terminal corrupted after a call to initscr().
60 74
61 75 2008-04-15 Ville Vainio <vivainio@gmail.com>
62 76
63 77 * genutils.py: SList.grep supports 'field' argument
64 78
65 79 * ipy_completers.py: module completer looks inside
66 80 .egg zip files (patch by mc). Close #196.
67 81
68 82 2008-04-09 Ville Vainio <vivainio@gmail.com>
69 83
70 84 * deep_reload.py: do not crash on from __future__ import
71 85 absolute_import. Close #244.
72 86
73 87 2008-04-02 Ville Vainio <vivainio@gmail.com>
74 88
75 89 * ipy_winpdb.py: New extension for winpdb integration. %wdb
76 90 test.py is winpdb equivalent of %run -d test.py. winpdb is a
77 91 crossplatform remote GUI debugger based on wxpython.
78 92
79 93 2008-03-29 Ville Vainio <vivainio@gmail.com>
80 94
81 95 * ipython.rst, do_sphinx.py: New documentation base, based on
82 96 reStucturedText and Sphinx (html/pdf generation). The old Lyx
83 97 based documentation will not be updated anymore.
84 98
85 99 * jobctrl.py: Use shell in Popen for 'start' command (in windows).
86 100
87 101 2008-03-24 Ville Vainio <vivainio@gmail.com>
88 102
89 103 * ipython.rst, do_sphinx.py: New documentation base, based on
90 104 reStucturedText and Sphinx (html/pdf generation). The old Lyx
91 105 based documentation will not be updated anymore.
92 106
93 107 ipython.rst has up to date documentation on matters that were not
94 108 documented at all, and it also removes various
95 109 misdocumented/deprecated features.
96 110
97 111 2008-03-22 Ville Vainio <vivainio@gmail.com>
98 112
99 113 * Shell.py: Merge mtexp branch:
100 114 https://code.launchpad.net/~ipython/ipython/mtexp
101 115
102 116 Privides simpler and more robust MTInteractiveShell that won't
103 117 deadlock, even when the worker thread (GUI) stops doing runcode()
104 118 regularly. r71.
105 119
106 120 2008-03-20 Ville Vainio <vivainio@gmail.com>
107 121
108 122 * twshell.py: New shell that runs IPython code in Twisted reactor.
109 123 Launch by doing ipython -twisted. r67.
110 124
111 125 2008-03-19 Ville Vainio <vivainio@gmail.com>
112 126
113 127 * Magic.py: %rehashx works correctly when shadowed system commands
114 128 have upper case characters (e.g. Print.exe). r64.
115 129
116 130 * ipy_bzr.py, ipy_app_completers.py: new bzr completer that also
117 131 knows options to commands, based on bzrtools. Uses bzrlib
118 132 directly. r66.
119 133
120 134 2008-03-16 Ville Vainio <vivainio@gmail.com>
121 135
122 136 * make_tarball.py: Fixed for bzr.
123 137
124 138 * ipapi.py: Better _ip.runlines() script cleanup. r56,r79.
125 139
126 140 * ipy_vimserver.py, ipy.vim: New extension for vim server mode,
127 141 by Erich Heine.
128 142
129 143 2008-03-12 Ville Vainio <vivainio@gmail.com>
130 144
131 145 * ipmaker.py: Force (reload?) import of ipy_user_conf and
132 146 ipy_profile_foo, so that embedded instances can be relaunched and
133 147 configuration is still done. r50
134 148
135 149 * ipapi.py, test_embed.py: Allow specifying shell class in
136 150 launch_new_instance & make_new instance. Use this in
137 151 test_embed.py. r51.
138 152
139 153 test_embed.py is also a good and simple demo of embedding IPython.
140 154
141 155
142 156 2008-03-10 Ville Vainio <vivainio@gmail.com>
143 157
144 158 * tool/update_revnum.py: Change to bzr revisioning scheme in
145 159 revision numbers.
146 160
147 161 * Shell.py: Threading improvements:
148 162
149 163 In multithreaded shells, do not hang on macros and o.autoexec
150 164 commands (or anything executed with _ip.runlines()) anymore. Allow
151 165 recursive execution of IPython code in
152 166 MTInteractiveShell.runsource by checking if we are already in
153 167 worker thread, and execute code directly if we are. r48.
154 168
155 169 MTInteractiveShell.runsource: execute code directly if worker
156 170 thread is not running yet (this is the case in config files). r49.
157 171
158 172 2008-03-09 Ville Vainio <vivainio@gmail.com>
159 173
160 174 * ipy_profile_sh.py: You can now use $LA or LA() to refer to last
161 175 argument of previous command in sh profile. Similar to bash '!$'.
162 176 LA(3) or $LA(3) stands for last argument of input history command
163 177 3.
164 178
165 179 * Shell.py: -pylab names don't clutter %whos listing.
166 180
167 181 2008-03-07 Ville Vainio <vivainio@gmail.com>
168 182
169 183 * ipy_autoreload.py: new extension (by Pauli Virtanen) for
170 184 autoreloading modules; try %autoreload and %aimport. Close #154.
171 185 Uses the new pre_runcode_hook.
172 186
173 187 2008-02-24 Ville Vainio <vivainio@gmail.com>
174 188
175 189 * platutils_posix.py: freeze_term_title works
176 190
177 191 2008-02-21 Ville Vainio <vivainio@gmail.com>
178 192
179 193 * Magic.py: %quickref does not crash with empty docstring
180 194
181 195 2008-02-20 Ville Vainio <vivainio@gmail.com>
182 196
183 197 * completer.py: do not treat [](){} as protectable chars anymore,
184 198 close #233.
185 199
186 200 * completer.py: do not treat [](){} as protectable chars anymore
187 201
188 202 * magic.py, test_cpaste.py: Allow different prefix for pasting
189 203 from email
190 204
191 205 2008-02-17 Ville Vainio <vivainio@gmail.com>
192 206
193 207 * Switched over to Launchpad/bzr as primary VCS.
194 208
195 209 2008-02-14 Ville Vainio <vivainio@gmail.com>
196 210
197 211 * ipapi.py: _ip.runlines() is now much more liberal about
198 212 indentation - it cleans up the scripts it gets
199 213
200 214 2008-02-14 Ville Vainio <vivainio@gmail.com>
201 215
202 216 * Extensions/ipy_leo.py: created 'ILeo' IPython-Leo bridge.
203 217 Changes to it (later on) are too numerous to list in ChangeLog
204 218 until it stabilizes
205 219
206 220 2008-02-07 Darren Dale <darren.dale@cornell.edu>
207 221
208 222 * IPython/Shell.py: Call QtCore.pyqtRemoveInputHook() when creating
209 223 an IPShellQt4. PyQt4-4.2.1 and later uses PyOS_InputHook to improve
210 224 interaction in the interpreter (like Tkinter does), but it seems to
211 225 partially interfere with the IPython implementation and exec_()
212 226 still seems to block. So we disable the PyQt implementation and
213 227 stick with the IPython one for now.
214 228
215 229 2008-02-02 Walter Doerwald <walter@livinglogic.de>
216 230
217 231 * ipipe.py: A new ipipe table has been added: ialias produces all
218 232 entries from IPython's alias table.
219 233
220 234 2008-02-01 Fernando Perez <Fernando.Perez@colorado.edu>
221 235
222 236 * IPython/Shell.py (MTInteractiveShell.runcode): Improve handling
223 237 of KBINT in threaded shells. After code provided by Marc in #212.
224 238
225 239 2008-01-30 Fernando Perez <Fernando.Perez@colorado.edu>
226 240
227 241 * IPython/Shell.py (MTInteractiveShell.__init__): Fixed deadlock
228 242 that could occur due to a race condition in threaded shells.
229 243 Thanks to code provided by Marc, as #210.
230 244
231 245 2008-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
232 246
233 247 * IPython/Magic.py (magic_doctest_mode): respect the user's
234 248 settings for input separators rather than overriding them. After
235 249 a report by Jeff Kowalczyk <jtk-AT-yahoo.com>
236 250
237 251 * IPython/history.py (magic_history): Add support for declaring an
238 252 output file directly from the history command.
239 253
240 254 2008-01-21 Walter Doerwald <walter@livinglogic.de>
241 255
242 256 * ipipe.py: Register ipipe's displayhooks via the generic function
243 257 generics.result_display() instead of using ipapi.set_hook().
244 258
245 259 2008-01-19 Walter Doerwald <walter@livinglogic.de>
246 260
247 261 * ibrowse.py, igrid.py, ipipe.py:
248 262 The input object can now be passed to the constructor of the display classes.
249 263 This makes it possible to use them with objects that implement __or__.
250 264 Use this constructor in the displayhook instead of piping.
251 265
252 266 * ipipe.py: Importing astyle.py is done as late as possible to
253 267 avoid problems with circular imports.
254 268
255 269 2008-01-19 Ville Vainio <vivainio@gmail.com>
256 270
257 271 * hooks.py, iplib.py: Added 'shell_hook' to customize how
258 272 IPython calls shell.
259 273
260 274 * hooks.py, iplib.py: Added 'show_in_pager' hook to specify
261 275 how IPython pages text (%page, %pycat, %pdoc etc.)
262 276
263 277 * Extensions/jobctrl.py: Use shell_hook. New magics: '%tasks'
264 278 and '%kill' to kill hanging processes that won't obey ctrl+C.
265 279
266 280 2008-01-16 Ville Vainio <vivainio@gmail.com>
267 281
268 282 * ipy_completers.py: pyw extension support for %run completer.
269 283
270 284 2008-01-11 Ville Vainio <vivainio@gmail.com>
271 285
272 286 * iplib.py, ipmaker.py: new rc option - autoexec. It's a list
273 287 of ipython commands to be run when IPython has started up
274 288 (just before running the scripts and -c arg on command line).
275 289
276 290 * ipy_user_conf.py: Added an example on how to change term
277 291 colors in config file (through using autoexec).
278 292
279 293 * completer.py, test_completer.py: Ability to specify custom
280 294 get_endidx to replace readline.get_endidx. For emacs users.
281 295
282 296 2008-01-10 Ville Vainio <vivainio@gmail.com>
283 297
284 298 * Prompts.py (set_p_str): do not crash on illegal prompt strings
285 299
286 300 2008-01-08 Ville Vainio <vivainio@gmail.com>
287 301
288 302 * '%macro -r' (raw mode) is now default in sh profile.
289 303
290 304 2007-12-31 Ville Vainio <vivainio@gmail.com>
291 305
292 306 * completer.py: custom completer matching is now case sensitive
293 307 (#207).
294 308
295 309 * ultraTB.py, iplib.py: Add some KeyboardInterrupt catching in
296 310 an attempt to prevent occasional crashes.
297 311
298 312 * CrashHandler.py: Crash log dump now asks user to press enter
299 313 before exiting.
300 314
301 315 * Store _ip in user_ns instead of __builtin__, enabling safer
302 316 coexistence of multiple IPython instances in the same python
303 317 interpreter (#197).
304 318
305 319 * Debugger.py, ipmaker.py: Need to add '-pydb' command line
306 320 switch to enable pydb in post-mortem debugging and %run -d.
307 321
308 322 2007-12-28 Ville Vainio <vivainio@gmail.com>
309 323
310 324 * ipy_server.py: TCP socket server for "remote control" of an IPython
311 325 instance.
312 326
313 327 * Debugger.py: Change to PSF license
314 328
315 329 * simplegeneric.py: Add license & author notes.
316 330
317 331 * ipy_fsops.py: Added PathObj and FileObj, an object-oriented way
318 332 to navigate file system with a custom completer. Run
319 333 ipy_fsops.test_pathobj() to play with it.
320 334
321 335 2007-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
322 336
323 337 * IPython/dtutils.py: Add utilities for interactively running
324 338 doctests. Still needs work to more easily handle the namespace of
325 339 the package one may be working on, but the basics are in place.
326 340
327 341 2007-12-27 Ville Vainio <vivainio@gmail.com>
328 342
329 343 * ipy_completers.py: Applied arno's patch to get proper list of
330 344 packages in import completer. Closes #196.
331 345
332 346 2007-12-20 Ville Vainio <vivainio@gmail.com>
333 347
334 348 * completer.py, generics.py(complete_object): Allow
335 349 custom complers based on python objects via simplegeneric.
336 350 See generics.py / my_demo_complete_object
337 351
338 352 2007-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
339 353
340 354 * IPython/Prompts.py (BasePrompt.__nonzero__): add proper boolean
341 355 behavior to prompt objects, useful for display hooks to adjust
342 356 themselves depending on whether prompts will be there or not.
343 357
344 358 2007-12-13 Ville Vainio <vivainio@gmail.com>
345 359
346 360 * iplib.py(raw_input): unix readline does not allow unicode in
347 361 history, encode to normal string. After patch by Tiago.
348 362 Close #201
349 363
350 364 2007-12-12 Ville Vainio <vivainio@gmail.com>
351 365
352 366 * genutils.py (abbrev_cwd): Terminal title now shows 2 levels of
353 367 current directory.
354 368
355 369 2007-12-12 Fernando Perez <Fernando.Perez@colorado.edu>
356 370
357 371 * IPython/Shell.py (_select_shell): add support for controlling
358 372 the pylab threading mode directly at the command line, without
359 373 having to modify MPL config files. Added unit tests for this
360 374 feature, though manual/docs update is still pending, will do later.
361 375
362 376 2007-12-11 Ville Vainio <vivainio@gmail.com>
363 377
364 378 * ext_rescapture.py: var = !cmd is no longer verbose (to facilitate
365 379 use in scripts)
366 380
367 381 2007-12-07 Ville Vainio <vivainio@gmail.com>
368 382
369 383 * iplib.py, ipy_profile_sh.py: Do not escape # on command lines
370 384 anymore (to \#) - even if it is a comment char that is implicitly
371 385 escaped in some unix shells in interactive mode, it is ok to leave
372 386 it in IPython as such.
373 387
374 388
375 389 2007-12-01 Robert Kern <robert.kern@gmail.com>
376 390
377 391 * IPython/ultraTB.py (findsource): Improve the monkeypatch to
378 392 inspect.findsource(). It can now find source lines inside zipped
379 393 packages.
380 394
381 395 * IPython/ultraTB.py: When constructing tracebacks, try to use __file__
382 396 in the frame's namespace before trusting the filename in the code object
383 397 which created the frame.
384 398
385 399 2007-11-29 *** Released version 0.8.2
386 400
387 401 2007-11-25 Fernando Perez <Fernando.Perez@colorado.edu>
388 402
389 403 * IPython/Logger.py (Logger.logstop): add a proper logstop()
390 404 method to fully stop the logger, along with a corresponding
391 405 %logstop magic for interactive use.
392 406
393 407 * IPython/Extensions/ipy_host_completers.py: added new host
394 408 completers functionality, contributed by Gael Pasgrimaud
395 409 <gawel-AT-afpy.org>.
396 410
397 411 2007-11-24 Fernando Perez <Fernando.Perez@colorado.edu>
398 412
399 413 * IPython/DPyGetOpt.py (ArgumentError): Apply patch by Paul Mueller
400 414 <gakusei-AT-dakotacom.net>, to fix deprecated string exceptions in
401 415 options handling. Unicode fix in %whos (committed a while ago)
402 416 was also contributed by Paul.
403 417
404 418 2007-11-23 Darren Dale <darren.dale@cornell.edu>
405 419 * ipy_traits_completer.py: let traits_completer respect the user's
406 420 readline_omit__names setting.
407 421
408 422 2007-11-08 Ville Vainio <vivainio@gmail.com>
409 423
410 424 * ipy_completers.py (import completer): assume 'xml' module exists.
411 425 Do not add every module twice anymore. Closes #196.
412 426
413 427 * ipy_completers.py, ipy_app_completers.py: Add proper apt-get
414 428 completer that uses apt-cache to search for existing packages.
415 429
416 430 2007-11-06 Ville Vainio <vivainio@gmail.com>
417 431
418 432 * Prompts.py: Do not update _oh and _123 when do_full_cache is not
419 433 true. Closes #194.
420 434
421 435 2007-11-01 Brian Granger <ellisonbg@gmail.com>
422 436
423 437 * iplib.py, rlineimpl.py: Applied Body Water's patches to get IPython
424 438 working with OS X 10.5 libedit implementation of readline.
425 439
426 440 2007-10-24 Ville Vainio <vivainio@gmail.com>
427 441
428 442 * iplib.py(user_setup): To route around buggy installations where
429 443 UserConfig is not available, create a minimal _ipython.
430 444
431 445 * iplib.py: Unicode fixes from Jorgen.
432 446
433 447 * genutils.py: Slist now has new method 'fields()' for extraction of
434 448 whitespace-separated fields from line-oriented data.
435 449
436 450 2007-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
437 451
438 452 * IPython/OInspect.py (Inspector.pinfo): fix bug that could arise
439 453 when querying objects with no __class__ attribute (such as
440 454 f2py-generated modules).
441 455
442 456 2007-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
443 457
444 458 * IPython/Magic.py (magic_time): track compilation time and report
445 459 it if longer than 0.1s (fix done to %time and %timeit). After a
446 460 SAGE bug report: http://trac.sagemath.org/sage_trac/ticket/632.
447 461
448 462 2007-09-18 Ville Vainio <vivainio@gmail.com>
449 463
450 464 * genutils.py(make_quoted_expr): Do not use Itpl, it does
451 465 not support unicode at the moment. Fixes (many) magic calls with
452 466 special characters.
453 467
454 468 2007-09-14 Fernando Perez <Fernando.Perez@colorado.edu>
455 469
456 470 * IPython/genutils.py (doctest_reload): expose the doctest
457 471 reloader to the user so that people can easily reset doctest while
458 472 using it interactively. Fixes a problem reported by Jorgen.
459 473
460 474 * IPython/iplib.py (InteractiveShell.__init__): protect the
461 475 FakeModule instances used for __main__ in %run calls from
462 476 deletion, so that user code defined in them isn't left with
463 477 dangling references due to the Python module deletion machinery.
464 478 This should fix the problems reported by Darren.
465 479
466 480 2007-09-10 Darren Dale <dd55@cornell.edu>
467 481
468 482 * Cleanup of IPShellQt and IPShellQt4
469 483
470 484 2007-09-09 Fernando Perez <Fernando.Perez@colorado.edu>
471 485
472 486 * IPython/FakeModule.py (FakeModule.__init__): further fixes for
473 487 doctest support.
474 488
475 489 * IPython/iplib.py (safe_execfile): minor docstring improvements.
476 490
477 491 2007-09-08 Ville Vainio <vivainio@gmail.com>
478 492
479 493 * Magic.py (%pushd, %popd, %dirs): Fix dir stack - push *current*
480 494 directory, not the target directory.
481 495
482 496 * ipapi.py, Magic.py, iplib.py: Add ipapi.UsageError, a lighter weight
483 497 exception that won't print the tracebacks. Switched many magics to
484 498 raise them on error situations, also GetoptError is not printed
485 499 anymore.
486 500
487 501 2007-09-07 Ville Vainio <vivainio@gmail.com>
488 502
489 503 * iplib.py: do not auto-alias "dir", it screws up other dir auto
490 504 aliases.
491 505
492 506 * genutils.py: SList.grep() implemented.
493 507
494 508 * ipy_editors.py, UserConfig/ipy_user_conf.py: Add some editors
495 509 for easy "out of the box" setup of several common editors, so that
496 510 e.g. '%edit os.path.isfile' will jump to the correct line
497 511 automatically. Contributions for command lines of your favourite
498 512 editors welcome.
499 513
500 514 2007-09-07 Fernando Perez <Fernando.Perez@colorado.edu>
501 515
502 516 * IPython/OInspect.py (Inspector.pinfo): fixed bug that was
503 517 preventing source display in certain cases. In reality I think
504 518 the problem is with Ubuntu's Python build, but this change works
505 519 around the issue in some cases (not in all, unfortunately). I'd
506 520 filed a Python bug on this with more details, but in the change of
507 521 bug trackers it seems to have been lost.
508 522
509 523 * IPython/Magic.py (magic_dhist): restore %dhist. No, cd -TAB is
510 524 not the same, it's not self-documenting, doesn't allow range
511 525 selection, and sorts alphabetically instead of numerically.
512 526 (magic_r): restore %r. No, "up + enter. One char magic" is not
513 527 the same thing, since %r takes parameters to allow fast retrieval
514 528 of old commands. I've received emails from users who use this a
515 529 LOT, so it stays.
516 530 (magic_automagic): restore %automagic. "use _ip.option.automagic"
517 531 is not a valid replacement b/c it doesn't provide an complete
518 532 explanation (which the automagic docstring does).
519 533 (magic_autocall): restore %autocall, with improved docstring.
520 534 Same argument as for others, "use _ip.options.autocall" is not a
521 535 valid replacement.
522 536 (magic_pdef): restore %pdef & friends. Used widely, mentioned in
523 537 tutorials and online docs.
524 538
525 539 2007-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
526 540
527 541 * IPython/usage.py (quick_reference): mention magics in quickref,
528 542 modified main banner to mention %quickref.
529 543
530 544 * IPython/FakeModule.py (FakeModule): fixes for doctest compatibility.
531 545
532 546 2007-09-06 Ville Vainio <vivainio@gmail.com>
533 547
534 548 * ipy_rehashdir.py, ipy_workdir.py, ipy_fsops.py, iplib.py:
535 549 Callable aliases now pass the _ip as first arg. This breaks
536 550 compatibility with earlier 0.8.2.svn series! (though they should
537 551 not have been in use yet outside these few extensions)
538 552
539 553 2007-09-05 Ville Vainio <vivainio@gmail.com>
540 554
541 555 * external/mglob.py: expand('dirname') => ['dirname'], instead
542 556 of ['dirname/foo','dirname/bar', ...].
543 557
544 558 * Extensions/ipy_fsops.py: added, has usefull shell utils for plain
545 559 win32 installations: icp, imv, imkdir, igrep, irm, collect (collect
546 560 is useful for others as well).
547 561
548 562 * iplib.py: on callable aliases (as opposed to old style aliases),
549 563 do var_expand() immediately, and use make_quoted_expr instead
550 564 of hardcoded r"""
551 565
552 566 * Extensions/ipy_profile_sh.py: Try to detect cygwin on win32,
553 567 if not available load ipy_fsops.py for cp, mv, etc. replacements
554 568
555 569 * OInspect.py, ipy_which.py: improve %which and obj? for callable
556 570 aliases
557 571
558 572 2007-09-04 Ville Vainio <vivainio@gmail.com>
559 573
560 574 * ipy_profile_zope.py: add zope profile, by Stefan Eletzhofer.
561 575 Relicensed under BSD with the authors approval.
562 576
563 577 * ipmaker.py, usage.py: Remove %magic from default banner, improve
564 578 %quickref
565 579
566 580 2007-09-03 Ville Vainio <vivainio@gmail.com>
567 581
568 582 * Magic.py: %time now passes expression through prefilter,
569 583 allowing IPython syntax.
570 584
571 585 2007-09-01 Ville Vainio <vivainio@gmail.com>
572 586
573 587 * ipmaker.py: Always show full traceback when newstyle config fails
574 588
575 589 2007-08-27 Ville Vainio <vivainio@gmail.com>
576 590
577 591 * Magic.py: fix %cd for nonexistent dir when dhist is empty, close #180
578 592
579 593 2007-08-26 Ville Vainio <vivainio@gmail.com>
580 594
581 595 * ipmaker.py: Command line args have the highest priority again
582 596
583 597 * iplib.py, ipmaker.py: -i command line argument now behaves as in
584 598 normal python, i.e. leaves the IPython session running after -c
585 599 command or running a batch file from command line.
586 600
587 601 2007-08-22 Ville Vainio <vivainio@gmail.com>
588 602
589 603 * iplib.py: no extra empty (last) line in raw hist w/ multiline
590 604 statements
591 605
592 606 * logger.py: Fix bug where blank lines in history were not
593 607 added until AFTER adding the current line; translated and raw
594 608 history should finally be in sync with prompt now.
595 609
596 610 * ipy_completers.py: quick_completer now makes it easy to create
597 611 trivial custom completers
598 612
599 613 * clearcmd.py: shadow history compression & erasing, fixed input hist
600 614 clearing.
601 615
602 616 * envpersist.py, history.py: %env (sh profile only), %hist completers
603 617
604 618 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
605 619 term title now include the drive letter, and always use / instead of
606 620 os.sep (as per recommended approach for win32 ipython in general).
607 621
608 622 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
609 623 plain python scripts from ipykit command line by running
610 624 "py myscript.py", even w/o installed python.
611 625
612 626 2007-08-21 Ville Vainio <vivainio@gmail.com>
613 627
614 628 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
615 629 (for backwards compatibility)
616 630
617 631 * history.py: switch back to %hist -t from %hist -r as default.
618 632 At least until raw history is fixed for good.
619 633
620 634 2007-08-20 Ville Vainio <vivainio@gmail.com>
621 635
622 636 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
623 637 locate alias redeclarations etc. Also, avoid handling
624 638 _ip.IP.alias_table directly, prefer using _ip.defalias.
625 639
626 640
627 641 2007-08-15 Ville Vainio <vivainio@gmail.com>
628 642
629 643 * prefilter.py: ! is now always served first
630 644
631 645 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
632 646
633 647 * IPython/iplib.py (safe_execfile): fix the SystemExit
634 648 auto-suppression code to work in Python2.4 (the internal structure
635 649 of that exception changed and I'd only tested the code with 2.5).
636 650 Bug reported by a SciPy attendee.
637 651
638 652 2007-08-13 Ville Vainio <vivainio@gmail.com>
639 653
640 654 * prefilter.py: reverted !c:/bin/foo fix, made % in
641 655 multiline specials work again
642 656
643 657 2007-08-13 Ville Vainio <vivainio@gmail.com>
644 658
645 659 * prefilter.py: Take more care to special-case !, so that
646 660 !c:/bin/foo.exe works.
647 661
648 662 * setup.py: if we are building eggs, strip all docs and
649 663 examples (it doesn't make sense to bytecompile examples,
650 664 and docs would be in an awkward place anyway).
651 665
652 666 * Ryan Krauss' patch fixes start menu shortcuts when IPython
653 667 is installed into a directory that has spaces in the name.
654 668
655 669 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
656 670
657 671 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
658 672 doctest profile and %doctest_mode, so they actually generate the
659 673 blank lines needed by doctest to separate individual tests.
660 674
661 675 * IPython/iplib.py (safe_execfile): modify so that running code
662 676 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
663 677 doesn't get a printed traceback. Any other value in sys.exit(),
664 678 including the empty call, still generates a traceback. This
665 679 enables use of %run without having to pass '-e' for codes that
666 680 correctly set the exit status flag.
667 681
668 682 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
669 683
670 684 * IPython/iplib.py (InteractiveShell.post_config_initialization):
671 685 fix problems with doctests failing when run inside IPython due to
672 686 IPython's modifications of sys.displayhook.
673 687
674 688 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
675 689
676 690 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
677 691 a string with names.
678 692
679 693 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
680 694
681 695 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
682 696 magic to toggle on/off the doctest pasting support without having
683 697 to leave a session to switch to a separate profile.
684 698
685 699 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
686 700
687 701 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
688 702 introduce a blank line between inputs, to conform to doctest
689 703 requirements.
690 704
691 705 * IPython/OInspect.py (Inspector.pinfo): fix another part where
692 706 auto-generated docstrings for new-style classes were showing up.
693 707
694 708 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
695 709
696 710 * api_changes: Add new file to track backward-incompatible
697 711 user-visible changes.
698 712
699 713 2007-08-06 Ville Vainio <vivainio@gmail.com>
700 714
701 715 * ipmaker.py: fix bug where user_config_ns didn't exist at all
702 716 before all the config files were handled.
703 717
704 718 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
705 719
706 720 * IPython/irunner.py (RunnerFactory): Add new factory class for
707 721 creating reusable runners based on filenames.
708 722
709 723 * IPython/Extensions/ipy_profile_doctest.py: New profile for
710 724 doctest support. It sets prompts/exceptions as similar to
711 725 standard Python as possible, so that ipython sessions in this
712 726 profile can be easily pasted as doctests with minimal
713 727 modifications. It also enables pasting of doctests from external
714 728 sources (even if they have leading whitespace), so that you can
715 729 rerun doctests from existing sources.
716 730
717 731 * IPython/iplib.py (_prefilter): fix a buglet where after entering
718 732 some whitespace, the prompt would become a continuation prompt
719 733 with no way of exiting it other than Ctrl-C. This fix brings us
720 734 into conformity with how the default python prompt works.
721 735
722 736 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
723 737 Add support for pasting not only lines that start with '>>>', but
724 738 also with ' >>>'. That is, arbitrary whitespace can now precede
725 739 the prompts. This makes the system useful for pasting doctests
726 740 from docstrings back into a normal session.
727 741
728 742 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
729 743
730 744 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
731 745 r1357, which had killed multiple invocations of an embedded
732 746 ipython (this means that example-embed has been broken for over 1
733 747 year!!!). Rather than possibly breaking the batch stuff for which
734 748 the code in iplib.py/interact was introduced, I worked around the
735 749 problem in the embedding class in Shell.py. We really need a
736 750 bloody test suite for this code, I'm sick of finding stuff that
737 751 used to work breaking left and right every time I use an old
738 752 feature I hadn't touched in a few months.
739 753 (kill_embedded): Add a new magic that only shows up in embedded
740 754 mode, to allow users to permanently deactivate an embedded instance.
741 755
742 756 2007-08-01 Ville Vainio <vivainio@gmail.com>
743 757
744 758 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
745 759 history gets out of sync on runlines (e.g. when running macros).
746 760
747 761 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
748 762
749 763 * IPython/Magic.py (magic_colors): fix win32-related error message
750 764 that could appear under *nix when readline was missing. Patch by
751 765 Scott Jackson, closes #175.
752 766
753 767 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
754 768
755 769 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
756 770 completer that it traits-aware, so that traits objects don't show
757 771 all of their internal attributes all the time.
758 772
759 773 * IPython/genutils.py (dir2): moved this code from inside
760 774 completer.py to expose it publicly, so I could use it in the
761 775 wildcards bugfix.
762 776
763 777 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
764 778 Stefan with Traits.
765 779
766 780 * IPython/completer.py (Completer.attr_matches): change internal
767 781 var name from 'object' to 'obj', since 'object' is now a builtin
768 782 and this can lead to weird bugs if reusing this code elsewhere.
769 783
770 784 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
771 785
772 786 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
773 787 'foo?' and update the code to prevent printing of default
774 788 docstrings that started appearing after I added support for
775 789 new-style classes. The approach I'm using isn't ideal (I just
776 790 special-case those strings) but I'm not sure how to more robustly
777 791 differentiate between truly user-written strings and Python's
778 792 automatic ones.
779 793
780 794 2007-07-09 Ville Vainio <vivainio@gmail.com>
781 795
782 796 * completer.py: Applied Matthew Neeley's patch:
783 797 Dynamic attributes from trait_names and _getAttributeNames are added
784 798 to the list of tab completions, but when this happens, the attribute
785 799 list is turned into a set, so the attributes are unordered when
786 800 printed, which makes it hard to find the right completion. This patch
787 801 turns this set back into a list and sort it.
788 802
789 803 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
790 804
791 805 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
792 806 classes in various inspector functions.
793 807
794 808 2007-06-28 Ville Vainio <vivainio@gmail.com>
795 809
796 810 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
797 811 Implement "shadow" namespace, and callable aliases that reside there.
798 812 Use them by:
799 813
800 814 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
801 815
802 816 foo hello world
803 817 (gets translated to:)
804 818 _sh.foo(r"""hello world""")
805 819
806 820 In practice, this kind of alias can take the role of a magic function
807 821
808 822 * New generic inspect_object, called on obj? and obj??
809 823
810 824 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
811 825
812 826 * IPython/ultraTB.py (findsource): fix a problem with
813 827 inspect.getfile that can cause crashes during traceback construction.
814 828
815 829 2007-06-14 Ville Vainio <vivainio@gmail.com>
816 830
817 831 * iplib.py (handle_auto): Try to use ascii for printing "--->"
818 832 autocall rewrite indication, becausesometimes unicode fails to print
819 833 properly (and you get ' - - - '). Use plain uncoloured ---> for
820 834 unicode.
821 835
822 836 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
823 837
824 838 . pickleshare 'hash' commands (hget, hset, hcompress,
825 839 hdict) for efficient shadow history storage.
826 840
827 841 2007-06-13 Ville Vainio <vivainio@gmail.com>
828 842
829 843 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
830 844 Added kw arg 'interactive', tell whether vars should be visible
831 845 with %whos.
832 846
833 847 2007-06-11 Ville Vainio <vivainio@gmail.com>
834 848
835 849 * pspersistence.py, Magic.py, iplib.py: directory history now saved
836 850 to db
837 851
838 852 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
839 853 Also, it exits IPython immediately after evaluating the command (just like
840 854 std python)
841 855
842 856 2007-06-05 Walter Doerwald <walter@livinglogic.de>
843 857
844 858 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
845 859 Python string and captures the output. (Idea and original patch by
846 860 Stefan van der Walt)
847 861
848 862 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
849 863
850 864 * IPython/ultraTB.py (VerboseTB.text): update printing of
851 865 exception types for Python 2.5 (now all exceptions in the stdlib
852 866 are new-style classes).
853 867
854 868 2007-05-31 Walter Doerwald <walter@livinglogic.de>
855 869
856 870 * IPython/Extensions/igrid.py: Add new commands refresh and
857 871 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
858 872 the iterator once (refresh) or after every x seconds (refresh_timer).
859 873 Add a working implementation of "searchexpression", where the text
860 874 entered is not the text to search for, but an expression that must
861 875 be true. Added display of shortcuts to the menu. Added commands "pickinput"
862 876 and "pickinputattr" that put the object or attribute under the cursor
863 877 in the input line. Split the statusbar to be able to display the currently
864 878 active refresh interval. (Patch by Nik Tautenhahn)
865 879
866 880 2007-05-29 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
867 881
868 882 * fixing set_term_title to use ctypes as default
869 883
870 884 * fixing set_term_title fallback to work when curent dir
871 885 is on a windows network share
872 886
873 887 2007-05-28 Ville Vainio <vivainio@gmail.com>
874 888
875 889 * %cpaste: strip + with > from left (diffs).
876 890
877 891 * iplib.py: Fix crash when readline not installed
878 892
879 893 2007-05-26 Ville Vainio <vivainio@gmail.com>
880 894
881 895 * generics.py: introduce easy to extend result_display generic
882 896 function (using simplegeneric.py).
883 897
884 898 * Fixed the append functionality of %set.
885 899
886 900 2007-05-25 Ville Vainio <vivainio@gmail.com>
887 901
888 902 * New magic: %rep (fetch / run old commands from history)
889 903
890 904 * New extension: mglob (%mglob magic), for powerful glob / find /filter
891 905 like functionality
892 906
893 907 % maghistory.py: %hist -g PATTERM greps the history for pattern
894 908
895 909 2007-05-24 Walter Doerwald <walter@livinglogic.de>
896 910
897 911 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
898 912 browse the IPython input history
899 913
900 914 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
901 915 (mapped to "i") can be used to put the object under the curser in the input
902 916 line. pickinputattr (mapped to "I") does the same for the attribute under
903 917 the cursor.
904 918
905 919 2007-05-24 Ville Vainio <vivainio@gmail.com>
906 920
907 921 * Grand magic cleansing (changeset [2380]):
908 922
909 923 * Introduce ipy_legacy.py where the following magics were
910 924 moved:
911 925
912 926 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
913 927
914 928 If you need them, either use default profile or "import ipy_legacy"
915 929 in your ipy_user_conf.py
916 930
917 931 * Move sh and scipy profile to Extensions from UserConfig. this implies
918 932 you should not edit them, but you don't need to run %upgrade when
919 933 upgrading IPython anymore.
920 934
921 935 * %hist/%history now operates in "raw" mode by default. To get the old
922 936 behaviour, run '%hist -n' (native mode).
923 937
924 938 * split ipy_stock_completers.py to ipy_stock_completers.py and
925 939 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
926 940 installed as default.
927 941
928 942 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
929 943 handling.
930 944
931 945 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
932 946 input if readline is available.
933 947
934 948 2007-05-23 Ville Vainio <vivainio@gmail.com>
935 949
936 950 * macro.py: %store uses __getstate__ properly
937 951
938 952 * exesetup.py: added new setup script for creating
939 953 standalone IPython executables with py2exe (i.e.
940 954 no python installation required).
941 955
942 956 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
943 957 its place.
944 958
945 959 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
946 960
947 961 2007-05-21 Ville Vainio <vivainio@gmail.com>
948 962
949 963 * platutil_win32.py (set_term_title): handle
950 964 failure of 'title' system call properly.
951 965
952 966 2007-05-17 Walter Doerwald <walter@livinglogic.de>
953 967
954 968 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
955 969 (Bug detected by Paul Mueller).
956 970
957 971 2007-05-16 Ville Vainio <vivainio@gmail.com>
958 972
959 973 * ipy_profile_sci.py, ipython_win_post_install.py: Create
960 974 new "sci" profile, effectively a modern version of the old
961 975 "scipy" profile (which is now slated for deprecation).
962 976
963 977 2007-05-15 Ville Vainio <vivainio@gmail.com>
964 978
965 979 * pycolorize.py, pycolor.1: Paul Mueller's patches that
966 980 make pycolorize read input from stdin when run without arguments.
967 981
968 982 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
969 983
970 984 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
971 985 it in sh profile (instead of ipy_system_conf.py).
972 986
973 987 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
974 988 aliases are now lower case on windows (MyCommand.exe => mycommand).
975 989
976 990 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
977 991 Macros are now callable objects that inherit from ipapi.IPyAutocall,
978 992 i.e. get autocalled regardless of system autocall setting.
979 993
980 994 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
981 995
982 996 * IPython/rlineimpl.py: check for clear_history in readline and
983 997 make it a dummy no-op if not available. This function isn't
984 998 guaranteed to be in the API and appeared in Python 2.4, so we need
985 999 to check it ourselves. Also, clean up this file quite a bit.
986 1000
987 1001 * ipython.1: update man page and full manual with information
988 1002 about threads (remove outdated warning). Closes #151.
989 1003
990 1004 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
991 1005
992 1006 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
993 1007 in trunk (note that this made it into the 0.8.1 release already,
994 1008 but the changelogs didn't get coordinated). Many thanks to Gael
995 1009 Varoquaux <gael.varoquaux-AT-normalesup.org>
996 1010
997 1011 2007-05-09 *** Released version 0.8.1
998 1012
999 1013 2007-05-10 Walter Doerwald <walter@livinglogic.de>
1000 1014
1001 1015 * IPython/Extensions/igrid.py: Incorporate html help into
1002 1016 the module, so we don't have to search for the file.
1003 1017
1004 1018 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
1005 1019
1006 1020 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
1007 1021
1008 1022 2007-04-30 Ville Vainio <vivainio@gmail.com>
1009 1023
1010 1024 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
1011 1025 user has illegal (non-ascii) home directory name
1012 1026
1013 1027 2007-04-27 Ville Vainio <vivainio@gmail.com>
1014 1028
1015 1029 * platutils_win32.py: implement set_term_title for windows
1016 1030
1017 1031 * Update version number
1018 1032
1019 1033 * ipy_profile_sh.py: more informative prompt (2 dir levels)
1020 1034
1021 1035 2007-04-26 Walter Doerwald <walter@livinglogic.de>
1022 1036
1023 1037 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
1024 1038 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
1025 1039 bug discovered by Ville).
1026 1040
1027 1041 2007-04-26 Ville Vainio <vivainio@gmail.com>
1028 1042
1029 1043 * Extensions/ipy_completers.py: Olivier's module completer now
1030 1044 saves the list of root modules if it takes > 4 secs on the first run.
1031 1045
1032 1046 * Magic.py (%rehashx): %rehashx now clears the completer cache
1033 1047
1034 1048
1035 1049 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
1036 1050
1037 1051 * ipython.el: fix incorrect color scheme, reported by Stefan.
1038 1052 Closes #149.
1039 1053
1040 1054 * IPython/PyColorize.py (Parser.format2): fix state-handling
1041 1055 logic. I still don't like how that code handles state, but at
1042 1056 least now it should be correct, if inelegant. Closes #146.
1043 1057
1044 1058 2007-04-25 Ville Vainio <vivainio@gmail.com>
1045 1059
1046 1060 * Extensions/ipy_which.py: added extension for %which magic, works
1047 1061 a lot like unix 'which' but also finds and expands aliases, and
1048 1062 allows wildcards.
1049 1063
1050 1064 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
1051 1065 as opposed to returning nothing.
1052 1066
1053 1067 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
1054 1068 ipy_stock_completers on default profile, do import on sh profile.
1055 1069
1056 1070 2007-04-22 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
1057 1071
1058 1072 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
1059 1073 like ipython.py foo.py which raised a IndexError.
1060 1074
1061 1075 2007-04-21 Ville Vainio <vivainio@gmail.com>
1062 1076
1063 1077 * Extensions/ipy_extutil.py: added extension to manage other ipython
1064 1078 extensions. Now only supports 'ls' == list extensions.
1065 1079
1066 1080 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
1067 1081
1068 1082 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
1069 1083 would prevent use of the exception system outside of a running
1070 1084 IPython instance.
1071 1085
1072 1086 2007-04-20 Ville Vainio <vivainio@gmail.com>
1073 1087
1074 1088 * Extensions/ipy_render.py: added extension for easy
1075 1089 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
1076 1090 'Iptl' template notation,
1077 1091
1078 1092 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
1079 1093 safer & faster 'import' completer.
1080 1094
1081 1095 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
1082 1096 and _ip.defalias(name, command).
1083 1097
1084 1098 * Extensions/ipy_exportdb.py: New extension for exporting all the
1085 1099 %store'd data in a portable format (normal ipapi calls like
1086 1100 defmacro() etc.)
1087 1101
1088 1102 2007-04-19 Ville Vainio <vivainio@gmail.com>
1089 1103
1090 1104 * upgrade_dir.py: skip junk files like *.pyc
1091 1105
1092 1106 * Release.py: version number to 0.8.1
1093 1107
1094 1108 2007-04-18 Ville Vainio <vivainio@gmail.com>
1095 1109
1096 1110 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
1097 1111 and later on win32.
1098 1112
1099 1113 2007-04-16 Ville Vainio <vivainio@gmail.com>
1100 1114
1101 1115 * iplib.py (showtraceback): Do not crash when running w/o readline.
1102 1116
1103 1117 2007-04-12 Walter Doerwald <walter@livinglogic.de>
1104 1118
1105 1119 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
1106 1120 sorted (case sensitive with files and dirs mixed).
1107 1121
1108 1122 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
1109 1123
1110 1124 * IPython/Release.py (version): Open trunk for 0.8.1 development.
1111 1125
1112 1126 2007-04-10 *** Released version 0.8.0
1113 1127
1114 1128 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
1115 1129
1116 1130 * Tag 0.8.0 for release.
1117 1131
1118 1132 * IPython/iplib.py (reloadhist): add API function to cleanly
1119 1133 reload the readline history, which was growing inappropriately on
1120 1134 every %run call.
1121 1135
1122 1136 * win32_manual_post_install.py (run): apply last part of Nicolas
1123 1137 Pernetty's patch (I'd accidentally applied it in a different
1124 1138 directory and this particular file didn't get patched).
1125 1139
1126 1140 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
1127 1141
1128 1142 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
1129 1143 find the main thread id and use the proper API call. Thanks to
1130 1144 Stefan for the fix.
1131 1145
1132 1146 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
1133 1147 unit tests to reflect fixed ticket #52, and add more tests sent by
1134 1148 him.
1135 1149
1136 1150 * IPython/iplib.py (raw_input): restore the readline completer
1137 1151 state on every input, in case third-party code messed it up.
1138 1152 (_prefilter): revert recent addition of early-escape checks which
1139 1153 prevent many valid alias calls from working.
1140 1154
1141 1155 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
1142 1156 flag for sigint handler so we don't run a full signal() call on
1143 1157 each runcode access.
1144 1158
1145 1159 * IPython/Magic.py (magic_whos): small improvement to diagnostic
1146 1160 message.
1147 1161
1148 1162 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
1149 1163
1150 1164 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
1151 1165 asynchronous exceptions working, i.e., Ctrl-C can actually
1152 1166 interrupt long-running code in the multithreaded shells.
1153 1167
1154 1168 This is using Tomer Filiba's great ctypes-based trick:
1155 1169 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
1156 1170 this in the past, but hadn't been able to make it work before. So
1157 1171 far it looks like it's actually running, but this needs more
1158 1172 testing. If it really works, I'll be *very* happy, and we'll owe
1159 1173 a huge thank you to Tomer. My current implementation is ugly,
1160 1174 hackish and uses nasty globals, but I don't want to try and clean
1161 1175 anything up until we know if it actually works.
1162 1176
1163 1177 NOTE: this feature needs ctypes to work. ctypes is included in
1164 1178 Python2.5, but 2.4 users will need to manually install it. This
1165 1179 feature makes multi-threaded shells so much more usable that it's
1166 1180 a minor price to pay (ctypes is very easy to install, already a
1167 1181 requirement for win32 and available in major linux distros).
1168 1182
1169 1183 2007-04-04 Ville Vainio <vivainio@gmail.com>
1170 1184
1171 1185 * Extensions/ipy_completers.py, ipy_stock_completers.py:
1172 1186 Moved implementations of 'bundled' completers to ipy_completers.py,
1173 1187 they are only enabled in ipy_stock_completers.py.
1174 1188
1175 1189 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
1176 1190
1177 1191 * IPython/PyColorize.py (Parser.format2): Fix identation of
1178 1192 colorzied output and return early if color scheme is NoColor, to
1179 1193 avoid unnecessary and expensive tokenization. Closes #131.
1180 1194
1181 1195 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
1182 1196
1183 1197 * IPython/Debugger.py: disable the use of pydb version 1.17. It
1184 1198 has a critical bug (a missing import that makes post-mortem not
1185 1199 work at all). Unfortunately as of this time, this is the version
1186 1200 shipped with Ubuntu Edgy, so quite a few people have this one. I
1187 1201 hope Edgy will update to a more recent package.
1188 1202
1189 1203 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
1190 1204
1191 1205 * IPython/iplib.py (_prefilter): close #52, second part of a patch
1192 1206 set by Stefan (only the first part had been applied before).
1193 1207
1194 1208 * IPython/Extensions/ipy_stock_completers.py (module_completer):
1195 1209 remove usage of the dangerous pkgutil.walk_packages(). See
1196 1210 details in comments left in the code.
1197 1211
1198 1212 * IPython/Magic.py (magic_whos): add support for numpy arrays
1199 1213 similar to what we had for Numeric.
1200 1214
1201 1215 * IPython/completer.py (IPCompleter.complete): extend the
1202 1216 complete() call API to support completions by other mechanisms
1203 1217 than readline. Closes #109.
1204 1218
1205 1219 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
1206 1220 protect against a bug in Python's execfile(). Closes #123.
1207 1221
1208 1222 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
1209 1223
1210 1224 * IPython/iplib.py (split_user_input): ensure that when splitting
1211 1225 user input, the part that can be treated as a python name is pure
1212 1226 ascii (Python identifiers MUST be pure ascii). Part of the
1213 1227 ongoing Unicode support work.
1214 1228
1215 1229 * IPython/Prompts.py (prompt_specials_color): Add \N for the
1216 1230 actual prompt number, without any coloring. This allows users to
1217 1231 produce numbered prompts with their own colors. Added after a
1218 1232 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
1219 1233
1220 1234 2007-03-31 Walter Doerwald <walter@livinglogic.de>
1221 1235
1222 1236 * IPython/Extensions/igrid.py: Map the return key
1223 1237 to enter() and shift-return to enterattr().
1224 1238
1225 1239 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
1226 1240
1227 1241 * IPython/Magic.py (magic_psearch): add unicode support by
1228 1242 encoding to ascii the input, since this routine also only deals
1229 1243 with valid Python names. Fixes a bug reported by Stefan.
1230 1244
1231 1245 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
1232 1246
1233 1247 * IPython/Magic.py (_inspect): convert unicode input into ascii
1234 1248 before trying to evaluate it as a Python identifier. This fixes a
1235 1249 problem that the new unicode support had introduced when analyzing
1236 1250 long definition lines for functions.
1237 1251
1238 1252 2007-03-24 Walter Doerwald <walter@livinglogic.de>
1239 1253
1240 1254 * IPython/Extensions/igrid.py: Fix picking. Using
1241 1255 igrid with wxPython 2.6 and -wthread should work now.
1242 1256 igrid.display() simply tries to create a frame without
1243 1257 an application. Only if this fails an application is created.
1244 1258
1245 1259 2007-03-23 Walter Doerwald <walter@livinglogic.de>
1246 1260
1247 1261 * IPython/Extensions/path.py: Updated to version 2.2.
1248 1262
1249 1263 2007-03-23 Ville Vainio <vivainio@gmail.com>
1250 1264
1251 1265 * iplib.py: recursive alias expansion now works better, so that
1252 1266 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
1253 1267 doesn't trip up the process, if 'd' has been aliased to 'ls'.
1254 1268
1255 1269 * Extensions/ipy_gnuglobal.py added, provides %global magic
1256 1270 for users of http://www.gnu.org/software/global
1257 1271
1258 1272 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
1259 1273 Closes #52. Patch by Stefan van der Walt.
1260 1274
1261 1275 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
1262 1276
1263 1277 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
1264 1278 respect the __file__ attribute when using %run. Thanks to a bug
1265 1279 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
1266 1280
1267 1281 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
1268 1282
1269 1283 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
1270 1284 input. Patch sent by Stefan.
1271 1285
1272 1286 2007-03-20 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
1273 1287 * IPython/Extensions/ipy_stock_completer.py
1274 1288 shlex_split, fix bug in shlex_split. len function
1275 1289 call was missing an if statement. Caused shlex_split to
1276 1290 sometimes return "" as last element.
1277 1291
1278 1292 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
1279 1293
1280 1294 * IPython/completer.py
1281 1295 (IPCompleter.file_matches.single_dir_expand): fix a problem
1282 1296 reported by Stefan, where directories containign a single subdir
1283 1297 would be completed too early.
1284 1298
1285 1299 * IPython/Shell.py (_load_pylab): Make the execution of 'from
1286 1300 pylab import *' when -pylab is given be optional. A new flag,
1287 1301 pylab_import_all controls this behavior, the default is True for
1288 1302 backwards compatibility.
1289 1303
1290 1304 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
1291 1305 modified) R. Bernstein's patch for fully syntax highlighted
1292 1306 tracebacks. The functionality is also available under ultraTB for
1293 1307 non-ipython users (someone using ultraTB but outside an ipython
1294 1308 session). They can select the color scheme by setting the
1295 1309 module-level global DEFAULT_SCHEME. The highlight functionality
1296 1310 also works when debugging.
1297 1311
1298 1312 * IPython/genutils.py (IOStream.close): small patch by
1299 1313 R. Bernstein for improved pydb support.
1300 1314
1301 1315 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
1302 1316 DaveS <davls@telus.net> to improve support of debugging under
1303 1317 NTEmacs, including improved pydb behavior.
1304 1318
1305 1319 * IPython/Magic.py (magic_prun): Fix saving of profile info for
1306 1320 Python 2.5, where the stats object API changed a little. Thanks
1307 1321 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
1308 1322
1309 1323 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
1310 1324 Pernetty's patch to improve support for (X)Emacs under Win32.
1311 1325
1312 1326 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
1313 1327
1314 1328 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
1315 1329 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
1316 1330 a report by Nik Tautenhahn.
1317 1331
1318 1332 2007-03-16 Walter Doerwald <walter@livinglogic.de>
1319 1333
1320 1334 * setup.py: Add the igrid help files to the list of data files
1321 1335 to be installed alongside igrid.
1322 1336 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
1323 1337 Show the input object of the igrid browser as the window tile.
1324 1338 Show the object the cursor is on in the statusbar.
1325 1339
1326 1340 2007-03-15 Ville Vainio <vivainio@gmail.com>
1327 1341
1328 1342 * Extensions/ipy_stock_completers.py: Fixed exception
1329 1343 on mismatching quotes in %run completer. Patch by
1330 1344 Jorgen Stenarson. Closes #127.
1331 1345
1332 1346 2007-03-14 Ville Vainio <vivainio@gmail.com>
1333 1347
1334 1348 * Extensions/ext_rehashdir.py: Do not do auto_alias
1335 1349 in %rehashdir, it clobbers %store'd aliases.
1336 1350
1337 1351 * UserConfig/ipy_profile_sh.py: envpersist.py extension
1338 1352 (beefed up %env) imported for sh profile.
1339 1353
1340 1354 2007-03-10 Walter Doerwald <walter@livinglogic.de>
1341 1355
1342 1356 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
1343 1357 as the default browser.
1344 1358 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
1345 1359 As igrid displays all attributes it ever encounters, fetch() (which has
1346 1360 been renamed to _fetch()) doesn't have to recalculate the display attributes
1347 1361 every time a new item is fetched. This should speed up scrolling.
1348 1362
1349 1363 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
1350 1364
1351 1365 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
1352 1366 Schmolck's recently reported tab-completion bug (my previous one
1353 1367 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
1354 1368
1355 1369 2007-03-09 Walter Doerwald <walter@livinglogic.de>
1356 1370
1357 1371 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
1358 1372 Close help window if exiting igrid.
1359 1373
1360 1374 2007-03-02 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
1361 1375
1362 1376 * IPython/Extensions/ipy_defaults.py: Check if readline is available
1363 1377 before calling functions from readline.
1364 1378
1365 1379 2007-03-02 Walter Doerwald <walter@livinglogic.de>
1366 1380
1367 1381 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
1368 1382 igrid is a wxPython-based display object for ipipe. If your system has
1369 1383 wx installed igrid will be the default display. Without wx ipipe falls
1370 1384 back to ibrowse (which needs curses). If no curses is installed ipipe
1371 1385 falls back to idump.
1372 1386
1373 1387 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
1374 1388
1375 1389 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
1376 1390 my changes from yesterday, they introduced bugs. Will reactivate
1377 1391 once I get a correct solution, which will be much easier thanks to
1378 1392 Dan Milstein's new prefilter test suite.
1379 1393
1380 1394 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
1381 1395
1382 1396 * IPython/iplib.py (split_user_input): fix input splitting so we
1383 1397 don't attempt attribute accesses on things that can't possibly be
1384 1398 valid Python attributes. After a bug report by Alex Schmolck.
1385 1399 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
1386 1400 %magic with explicit % prefix.
1387 1401
1388 1402 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
1389 1403
1390 1404 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
1391 1405 avoid a DeprecationWarning from GTK.
1392 1406
1393 1407 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
1394 1408
1395 1409 * IPython/genutils.py (clock): I modified clock() to return total
1396 1410 time, user+system. This is a more commonly needed metric. I also
1397 1411 introduced the new clocku/clocks to get only user/system time if
1398 1412 one wants those instead.
1399 1413
1400 1414 ***WARNING: API CHANGE*** clock() used to return only user time,
1401 1415 so if you want exactly the same results as before, use clocku
1402 1416 instead.
1403 1417
1404 1418 2007-02-22 Ville Vainio <vivainio@gmail.com>
1405 1419
1406 1420 * IPython/Extensions/ipy_p4.py: Extension for improved
1407 1421 p4 (perforce version control system) experience.
1408 1422 Adds %p4 magic with p4 command completion and
1409 1423 automatic -G argument (marshall output as python dict)
1410 1424
1411 1425 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
1412 1426
1413 1427 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
1414 1428 stop marks.
1415 1429 (ClearingMixin): a simple mixin to easily make a Demo class clear
1416 1430 the screen in between blocks and have empty marquees. The
1417 1431 ClearDemo and ClearIPDemo classes that use it are included.
1418 1432
1419 1433 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
1420 1434
1421 1435 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
1422 1436 protect against exceptions at Python shutdown time. Patch
1423 1437 sumbmitted to upstream.
1424 1438
1425 1439 2007-02-14 Walter Doerwald <walter@livinglogic.de>
1426 1440
1427 1441 * IPython/Extensions/ibrowse.py: If entering the first object level
1428 1442 (i.e. the object for which the browser has been started) fails,
1429 1443 now the error is raised directly (aborting the browser) instead of
1430 1444 running into an empty levels list later.
1431 1445
1432 1446 2007-02-03 Walter Doerwald <walter@livinglogic.de>
1433 1447
1434 1448 * IPython/Extensions/ipipe.py: Add an xrepr implementation
1435 1449 for the noitem object.
1436 1450
1437 1451 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
1438 1452
1439 1453 * IPython/completer.py (Completer.attr_matches): Fix small
1440 1454 tab-completion bug with Enthought Traits objects with units.
1441 1455 Thanks to a bug report by Tom Denniston
1442 1456 <tom.denniston-AT-alum.dartmouth.org>.
1443 1457
1444 1458 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
1445 1459
1446 1460 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
1447 1461 bug where only .ipy or .py would be completed. Once the first
1448 1462 argument to %run has been given, all completions are valid because
1449 1463 they are the arguments to the script, which may well be non-python
1450 1464 filenames.
1451 1465
1452 1466 * IPython/irunner.py (InteractiveRunner.run_source): major updates
1453 1467 to irunner to allow it to correctly support real doctesting of
1454 1468 out-of-process ipython code.
1455 1469
1456 1470 * IPython/Magic.py (magic_cd): Make the setting of the terminal
1457 1471 title an option (-noterm_title) because it completely breaks
1458 1472 doctesting.
1459 1473
1460 1474 * IPython/demo.py: fix IPythonDemo class that was not actually working.
1461 1475
1462 1476 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
1463 1477
1464 1478 * IPython/irunner.py (main): fix small bug where extensions were
1465 1479 not being correctly recognized.
1466 1480
1467 1481 2007-01-23 Walter Doerwald <walter@livinglogic.de>
1468 1482
1469 1483 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
1470 1484 a string containing a single line yields the string itself as the
1471 1485 only item.
1472 1486
1473 1487 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
1474 1488 object if it's the same as the one on the last level (This avoids
1475 1489 infinite recursion for one line strings).
1476 1490
1477 1491 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1478 1492
1479 1493 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
1480 1494 all output streams before printing tracebacks. This ensures that
1481 1495 user output doesn't end up interleaved with traceback output.
1482 1496
1483 1497 2007-01-10 Ville Vainio <vivainio@gmail.com>
1484 1498
1485 1499 * Extensions/envpersist.py: Turbocharged %env that remembers
1486 1500 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
1487 1501 "%env VISUAL=jed".
1488 1502
1489 1503 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
1490 1504
1491 1505 * IPython/iplib.py (showtraceback): ensure that we correctly call
1492 1506 custom handlers in all cases (some with pdb were slipping through,
1493 1507 but I'm not exactly sure why).
1494 1508
1495 1509 * IPython/Debugger.py (Tracer.__init__): added new class to
1496 1510 support set_trace-like usage of IPython's enhanced debugger.
1497 1511
1498 1512 2006-12-24 Ville Vainio <vivainio@gmail.com>
1499 1513
1500 1514 * ipmaker.py: more informative message when ipy_user_conf
1501 1515 import fails (suggest running %upgrade).
1502 1516
1503 1517 * tools/run_ipy_in_profiler.py: Utility to see where
1504 1518 the time during IPython startup is spent.
1505 1519
1506 1520 2006-12-20 Ville Vainio <vivainio@gmail.com>
1507 1521
1508 1522 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
1509 1523
1510 1524 * ipapi.py: Add new ipapi method, expand_alias.
1511 1525
1512 1526 * Release.py: Bump up version to 0.7.4.svn
1513 1527
1514 1528 2006-12-17 Ville Vainio <vivainio@gmail.com>
1515 1529
1516 1530 * Extensions/jobctrl.py: Fixed &cmd arg arg...
1517 1531 to work properly on posix too
1518 1532
1519 1533 * Release.py: Update revnum (version is still just 0.7.3).
1520 1534
1521 1535 2006-12-15 Ville Vainio <vivainio@gmail.com>
1522 1536
1523 1537 * scripts/ipython_win_post_install: create ipython.py in
1524 1538 prefix + "/scripts".
1525 1539
1526 1540 * Release.py: Update version to 0.7.3.
1527 1541
1528 1542 2006-12-14 Ville Vainio <vivainio@gmail.com>
1529 1543
1530 1544 * scripts/ipython_win_post_install: Overwrite old shortcuts
1531 1545 if they already exist
1532 1546
1533 1547 * Release.py: release 0.7.3rc2
1534 1548
1535 1549 2006-12-13 Ville Vainio <vivainio@gmail.com>
1536 1550
1537 1551 * Branch and update Release.py for 0.7.3rc1
1538 1552
1539 1553 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
1540 1554
1541 1555 * IPython/Shell.py (IPShellWX): update for current WX naming
1542 1556 conventions, to avoid a deprecation warning with current WX
1543 1557 versions. Thanks to a report by Danny Shevitz.
1544 1558
1545 1559 2006-12-12 Ville Vainio <vivainio@gmail.com>
1546 1560
1547 1561 * ipmaker.py: apply david cournapeau's patch to make
1548 1562 import_some work properly even when ipythonrc does
1549 1563 import_some on empty list (it was an old bug!).
1550 1564
1551 1565 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
1552 1566 Add deprecation note to ipythonrc and a url to wiki
1553 1567 in ipy_user_conf.py
1554 1568
1555 1569
1556 1570 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
1557 1571 as if it was typed on IPython command prompt, i.e.
1558 1572 as IPython script.
1559 1573
1560 1574 * example-magic.py, magic_grepl.py: remove outdated examples
1561 1575
1562 1576 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
1563 1577
1564 1578 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
1565 1579 is called before any exception has occurred.
1566 1580
1567 1581 2006-12-08 Ville Vainio <vivainio@gmail.com>
1568 1582
1569 1583 * Extensions/ipy_stock_completers.py: fix cd completer
1570 1584 to translate /'s to \'s again.
1571 1585
1572 1586 * completer.py: prevent traceback on file completions w/
1573 1587 backslash.
1574 1588
1575 1589 * Release.py: Update release number to 0.7.3b3 for release
1576 1590
1577 1591 2006-12-07 Ville Vainio <vivainio@gmail.com>
1578 1592
1579 1593 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1580 1594 while executing external code. Provides more shell-like behaviour
1581 1595 and overall better response to ctrl + C / ctrl + break.
1582 1596
1583 1597 * tools/make_tarball.py: new script to create tarball straight from svn
1584 1598 (setup.py sdist doesn't work on win32).
1585 1599
1586 1600 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1587 1601 on dirnames with spaces and use the default completer instead.
1588 1602
1589 1603 * Revision.py: Change version to 0.7.3b2 for release.
1590 1604
1591 1605 2006-12-05 Ville Vainio <vivainio@gmail.com>
1592 1606
1593 1607 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1594 1608 pydb patch 4 (rm debug printing, py 2.5 checking)
1595 1609
1596 1610 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1597 1611 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1598 1612 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1599 1613 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1600 1614 object the cursor was on before the refresh. The command "markrange" is
1601 1615 mapped to "%" now.
1602 1616 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1603 1617
1604 1618 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1605 1619
1606 1620 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1607 1621 interactive debugger on the last traceback, without having to call
1608 1622 %pdb and rerun your code. Made minor changes in various modules,
1609 1623 should automatically recognize pydb if available.
1610 1624
1611 1625 2006-11-28 Ville Vainio <vivainio@gmail.com>
1612 1626
1613 1627 * completer.py: If the text start with !, show file completions
1614 1628 properly. This helps when trying to complete command name
1615 1629 for shell escapes.
1616 1630
1617 1631 2006-11-27 Ville Vainio <vivainio@gmail.com>
1618 1632
1619 1633 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1620 1634 der Walt. Clean up svn and hg completers by using a common
1621 1635 vcs_completer.
1622 1636
1623 1637 2006-11-26 Ville Vainio <vivainio@gmail.com>
1624 1638
1625 1639 * Remove ipconfig and %config; you should use _ip.options structure
1626 1640 directly instead!
1627 1641
1628 1642 * genutils.py: add wrap_deprecated function for deprecating callables
1629 1643
1630 1644 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1631 1645 _ip.system instead. ipalias is redundant.
1632 1646
1633 1647 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1634 1648 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1635 1649 explicit.
1636 1650
1637 1651 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1638 1652 completer. Try it by entering 'hg ' and pressing tab.
1639 1653
1640 1654 * macro.py: Give Macro a useful __repr__ method
1641 1655
1642 1656 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1643 1657
1644 1658 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1645 1659 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1646 1660 we don't get a duplicate ipipe module, where registration of the xrepr
1647 1661 implementation for Text is useless.
1648 1662
1649 1663 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1650 1664
1651 1665 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1652 1666
1653 1667 2006-11-24 Ville Vainio <vivainio@gmail.com>
1654 1668
1655 1669 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1656 1670 try to use "cProfile" instead of the slower pure python
1657 1671 "profile"
1658 1672
1659 1673 2006-11-23 Ville Vainio <vivainio@gmail.com>
1660 1674
1661 1675 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1662 1676 Qt+IPython+Designer link in documentation.
1663 1677
1664 1678 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1665 1679 correct Pdb object to %pydb.
1666 1680
1667 1681
1668 1682 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1669 1683 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1670 1684 generic xrepr(), otherwise the list implementation would kick in.
1671 1685
1672 1686 2006-11-21 Ville Vainio <vivainio@gmail.com>
1673 1687
1674 1688 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1675 1689 with one from UserConfig.
1676 1690
1677 1691 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1678 1692 it was missing which broke the sh profile.
1679 1693
1680 1694 * completer.py: file completer now uses explicit '/' instead
1681 1695 of os.path.join, expansion of 'foo' was broken on win32
1682 1696 if there was one directory with name 'foobar'.
1683 1697
1684 1698 * A bunch of patches from Kirill Smelkov:
1685 1699
1686 1700 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1687 1701
1688 1702 * [patch 7/9] Implement %page -r (page in raw mode) -
1689 1703
1690 1704 * [patch 5/9] ScientificPython webpage has moved
1691 1705
1692 1706 * [patch 4/9] The manual mentions %ds, should be %dhist
1693 1707
1694 1708 * [patch 3/9] Kill old bits from %prun doc.
1695 1709
1696 1710 * [patch 1/9] Fix typos here and there.
1697 1711
1698 1712 2006-11-08 Ville Vainio <vivainio@gmail.com>
1699 1713
1700 1714 * completer.py (attr_matches): catch all exceptions raised
1701 1715 by eval of expr with dots.
1702 1716
1703 1717 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1704 1718
1705 1719 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1706 1720 input if it starts with whitespace. This allows you to paste
1707 1721 indented input from any editor without manually having to type in
1708 1722 the 'if 1:', which is convenient when working interactively.
1709 1723 Slightly modifed version of a patch by Bo Peng
1710 1724 <bpeng-AT-rice.edu>.
1711 1725
1712 1726 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1713 1727
1714 1728 * IPython/irunner.py (main): modified irunner so it automatically
1715 1729 recognizes the right runner to use based on the extension (.py for
1716 1730 python, .ipy for ipython and .sage for sage).
1717 1731
1718 1732 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1719 1733 visible in ipapi as ip.config(), to programatically control the
1720 1734 internal rc object. There's an accompanying %config magic for
1721 1735 interactive use, which has been enhanced to match the
1722 1736 funtionality in ipconfig.
1723 1737
1724 1738 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1725 1739 so it's not just a toggle, it now takes an argument. Add support
1726 1740 for a customizable header when making system calls, as the new
1727 1741 system_header variable in the ipythonrc file.
1728 1742
1729 1743 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1730 1744
1731 1745 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1732 1746 generic functions (using Philip J. Eby's simplegeneric package).
1733 1747 This makes it possible to customize the display of third-party classes
1734 1748 without having to monkeypatch them. xiter() no longer supports a mode
1735 1749 argument and the XMode class has been removed. The same functionality can
1736 1750 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1737 1751 One consequence of the switch to generic functions is that xrepr() and
1738 1752 xattrs() implementation must define the default value for the mode
1739 1753 argument themselves and xattrs() implementations must return real
1740 1754 descriptors.
1741 1755
1742 1756 * IPython/external: This new subpackage will contain all third-party
1743 1757 packages that are bundled with IPython. (The first one is simplegeneric).
1744 1758
1745 1759 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1746 1760 directory which as been dropped in r1703.
1747 1761
1748 1762 * IPython/Extensions/ipipe.py (iless): Fixed.
1749 1763
1750 1764 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1751 1765
1752 1766 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1753 1767
1754 1768 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1755 1769 handling in variable expansion so that shells and magics recognize
1756 1770 function local scopes correctly. Bug reported by Brian.
1757 1771
1758 1772 * scripts/ipython: remove the very first entry in sys.path which
1759 1773 Python auto-inserts for scripts, so that sys.path under IPython is
1760 1774 as similar as possible to that under plain Python.
1761 1775
1762 1776 * IPython/completer.py (IPCompleter.file_matches): Fix
1763 1777 tab-completion so that quotes are not closed unless the completion
1764 1778 is unambiguous. After a request by Stefan. Minor cleanups in
1765 1779 ipy_stock_completers.
1766 1780
1767 1781 2006-11-02 Ville Vainio <vivainio@gmail.com>
1768 1782
1769 1783 * ipy_stock_completers.py: Add %run and %cd completers.
1770 1784
1771 1785 * completer.py: Try running custom completer for both
1772 1786 "foo" and "%foo" if the command is just "foo". Ignore case
1773 1787 when filtering possible completions.
1774 1788
1775 1789 * UserConfig/ipy_user_conf.py: install stock completers as default
1776 1790
1777 1791 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1778 1792 simplified readline history save / restore through a wrapper
1779 1793 function
1780 1794
1781 1795
1782 1796 2006-10-31 Ville Vainio <vivainio@gmail.com>
1783 1797
1784 1798 * strdispatch.py, completer.py, ipy_stock_completers.py:
1785 1799 Allow str_key ("command") in completer hooks. Implement
1786 1800 trivial completer for 'import' (stdlib modules only). Rename
1787 1801 ipy_linux_package_managers.py to ipy_stock_completers.py.
1788 1802 SVN completer.
1789 1803
1790 1804 * Extensions/ledit.py: %magic line editor for easily and
1791 1805 incrementally manipulating lists of strings. The magic command
1792 1806 name is %led.
1793 1807
1794 1808 2006-10-30 Ville Vainio <vivainio@gmail.com>
1795 1809
1796 1810 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1797 1811 Bernsteins's patches for pydb integration.
1798 1812 http://bashdb.sourceforge.net/pydb/
1799 1813
1800 1814 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1801 1815 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1802 1816 custom completer hook to allow the users to implement their own
1803 1817 completers. See ipy_linux_package_managers.py for example. The
1804 1818 hook name is 'complete_command'.
1805 1819
1806 1820 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1807 1821
1808 1822 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1809 1823 Numeric leftovers.
1810 1824
1811 1825 * ipython.el (py-execute-region): apply Stefan's patch to fix
1812 1826 garbled results if the python shell hasn't been previously started.
1813 1827
1814 1828 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1815 1829 pretty generic function and useful for other things.
1816 1830
1817 1831 * IPython/OInspect.py (getsource): Add customizable source
1818 1832 extractor. After a request/patch form W. Stein (SAGE).
1819 1833
1820 1834 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1821 1835 window size to a more reasonable value from what pexpect does,
1822 1836 since their choice causes wrapping bugs with long input lines.
1823 1837
1824 1838 2006-10-28 Ville Vainio <vivainio@gmail.com>
1825 1839
1826 1840 * Magic.py (%run): Save and restore the readline history from
1827 1841 file around %run commands to prevent side effects from
1828 1842 %runned programs that might use readline (e.g. pydb).
1829 1843
1830 1844 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1831 1845 invoking the pydb enhanced debugger.
1832 1846
1833 1847 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1834 1848
1835 1849 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1836 1850 call the base class method and propagate the return value to
1837 1851 ifile. This is now done by path itself.
1838 1852
1839 1853 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1840 1854
1841 1855 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1842 1856 api: set_crash_handler(), to expose the ability to change the
1843 1857 internal crash handler.
1844 1858
1845 1859 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1846 1860 the various parameters of the crash handler so that apps using
1847 1861 IPython as their engine can customize crash handling. Ipmlemented
1848 1862 at the request of SAGE.
1849 1863
1850 1864 2006-10-14 Ville Vainio <vivainio@gmail.com>
1851 1865
1852 1866 * Magic.py, ipython.el: applied first "safe" part of Rocky
1853 1867 Bernstein's patch set for pydb integration.
1854 1868
1855 1869 * Magic.py (%unalias, %alias): %store'd aliases can now be
1856 1870 removed with '%unalias'. %alias w/o args now shows most
1857 1871 interesting (stored / manually defined) aliases last
1858 1872 where they catch the eye w/o scrolling.
1859 1873
1860 1874 * Magic.py (%rehashx), ext_rehashdir.py: files with
1861 1875 'py' extension are always considered executable, even
1862 1876 when not in PATHEXT environment variable.
1863 1877
1864 1878 2006-10-12 Ville Vainio <vivainio@gmail.com>
1865 1879
1866 1880 * jobctrl.py: Add new "jobctrl" extension for spawning background
1867 1881 processes with "&find /". 'import jobctrl' to try it out. Requires
1868 1882 'subprocess' module, standard in python 2.4+.
1869 1883
1870 1884 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1871 1885 so if foo -> bar and bar -> baz, then foo -> baz.
1872 1886
1873 1887 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1874 1888
1875 1889 * IPython/Magic.py (Magic.parse_options): add a new posix option
1876 1890 to allow parsing of input args in magics that doesn't strip quotes
1877 1891 (if posix=False). This also closes %timeit bug reported by
1878 1892 Stefan.
1879 1893
1880 1894 2006-10-03 Ville Vainio <vivainio@gmail.com>
1881 1895
1882 1896 * iplib.py (raw_input, interact): Return ValueError catching for
1883 1897 raw_input. Fixes infinite loop for sys.stdin.close() or
1884 1898 sys.stdout.close().
1885 1899
1886 1900 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1887 1901
1888 1902 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1889 1903 to help in handling doctests. irunner is now pretty useful for
1890 1904 running standalone scripts and simulate a full interactive session
1891 1905 in a format that can be then pasted as a doctest.
1892 1906
1893 1907 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1894 1908 on top of the default (useless) ones. This also fixes the nasty
1895 1909 way in which 2.5's Quitter() exits (reverted [1785]).
1896 1910
1897 1911 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1898 1912 2.5.
1899 1913
1900 1914 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1901 1915 color scheme is updated as well when color scheme is changed
1902 1916 interactively.
1903 1917
1904 1918 2006-09-27 Ville Vainio <vivainio@gmail.com>
1905 1919
1906 1920 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1907 1921 infinite loop and just exit. It's a hack, but will do for a while.
1908 1922
1909 1923 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1910 1924
1911 1925 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1912 1926 the constructor, this makes it possible to get a list of only directories
1913 1927 or only files.
1914 1928
1915 1929 2006-08-12 Ville Vainio <vivainio@gmail.com>
1916 1930
1917 1931 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1918 1932 they broke unittest
1919 1933
1920 1934 2006-08-11 Ville Vainio <vivainio@gmail.com>
1921 1935
1922 1936 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1923 1937 by resolving issue properly, i.e. by inheriting FakeModule
1924 1938 from types.ModuleType. Pickling ipython interactive data
1925 1939 should still work as usual (testing appreciated).
1926 1940
1927 1941 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1928 1942
1929 1943 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1930 1944 running under python 2.3 with code from 2.4 to fix a bug with
1931 1945 help(). Reported by the Debian maintainers, Norbert Tretkowski
1932 1946 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1933 1947 <afayolle-AT-debian.org>.
1934 1948
1935 1949 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1936 1950
1937 1951 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1938 1952 (which was displaying "quit" twice).
1939 1953
1940 1954 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1941 1955
1942 1956 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1943 1957 the mode argument).
1944 1958
1945 1959 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1946 1960
1947 1961 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1948 1962 not running under IPython.
1949 1963
1950 1964 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1951 1965 and make it iterable (iterating over the attribute itself). Add two new
1952 1966 magic strings for __xattrs__(): If the string starts with "-", the attribute
1953 1967 will not be displayed in ibrowse's detail view (but it can still be
1954 1968 iterated over). This makes it possible to add attributes that are large
1955 1969 lists or generator methods to the detail view. Replace magic attribute names
1956 1970 and _attrname() and _getattr() with "descriptors": For each type of magic
1957 1971 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1958 1972 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1959 1973 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1960 1974 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1961 1975 are still supported.
1962 1976
1963 1977 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1964 1978 fails in ibrowse.fetch(), the exception object is added as the last item
1965 1979 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1966 1980 a generator throws an exception midway through execution.
1967 1981
1968 1982 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1969 1983 encoding into methods.
1970 1984
1971 1985 2006-07-26 Ville Vainio <vivainio@gmail.com>
1972 1986
1973 1987 * iplib.py: history now stores multiline input as single
1974 1988 history entries. Patch by Jorgen Cederlof.
1975 1989
1976 1990 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1977 1991
1978 1992 * IPython/Extensions/ibrowse.py: Make cursor visible over
1979 1993 non existing attributes.
1980 1994
1981 1995 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1982 1996
1983 1997 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1984 1998 error output of the running command doesn't mess up the screen.
1985 1999
1986 2000 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1987 2001
1988 2002 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1989 2003 argument. This sorts the items themselves.
1990 2004
1991 2005 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1992 2006
1993 2007 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1994 2008 Compile expression strings into code objects. This should speed
1995 2009 up ifilter and friends somewhat.
1996 2010
1997 2011 2006-07-08 Ville Vainio <vivainio@gmail.com>
1998 2012
1999 2013 * Magic.py: %cpaste now strips > from the beginning of lines
2000 2014 to ease pasting quoted code from emails. Contributed by
2001 2015 Stefan van der Walt.
2002 2016
2003 2017 2006-06-29 Ville Vainio <vivainio@gmail.com>
2004 2018
2005 2019 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
2006 2020 mode, patch contributed by Darren Dale. NEEDS TESTING!
2007 2021
2008 2022 2006-06-28 Walter Doerwald <walter@livinglogic.de>
2009 2023
2010 2024 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
2011 2025 a blue background. Fix fetching new display rows when the browser
2012 2026 scrolls more than a screenful (e.g. by using the goto command).
2013 2027
2014 2028 2006-06-27 Ville Vainio <vivainio@gmail.com>
2015 2029
2016 2030 * Magic.py (_inspect, _ofind) Apply David Huard's
2017 2031 patch for displaying the correct docstring for 'property'
2018 2032 attributes.
2019 2033
2020 2034 2006-06-23 Walter Doerwald <walter@livinglogic.de>
2021 2035
2022 2036 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
2023 2037 commands into the methods implementing them.
2024 2038
2025 2039 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
2026 2040
2027 2041 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
2028 2042 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
2029 2043 autoindent support was authored by Jin Liu.
2030 2044
2031 2045 2006-06-22 Walter Doerwald <walter@livinglogic.de>
2032 2046
2033 2047 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
2034 2048 for keymaps with a custom class that simplifies handling.
2035 2049
2036 2050 2006-06-19 Walter Doerwald <walter@livinglogic.de>
2037 2051
2038 2052 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
2039 2053 resizing. This requires Python 2.5 to work.
2040 2054
2041 2055 2006-06-16 Walter Doerwald <walter@livinglogic.de>
2042 2056
2043 2057 * IPython/Extensions/ibrowse.py: Add two new commands to
2044 2058 ibrowse: "hideattr" (mapped to "h") hides the attribute under
2045 2059 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
2046 2060 attributes again. Remapped the help command to "?". Display
2047 2061 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
2048 2062 as keys for the "home" and "end" commands. Add three new commands
2049 2063 to the input mode for "find" and friends: "delend" (CTRL-K)
2050 2064 deletes to the end of line. "incsearchup" searches upwards in the
2051 2065 command history for an input that starts with the text before the cursor.
2052 2066 "incsearchdown" does the same downwards. Removed a bogus mapping of
2053 2067 the x key to "delete".
2054 2068
2055 2069 2006-06-15 Ville Vainio <vivainio@gmail.com>
2056 2070
2057 2071 * iplib.py, hooks.py: Added new generate_prompt hook that can be
2058 2072 used to create prompts dynamically, instead of the "old" way of
2059 2073 assigning "magic" strings to prompt_in1 and prompt_in2. The old
2060 2074 way still works (it's invoked by the default hook), of course.
2061 2075
2062 2076 * Prompts.py: added generate_output_prompt hook for altering output
2063 2077 prompt
2064 2078
2065 2079 * Release.py: Changed version string to 0.7.3.svn.
2066 2080
2067 2081 2006-06-15 Walter Doerwald <walter@livinglogic.de>
2068 2082
2069 2083 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
2070 2084 the call to fetch() always tries to fetch enough data for at least one
2071 2085 full screen. This makes it possible to simply call moveto(0,0,True) in
2072 2086 the constructor. Fix typos and removed the obsolete goto attribute.
2073 2087
2074 2088 2006-06-12 Ville Vainio <vivainio@gmail.com>
2075 2089
2076 2090 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
2077 2091 allowing $variable interpolation within multiline statements,
2078 2092 though so far only with "sh" profile for a testing period.
2079 2093 The patch also enables splitting long commands with \ but it
2080 2094 doesn't work properly yet.
2081 2095
2082 2096 2006-06-12 Walter Doerwald <walter@livinglogic.de>
2083 2097
2084 2098 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
2085 2099 input history and the position of the cursor in the input history for
2086 2100 the find, findbackwards and goto command.
2087 2101
2088 2102 2006-06-10 Walter Doerwald <walter@livinglogic.de>
2089 2103
2090 2104 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
2091 2105 implements the basic functionality of browser commands that require
2092 2106 input. Reimplement the goto, find and findbackwards commands as
2093 2107 subclasses of _CommandInput. Add an input history and keymaps to those
2094 2108 commands. Add "\r" as a keyboard shortcut for the enterdefault and
2095 2109 execute commands.
2096 2110
2097 2111 2006-06-07 Ville Vainio <vivainio@gmail.com>
2098 2112
2099 2113 * iplib.py: ipython mybatch.ipy exits ipython immediately after
2100 2114 running the batch files instead of leaving the session open.
2101 2115
2102 2116 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
2103 2117
2104 2118 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
2105 2119 the original fix was incomplete. Patch submitted by W. Maier.
2106 2120
2107 2121 2006-06-07 Ville Vainio <vivainio@gmail.com>
2108 2122
2109 2123 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
2110 2124 Confirmation prompts can be supressed by 'quiet' option.
2111 2125 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
2112 2126
2113 2127 2006-06-06 *** Released version 0.7.2
2114 2128
2115 2129 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
2116 2130
2117 2131 * IPython/Release.py (version): Made 0.7.2 final for release.
2118 2132 Repo tagged and release cut.
2119 2133
2120 2134 2006-06-05 Ville Vainio <vivainio@gmail.com>
2121 2135
2122 2136 * Magic.py (magic_rehashx): Honor no_alias list earlier in
2123 2137 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
2124 2138
2125 2139 * upgrade_dir.py: try import 'path' module a bit harder
2126 2140 (for %upgrade)
2127 2141
2128 2142 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
2129 2143
2130 2144 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
2131 2145 instead of looping 20 times.
2132 2146
2133 2147 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
2134 2148 correctly at initialization time. Bug reported by Krishna Mohan
2135 2149 Gundu <gkmohan-AT-gmail.com> on the user list.
2136 2150
2137 2151 * IPython/Release.py (version): Mark 0.7.2 version to start
2138 2152 testing for release on 06/06.
2139 2153
2140 2154 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
2141 2155
2142 2156 * scripts/irunner: thin script interface so users don't have to
2143 2157 find the module and call it as an executable, since modules rarely
2144 2158 live in people's PATH.
2145 2159
2146 2160 * IPython/irunner.py (InteractiveRunner.__init__): added
2147 2161 delaybeforesend attribute to control delays with newer versions of
2148 2162 pexpect. Thanks to detailed help from pexpect's author, Noah
2149 2163 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
2150 2164 correctly (it works in NoColor mode).
2151 2165
2152 2166 * IPython/iplib.py (handle_normal): fix nasty crash reported on
2153 2167 SAGE list, from improper log() calls.
2154 2168
2155 2169 2006-05-31 Ville Vainio <vivainio@gmail.com>
2156 2170
2157 2171 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
2158 2172 with args in parens to work correctly with dirs that have spaces.
2159 2173
2160 2174 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
2161 2175
2162 2176 * IPython/Logger.py (Logger.logstart): add option to log raw input
2163 2177 instead of the processed one. A -r flag was added to the
2164 2178 %logstart magic used for controlling logging.
2165 2179
2166 2180 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
2167 2181
2168 2182 * IPython/iplib.py (InteractiveShell.__init__): add check for the
2169 2183 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
2170 2184 recognize the option. After a bug report by Will Maier. This
2171 2185 closes #64 (will do it after confirmation from W. Maier).
2172 2186
2173 2187 * IPython/irunner.py: New module to run scripts as if manually
2174 2188 typed into an interactive environment, based on pexpect. After a
2175 2189 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
2176 2190 ipython-user list. Simple unittests in the tests/ directory.
2177 2191
2178 2192 * tools/release: add Will Maier, OpenBSD port maintainer, to
2179 2193 recepients list. We are now officially part of the OpenBSD ports:
2180 2194 http://www.openbsd.org/ports.html ! Many thanks to Will for the
2181 2195 work.
2182 2196
2183 2197 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
2184 2198
2185 2199 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
2186 2200 so that it doesn't break tkinter apps.
2187 2201
2188 2202 * IPython/iplib.py (_prefilter): fix bug where aliases would
2189 2203 shadow variables when autocall was fully off. Reported by SAGE
2190 2204 author William Stein.
2191 2205
2192 2206 * IPython/OInspect.py (Inspector.__init__): add a flag to control
2193 2207 at what detail level strings are computed when foo? is requested.
2194 2208 This allows users to ask for example that the string form of an
2195 2209 object is only computed when foo?? is called, or even never, by
2196 2210 setting the object_info_string_level >= 2 in the configuration
2197 2211 file. This new option has been added and documented. After a
2198 2212 request by SAGE to be able to control the printing of very large
2199 2213 objects more easily.
2200 2214
2201 2215 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
2202 2216
2203 2217 * IPython/ipmaker.py (make_IPython): remove the ipython call path
2204 2218 from sys.argv, to be 100% consistent with how Python itself works
2205 2219 (as seen for example with python -i file.py). After a bug report
2206 2220 by Jeffrey Collins.
2207 2221
2208 2222 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
2209 2223 nasty bug which was preventing custom namespaces with -pylab,
2210 2224 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
2211 2225 compatibility (long gone from mpl).
2212 2226
2213 2227 * IPython/ipapi.py (make_session): name change: create->make. We
2214 2228 use make in other places (ipmaker,...), it's shorter and easier to
2215 2229 type and say, etc. I'm trying to clean things before 0.7.2 so
2216 2230 that I can keep things stable wrt to ipapi in the chainsaw branch.
2217 2231
2218 2232 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
2219 2233 python-mode recognizes our debugger mode. Add support for
2220 2234 autoindent inside (X)emacs. After a patch sent in by Jin Liu
2221 2235 <m.liu.jin-AT-gmail.com> originally written by
2222 2236 doxgen-AT-newsmth.net (with minor modifications for xemacs
2223 2237 compatibility)
2224 2238
2225 2239 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
2226 2240 tracebacks when walking the stack so that the stack tracking system
2227 2241 in emacs' python-mode can identify the frames correctly.
2228 2242
2229 2243 * IPython/ipmaker.py (make_IPython): make the internal (and
2230 2244 default config) autoedit_syntax value false by default. Too many
2231 2245 users have complained to me (both on and off-list) about problems
2232 2246 with this option being on by default, so I'm making it default to
2233 2247 off. It can still be enabled by anyone via the usual mechanisms.
2234 2248
2235 2249 * IPython/completer.py (Completer.attr_matches): add support for
2236 2250 PyCrust-style _getAttributeNames magic method. Patch contributed
2237 2251 by <mscott-AT-goldenspud.com>. Closes #50.
2238 2252
2239 2253 * IPython/iplib.py (InteractiveShell.__init__): remove the
2240 2254 deletion of exit/quit from __builtin__, which can break
2241 2255 third-party tools like the Zope debugging console. The
2242 2256 %exit/%quit magics remain. In general, it's probably a good idea
2243 2257 not to delete anything from __builtin__, since we never know what
2244 2258 that will break. In any case, python now (for 2.5) will support
2245 2259 'real' exit/quit, so this issue is moot. Closes #55.
2246 2260
2247 2261 * IPython/genutils.py (with_obj): rename the 'with' function to
2248 2262 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
2249 2263 becomes a language keyword. Closes #53.
2250 2264
2251 2265 * IPython/FakeModule.py (FakeModule.__init__): add a proper
2252 2266 __file__ attribute to this so it fools more things into thinking
2253 2267 it is a real module. Closes #59.
2254 2268
2255 2269 * IPython/Magic.py (magic_edit): add -n option to open the editor
2256 2270 at a specific line number. After a patch by Stefan van der Walt.
2257 2271
2258 2272 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
2259 2273
2260 2274 * IPython/iplib.py (edit_syntax_error): fix crash when for some
2261 2275 reason the file could not be opened. After automatic crash
2262 2276 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
2263 2277 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
2264 2278 (_should_recompile): Don't fire editor if using %bg, since there
2265 2279 is no file in the first place. From the same report as above.
2266 2280 (raw_input): protect against faulty third-party prefilters. After
2267 2281 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
2268 2282 while running under SAGE.
2269 2283
2270 2284 2006-05-23 Ville Vainio <vivainio@gmail.com>
2271 2285
2272 2286 * ipapi.py: Stripped down ip.to_user_ns() to work only as
2273 2287 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
2274 2288 now returns None (again), unless dummy is specifically allowed by
2275 2289 ipapi.get(allow_dummy=True).
2276 2290
2277 2291 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
2278 2292
2279 2293 * IPython: remove all 2.2-compatibility objects and hacks from
2280 2294 everywhere, since we only support 2.3 at this point. Docs
2281 2295 updated.
2282 2296
2283 2297 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
2284 2298 Anything requiring extra validation can be turned into a Python
2285 2299 property in the future. I used a property for the db one b/c
2286 2300 there was a nasty circularity problem with the initialization
2287 2301 order, which right now I don't have time to clean up.
2288 2302
2289 2303 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
2290 2304 another locking bug reported by Jorgen. I'm not 100% sure though,
2291 2305 so more testing is needed...
2292 2306
2293 2307 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
2294 2308
2295 2309 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
2296 2310 local variables from any routine in user code (typically executed
2297 2311 with %run) directly into the interactive namespace. Very useful
2298 2312 when doing complex debugging.
2299 2313 (IPythonNotRunning): Changed the default None object to a dummy
2300 2314 whose attributes can be queried as well as called without
2301 2315 exploding, to ease writing code which works transparently both in
2302 2316 and out of ipython and uses some of this API.
2303 2317
2304 2318 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
2305 2319
2306 2320 * IPython/hooks.py (result_display): Fix the fact that our display
2307 2321 hook was using str() instead of repr(), as the default python
2308 2322 console does. This had gone unnoticed b/c it only happened if
2309 2323 %Pprint was off, but the inconsistency was there.
2310 2324
2311 2325 2006-05-15 Ville Vainio <vivainio@gmail.com>
2312 2326
2313 2327 * Oinspect.py: Only show docstring for nonexisting/binary files
2314 2328 when doing object??, closing ticket #62
2315 2329
2316 2330 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
2317 2331
2318 2332 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
2319 2333 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
2320 2334 was being released in a routine which hadn't checked if it had
2321 2335 been the one to acquire it.
2322 2336
2323 2337 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
2324 2338
2325 2339 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
2326 2340
2327 2341 2006-04-11 Ville Vainio <vivainio@gmail.com>
2328 2342
2329 2343 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
2330 2344 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
2331 2345 prefilters, allowing stuff like magics and aliases in the file.
2332 2346
2333 2347 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
2334 2348 added. Supported now are "%clear in" and "%clear out" (clear input and
2335 2349 output history, respectively). Also fixed CachedOutput.flush to
2336 2350 properly flush the output cache.
2337 2351
2338 2352 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
2339 2353 half-success (and fail explicitly).
2340 2354
2341 2355 2006-03-28 Ville Vainio <vivainio@gmail.com>
2342 2356
2343 2357 * iplib.py: Fix quoting of aliases so that only argless ones
2344 2358 are quoted
2345 2359
2346 2360 2006-03-28 Ville Vainio <vivainio@gmail.com>
2347 2361
2348 2362 * iplib.py: Quote aliases with spaces in the name.
2349 2363 "c:\program files\blah\bin" is now legal alias target.
2350 2364
2351 2365 * ext_rehashdir.py: Space no longer allowed as arg
2352 2366 separator, since space is legal in path names.
2353 2367
2354 2368 2006-03-16 Ville Vainio <vivainio@gmail.com>
2355 2369
2356 2370 * upgrade_dir.py: Take path.py from Extensions, correcting
2357 2371 %upgrade magic
2358 2372
2359 2373 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
2360 2374
2361 2375 * hooks.py: Only enclose editor binary in quotes if legal and
2362 2376 necessary (space in the name, and is an existing file). Fixes a bug
2363 2377 reported by Zachary Pincus.
2364 2378
2365 2379 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
2366 2380
2367 2381 * Manual: thanks to a tip on proper color handling for Emacs, by
2368 2382 Eric J Haywiser <ejh1-AT-MIT.EDU>.
2369 2383
2370 2384 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
2371 2385 by applying the provided patch. Thanks to Liu Jin
2372 2386 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
2373 2387 XEmacs/Linux, I'm trusting the submitter that it actually helps
2374 2388 under win32/GNU Emacs. Will revisit if any problems are reported.
2375 2389
2376 2390 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
2377 2391
2378 2392 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
2379 2393 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
2380 2394
2381 2395 2006-03-12 Ville Vainio <vivainio@gmail.com>
2382 2396
2383 2397 * Magic.py (magic_timeit): Added %timeit magic, contributed by
2384 2398 Torsten Marek.
2385 2399
2386 2400 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
2387 2401
2388 2402 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
2389 2403 line ranges works again.
2390 2404
2391 2405 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
2392 2406
2393 2407 * IPython/iplib.py (showtraceback): add back sys.last_traceback
2394 2408 and friends, after a discussion with Zach Pincus on ipython-user.
2395 2409 I'm not 100% sure, but after thinking about it quite a bit, it may
2396 2410 be OK. Testing with the multithreaded shells didn't reveal any
2397 2411 problems, but let's keep an eye out.
2398 2412
2399 2413 In the process, I fixed a few things which were calling
2400 2414 self.InteractiveTB() directly (like safe_execfile), which is a
2401 2415 mistake: ALL exception reporting should be done by calling
2402 2416 self.showtraceback(), which handles state and tab-completion and
2403 2417 more.
2404 2418
2405 2419 2006-03-01 Ville Vainio <vivainio@gmail.com>
2406 2420
2407 2421 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
2408 2422 To use, do "from ipipe import *".
2409 2423
2410 2424 2006-02-24 Ville Vainio <vivainio@gmail.com>
2411 2425
2412 2426 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
2413 2427 "cleanly" and safely than the older upgrade mechanism.
2414 2428
2415 2429 2006-02-21 Ville Vainio <vivainio@gmail.com>
2416 2430
2417 2431 * Magic.py: %save works again.
2418 2432
2419 2433 2006-02-15 Ville Vainio <vivainio@gmail.com>
2420 2434
2421 2435 * Magic.py: %Pprint works again
2422 2436
2423 2437 * Extensions/ipy_sane_defaults.py: Provide everything provided
2424 2438 in default ipythonrc, to make it possible to have a completely empty
2425 2439 ipythonrc (and thus completely rc-file free configuration)
2426 2440
2427 2441 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
2428 2442
2429 2443 * IPython/hooks.py (editor): quote the call to the editor command,
2430 2444 to allow commands with spaces in them. Problem noted by watching
2431 2445 Ian Oswald's video about textpad under win32 at
2432 2446 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
2433 2447
2434 2448 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
2435 2449 describing magics (we haven't used @ for a loong time).
2436 2450
2437 2451 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
2438 2452 contributed by marienz to close
2439 2453 http://www.scipy.net/roundup/ipython/issue53.
2440 2454
2441 2455 2006-02-10 Ville Vainio <vivainio@gmail.com>
2442 2456
2443 2457 * genutils.py: getoutput now works in win32 too
2444 2458
2445 2459 * completer.py: alias and magic completion only invoked
2446 2460 at the first "item" in the line, to avoid "cd %store"
2447 2461 nonsense.
2448 2462
2449 2463 2006-02-09 Ville Vainio <vivainio@gmail.com>
2450 2464
2451 2465 * test/*: Added a unit testing framework (finally).
2452 2466 '%run runtests.py' to run test_*.
2453 2467
2454 2468 * ipapi.py: Exposed runlines and set_custom_exc
2455 2469
2456 2470 2006-02-07 Ville Vainio <vivainio@gmail.com>
2457 2471
2458 2472 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
2459 2473 instead use "f(1 2)" as before.
2460 2474
2461 2475 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
2462 2476
2463 2477 * IPython/demo.py (IPythonDemo): Add new classes to the demo
2464 2478 facilities, for demos processed by the IPython input filter
2465 2479 (IPythonDemo), and for running a script one-line-at-a-time as a
2466 2480 demo, both for pure Python (LineDemo) and for IPython-processed
2467 2481 input (IPythonLineDemo). After a request by Dave Kohel, from the
2468 2482 SAGE team.
2469 2483 (Demo.edit): added an edit() method to the demo objects, to edit
2470 2484 the in-memory copy of the last executed block.
2471 2485
2472 2486 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
2473 2487 processing to %edit, %macro and %save. These commands can now be
2474 2488 invoked on the unprocessed input as it was typed by the user
2475 2489 (without any prefilters applied). After requests by the SAGE team
2476 2490 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
2477 2491
2478 2492 2006-02-01 Ville Vainio <vivainio@gmail.com>
2479 2493
2480 2494 * setup.py, eggsetup.py: easy_install ipython==dev works
2481 2495 correctly now (on Linux)
2482 2496
2483 2497 * ipy_user_conf,ipmaker: user config changes, removed spurious
2484 2498 warnings
2485 2499
2486 2500 * iplib: if rc.banner is string, use it as is.
2487 2501
2488 2502 * Magic: %pycat accepts a string argument and pages it's contents.
2489 2503
2490 2504
2491 2505 2006-01-30 Ville Vainio <vivainio@gmail.com>
2492 2506
2493 2507 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
2494 2508 Now %store and bookmarks work through PickleShare, meaning that
2495 2509 concurrent access is possible and all ipython sessions see the
2496 2510 same database situation all the time, instead of snapshot of
2497 2511 the situation when the session was started. Hence, %bookmark
2498 2512 results are immediately accessible from othes sessions. The database
2499 2513 is also available for use by user extensions. See:
2500 2514 http://www.python.org/pypi/pickleshare
2501 2515
2502 2516 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
2503 2517
2504 2518 * aliases can now be %store'd
2505 2519
2506 2520 * path.py moved to Extensions so that pickleshare does not need
2507 2521 IPython-specific import. Extensions added to pythonpath right
2508 2522 at __init__.
2509 2523
2510 2524 * iplib.py: ipalias deprecated/redundant; aliases are converted and
2511 2525 called with _ip.system and the pre-transformed command string.
2512 2526
2513 2527 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
2514 2528
2515 2529 * IPython/iplib.py (interact): Fix that we were not catching
2516 2530 KeyboardInterrupt exceptions properly. I'm not quite sure why the
2517 2531 logic here had to change, but it's fixed now.
2518 2532
2519 2533 2006-01-29 Ville Vainio <vivainio@gmail.com>
2520 2534
2521 2535 * iplib.py: Try to import pyreadline on Windows.
2522 2536
2523 2537 2006-01-27 Ville Vainio <vivainio@gmail.com>
2524 2538
2525 2539 * iplib.py: Expose ipapi as _ip in builtin namespace.
2526 2540 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
2527 2541 and ip_set_hook (-> _ip.set_hook) redundant. % and !
2528 2542 syntax now produce _ip.* variant of the commands.
2529 2543
2530 2544 * "_ip.options().autoedit_syntax = 2" automatically throws
2531 2545 user to editor for syntax error correction without prompting.
2532 2546
2533 2547 2006-01-27 Ville Vainio <vivainio@gmail.com>
2534 2548
2535 2549 * ipmaker.py: Give "realistic" sys.argv for scripts (without
2536 2550 'ipython' at argv[0]) executed through command line.
2537 2551 NOTE: this DEPRECATES calling ipython with multiple scripts
2538 2552 ("ipython a.py b.py c.py")
2539 2553
2540 2554 * iplib.py, hooks.py: Added configurable input prefilter,
2541 2555 named 'input_prefilter'. See ext_rescapture.py for example
2542 2556 usage.
2543 2557
2544 2558 * ext_rescapture.py, Magic.py: Better system command output capture
2545 2559 through 'var = !ls' (deprecates user-visible %sc). Same notation
2546 2560 applies for magics, 'var = %alias' assigns alias list to var.
2547 2561
2548 2562 * ipapi.py: added meta() for accessing extension-usable data store.
2549 2563
2550 2564 * iplib.py: added InteractiveShell.getapi(). New magics should be
2551 2565 written doing self.getapi() instead of using the shell directly.
2552 2566
2553 2567 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
2554 2568 %store foo >> ~/myfoo.txt to store variables to files (in clean
2555 2569 textual form, not a restorable pickle).
2556 2570
2557 2571 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
2558 2572
2559 2573 * usage.py, Magic.py: added %quickref
2560 2574
2561 2575 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
2562 2576
2563 2577 * GetoptErrors when invoking magics etc. with wrong args
2564 2578 are now more helpful:
2565 2579 GetoptError: option -l not recognized (allowed: "qb" )
2566 2580
2567 2581 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
2568 2582
2569 2583 * IPython/demo.py (Demo.show): Flush stdout after each block, so
2570 2584 computationally intensive blocks don't appear to stall the demo.
2571 2585
2572 2586 2006-01-24 Ville Vainio <vivainio@gmail.com>
2573 2587
2574 2588 * iplib.py, hooks.py: 'result_display' hook can return a non-None
2575 2589 value to manipulate resulting history entry.
2576 2590
2577 2591 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2578 2592 to instance methods of IPApi class, to make extending an embedded
2579 2593 IPython feasible. See ext_rehashdir.py for example usage.
2580 2594
2581 2595 * Merged 1071-1076 from branches/0.7.1
2582 2596
2583 2597
2584 2598 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2585 2599
2586 2600 * tools/release (daystamp): Fix build tools to use the new
2587 2601 eggsetup.py script to build lightweight eggs.
2588 2602
2589 2603 * Applied changesets 1062 and 1064 before 0.7.1 release.
2590 2604
2591 2605 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2592 2606 see the raw input history (without conversions like %ls ->
2593 2607 ipmagic("ls")). After a request from W. Stein, SAGE
2594 2608 (http://modular.ucsd.edu/sage) developer. This information is
2595 2609 stored in the input_hist_raw attribute of the IPython instance, so
2596 2610 developers can access it if needed (it's an InputList instance).
2597 2611
2598 2612 * Versionstring = 0.7.2.svn
2599 2613
2600 2614 * eggsetup.py: A separate script for constructing eggs, creates
2601 2615 proper launch scripts even on Windows (an .exe file in
2602 2616 \python24\scripts).
2603 2617
2604 2618 * ipapi.py: launch_new_instance, launch entry point needed for the
2605 2619 egg.
2606 2620
2607 2621 2006-01-23 Ville Vainio <vivainio@gmail.com>
2608 2622
2609 2623 * Added %cpaste magic for pasting python code
2610 2624
2611 2625 2006-01-22 Ville Vainio <vivainio@gmail.com>
2612 2626
2613 2627 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2614 2628
2615 2629 * Versionstring = 0.7.2.svn
2616 2630
2617 2631 * eggsetup.py: A separate script for constructing eggs, creates
2618 2632 proper launch scripts even on Windows (an .exe file in
2619 2633 \python24\scripts).
2620 2634
2621 2635 * ipapi.py: launch_new_instance, launch entry point needed for the
2622 2636 egg.
2623 2637
2624 2638 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2625 2639
2626 2640 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2627 2641 %pfile foo would print the file for foo even if it was a binary.
2628 2642 Now, extensions '.so' and '.dll' are skipped.
2629 2643
2630 2644 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2631 2645 bug, where macros would fail in all threaded modes. I'm not 100%
2632 2646 sure, so I'm going to put out an rc instead of making a release
2633 2647 today, and wait for feedback for at least a few days.
2634 2648
2635 2649 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2636 2650 it...) the handling of pasting external code with autoindent on.
2637 2651 To get out of a multiline input, the rule will appear for most
2638 2652 users unchanged: two blank lines or change the indent level
2639 2653 proposed by IPython. But there is a twist now: you can
2640 2654 add/subtract only *one or two spaces*. If you add/subtract three
2641 2655 or more (unless you completely delete the line), IPython will
2642 2656 accept that line, and you'll need to enter a second one of pure
2643 2657 whitespace. I know it sounds complicated, but I can't find a
2644 2658 different solution that covers all the cases, with the right
2645 2659 heuristics. Hopefully in actual use, nobody will really notice
2646 2660 all these strange rules and things will 'just work'.
2647 2661
2648 2662 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2649 2663
2650 2664 * IPython/iplib.py (interact): catch exceptions which can be
2651 2665 triggered asynchronously by signal handlers. Thanks to an
2652 2666 automatic crash report, submitted by Colin Kingsley
2653 2667 <tercel-AT-gentoo.org>.
2654 2668
2655 2669 2006-01-20 Ville Vainio <vivainio@gmail.com>
2656 2670
2657 2671 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2658 2672 (%rehashdir, very useful, try it out) of how to extend ipython
2659 2673 with new magics. Also added Extensions dir to pythonpath to make
2660 2674 importing extensions easy.
2661 2675
2662 2676 * %store now complains when trying to store interactively declared
2663 2677 classes / instances of those classes.
2664 2678
2665 2679 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2666 2680 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2667 2681 if they exist, and ipy_user_conf.py with some defaults is created for
2668 2682 the user.
2669 2683
2670 2684 * Startup rehashing done by the config file, not InterpreterExec.
2671 2685 This means system commands are available even without selecting the
2672 2686 pysh profile. It's the sensible default after all.
2673 2687
2674 2688 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2675 2689
2676 2690 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2677 2691 multiline code with autoindent on working. But I am really not
2678 2692 sure, so this needs more testing. Will commit a debug-enabled
2679 2693 version for now, while I test it some more, so that Ville and
2680 2694 others may also catch any problems. Also made
2681 2695 self.indent_current_str() a method, to ensure that there's no
2682 2696 chance of the indent space count and the corresponding string
2683 2697 falling out of sync. All code needing the string should just call
2684 2698 the method.
2685 2699
2686 2700 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2687 2701
2688 2702 * IPython/Magic.py (magic_edit): fix check for when users don't
2689 2703 save their output files, the try/except was in the wrong section.
2690 2704
2691 2705 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2692 2706
2693 2707 * IPython/Magic.py (magic_run): fix __file__ global missing from
2694 2708 script's namespace when executed via %run. After a report by
2695 2709 Vivian.
2696 2710
2697 2711 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2698 2712 when using python 2.4. The parent constructor changed in 2.4, and
2699 2713 we need to track it directly (we can't call it, as it messes up
2700 2714 readline and tab-completion inside our pdb would stop working).
2701 2715 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2702 2716
2703 2717 2006-01-16 Ville Vainio <vivainio@gmail.com>
2704 2718
2705 2719 * Ipython/magic.py: Reverted back to old %edit functionality
2706 2720 that returns file contents on exit.
2707 2721
2708 2722 * IPython/path.py: Added Jason Orendorff's "path" module to
2709 2723 IPython tree, http://www.jorendorff.com/articles/python/path/.
2710 2724 You can get path objects conveniently through %sc, and !!, e.g.:
2711 2725 sc files=ls
2712 2726 for p in files.paths: # or files.p
2713 2727 print p,p.mtime
2714 2728
2715 2729 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2716 2730 now work again without considering the exclusion regexp -
2717 2731 hence, things like ',foo my/path' turn to 'foo("my/path")'
2718 2732 instead of syntax error.
2719 2733
2720 2734
2721 2735 2006-01-14 Ville Vainio <vivainio@gmail.com>
2722 2736
2723 2737 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2724 2738 ipapi decorators for python 2.4 users, options() provides access to rc
2725 2739 data.
2726 2740
2727 2741 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2728 2742 as path separators (even on Linux ;-). Space character after
2729 2743 backslash (as yielded by tab completer) is still space;
2730 2744 "%cd long\ name" works as expected.
2731 2745
2732 2746 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2733 2747 as "chain of command", with priority. API stays the same,
2734 2748 TryNext exception raised by a hook function signals that
2735 2749 current hook failed and next hook should try handling it, as
2736 2750 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2737 2751 requested configurable display hook, which is now implemented.
2738 2752
2739 2753 2006-01-13 Ville Vainio <vivainio@gmail.com>
2740 2754
2741 2755 * IPython/platutils*.py: platform specific utility functions,
2742 2756 so far only set_term_title is implemented (change terminal
2743 2757 label in windowing systems). %cd now changes the title to
2744 2758 current dir.
2745 2759
2746 2760 * IPython/Release.py: Added myself to "authors" list,
2747 2761 had to create new files.
2748 2762
2749 2763 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2750 2764 shell escape; not a known bug but had potential to be one in the
2751 2765 future.
2752 2766
2753 2767 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2754 2768 extension API for IPython! See the module for usage example. Fix
2755 2769 OInspect for docstring-less magic functions.
2756 2770
2757 2771
2758 2772 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2759 2773
2760 2774 * IPython/iplib.py (raw_input): temporarily deactivate all
2761 2775 attempts at allowing pasting of code with autoindent on. It
2762 2776 introduced bugs (reported by Prabhu) and I can't seem to find a
2763 2777 robust combination which works in all cases. Will have to revisit
2764 2778 later.
2765 2779
2766 2780 * IPython/genutils.py: remove isspace() function. We've dropped
2767 2781 2.2 compatibility, so it's OK to use the string method.
2768 2782
2769 2783 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2770 2784
2771 2785 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2772 2786 matching what NOT to autocall on, to include all python binary
2773 2787 operators (including things like 'and', 'or', 'is' and 'in').
2774 2788 Prompted by a bug report on 'foo & bar', but I realized we had
2775 2789 many more potential bug cases with other operators. The regexp is
2776 2790 self.re_exclude_auto, it's fairly commented.
2777 2791
2778 2792 2006-01-12 Ville Vainio <vivainio@gmail.com>
2779 2793
2780 2794 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2781 2795 Prettified and hardened string/backslash quoting with ipsystem(),
2782 2796 ipalias() and ipmagic(). Now even \ characters are passed to
2783 2797 %magics, !shell escapes and aliases exactly as they are in the
2784 2798 ipython command line. Should improve backslash experience,
2785 2799 particularly in Windows (path delimiter for some commands that
2786 2800 won't understand '/'), but Unix benefits as well (regexps). %cd
2787 2801 magic still doesn't support backslash path delimiters, though. Also
2788 2802 deleted all pretense of supporting multiline command strings in
2789 2803 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2790 2804
2791 2805 * doc/build_doc_instructions.txt added. Documentation on how to
2792 2806 use doc/update_manual.py, added yesterday. Both files contributed
2793 2807 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2794 2808 doc/*.sh for deprecation at a later date.
2795 2809
2796 2810 * /ipython.py Added ipython.py to root directory for
2797 2811 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2798 2812 ipython.py) and development convenience (no need to keep doing
2799 2813 "setup.py install" between changes).
2800 2814
2801 2815 * Made ! and !! shell escapes work (again) in multiline expressions:
2802 2816 if 1:
2803 2817 !ls
2804 2818 !!ls
2805 2819
2806 2820 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2807 2821
2808 2822 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2809 2823 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2810 2824 module in case-insensitive installation. Was causing crashes
2811 2825 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2812 2826
2813 2827 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2814 2828 <marienz-AT-gentoo.org>, closes
2815 2829 http://www.scipy.net/roundup/ipython/issue51.
2816 2830
2817 2831 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2818 2832
2819 2833 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2820 2834 problem of excessive CPU usage under *nix and keyboard lag under
2821 2835 win32.
2822 2836
2823 2837 2006-01-10 *** Released version 0.7.0
2824 2838
2825 2839 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2826 2840
2827 2841 * IPython/Release.py (revision): tag version number to 0.7.0,
2828 2842 ready for release.
2829 2843
2830 2844 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2831 2845 it informs the user of the name of the temp. file used. This can
2832 2846 help if you decide later to reuse that same file, so you know
2833 2847 where to copy the info from.
2834 2848
2835 2849 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2836 2850
2837 2851 * setup_bdist_egg.py: little script to build an egg. Added
2838 2852 support in the release tools as well.
2839 2853
2840 2854 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2841 2855
2842 2856 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2843 2857 version selection (new -wxversion command line and ipythonrc
2844 2858 parameter). Patch contributed by Arnd Baecker
2845 2859 <arnd.baecker-AT-web.de>.
2846 2860
2847 2861 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2848 2862 embedded instances, for variables defined at the interactive
2849 2863 prompt of the embedded ipython. Reported by Arnd.
2850 2864
2851 2865 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2852 2866 it can be used as a (stateful) toggle, or with a direct parameter.
2853 2867
2854 2868 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2855 2869 could be triggered in certain cases and cause the traceback
2856 2870 printer not to work.
2857 2871
2858 2872 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2859 2873
2860 2874 * IPython/iplib.py (_should_recompile): Small fix, closes
2861 2875 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2862 2876
2863 2877 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2864 2878
2865 2879 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2866 2880 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2867 2881 Moad for help with tracking it down.
2868 2882
2869 2883 * IPython/iplib.py (handle_auto): fix autocall handling for
2870 2884 objects which support BOTH __getitem__ and __call__ (so that f [x]
2871 2885 is left alone, instead of becoming f([x]) automatically).
2872 2886
2873 2887 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2874 2888 Ville's patch.
2875 2889
2876 2890 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2877 2891
2878 2892 * IPython/iplib.py (handle_auto): changed autocall semantics to
2879 2893 include 'smart' mode, where the autocall transformation is NOT
2880 2894 applied if there are no arguments on the line. This allows you to
2881 2895 just type 'foo' if foo is a callable to see its internal form,
2882 2896 instead of having it called with no arguments (typically a
2883 2897 mistake). The old 'full' autocall still exists: for that, you
2884 2898 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2885 2899
2886 2900 * IPython/completer.py (Completer.attr_matches): add
2887 2901 tab-completion support for Enthoughts' traits. After a report by
2888 2902 Arnd and a patch by Prabhu.
2889 2903
2890 2904 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2891 2905
2892 2906 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2893 2907 Schmolck's patch to fix inspect.getinnerframes().
2894 2908
2895 2909 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2896 2910 for embedded instances, regarding handling of namespaces and items
2897 2911 added to the __builtin__ one. Multiple embedded instances and
2898 2912 recursive embeddings should work better now (though I'm not sure
2899 2913 I've got all the corner cases fixed, that code is a bit of a brain
2900 2914 twister).
2901 2915
2902 2916 * IPython/Magic.py (magic_edit): added support to edit in-memory
2903 2917 macros (automatically creates the necessary temp files). %edit
2904 2918 also doesn't return the file contents anymore, it's just noise.
2905 2919
2906 2920 * IPython/completer.py (Completer.attr_matches): revert change to
2907 2921 complete only on attributes listed in __all__. I realized it
2908 2922 cripples the tab-completion system as a tool for exploring the
2909 2923 internals of unknown libraries (it renders any non-__all__
2910 2924 attribute off-limits). I got bit by this when trying to see
2911 2925 something inside the dis module.
2912 2926
2913 2927 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2914 2928
2915 2929 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2916 2930 namespace for users and extension writers to hold data in. This
2917 2931 follows the discussion in
2918 2932 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2919 2933
2920 2934 * IPython/completer.py (IPCompleter.complete): small patch to help
2921 2935 tab-completion under Emacs, after a suggestion by John Barnard
2922 2936 <barnarj-AT-ccf.org>.
2923 2937
2924 2938 * IPython/Magic.py (Magic.extract_input_slices): added support for
2925 2939 the slice notation in magics to use N-M to represent numbers N...M
2926 2940 (closed endpoints). This is used by %macro and %save.
2927 2941
2928 2942 * IPython/completer.py (Completer.attr_matches): for modules which
2929 2943 define __all__, complete only on those. After a patch by Jeffrey
2930 2944 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2931 2945 speed up this routine.
2932 2946
2933 2947 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2934 2948 don't know if this is the end of it, but the behavior now is
2935 2949 certainly much more correct. Note that coupled with macros,
2936 2950 slightly surprising (at first) behavior may occur: a macro will in
2937 2951 general expand to multiple lines of input, so upon exiting, the
2938 2952 in/out counters will both be bumped by the corresponding amount
2939 2953 (as if the macro's contents had been typed interactively). Typing
2940 2954 %hist will reveal the intermediate (silently processed) lines.
2941 2955
2942 2956 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2943 2957 pickle to fail (%run was overwriting __main__ and not restoring
2944 2958 it, but pickle relies on __main__ to operate).
2945 2959
2946 2960 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2947 2961 using properties, but forgot to make the main InteractiveShell
2948 2962 class a new-style class. Properties fail silently, and
2949 2963 mysteriously, with old-style class (getters work, but
2950 2964 setters don't do anything).
2951 2965
2952 2966 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2953 2967
2954 2968 * IPython/Magic.py (magic_history): fix history reporting bug (I
2955 2969 know some nasties are still there, I just can't seem to find a
2956 2970 reproducible test case to track them down; the input history is
2957 2971 falling out of sync...)
2958 2972
2959 2973 * IPython/iplib.py (handle_shell_escape): fix bug where both
2960 2974 aliases and system accesses where broken for indented code (such
2961 2975 as loops).
2962 2976
2963 2977 * IPython/genutils.py (shell): fix small but critical bug for
2964 2978 win32 system access.
2965 2979
2966 2980 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2967 2981
2968 2982 * IPython/iplib.py (showtraceback): remove use of the
2969 2983 sys.last_{type/value/traceback} structures, which are non
2970 2984 thread-safe.
2971 2985 (_prefilter): change control flow to ensure that we NEVER
2972 2986 introspect objects when autocall is off. This will guarantee that
2973 2987 having an input line of the form 'x.y', where access to attribute
2974 2988 'y' has side effects, doesn't trigger the side effect TWICE. It
2975 2989 is important to note that, with autocall on, these side effects
2976 2990 can still happen.
2977 2991 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2978 2992 trio. IPython offers these three kinds of special calls which are
2979 2993 not python code, and it's a good thing to have their call method
2980 2994 be accessible as pure python functions (not just special syntax at
2981 2995 the command line). It gives us a better internal implementation
2982 2996 structure, as well as exposing these for user scripting more
2983 2997 cleanly.
2984 2998
2985 2999 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2986 3000 file. Now that they'll be more likely to be used with the
2987 3001 persistance system (%store), I want to make sure their module path
2988 3002 doesn't change in the future, so that we don't break things for
2989 3003 users' persisted data.
2990 3004
2991 3005 * IPython/iplib.py (autoindent_update): move indentation
2992 3006 management into the _text_ processing loop, not the keyboard
2993 3007 interactive one. This is necessary to correctly process non-typed
2994 3008 multiline input (such as macros).
2995 3009
2996 3010 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2997 3011 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2998 3012 which was producing problems in the resulting manual.
2999 3013 (magic_whos): improve reporting of instances (show their class,
3000 3014 instead of simply printing 'instance' which isn't terribly
3001 3015 informative).
3002 3016
3003 3017 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
3004 3018 (minor mods) to support network shares under win32.
3005 3019
3006 3020 * IPython/winconsole.py (get_console_size): add new winconsole
3007 3021 module and fixes to page_dumb() to improve its behavior under
3008 3022 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
3009 3023
3010 3024 * IPython/Magic.py (Macro): simplified Macro class to just
3011 3025 subclass list. We've had only 2.2 compatibility for a very long
3012 3026 time, yet I was still avoiding subclassing the builtin types. No
3013 3027 more (I'm also starting to use properties, though I won't shift to
3014 3028 2.3-specific features quite yet).
3015 3029 (magic_store): added Ville's patch for lightweight variable
3016 3030 persistence, after a request on the user list by Matt Wilkie
3017 3031 <maphew-AT-gmail.com>. The new %store magic's docstring has full
3018 3032 details.
3019 3033
3020 3034 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3021 3035 changed the default logfile name from 'ipython.log' to
3022 3036 'ipython_log.py'. These logs are real python files, and now that
3023 3037 we have much better multiline support, people are more likely to
3024 3038 want to use them as such. Might as well name them correctly.
3025 3039
3026 3040 * IPython/Magic.py: substantial cleanup. While we can't stop
3027 3041 using magics as mixins, due to the existing customizations 'out
3028 3042 there' which rely on the mixin naming conventions, at least I
3029 3043 cleaned out all cross-class name usage. So once we are OK with
3030 3044 breaking compatibility, the two systems can be separated.
3031 3045
3032 3046 * IPython/Logger.py: major cleanup. This one is NOT a mixin
3033 3047 anymore, and the class is a fair bit less hideous as well. New
3034 3048 features were also introduced: timestamping of input, and logging
3035 3049 of output results. These are user-visible with the -t and -o
3036 3050 options to %logstart. Closes
3037 3051 http://www.scipy.net/roundup/ipython/issue11 and a request by
3038 3052 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
3039 3053
3040 3054 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
3041 3055
3042 3056 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
3043 3057 better handle backslashes in paths. See the thread 'More Windows
3044 3058 questions part 2 - \/ characters revisited' on the iypthon user
3045 3059 list:
3046 3060 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
3047 3061
3048 3062 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
3049 3063
3050 3064 (InteractiveShell.__init__): change threaded shells to not use the
3051 3065 ipython crash handler. This was causing more problems than not,
3052 3066 as exceptions in the main thread (GUI code, typically) would
3053 3067 always show up as a 'crash', when they really weren't.
3054 3068
3055 3069 The colors and exception mode commands (%colors/%xmode) have been
3056 3070 synchronized to also take this into account, so users can get
3057 3071 verbose exceptions for their threaded code as well. I also added
3058 3072 support for activating pdb inside this exception handler as well,
3059 3073 so now GUI authors can use IPython's enhanced pdb at runtime.
3060 3074
3061 3075 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
3062 3076 true by default, and add it to the shipped ipythonrc file. Since
3063 3077 this asks the user before proceeding, I think it's OK to make it
3064 3078 true by default.
3065 3079
3066 3080 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
3067 3081 of the previous special-casing of input in the eval loop. I think
3068 3082 this is cleaner, as they really are commands and shouldn't have
3069 3083 a special role in the middle of the core code.
3070 3084
3071 3085 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
3072 3086
3073 3087 * IPython/iplib.py (edit_syntax_error): added support for
3074 3088 automatically reopening the editor if the file had a syntax error
3075 3089 in it. Thanks to scottt who provided the patch at:
3076 3090 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
3077 3091 version committed).
3078 3092
3079 3093 * IPython/iplib.py (handle_normal): add suport for multi-line
3080 3094 input with emtpy lines. This fixes
3081 3095 http://www.scipy.net/roundup/ipython/issue43 and a similar
3082 3096 discussion on the user list.
3083 3097
3084 3098 WARNING: a behavior change is necessarily introduced to support
3085 3099 blank lines: now a single blank line with whitespace does NOT
3086 3100 break the input loop, which means that when autoindent is on, by
3087 3101 default hitting return on the next (indented) line does NOT exit.
3088 3102
3089 3103 Instead, to exit a multiline input you can either have:
3090 3104
3091 3105 - TWO whitespace lines (just hit return again), or
3092 3106 - a single whitespace line of a different length than provided
3093 3107 by the autoindent (add or remove a space).
3094 3108
3095 3109 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
3096 3110 module to better organize all readline-related functionality.
3097 3111 I've deleted FlexCompleter and put all completion clases here.
3098 3112
3099 3113 * IPython/iplib.py (raw_input): improve indentation management.
3100 3114 It is now possible to paste indented code with autoindent on, and
3101 3115 the code is interpreted correctly (though it still looks bad on
3102 3116 screen, due to the line-oriented nature of ipython).
3103 3117 (MagicCompleter.complete): change behavior so that a TAB key on an
3104 3118 otherwise empty line actually inserts a tab, instead of completing
3105 3119 on the entire global namespace. This makes it easier to use the
3106 3120 TAB key for indentation. After a request by Hans Meine
3107 3121 <hans_meine-AT-gmx.net>
3108 3122 (_prefilter): add support so that typing plain 'exit' or 'quit'
3109 3123 does a sensible thing. Originally I tried to deviate as little as
3110 3124 possible from the default python behavior, but even that one may
3111 3125 change in this direction (thread on python-dev to that effect).
3112 3126 Regardless, ipython should do the right thing even if CPython's
3113 3127 '>>>' prompt doesn't.
3114 3128 (InteractiveShell): removed subclassing code.InteractiveConsole
3115 3129 class. By now we'd overridden just about all of its methods: I've
3116 3130 copied the remaining two over, and now ipython is a standalone
3117 3131 class. This will provide a clearer picture for the chainsaw
3118 3132 branch refactoring.
3119 3133
3120 3134 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
3121 3135
3122 3136 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
3123 3137 failures for objects which break when dir() is called on them.
3124 3138
3125 3139 * IPython/FlexCompleter.py (Completer.__init__): Added support for
3126 3140 distinct local and global namespaces in the completer API. This
3127 3141 change allows us to properly handle completion with distinct
3128 3142 scopes, including in embedded instances (this had never really
3129 3143 worked correctly).
3130 3144
3131 3145 Note: this introduces a change in the constructor for
3132 3146 MagicCompleter, as a new global_namespace parameter is now the
3133 3147 second argument (the others were bumped one position).
3134 3148
3135 3149 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
3136 3150
3137 3151 * IPython/iplib.py (embed_mainloop): fix tab-completion in
3138 3152 embedded instances (which can be done now thanks to Vivian's
3139 3153 frame-handling fixes for pdb).
3140 3154 (InteractiveShell.__init__): Fix namespace handling problem in
3141 3155 embedded instances. We were overwriting __main__ unconditionally,
3142 3156 and this should only be done for 'full' (non-embedded) IPython;
3143 3157 embedded instances must respect the caller's __main__. Thanks to
3144 3158 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
3145 3159
3146 3160 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
3147 3161
3148 3162 * setup.py: added download_url to setup(). This registers the
3149 3163 download address at PyPI, which is not only useful to humans
3150 3164 browsing the site, but is also picked up by setuptools (the Eggs
3151 3165 machinery). Thanks to Ville and R. Kern for the info/discussion
3152 3166 on this.
3153 3167
3154 3168 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
3155 3169
3156 3170 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
3157 3171 This brings a lot of nice functionality to the pdb mode, which now
3158 3172 has tab-completion, syntax highlighting, and better stack handling
3159 3173 than before. Many thanks to Vivian De Smedt
3160 3174 <vivian-AT-vdesmedt.com> for the original patches.
3161 3175
3162 3176 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
3163 3177
3164 3178 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
3165 3179 sequence to consistently accept the banner argument. The
3166 3180 inconsistency was tripping SAGE, thanks to Gary Zablackis
3167 3181 <gzabl-AT-yahoo.com> for the report.
3168 3182
3169 3183 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
3170 3184
3171 3185 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3172 3186 Fix bug where a naked 'alias' call in the ipythonrc file would
3173 3187 cause a crash. Bug reported by Jorgen Stenarson.
3174 3188
3175 3189 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
3176 3190
3177 3191 * IPython/ipmaker.py (make_IPython): cleanups which should improve
3178 3192 startup time.
3179 3193
3180 3194 * IPython/iplib.py (runcode): my globals 'fix' for embedded
3181 3195 instances had introduced a bug with globals in normal code. Now
3182 3196 it's working in all cases.
3183 3197
3184 3198 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
3185 3199 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
3186 3200 has been introduced to set the default case sensitivity of the
3187 3201 searches. Users can still select either mode at runtime on a
3188 3202 per-search basis.
3189 3203
3190 3204 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
3191 3205
3192 3206 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
3193 3207 attributes in wildcard searches for subclasses. Modified version
3194 3208 of a patch by Jorgen.
3195 3209
3196 3210 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
3197 3211
3198 3212 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
3199 3213 embedded instances. I added a user_global_ns attribute to the
3200 3214 InteractiveShell class to handle this.
3201 3215
3202 3216 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
3203 3217
3204 3218 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
3205 3219 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
3206 3220 (reported under win32, but may happen also in other platforms).
3207 3221 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
3208 3222
3209 3223 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
3210 3224
3211 3225 * IPython/Magic.py (magic_psearch): new support for wildcard
3212 3226 patterns. Now, typing ?a*b will list all names which begin with a
3213 3227 and end in b, for example. The %psearch magic has full
3214 3228 docstrings. Many thanks to JΓΆrgen Stenarson
3215 3229 <jorgen.stenarson-AT-bostream.nu>, author of the patches
3216 3230 implementing this functionality.
3217 3231
3218 3232 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
3219 3233
3220 3234 * Manual: fixed long-standing annoyance of double-dashes (as in
3221 3235 --prefix=~, for example) being stripped in the HTML version. This
3222 3236 is a latex2html bug, but a workaround was provided. Many thanks
3223 3237 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
3224 3238 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
3225 3239 rolling. This seemingly small issue had tripped a number of users
3226 3240 when first installing, so I'm glad to see it gone.
3227 3241
3228 3242 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
3229 3243
3230 3244 * IPython/Extensions/numeric_formats.py: fix missing import,
3231 3245 reported by Stephen Walton.
3232 3246
3233 3247 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
3234 3248
3235 3249 * IPython/demo.py: finish demo module, fully documented now.
3236 3250
3237 3251 * IPython/genutils.py (file_read): simple little utility to read a
3238 3252 file and ensure it's closed afterwards.
3239 3253
3240 3254 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
3241 3255
3242 3256 * IPython/demo.py (Demo.__init__): added support for individually
3243 3257 tagging blocks for automatic execution.
3244 3258
3245 3259 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
3246 3260 syntax-highlighted python sources, requested by John.
3247 3261
3248 3262 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
3249 3263
3250 3264 * IPython/demo.py (Demo.again): fix bug where again() blocks after
3251 3265 finishing.
3252 3266
3253 3267 * IPython/genutils.py (shlex_split): moved from Magic to here,
3254 3268 where all 2.2 compatibility stuff lives. I needed it for demo.py.
3255 3269
3256 3270 * IPython/demo.py (Demo.__init__): added support for silent
3257 3271 blocks, improved marks as regexps, docstrings written.
3258 3272 (Demo.__init__): better docstring, added support for sys.argv.
3259 3273
3260 3274 * IPython/genutils.py (marquee): little utility used by the demo
3261 3275 code, handy in general.
3262 3276
3263 3277 * IPython/demo.py (Demo.__init__): new class for interactive
3264 3278 demos. Not documented yet, I just wrote it in a hurry for
3265 3279 scipy'05. Will docstring later.
3266 3280
3267 3281 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
3268 3282
3269 3283 * IPython/Shell.py (sigint_handler): Drastic simplification which
3270 3284 also seems to make Ctrl-C work correctly across threads! This is
3271 3285 so simple, that I can't beleive I'd missed it before. Needs more
3272 3286 testing, though.
3273 3287 (KBINT): Never mind, revert changes. I'm sure I'd tried something
3274 3288 like this before...
3275 3289
3276 3290 * IPython/genutils.py (get_home_dir): add protection against
3277 3291 non-dirs in win32 registry.
3278 3292
3279 3293 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
3280 3294 bug where dict was mutated while iterating (pysh crash).
3281 3295
3282 3296 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
3283 3297
3284 3298 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
3285 3299 spurious newlines added by this routine. After a report by
3286 3300 F. Mantegazza.
3287 3301
3288 3302 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
3289 3303
3290 3304 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
3291 3305 calls. These were a leftover from the GTK 1.x days, and can cause
3292 3306 problems in certain cases (after a report by John Hunter).
3293 3307
3294 3308 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
3295 3309 os.getcwd() fails at init time. Thanks to patch from David Remahl
3296 3310 <chmod007-AT-mac.com>.
3297 3311 (InteractiveShell.__init__): prevent certain special magics from
3298 3312 being shadowed by aliases. Closes
3299 3313 http://www.scipy.net/roundup/ipython/issue41.
3300 3314
3301 3315 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
3302 3316
3303 3317 * IPython/iplib.py (InteractiveShell.complete): Added new
3304 3318 top-level completion method to expose the completion mechanism
3305 3319 beyond readline-based environments.
3306 3320
3307 3321 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
3308 3322
3309 3323 * tools/ipsvnc (svnversion): fix svnversion capture.
3310 3324
3311 3325 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
3312 3326 attribute to self, which was missing. Before, it was set by a
3313 3327 routine which in certain cases wasn't being called, so the
3314 3328 instance could end up missing the attribute. This caused a crash.
3315 3329 Closes http://www.scipy.net/roundup/ipython/issue40.
3316 3330
3317 3331 2005-08-16 Fernando Perez <fperez@colorado.edu>
3318 3332
3319 3333 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
3320 3334 contains non-string attribute. Closes
3321 3335 http://www.scipy.net/roundup/ipython/issue38.
3322 3336
3323 3337 2005-08-14 Fernando Perez <fperez@colorado.edu>
3324 3338
3325 3339 * tools/ipsvnc: Minor improvements, to add changeset info.
3326 3340
3327 3341 2005-08-12 Fernando Perez <fperez@colorado.edu>
3328 3342
3329 3343 * IPython/iplib.py (runsource): remove self.code_to_run_src
3330 3344 attribute. I realized this is nothing more than
3331 3345 '\n'.join(self.buffer), and having the same data in two different
3332 3346 places is just asking for synchronization bugs. This may impact
3333 3347 people who have custom exception handlers, so I need to warn
3334 3348 ipython-dev about it (F. Mantegazza may use them).
3335 3349
3336 3350 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
3337 3351
3338 3352 * IPython/genutils.py: fix 2.2 compatibility (generators)
3339 3353
3340 3354 2005-07-18 Fernando Perez <fperez@colorado.edu>
3341 3355
3342 3356 * IPython/genutils.py (get_home_dir): fix to help users with
3343 3357 invalid $HOME under win32.
3344 3358
3345 3359 2005-07-17 Fernando Perez <fperez@colorado.edu>
3346 3360
3347 3361 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
3348 3362 some old hacks and clean up a bit other routines; code should be
3349 3363 simpler and a bit faster.
3350 3364
3351 3365 * IPython/iplib.py (interact): removed some last-resort attempts
3352 3366 to survive broken stdout/stderr. That code was only making it
3353 3367 harder to abstract out the i/o (necessary for gui integration),
3354 3368 and the crashes it could prevent were extremely rare in practice
3355 3369 (besides being fully user-induced in a pretty violent manner).
3356 3370
3357 3371 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
3358 3372 Nothing major yet, but the code is simpler to read; this should
3359 3373 make it easier to do more serious modifications in the future.
3360 3374
3361 3375 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
3362 3376 which broke in .15 (thanks to a report by Ville).
3363 3377
3364 3378 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
3365 3379 be quite correct, I know next to nothing about unicode). This
3366 3380 will allow unicode strings to be used in prompts, amongst other
3367 3381 cases. It also will prevent ipython from crashing when unicode
3368 3382 shows up unexpectedly in many places. If ascii encoding fails, we
3369 3383 assume utf_8. Currently the encoding is not a user-visible
3370 3384 setting, though it could be made so if there is demand for it.
3371 3385
3372 3386 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
3373 3387
3374 3388 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
3375 3389
3376 3390 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
3377 3391
3378 3392 * IPython/genutils.py: Add 2.2 compatibility here, so all other
3379 3393 code can work transparently for 2.2/2.3.
3380 3394
3381 3395 2005-07-16 Fernando Perez <fperez@colorado.edu>
3382 3396
3383 3397 * IPython/ultraTB.py (ExceptionColors): Make a global variable
3384 3398 out of the color scheme table used for coloring exception
3385 3399 tracebacks. This allows user code to add new schemes at runtime.
3386 3400 This is a minimally modified version of the patch at
3387 3401 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
3388 3402 for the contribution.
3389 3403
3390 3404 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
3391 3405 slightly modified version of the patch in
3392 3406 http://www.scipy.net/roundup/ipython/issue34, which also allows me
3393 3407 to remove the previous try/except solution (which was costlier).
3394 3408 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
3395 3409
3396 3410 2005-06-08 Fernando Perez <fperez@colorado.edu>
3397 3411
3398 3412 * IPython/iplib.py (write/write_err): Add methods to abstract all
3399 3413 I/O a bit more.
3400 3414
3401 3415 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
3402 3416 warning, reported by Aric Hagberg, fix by JD Hunter.
3403 3417
3404 3418 2005-06-02 *** Released version 0.6.15
3405 3419
3406 3420 2005-06-01 Fernando Perez <fperez@colorado.edu>
3407 3421
3408 3422 * IPython/iplib.py (MagicCompleter.file_matches): Fix
3409 3423 tab-completion of filenames within open-quoted strings. Note that
3410 3424 this requires that in ~/.ipython/ipythonrc, users change the
3411 3425 readline delimiters configuration to read:
3412 3426
3413 3427 readline_remove_delims -/~
3414 3428
3415 3429
3416 3430 2005-05-31 *** Released version 0.6.14
3417 3431
3418 3432 2005-05-29 Fernando Perez <fperez@colorado.edu>
3419 3433
3420 3434 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
3421 3435 with files not on the filesystem. Reported by Eliyahu Sandler
3422 3436 <eli@gondolin.net>
3423 3437
3424 3438 2005-05-22 Fernando Perez <fperez@colorado.edu>
3425 3439
3426 3440 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
3427 3441 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
3428 3442
3429 3443 2005-05-19 Fernando Perez <fperez@colorado.edu>
3430 3444
3431 3445 * IPython/iplib.py (safe_execfile): close a file which could be
3432 3446 left open (causing problems in win32, which locks open files).
3433 3447 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
3434 3448
3435 3449 2005-05-18 Fernando Perez <fperez@colorado.edu>
3436 3450
3437 3451 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
3438 3452 keyword arguments correctly to safe_execfile().
3439 3453
3440 3454 2005-05-13 Fernando Perez <fperez@colorado.edu>
3441 3455
3442 3456 * ipython.1: Added info about Qt to manpage, and threads warning
3443 3457 to usage page (invoked with --help).
3444 3458
3445 3459 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
3446 3460 new matcher (it goes at the end of the priority list) to do
3447 3461 tab-completion on named function arguments. Submitted by George
3448 3462 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
3449 3463 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
3450 3464 for more details.
3451 3465
3452 3466 * IPython/Magic.py (magic_run): Added new -e flag to ignore
3453 3467 SystemExit exceptions in the script being run. Thanks to a report
3454 3468 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
3455 3469 producing very annoying behavior when running unit tests.
3456 3470
3457 3471 2005-05-12 Fernando Perez <fperez@colorado.edu>
3458 3472
3459 3473 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
3460 3474 which I'd broken (again) due to a changed regexp. In the process,
3461 3475 added ';' as an escape to auto-quote the whole line without
3462 3476 splitting its arguments. Thanks to a report by Jerry McRae
3463 3477 <qrs0xyc02-AT-sneakemail.com>.
3464 3478
3465 3479 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
3466 3480 possible crashes caused by a TokenError. Reported by Ed Schofield
3467 3481 <schofield-AT-ftw.at>.
3468 3482
3469 3483 2005-05-06 Fernando Perez <fperez@colorado.edu>
3470 3484
3471 3485 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
3472 3486
3473 3487 2005-04-29 Fernando Perez <fperez@colorado.edu>
3474 3488
3475 3489 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
3476 3490 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
3477 3491 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
3478 3492 which provides support for Qt interactive usage (similar to the
3479 3493 existing one for WX and GTK). This had been often requested.
3480 3494
3481 3495 2005-04-14 *** Released version 0.6.13
3482 3496
3483 3497 2005-04-08 Fernando Perez <fperez@colorado.edu>
3484 3498
3485 3499 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
3486 3500 from _ofind, which gets called on almost every input line. Now,
3487 3501 we only try to get docstrings if they are actually going to be
3488 3502 used (the overhead of fetching unnecessary docstrings can be
3489 3503 noticeable for certain objects, such as Pyro proxies).
3490 3504
3491 3505 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
3492 3506 for completers. For some reason I had been passing them the state
3493 3507 variable, which completers never actually need, and was in
3494 3508 conflict with the rlcompleter API. Custom completers ONLY need to
3495 3509 take the text parameter.
3496 3510
3497 3511 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
3498 3512 work correctly in pysh. I've also moved all the logic which used
3499 3513 to be in pysh.py here, which will prevent problems with future
3500 3514 upgrades. However, this time I must warn users to update their
3501 3515 pysh profile to include the line
3502 3516
3503 3517 import_all IPython.Extensions.InterpreterExec
3504 3518
3505 3519 because otherwise things won't work for them. They MUST also
3506 3520 delete pysh.py and the line
3507 3521
3508 3522 execfile pysh.py
3509 3523
3510 3524 from their ipythonrc-pysh.
3511 3525
3512 3526 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
3513 3527 robust in the face of objects whose dir() returns non-strings
3514 3528 (which it shouldn't, but some broken libs like ITK do). Thanks to
3515 3529 a patch by John Hunter (implemented differently, though). Also
3516 3530 minor improvements by using .extend instead of + on lists.
3517 3531
3518 3532 * pysh.py:
3519 3533
3520 3534 2005-04-06 Fernando Perez <fperez@colorado.edu>
3521 3535
3522 3536 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
3523 3537 by default, so that all users benefit from it. Those who don't
3524 3538 want it can still turn it off.
3525 3539
3526 3540 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
3527 3541 config file, I'd forgotten about this, so users were getting it
3528 3542 off by default.
3529 3543
3530 3544 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
3531 3545 consistency. Now magics can be called in multiline statements,
3532 3546 and python variables can be expanded in magic calls via $var.
3533 3547 This makes the magic system behave just like aliases or !system
3534 3548 calls.
3535 3549
3536 3550 2005-03-28 Fernando Perez <fperez@colorado.edu>
3537 3551
3538 3552 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
3539 3553 expensive string additions for building command. Add support for
3540 3554 trailing ';' when autocall is used.
3541 3555
3542 3556 2005-03-26 Fernando Perez <fperez@colorado.edu>
3543 3557
3544 3558 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
3545 3559 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
3546 3560 ipython.el robust against prompts with any number of spaces
3547 3561 (including 0) after the ':' character.
3548 3562
3549 3563 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
3550 3564 continuation prompt, which misled users to think the line was
3551 3565 already indented. Closes debian Bug#300847, reported to me by
3552 3566 Norbert Tretkowski <tretkowski-AT-inittab.de>.
3553 3567
3554 3568 2005-03-23 Fernando Perez <fperez@colorado.edu>
3555 3569
3556 3570 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
3557 3571 properly aligned if they have embedded newlines.
3558 3572
3559 3573 * IPython/iplib.py (runlines): Add a public method to expose
3560 3574 IPython's code execution machinery, so that users can run strings
3561 3575 as if they had been typed at the prompt interactively.
3562 3576 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
3563 3577 methods which can call the system shell, but with python variable
3564 3578 expansion. The three such methods are: __IPYTHON__.system,
3565 3579 .getoutput and .getoutputerror. These need to be documented in a
3566 3580 'public API' section (to be written) of the manual.
3567 3581
3568 3582 2005-03-20 Fernando Perez <fperez@colorado.edu>
3569 3583
3570 3584 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
3571 3585 for custom exception handling. This is quite powerful, and it
3572 3586 allows for user-installable exception handlers which can trap
3573 3587 custom exceptions at runtime and treat them separately from
3574 3588 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
3575 3589 Mantegazza <mantegazza-AT-ill.fr>.
3576 3590 (InteractiveShell.set_custom_completer): public API function to
3577 3591 add new completers at runtime.
3578 3592
3579 3593 2005-03-19 Fernando Perez <fperez@colorado.edu>
3580 3594
3581 3595 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3582 3596 allow objects which provide their docstrings via non-standard
3583 3597 mechanisms (like Pyro proxies) to still be inspected by ipython's
3584 3598 ? system.
3585 3599
3586 3600 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3587 3601 automatic capture system. I tried quite hard to make it work
3588 3602 reliably, and simply failed. I tried many combinations with the
3589 3603 subprocess module, but eventually nothing worked in all needed
3590 3604 cases (not blocking stdin for the child, duplicating stdout
3591 3605 without blocking, etc). The new %sc/%sx still do capture to these
3592 3606 magical list/string objects which make shell use much more
3593 3607 conveninent, so not all is lost.
3594 3608
3595 3609 XXX - FIX MANUAL for the change above!
3596 3610
3597 3611 (runsource): I copied code.py's runsource() into ipython to modify
3598 3612 it a bit. Now the code object and source to be executed are
3599 3613 stored in ipython. This makes this info accessible to third-party
3600 3614 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
3601 3615 Mantegazza <mantegazza-AT-ill.fr>.
3602 3616
3603 3617 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3604 3618 history-search via readline (like C-p/C-n). I'd wanted this for a
3605 3619 long time, but only recently found out how to do it. For users
3606 3620 who already have their ipythonrc files made and want this, just
3607 3621 add:
3608 3622
3609 3623 readline_parse_and_bind "\e[A": history-search-backward
3610 3624 readline_parse_and_bind "\e[B": history-search-forward
3611 3625
3612 3626 2005-03-18 Fernando Perez <fperez@colorado.edu>
3613 3627
3614 3628 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3615 3629 LSString and SList classes which allow transparent conversions
3616 3630 between list mode and whitespace-separated string.
3617 3631 (magic_r): Fix recursion problem in %r.
3618 3632
3619 3633 * IPython/genutils.py (LSString): New class to be used for
3620 3634 automatic storage of the results of all alias/system calls in _o
3621 3635 and _e (stdout/err). These provide a .l/.list attribute which
3622 3636 does automatic splitting on newlines. This means that for most
3623 3637 uses, you'll never need to do capturing of output with %sc/%sx
3624 3638 anymore, since ipython keeps this always done for you. Note that
3625 3639 only the LAST results are stored, the _o/e variables are
3626 3640 overwritten on each call. If you need to save their contents
3627 3641 further, simply bind them to any other name.
3628 3642
3629 3643 2005-03-17 Fernando Perez <fperez@colorado.edu>
3630 3644
3631 3645 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3632 3646 prompt namespace handling.
3633 3647
3634 3648 2005-03-16 Fernando Perez <fperez@colorado.edu>
3635 3649
3636 3650 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3637 3651 classic prompts to be '>>> ' (final space was missing, and it
3638 3652 trips the emacs python mode).
3639 3653 (BasePrompt.__str__): Added safe support for dynamic prompt
3640 3654 strings. Now you can set your prompt string to be '$x', and the
3641 3655 value of x will be printed from your interactive namespace. The
3642 3656 interpolation syntax includes the full Itpl support, so
3643 3657 ${foo()+x+bar()} is a valid prompt string now, and the function
3644 3658 calls will be made at runtime.
3645 3659
3646 3660 2005-03-15 Fernando Perez <fperez@colorado.edu>
3647 3661
3648 3662 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3649 3663 avoid name clashes in pylab. %hist still works, it just forwards
3650 3664 the call to %history.
3651 3665
3652 3666 2005-03-02 *** Released version 0.6.12
3653 3667
3654 3668 2005-03-02 Fernando Perez <fperez@colorado.edu>
3655 3669
3656 3670 * IPython/iplib.py (handle_magic): log magic calls properly as
3657 3671 ipmagic() function calls.
3658 3672
3659 3673 * IPython/Magic.py (magic_time): Improved %time to support
3660 3674 statements and provide wall-clock as well as CPU time.
3661 3675
3662 3676 2005-02-27 Fernando Perez <fperez@colorado.edu>
3663 3677
3664 3678 * IPython/hooks.py: New hooks module, to expose user-modifiable
3665 3679 IPython functionality in a clean manner. For now only the editor
3666 3680 hook is actually written, and other thigns which I intend to turn
3667 3681 into proper hooks aren't yet there. The display and prefilter
3668 3682 stuff, for example, should be hooks. But at least now the
3669 3683 framework is in place, and the rest can be moved here with more
3670 3684 time later. IPython had had a .hooks variable for a long time for
3671 3685 this purpose, but I'd never actually used it for anything.
3672 3686
3673 3687 2005-02-26 Fernando Perez <fperez@colorado.edu>
3674 3688
3675 3689 * IPython/ipmaker.py (make_IPython): make the default ipython
3676 3690 directory be called _ipython under win32, to follow more the
3677 3691 naming peculiarities of that platform (where buggy software like
3678 3692 Visual Sourcesafe breaks with .named directories). Reported by
3679 3693 Ville Vainio.
3680 3694
3681 3695 2005-02-23 Fernando Perez <fperez@colorado.edu>
3682 3696
3683 3697 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3684 3698 auto_aliases for win32 which were causing problems. Users can
3685 3699 define the ones they personally like.
3686 3700
3687 3701 2005-02-21 Fernando Perez <fperez@colorado.edu>
3688 3702
3689 3703 * IPython/Magic.py (magic_time): new magic to time execution of
3690 3704 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3691 3705
3692 3706 2005-02-19 Fernando Perez <fperez@colorado.edu>
3693 3707
3694 3708 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3695 3709 into keys (for prompts, for example).
3696 3710
3697 3711 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3698 3712 prompts in case users want them. This introduces a small behavior
3699 3713 change: ipython does not automatically add a space to all prompts
3700 3714 anymore. To get the old prompts with a space, users should add it
3701 3715 manually to their ipythonrc file, so for example prompt_in1 should
3702 3716 now read 'In [\#]: ' instead of 'In [\#]:'.
3703 3717 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3704 3718 file) to control left-padding of secondary prompts.
3705 3719
3706 3720 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3707 3721 the profiler can't be imported. Fix for Debian, which removed
3708 3722 profile.py because of License issues. I applied a slightly
3709 3723 modified version of the original Debian patch at
3710 3724 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3711 3725
3712 3726 2005-02-17 Fernando Perez <fperez@colorado.edu>
3713 3727
3714 3728 * IPython/genutils.py (native_line_ends): Fix bug which would
3715 3729 cause improper line-ends under win32 b/c I was not opening files
3716 3730 in binary mode. Bug report and fix thanks to Ville.
3717 3731
3718 3732 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3719 3733 trying to catch spurious foo[1] autocalls. My fix actually broke
3720 3734 ',/' autoquote/call with explicit escape (bad regexp).
3721 3735
3722 3736 2005-02-15 *** Released version 0.6.11
3723 3737
3724 3738 2005-02-14 Fernando Perez <fperez@colorado.edu>
3725 3739
3726 3740 * IPython/background_jobs.py: New background job management
3727 3741 subsystem. This is implemented via a new set of classes, and
3728 3742 IPython now provides a builtin 'jobs' object for background job
3729 3743 execution. A convenience %bg magic serves as a lightweight
3730 3744 frontend for starting the more common type of calls. This was
3731 3745 inspired by discussions with B. Granger and the BackgroundCommand
3732 3746 class described in the book Python Scripting for Computational
3733 3747 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3734 3748 (although ultimately no code from this text was used, as IPython's
3735 3749 system is a separate implementation).
3736 3750
3737 3751 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3738 3752 to control the completion of single/double underscore names
3739 3753 separately. As documented in the example ipytonrc file, the
3740 3754 readline_omit__names variable can now be set to 2, to omit even
3741 3755 single underscore names. Thanks to a patch by Brian Wong
3742 3756 <BrianWong-AT-AirgoNetworks.Com>.
3743 3757 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3744 3758 be autocalled as foo([1]) if foo were callable. A problem for
3745 3759 things which are both callable and implement __getitem__.
3746 3760 (init_readline): Fix autoindentation for win32. Thanks to a patch
3747 3761 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3748 3762
3749 3763 2005-02-12 Fernando Perez <fperez@colorado.edu>
3750 3764
3751 3765 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3752 3766 which I had written long ago to sort out user error messages which
3753 3767 may occur during startup. This seemed like a good idea initially,
3754 3768 but it has proven a disaster in retrospect. I don't want to
3755 3769 change much code for now, so my fix is to set the internal 'debug'
3756 3770 flag to true everywhere, whose only job was precisely to control
3757 3771 this subsystem. This closes issue 28 (as well as avoiding all
3758 3772 sorts of strange hangups which occur from time to time).
3759 3773
3760 3774 2005-02-07 Fernando Perez <fperez@colorado.edu>
3761 3775
3762 3776 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3763 3777 previous call produced a syntax error.
3764 3778
3765 3779 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3766 3780 classes without constructor.
3767 3781
3768 3782 2005-02-06 Fernando Perez <fperez@colorado.edu>
3769 3783
3770 3784 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3771 3785 completions with the results of each matcher, so we return results
3772 3786 to the user from all namespaces. This breaks with ipython
3773 3787 tradition, but I think it's a nicer behavior. Now you get all
3774 3788 possible completions listed, from all possible namespaces (python,
3775 3789 filesystem, magics...) After a request by John Hunter
3776 3790 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3777 3791
3778 3792 2005-02-05 Fernando Perez <fperez@colorado.edu>
3779 3793
3780 3794 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3781 3795 the call had quote characters in it (the quotes were stripped).
3782 3796
3783 3797 2005-01-31 Fernando Perez <fperez@colorado.edu>
3784 3798
3785 3799 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3786 3800 Itpl.itpl() to make the code more robust against psyco
3787 3801 optimizations.
3788 3802
3789 3803 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3790 3804 of causing an exception. Quicker, cleaner.
3791 3805
3792 3806 2005-01-28 Fernando Perez <fperez@colorado.edu>
3793 3807
3794 3808 * scripts/ipython_win_post_install.py (install): hardcode
3795 3809 sys.prefix+'python.exe' as the executable path. It turns out that
3796 3810 during the post-installation run, sys.executable resolves to the
3797 3811 name of the binary installer! I should report this as a distutils
3798 3812 bug, I think. I updated the .10 release with this tiny fix, to
3799 3813 avoid annoying the lists further.
3800 3814
3801 3815 2005-01-27 *** Released version 0.6.10
3802 3816
3803 3817 2005-01-27 Fernando Perez <fperez@colorado.edu>
3804 3818
3805 3819 * IPython/numutils.py (norm): Added 'inf' as optional name for
3806 3820 L-infinity norm, included references to mathworld.com for vector
3807 3821 norm definitions.
3808 3822 (amin/amax): added amin/amax for array min/max. Similar to what
3809 3823 pylab ships with after the recent reorganization of names.
3810 3824 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3811 3825
3812 3826 * ipython.el: committed Alex's recent fixes and improvements.
3813 3827 Tested with python-mode from CVS, and it looks excellent. Since
3814 3828 python-mode hasn't released anything in a while, I'm temporarily
3815 3829 putting a copy of today's CVS (v 4.70) of python-mode in:
3816 3830 http://ipython.scipy.org/tmp/python-mode.el
3817 3831
3818 3832 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3819 3833 sys.executable for the executable name, instead of assuming it's
3820 3834 called 'python.exe' (the post-installer would have produced broken
3821 3835 setups on systems with a differently named python binary).
3822 3836
3823 3837 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3824 3838 references to os.linesep, to make the code more
3825 3839 platform-independent. This is also part of the win32 coloring
3826 3840 fixes.
3827 3841
3828 3842 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3829 3843 lines, which actually cause coloring bugs because the length of
3830 3844 the line is very difficult to correctly compute with embedded
3831 3845 escapes. This was the source of all the coloring problems under
3832 3846 Win32. I think that _finally_, Win32 users have a properly
3833 3847 working ipython in all respects. This would never have happened
3834 3848 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3835 3849
3836 3850 2005-01-26 *** Released version 0.6.9
3837 3851
3838 3852 2005-01-25 Fernando Perez <fperez@colorado.edu>
3839 3853
3840 3854 * setup.py: finally, we have a true Windows installer, thanks to
3841 3855 the excellent work of Viktor Ransmayr
3842 3856 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3843 3857 Windows users. The setup routine is quite a bit cleaner thanks to
3844 3858 this, and the post-install script uses the proper functions to
3845 3859 allow a clean de-installation using the standard Windows Control
3846 3860 Panel.
3847 3861
3848 3862 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3849 3863 environment variable under all OSes (including win32) if
3850 3864 available. This will give consistency to win32 users who have set
3851 3865 this variable for any reason. If os.environ['HOME'] fails, the
3852 3866 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3853 3867
3854 3868 2005-01-24 Fernando Perez <fperez@colorado.edu>
3855 3869
3856 3870 * IPython/numutils.py (empty_like): add empty_like(), similar to
3857 3871 zeros_like() but taking advantage of the new empty() Numeric routine.
3858 3872
3859 3873 2005-01-23 *** Released version 0.6.8
3860 3874
3861 3875 2005-01-22 Fernando Perez <fperez@colorado.edu>
3862 3876
3863 3877 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3864 3878 automatic show() calls. After discussing things with JDH, it
3865 3879 turns out there are too many corner cases where this can go wrong.
3866 3880 It's best not to try to be 'too smart', and simply have ipython
3867 3881 reproduce as much as possible the default behavior of a normal
3868 3882 python shell.
3869 3883
3870 3884 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3871 3885 line-splitting regexp and _prefilter() to avoid calling getattr()
3872 3886 on assignments. This closes
3873 3887 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3874 3888 readline uses getattr(), so a simple <TAB> keypress is still
3875 3889 enough to trigger getattr() calls on an object.
3876 3890
3877 3891 2005-01-21 Fernando Perez <fperez@colorado.edu>
3878 3892
3879 3893 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3880 3894 docstring under pylab so it doesn't mask the original.
3881 3895
3882 3896 2005-01-21 *** Released version 0.6.7
3883 3897
3884 3898 2005-01-21 Fernando Perez <fperez@colorado.edu>
3885 3899
3886 3900 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3887 3901 signal handling for win32 users in multithreaded mode.
3888 3902
3889 3903 2005-01-17 Fernando Perez <fperez@colorado.edu>
3890 3904
3891 3905 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3892 3906 instances with no __init__. After a crash report by Norbert Nemec
3893 3907 <Norbert-AT-nemec-online.de>.
3894 3908
3895 3909 2005-01-14 Fernando Perez <fperez@colorado.edu>
3896 3910
3897 3911 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3898 3912 names for verbose exceptions, when multiple dotted names and the
3899 3913 'parent' object were present on the same line.
3900 3914
3901 3915 2005-01-11 Fernando Perez <fperez@colorado.edu>
3902 3916
3903 3917 * IPython/genutils.py (flag_calls): new utility to trap and flag
3904 3918 calls in functions. I need it to clean up matplotlib support.
3905 3919 Also removed some deprecated code in genutils.
3906 3920
3907 3921 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3908 3922 that matplotlib scripts called with %run, which don't call show()
3909 3923 themselves, still have their plotting windows open.
3910 3924
3911 3925 2005-01-05 Fernando Perez <fperez@colorado.edu>
3912 3926
3913 3927 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3914 3928 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3915 3929
3916 3930 2004-12-19 Fernando Perez <fperez@colorado.edu>
3917 3931
3918 3932 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3919 3933 parent_runcode, which was an eyesore. The same result can be
3920 3934 obtained with Python's regular superclass mechanisms.
3921 3935
3922 3936 2004-12-17 Fernando Perez <fperez@colorado.edu>
3923 3937
3924 3938 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3925 3939 reported by Prabhu.
3926 3940 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3927 3941 sys.stderr) instead of explicitly calling sys.stderr. This helps
3928 3942 maintain our I/O abstractions clean, for future GUI embeddings.
3929 3943
3930 3944 * IPython/genutils.py (info): added new utility for sys.stderr
3931 3945 unified info message handling (thin wrapper around warn()).
3932 3946
3933 3947 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3934 3948 composite (dotted) names on verbose exceptions.
3935 3949 (VerboseTB.nullrepr): harden against another kind of errors which
3936 3950 Python's inspect module can trigger, and which were crashing
3937 3951 IPython. Thanks to a report by Marco Lombardi
3938 3952 <mlombard-AT-ma010192.hq.eso.org>.
3939 3953
3940 3954 2004-12-13 *** Released version 0.6.6
3941 3955
3942 3956 2004-12-12 Fernando Perez <fperez@colorado.edu>
3943 3957
3944 3958 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3945 3959 generated by pygtk upon initialization if it was built without
3946 3960 threads (for matplotlib users). After a crash reported by
3947 3961 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3948 3962
3949 3963 * IPython/ipmaker.py (make_IPython): fix small bug in the
3950 3964 import_some parameter for multiple imports.
3951 3965
3952 3966 * IPython/iplib.py (ipmagic): simplified the interface of
3953 3967 ipmagic() to take a single string argument, just as it would be
3954 3968 typed at the IPython cmd line.
3955 3969 (ipalias): Added new ipalias() with an interface identical to
3956 3970 ipmagic(). This completes exposing a pure python interface to the
3957 3971 alias and magic system, which can be used in loops or more complex
3958 3972 code where IPython's automatic line mangling is not active.
3959 3973
3960 3974 * IPython/genutils.py (timing): changed interface of timing to
3961 3975 simply run code once, which is the most common case. timings()
3962 3976 remains unchanged, for the cases where you want multiple runs.
3963 3977
3964 3978 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3965 3979 bug where Python2.2 crashes with exec'ing code which does not end
3966 3980 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3967 3981 before.
3968 3982
3969 3983 2004-12-10 Fernando Perez <fperez@colorado.edu>
3970 3984
3971 3985 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3972 3986 -t to -T, to accomodate the new -t flag in %run (the %run and
3973 3987 %prun options are kind of intermixed, and it's not easy to change
3974 3988 this with the limitations of python's getopt).
3975 3989
3976 3990 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3977 3991 the execution of scripts. It's not as fine-tuned as timeit.py,
3978 3992 but it works from inside ipython (and under 2.2, which lacks
3979 3993 timeit.py). Optionally a number of runs > 1 can be given for
3980 3994 timing very short-running code.
3981 3995
3982 3996 * IPython/genutils.py (uniq_stable): new routine which returns a
3983 3997 list of unique elements in any iterable, but in stable order of
3984 3998 appearance. I needed this for the ultraTB fixes, and it's a handy
3985 3999 utility.
3986 4000
3987 4001 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3988 4002 dotted names in Verbose exceptions. This had been broken since
3989 4003 the very start, now x.y will properly be printed in a Verbose
3990 4004 traceback, instead of x being shown and y appearing always as an
3991 4005 'undefined global'. Getting this to work was a bit tricky,
3992 4006 because by default python tokenizers are stateless. Saved by
3993 4007 python's ability to easily add a bit of state to an arbitrary
3994 4008 function (without needing to build a full-blown callable object).
3995 4009
3996 4010 Also big cleanup of this code, which had horrendous runtime
3997 4011 lookups of zillions of attributes for colorization. Moved all
3998 4012 this code into a few templates, which make it cleaner and quicker.
3999 4013
4000 4014 Printout quality was also improved for Verbose exceptions: one
4001 4015 variable per line, and memory addresses are printed (this can be
4002 4016 quite handy in nasty debugging situations, which is what Verbose
4003 4017 is for).
4004 4018
4005 4019 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
4006 4020 the command line as scripts to be loaded by embedded instances.
4007 4021 Doing so has the potential for an infinite recursion if there are
4008 4022 exceptions thrown in the process. This fixes a strange crash
4009 4023 reported by Philippe MULLER <muller-AT-irit.fr>.
4010 4024
4011 4025 2004-12-09 Fernando Perez <fperez@colorado.edu>
4012 4026
4013 4027 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
4014 4028 to reflect new names in matplotlib, which now expose the
4015 4029 matlab-compatible interface via a pylab module instead of the
4016 4030 'matlab' name. The new code is backwards compatible, so users of
4017 4031 all matplotlib versions are OK. Patch by J. Hunter.
4018 4032
4019 4033 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
4020 4034 of __init__ docstrings for instances (class docstrings are already
4021 4035 automatically printed). Instances with customized docstrings
4022 4036 (indep. of the class) are also recognized and all 3 separate
4023 4037 docstrings are printed (instance, class, constructor). After some
4024 4038 comments/suggestions by J. Hunter.
4025 4039
4026 4040 2004-12-05 Fernando Perez <fperez@colorado.edu>
4027 4041
4028 4042 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
4029 4043 warnings when tab-completion fails and triggers an exception.
4030 4044
4031 4045 2004-12-03 Fernando Perez <fperez@colorado.edu>
4032 4046
4033 4047 * IPython/Magic.py (magic_prun): Fix bug where an exception would
4034 4048 be triggered when using 'run -p'. An incorrect option flag was
4035 4049 being set ('d' instead of 'D').
4036 4050 (manpage): fix missing escaped \- sign.
4037 4051
4038 4052 2004-11-30 *** Released version 0.6.5
4039 4053
4040 4054 2004-11-30 Fernando Perez <fperez@colorado.edu>
4041 4055
4042 4056 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
4043 4057 setting with -d option.
4044 4058
4045 4059 * setup.py (docfiles): Fix problem where the doc glob I was using
4046 4060 was COMPLETELY BROKEN. It was giving the right files by pure
4047 4061 accident, but failed once I tried to include ipython.el. Note:
4048 4062 glob() does NOT allow you to do exclusion on multiple endings!
4049 4063
4050 4064 2004-11-29 Fernando Perez <fperez@colorado.edu>
4051 4065
4052 4066 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
4053 4067 the manpage as the source. Better formatting & consistency.
4054 4068
4055 4069 * IPython/Magic.py (magic_run): Added new -d option, to run
4056 4070 scripts under the control of the python pdb debugger. Note that
4057 4071 this required changing the %prun option -d to -D, to avoid a clash
4058 4072 (since %run must pass options to %prun, and getopt is too dumb to
4059 4073 handle options with string values with embedded spaces). Thanks
4060 4074 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
4061 4075 (magic_who_ls): added type matching to %who and %whos, so that one
4062 4076 can filter their output to only include variables of certain
4063 4077 types. Another suggestion by Matthew.
4064 4078 (magic_whos): Added memory summaries in kb and Mb for arrays.
4065 4079 (magic_who): Improve formatting (break lines every 9 vars).
4066 4080
4067 4081 2004-11-28 Fernando Perez <fperez@colorado.edu>
4068 4082
4069 4083 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
4070 4084 cache when empty lines were present.
4071 4085
4072 4086 2004-11-24 Fernando Perez <fperez@colorado.edu>
4073 4087
4074 4088 * IPython/usage.py (__doc__): document the re-activated threading
4075 4089 options for WX and GTK.
4076 4090
4077 4091 2004-11-23 Fernando Perez <fperez@colorado.edu>
4078 4092
4079 4093 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
4080 4094 the -wthread and -gthread options, along with a new -tk one to try
4081 4095 and coordinate Tk threading with wx/gtk. The tk support is very
4082 4096 platform dependent, since it seems to require Tcl and Tk to be
4083 4097 built with threads (Fedora1/2 appears NOT to have it, but in
4084 4098 Prabhu's Debian boxes it works OK). But even with some Tk
4085 4099 limitations, this is a great improvement.
4086 4100
4087 4101 * IPython/Prompts.py (prompt_specials_color): Added \t for time
4088 4102 info in user prompts. Patch by Prabhu.
4089 4103
4090 4104 2004-11-18 Fernando Perez <fperez@colorado.edu>
4091 4105
4092 4106 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
4093 4107 EOFErrors and bail, to avoid infinite loops if a non-terminating
4094 4108 file is fed into ipython. Patch submitted in issue 19 by user,
4095 4109 many thanks.
4096 4110
4097 4111 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
4098 4112 autoquote/parens in continuation prompts, which can cause lots of
4099 4113 problems. Closes roundup issue 20.
4100 4114
4101 4115 2004-11-17 Fernando Perez <fperez@colorado.edu>
4102 4116
4103 4117 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
4104 4118 reported as debian bug #280505. I'm not sure my local changelog
4105 4119 entry has the proper debian format (Jack?).
4106 4120
4107 4121 2004-11-08 *** Released version 0.6.4
4108 4122
4109 4123 2004-11-08 Fernando Perez <fperez@colorado.edu>
4110 4124
4111 4125 * IPython/iplib.py (init_readline): Fix exit message for Windows
4112 4126 when readline is active. Thanks to a report by Eric Jones
4113 4127 <eric-AT-enthought.com>.
4114 4128
4115 4129 2004-11-07 Fernando Perez <fperez@colorado.edu>
4116 4130
4117 4131 * IPython/genutils.py (page): Add a trap for OSError exceptions,
4118 4132 sometimes seen by win2k/cygwin users.
4119 4133
4120 4134 2004-11-06 Fernando Perez <fperez@colorado.edu>
4121 4135
4122 4136 * IPython/iplib.py (interact): Change the handling of %Exit from
4123 4137 trying to propagate a SystemExit to an internal ipython flag.
4124 4138 This is less elegant than using Python's exception mechanism, but
4125 4139 I can't get that to work reliably with threads, so under -pylab
4126 4140 %Exit was hanging IPython. Cross-thread exception handling is
4127 4141 really a bitch. Thaks to a bug report by Stephen Walton
4128 4142 <stephen.walton-AT-csun.edu>.
4129 4143
4130 4144 2004-11-04 Fernando Perez <fperez@colorado.edu>
4131 4145
4132 4146 * IPython/iplib.py (raw_input_original): store a pointer to the
4133 4147 true raw_input to harden against code which can modify it
4134 4148 (wx.py.PyShell does this and would otherwise crash ipython).
4135 4149 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
4136 4150
4137 4151 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
4138 4152 Ctrl-C problem, which does not mess up the input line.
4139 4153
4140 4154 2004-11-03 Fernando Perez <fperez@colorado.edu>
4141 4155
4142 4156 * IPython/Release.py: Changed licensing to BSD, in all files.
4143 4157 (name): lowercase name for tarball/RPM release.
4144 4158
4145 4159 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
4146 4160 use throughout ipython.
4147 4161
4148 4162 * IPython/Magic.py (Magic._ofind): Switch to using the new
4149 4163 OInspect.getdoc() function.
4150 4164
4151 4165 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
4152 4166 of the line currently being canceled via Ctrl-C. It's extremely
4153 4167 ugly, but I don't know how to do it better (the problem is one of
4154 4168 handling cross-thread exceptions).
4155 4169
4156 4170 2004-10-28 Fernando Perez <fperez@colorado.edu>
4157 4171
4158 4172 * IPython/Shell.py (signal_handler): add signal handlers to trap
4159 4173 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
4160 4174 report by Francesc Alted.
4161 4175
4162 4176 2004-10-21 Fernando Perez <fperez@colorado.edu>
4163 4177
4164 4178 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
4165 4179 to % for pysh syntax extensions.
4166 4180
4167 4181 2004-10-09 Fernando Perez <fperez@colorado.edu>
4168 4182
4169 4183 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
4170 4184 arrays to print a more useful summary, without calling str(arr).
4171 4185 This avoids the problem of extremely lengthy computations which
4172 4186 occur if arr is large, and appear to the user as a system lockup
4173 4187 with 100% cpu activity. After a suggestion by Kristian Sandberg
4174 4188 <Kristian.Sandberg@colorado.edu>.
4175 4189 (Magic.__init__): fix bug in global magic escapes not being
4176 4190 correctly set.
4177 4191
4178 4192 2004-10-08 Fernando Perez <fperez@colorado.edu>
4179 4193
4180 4194 * IPython/Magic.py (__license__): change to absolute imports of
4181 4195 ipython's own internal packages, to start adapting to the absolute
4182 4196 import requirement of PEP-328.
4183 4197
4184 4198 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
4185 4199 files, and standardize author/license marks through the Release
4186 4200 module instead of having per/file stuff (except for files with
4187 4201 particular licenses, like the MIT/PSF-licensed codes).
4188 4202
4189 4203 * IPython/Debugger.py: remove dead code for python 2.1
4190 4204
4191 4205 2004-10-04 Fernando Perez <fperez@colorado.edu>
4192 4206
4193 4207 * IPython/iplib.py (ipmagic): New function for accessing magics
4194 4208 via a normal python function call.
4195 4209
4196 4210 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
4197 4211 from '@' to '%', to accomodate the new @decorator syntax of python
4198 4212 2.4.
4199 4213
4200 4214 2004-09-29 Fernando Perez <fperez@colorado.edu>
4201 4215
4202 4216 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
4203 4217 matplotlib.use to prevent running scripts which try to switch
4204 4218 interactive backends from within ipython. This will just crash
4205 4219 the python interpreter, so we can't allow it (but a detailed error
4206 4220 is given to the user).
4207 4221
4208 4222 2004-09-28 Fernando Perez <fperez@colorado.edu>
4209 4223
4210 4224 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
4211 4225 matplotlib-related fixes so that using @run with non-matplotlib
4212 4226 scripts doesn't pop up spurious plot windows. This requires
4213 4227 matplotlib >= 0.63, where I had to make some changes as well.
4214 4228
4215 4229 * IPython/ipmaker.py (make_IPython): update version requirement to
4216 4230 python 2.2.
4217 4231
4218 4232 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
4219 4233 banner arg for embedded customization.
4220 4234
4221 4235 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
4222 4236 explicit uses of __IP as the IPython's instance name. Now things
4223 4237 are properly handled via the shell.name value. The actual code
4224 4238 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
4225 4239 is much better than before. I'll clean things completely when the
4226 4240 magic stuff gets a real overhaul.
4227 4241
4228 4242 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
4229 4243 minor changes to debian dir.
4230 4244
4231 4245 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
4232 4246 pointer to the shell itself in the interactive namespace even when
4233 4247 a user-supplied dict is provided. This is needed for embedding
4234 4248 purposes (found by tests with Michel Sanner).
4235 4249
4236 4250 2004-09-27 Fernando Perez <fperez@colorado.edu>
4237 4251
4238 4252 * IPython/UserConfig/ipythonrc: remove []{} from
4239 4253 readline_remove_delims, so that things like [modname.<TAB> do
4240 4254 proper completion. This disables [].TAB, but that's a less common
4241 4255 case than module names in list comprehensions, for example.
4242 4256 Thanks to a report by Andrea Riciputi.
4243 4257
4244 4258 2004-09-09 Fernando Perez <fperez@colorado.edu>
4245 4259
4246 4260 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
4247 4261 blocking problems in win32 and osx. Fix by John.
4248 4262
4249 4263 2004-09-08 Fernando Perez <fperez@colorado.edu>
4250 4264
4251 4265 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
4252 4266 for Win32 and OSX. Fix by John Hunter.
4253 4267
4254 4268 2004-08-30 *** Released version 0.6.3
4255 4269
4256 4270 2004-08-30 Fernando Perez <fperez@colorado.edu>
4257 4271
4258 4272 * setup.py (isfile): Add manpages to list of dependent files to be
4259 4273 updated.
4260 4274
4261 4275 2004-08-27 Fernando Perez <fperez@colorado.edu>
4262 4276
4263 4277 * IPython/Shell.py (start): I've disabled -wthread and -gthread
4264 4278 for now. They don't really work with standalone WX/GTK code
4265 4279 (though matplotlib IS working fine with both of those backends).
4266 4280 This will neeed much more testing. I disabled most things with
4267 4281 comments, so turning it back on later should be pretty easy.
4268 4282
4269 4283 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
4270 4284 autocalling of expressions like r'foo', by modifying the line
4271 4285 split regexp. Closes
4272 4286 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
4273 4287 Riley <ipythonbugs-AT-sabi.net>.
4274 4288 (InteractiveShell.mainloop): honor --nobanner with banner
4275 4289 extensions.
4276 4290
4277 4291 * IPython/Shell.py: Significant refactoring of all classes, so
4278 4292 that we can really support ALL matplotlib backends and threading
4279 4293 models (John spotted a bug with Tk which required this). Now we
4280 4294 should support single-threaded, WX-threads and GTK-threads, both
4281 4295 for generic code and for matplotlib.
4282 4296
4283 4297 * IPython/ipmaker.py (__call__): Changed -mpthread option to
4284 4298 -pylab, to simplify things for users. Will also remove the pylab
4285 4299 profile, since now all of matplotlib configuration is directly
4286 4300 handled here. This also reduces startup time.
4287 4301
4288 4302 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
4289 4303 shell wasn't being correctly called. Also in IPShellWX.
4290 4304
4291 4305 * IPython/iplib.py (InteractiveShell.__init__): Added option to
4292 4306 fine-tune banner.
4293 4307
4294 4308 * IPython/numutils.py (spike): Deprecate these spike functions,
4295 4309 delete (long deprecated) gnuplot_exec handler.
4296 4310
4297 4311 2004-08-26 Fernando Perez <fperez@colorado.edu>
4298 4312
4299 4313 * ipython.1: Update for threading options, plus some others which
4300 4314 were missing.
4301 4315
4302 4316 * IPython/ipmaker.py (__call__): Added -wthread option for
4303 4317 wxpython thread handling. Make sure threading options are only
4304 4318 valid at the command line.
4305 4319
4306 4320 * scripts/ipython: moved shell selection into a factory function
4307 4321 in Shell.py, to keep the starter script to a minimum.
4308 4322
4309 4323 2004-08-25 Fernando Perez <fperez@colorado.edu>
4310 4324
4311 4325 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
4312 4326 John. Along with some recent changes he made to matplotlib, the
4313 4327 next versions of both systems should work very well together.
4314 4328
4315 4329 2004-08-24 Fernando Perez <fperez@colorado.edu>
4316 4330
4317 4331 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
4318 4332 tried to switch the profiling to using hotshot, but I'm getting
4319 4333 strange errors from prof.runctx() there. I may be misreading the
4320 4334 docs, but it looks weird. For now the profiling code will
4321 4335 continue to use the standard profiler.
4322 4336
4323 4337 2004-08-23 Fernando Perez <fperez@colorado.edu>
4324 4338
4325 4339 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
4326 4340 threaded shell, by John Hunter. It's not quite ready yet, but
4327 4341 close.
4328 4342
4329 4343 2004-08-22 Fernando Perez <fperez@colorado.edu>
4330 4344
4331 4345 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
4332 4346 in Magic and ultraTB.
4333 4347
4334 4348 * ipython.1: document threading options in manpage.
4335 4349
4336 4350 * scripts/ipython: Changed name of -thread option to -gthread,
4337 4351 since this is GTK specific. I want to leave the door open for a
4338 4352 -wthread option for WX, which will most likely be necessary. This
4339 4353 change affects usage and ipmaker as well.
4340 4354
4341 4355 * IPython/Shell.py (matplotlib_shell): Add a factory function to
4342 4356 handle the matplotlib shell issues. Code by John Hunter
4343 4357 <jdhunter-AT-nitace.bsd.uchicago.edu>.
4344 4358 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
4345 4359 broken (and disabled for end users) for now, but it puts the
4346 4360 infrastructure in place.
4347 4361
4348 4362 2004-08-21 Fernando Perez <fperez@colorado.edu>
4349 4363
4350 4364 * ipythonrc-pylab: Add matplotlib support.
4351 4365
4352 4366 * matplotlib_config.py: new files for matplotlib support, part of
4353 4367 the pylab profile.
4354 4368
4355 4369 * IPython/usage.py (__doc__): documented the threading options.
4356 4370
4357 4371 2004-08-20 Fernando Perez <fperez@colorado.edu>
4358 4372
4359 4373 * ipython: Modified the main calling routine to handle the -thread
4360 4374 and -mpthread options. This needs to be done as a top-level hack,
4361 4375 because it determines which class to instantiate for IPython
4362 4376 itself.
4363 4377
4364 4378 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
4365 4379 classes to support multithreaded GTK operation without blocking,
4366 4380 and matplotlib with all backends. This is a lot of still very
4367 4381 experimental code, and threads are tricky. So it may still have a
4368 4382 few rough edges... This code owes a lot to
4369 4383 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
4370 4384 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
4371 4385 to John Hunter for all the matplotlib work.
4372 4386
4373 4387 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
4374 4388 options for gtk thread and matplotlib support.
4375 4389
4376 4390 2004-08-16 Fernando Perez <fperez@colorado.edu>
4377 4391
4378 4392 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
4379 4393 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
4380 4394 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
4381 4395
4382 4396 2004-08-11 Fernando Perez <fperez@colorado.edu>
4383 4397
4384 4398 * setup.py (isfile): Fix build so documentation gets updated for
4385 4399 rpms (it was only done for .tgz builds).
4386 4400
4387 4401 2004-08-10 Fernando Perez <fperez@colorado.edu>
4388 4402
4389 4403 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
4390 4404
4391 4405 * iplib.py : Silence syntax error exceptions in tab-completion.
4392 4406
4393 4407 2004-08-05 Fernando Perez <fperez@colorado.edu>
4394 4408
4395 4409 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
4396 4410 'color off' mark for continuation prompts. This was causing long
4397 4411 continuation lines to mis-wrap.
4398 4412
4399 4413 2004-08-01 Fernando Perez <fperez@colorado.edu>
4400 4414
4401 4415 * IPython/ipmaker.py (make_IPython): Allow the shell class used
4402 4416 for building ipython to be a parameter. All this is necessary
4403 4417 right now to have a multithreaded version, but this insane
4404 4418 non-design will be cleaned up soon. For now, it's a hack that
4405 4419 works.
4406 4420
4407 4421 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
4408 4422 args in various places. No bugs so far, but it's a dangerous
4409 4423 practice.
4410 4424
4411 4425 2004-07-31 Fernando Perez <fperez@colorado.edu>
4412 4426
4413 4427 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
4414 4428 fix completion of files with dots in their names under most
4415 4429 profiles (pysh was OK because the completion order is different).
4416 4430
4417 4431 2004-07-27 Fernando Perez <fperez@colorado.edu>
4418 4432
4419 4433 * IPython/iplib.py (InteractiveShell.__init__): build dict of
4420 4434 keywords manually, b/c the one in keyword.py was removed in python
4421 4435 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
4422 4436 This is NOT a bug under python 2.3 and earlier.
4423 4437
4424 4438 2004-07-26 Fernando Perez <fperez@colorado.edu>
4425 4439
4426 4440 * IPython/ultraTB.py (VerboseTB.text): Add another
4427 4441 linecache.checkcache() call to try to prevent inspect.py from
4428 4442 crashing under python 2.3. I think this fixes
4429 4443 http://www.scipy.net/roundup/ipython/issue17.
4430 4444
4431 4445 2004-07-26 *** Released version 0.6.2
4432 4446
4433 4447 2004-07-26 Fernando Perez <fperez@colorado.edu>
4434 4448
4435 4449 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
4436 4450 fail for any number.
4437 4451 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
4438 4452 empty bookmarks.
4439 4453
4440 4454 2004-07-26 *** Released version 0.6.1
4441 4455
4442 4456 2004-07-26 Fernando Perez <fperez@colorado.edu>
4443 4457
4444 4458 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
4445 4459
4446 4460 * IPython/iplib.py (protect_filename): Applied Ville's patch for
4447 4461 escaping '()[]{}' in filenames.
4448 4462
4449 4463 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
4450 4464 Python 2.2 users who lack a proper shlex.split.
4451 4465
4452 4466 2004-07-19 Fernando Perez <fperez@colorado.edu>
4453 4467
4454 4468 * IPython/iplib.py (InteractiveShell.init_readline): Add support
4455 4469 for reading readline's init file. I follow the normal chain:
4456 4470 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
4457 4471 report by Mike Heeter. This closes
4458 4472 http://www.scipy.net/roundup/ipython/issue16.
4459 4473
4460 4474 2004-07-18 Fernando Perez <fperez@colorado.edu>
4461 4475
4462 4476 * IPython/iplib.py (__init__): Add better handling of '\' under
4463 4477 Win32 for filenames. After a patch by Ville.
4464 4478
4465 4479 2004-07-17 Fernando Perez <fperez@colorado.edu>
4466 4480
4467 4481 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4468 4482 autocalling would be triggered for 'foo is bar' if foo is
4469 4483 callable. I also cleaned up the autocall detection code to use a
4470 4484 regexp, which is faster. Bug reported by Alexander Schmolck.
4471 4485
4472 4486 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
4473 4487 '?' in them would confuse the help system. Reported by Alex
4474 4488 Schmolck.
4475 4489
4476 4490 2004-07-16 Fernando Perez <fperez@colorado.edu>
4477 4491
4478 4492 * IPython/GnuplotInteractive.py (__all__): added plot2.
4479 4493
4480 4494 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
4481 4495 plotting dictionaries, lists or tuples of 1d arrays.
4482 4496
4483 4497 * IPython/Magic.py (Magic.magic_hist): small clenaups and
4484 4498 optimizations.
4485 4499
4486 4500 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
4487 4501 the information which was there from Janko's original IPP code:
4488 4502
4489 4503 03.05.99 20:53 porto.ifm.uni-kiel.de
4490 4504 --Started changelog.
4491 4505 --make clear do what it say it does
4492 4506 --added pretty output of lines from inputcache
4493 4507 --Made Logger a mixin class, simplifies handling of switches
4494 4508 --Added own completer class. .string<TAB> expands to last history
4495 4509 line which starts with string. The new expansion is also present
4496 4510 with Ctrl-r from the readline library. But this shows, who this
4497 4511 can be done for other cases.
4498 4512 --Added convention that all shell functions should accept a
4499 4513 parameter_string This opens the door for different behaviour for
4500 4514 each function. @cd is a good example of this.
4501 4515
4502 4516 04.05.99 12:12 porto.ifm.uni-kiel.de
4503 4517 --added logfile rotation
4504 4518 --added new mainloop method which freezes first the namespace
4505 4519
4506 4520 07.05.99 21:24 porto.ifm.uni-kiel.de
4507 4521 --added the docreader classes. Now there is a help system.
4508 4522 -This is only a first try. Currently it's not easy to put new
4509 4523 stuff in the indices. But this is the way to go. Info would be
4510 4524 better, but HTML is every where and not everybody has an info
4511 4525 system installed and it's not so easy to change html-docs to info.
4512 4526 --added global logfile option
4513 4527 --there is now a hook for object inspection method pinfo needs to
4514 4528 be provided for this. Can be reached by two '??'.
4515 4529
4516 4530 08.05.99 20:51 porto.ifm.uni-kiel.de
4517 4531 --added a README
4518 4532 --bug in rc file. Something has changed so functions in the rc
4519 4533 file need to reference the shell and not self. Not clear if it's a
4520 4534 bug or feature.
4521 4535 --changed rc file for new behavior
4522 4536
4523 4537 2004-07-15 Fernando Perez <fperez@colorado.edu>
4524 4538
4525 4539 * IPython/Logger.py (Logger.log): fixed recent bug where the input
4526 4540 cache was falling out of sync in bizarre manners when multi-line
4527 4541 input was present. Minor optimizations and cleanup.
4528 4542
4529 4543 (Logger): Remove old Changelog info for cleanup. This is the
4530 4544 information which was there from Janko's original code:
4531 4545
4532 4546 Changes to Logger: - made the default log filename a parameter
4533 4547
4534 4548 - put a check for lines beginning with !@? in log(). Needed
4535 4549 (even if the handlers properly log their lines) for mid-session
4536 4550 logging activation to work properly. Without this, lines logged
4537 4551 in mid session, which get read from the cache, would end up
4538 4552 'bare' (with !@? in the open) in the log. Now they are caught
4539 4553 and prepended with a #.
4540 4554
4541 4555 * IPython/iplib.py (InteractiveShell.init_readline): added check
4542 4556 in case MagicCompleter fails to be defined, so we don't crash.
4543 4557
4544 4558 2004-07-13 Fernando Perez <fperez@colorado.edu>
4545 4559
4546 4560 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
4547 4561 of EPS if the requested filename ends in '.eps'.
4548 4562
4549 4563 2004-07-04 Fernando Perez <fperez@colorado.edu>
4550 4564
4551 4565 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
4552 4566 escaping of quotes when calling the shell.
4553 4567
4554 4568 2004-07-02 Fernando Perez <fperez@colorado.edu>
4555 4569
4556 4570 * IPython/Prompts.py (CachedOutput.update): Fix problem with
4557 4571 gettext not working because we were clobbering '_'. Fixes
4558 4572 http://www.scipy.net/roundup/ipython/issue6.
4559 4573
4560 4574 2004-07-01 Fernando Perez <fperez@colorado.edu>
4561 4575
4562 4576 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
4563 4577 into @cd. Patch by Ville.
4564 4578
4565 4579 * IPython/iplib.py (InteractiveShell.post_config_initialization):
4566 4580 new function to store things after ipmaker runs. Patch by Ville.
4567 4581 Eventually this will go away once ipmaker is removed and the class
4568 4582 gets cleaned up, but for now it's ok. Key functionality here is
4569 4583 the addition of the persistent storage mechanism, a dict for
4570 4584 keeping data across sessions (for now just bookmarks, but more can
4571 4585 be implemented later).
4572 4586
4573 4587 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
4574 4588 persistent across sections. Patch by Ville, I modified it
4575 4589 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
4576 4590 added a '-l' option to list all bookmarks.
4577 4591
4578 4592 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4579 4593 center for cleanup. Registered with atexit.register(). I moved
4580 4594 here the old exit_cleanup(). After a patch by Ville.
4581 4595
4582 4596 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4583 4597 characters in the hacked shlex_split for python 2.2.
4584 4598
4585 4599 * IPython/iplib.py (file_matches): more fixes to filenames with
4586 4600 whitespace in them. It's not perfect, but limitations in python's
4587 4601 readline make it impossible to go further.
4588 4602
4589 4603 2004-06-29 Fernando Perez <fperez@colorado.edu>
4590 4604
4591 4605 * IPython/iplib.py (file_matches): escape whitespace correctly in
4592 4606 filename completions. Bug reported by Ville.
4593 4607
4594 4608 2004-06-28 Fernando Perez <fperez@colorado.edu>
4595 4609
4596 4610 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4597 4611 the history file will be called 'history-PROFNAME' (or just
4598 4612 'history' if no profile is loaded). I was getting annoyed at
4599 4613 getting my Numerical work history clobbered by pysh sessions.
4600 4614
4601 4615 * IPython/iplib.py (InteractiveShell.__init__): Internal
4602 4616 getoutputerror() function so that we can honor the system_verbose
4603 4617 flag for _all_ system calls. I also added escaping of #
4604 4618 characters here to avoid confusing Itpl.
4605 4619
4606 4620 * IPython/Magic.py (shlex_split): removed call to shell in
4607 4621 parse_options and replaced it with shlex.split(). The annoying
4608 4622 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4609 4623 to backport it from 2.3, with several frail hacks (the shlex
4610 4624 module is rather limited in 2.2). Thanks to a suggestion by Ville
4611 4625 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4612 4626 problem.
4613 4627
4614 4628 (Magic.magic_system_verbose): new toggle to print the actual
4615 4629 system calls made by ipython. Mainly for debugging purposes.
4616 4630
4617 4631 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4618 4632 doesn't support persistence. Reported (and fix suggested) by
4619 4633 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4620 4634
4621 4635 2004-06-26 Fernando Perez <fperez@colorado.edu>
4622 4636
4623 4637 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4624 4638 continue prompts.
4625 4639
4626 4640 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4627 4641 function (basically a big docstring) and a few more things here to
4628 4642 speedup startup. pysh.py is now very lightweight. We want because
4629 4643 it gets execfile'd, while InterpreterExec gets imported, so
4630 4644 byte-compilation saves time.
4631 4645
4632 4646 2004-06-25 Fernando Perez <fperez@colorado.edu>
4633 4647
4634 4648 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4635 4649 -NUM', which was recently broken.
4636 4650
4637 4651 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4638 4652 in multi-line input (but not !!, which doesn't make sense there).
4639 4653
4640 4654 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4641 4655 It's just too useful, and people can turn it off in the less
4642 4656 common cases where it's a problem.
4643 4657
4644 4658 2004-06-24 Fernando Perez <fperez@colorado.edu>
4645 4659
4646 4660 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4647 4661 special syntaxes (like alias calling) is now allied in multi-line
4648 4662 input. This is still _very_ experimental, but it's necessary for
4649 4663 efficient shell usage combining python looping syntax with system
4650 4664 calls. For now it's restricted to aliases, I don't think it
4651 4665 really even makes sense to have this for magics.
4652 4666
4653 4667 2004-06-23 Fernando Perez <fperez@colorado.edu>
4654 4668
4655 4669 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4656 4670 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4657 4671
4658 4672 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4659 4673 extensions under Windows (after code sent by Gary Bishop). The
4660 4674 extensions considered 'executable' are stored in IPython's rc
4661 4675 structure as win_exec_ext.
4662 4676
4663 4677 * IPython/genutils.py (shell): new function, like system() but
4664 4678 without return value. Very useful for interactive shell work.
4665 4679
4666 4680 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4667 4681 delete aliases.
4668 4682
4669 4683 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4670 4684 sure that the alias table doesn't contain python keywords.
4671 4685
4672 4686 2004-06-21 Fernando Perez <fperez@colorado.edu>
4673 4687
4674 4688 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4675 4689 non-existent items are found in $PATH. Reported by Thorsten.
4676 4690
4677 4691 2004-06-20 Fernando Perez <fperez@colorado.edu>
4678 4692
4679 4693 * IPython/iplib.py (complete): modified the completer so that the
4680 4694 order of priorities can be easily changed at runtime.
4681 4695
4682 4696 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4683 4697 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4684 4698
4685 4699 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4686 4700 expand Python variables prepended with $ in all system calls. The
4687 4701 same was done to InteractiveShell.handle_shell_escape. Now all
4688 4702 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4689 4703 expansion of python variables and expressions according to the
4690 4704 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4691 4705
4692 4706 Though PEP-215 has been rejected, a similar (but simpler) one
4693 4707 seems like it will go into Python 2.4, PEP-292 -
4694 4708 http://www.python.org/peps/pep-0292.html.
4695 4709
4696 4710 I'll keep the full syntax of PEP-215, since IPython has since the
4697 4711 start used Ka-Ping Yee's reference implementation discussed there
4698 4712 (Itpl), and I actually like the powerful semantics it offers.
4699 4713
4700 4714 In order to access normal shell variables, the $ has to be escaped
4701 4715 via an extra $. For example:
4702 4716
4703 4717 In [7]: PATH='a python variable'
4704 4718
4705 4719 In [8]: !echo $PATH
4706 4720 a python variable
4707 4721
4708 4722 In [9]: !echo $$PATH
4709 4723 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4710 4724
4711 4725 (Magic.parse_options): escape $ so the shell doesn't evaluate
4712 4726 things prematurely.
4713 4727
4714 4728 * IPython/iplib.py (InteractiveShell.call_alias): added the
4715 4729 ability for aliases to expand python variables via $.
4716 4730
4717 4731 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4718 4732 system, now there's a @rehash/@rehashx pair of magics. These work
4719 4733 like the csh rehash command, and can be invoked at any time. They
4720 4734 build a table of aliases to everything in the user's $PATH
4721 4735 (@rehash uses everything, @rehashx is slower but only adds
4722 4736 executable files). With this, the pysh.py-based shell profile can
4723 4737 now simply call rehash upon startup, and full access to all
4724 4738 programs in the user's path is obtained.
4725 4739
4726 4740 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4727 4741 functionality is now fully in place. I removed the old dynamic
4728 4742 code generation based approach, in favor of a much lighter one
4729 4743 based on a simple dict. The advantage is that this allows me to
4730 4744 now have thousands of aliases with negligible cost (unthinkable
4731 4745 with the old system).
4732 4746
4733 4747 2004-06-19 Fernando Perez <fperez@colorado.edu>
4734 4748
4735 4749 * IPython/iplib.py (__init__): extended MagicCompleter class to
4736 4750 also complete (last in priority) on user aliases.
4737 4751
4738 4752 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4739 4753 call to eval.
4740 4754 (ItplNS.__init__): Added a new class which functions like Itpl,
4741 4755 but allows configuring the namespace for the evaluation to occur
4742 4756 in.
4743 4757
4744 4758 2004-06-18 Fernando Perez <fperez@colorado.edu>
4745 4759
4746 4760 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4747 4761 better message when 'exit' or 'quit' are typed (a common newbie
4748 4762 confusion).
4749 4763
4750 4764 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4751 4765 check for Windows users.
4752 4766
4753 4767 * IPython/iplib.py (InteractiveShell.user_setup): removed
4754 4768 disabling of colors for Windows. I'll test at runtime and issue a
4755 4769 warning if Gary's readline isn't found, as to nudge users to
4756 4770 download it.
4757 4771
4758 4772 2004-06-16 Fernando Perez <fperez@colorado.edu>
4759 4773
4760 4774 * IPython/genutils.py (Stream.__init__): changed to print errors
4761 4775 to sys.stderr. I had a circular dependency here. Now it's
4762 4776 possible to run ipython as IDLE's shell (consider this pre-alpha,
4763 4777 since true stdout things end up in the starting terminal instead
4764 4778 of IDLE's out).
4765 4779
4766 4780 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4767 4781 users who haven't # updated their prompt_in2 definitions. Remove
4768 4782 eventually.
4769 4783 (multiple_replace): added credit to original ASPN recipe.
4770 4784
4771 4785 2004-06-15 Fernando Perez <fperez@colorado.edu>
4772 4786
4773 4787 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4774 4788 list of auto-defined aliases.
4775 4789
4776 4790 2004-06-13 Fernando Perez <fperez@colorado.edu>
4777 4791
4778 4792 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4779 4793 install was really requested (so setup.py can be used for other
4780 4794 things under Windows).
4781 4795
4782 4796 2004-06-10 Fernando Perez <fperez@colorado.edu>
4783 4797
4784 4798 * IPython/Logger.py (Logger.create_log): Manually remove any old
4785 4799 backup, since os.remove may fail under Windows. Fixes bug
4786 4800 reported by Thorsten.
4787 4801
4788 4802 2004-06-09 Fernando Perez <fperez@colorado.edu>
4789 4803
4790 4804 * examples/example-embed.py: fixed all references to %n (replaced
4791 4805 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4792 4806 for all examples and the manual as well.
4793 4807
4794 4808 2004-06-08 Fernando Perez <fperez@colorado.edu>
4795 4809
4796 4810 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4797 4811 alignment and color management. All 3 prompt subsystems now
4798 4812 inherit from BasePrompt.
4799 4813
4800 4814 * tools/release: updates for windows installer build and tag rpms
4801 4815 with python version (since paths are fixed).
4802 4816
4803 4817 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4804 4818 which will become eventually obsolete. Also fixed the default
4805 4819 prompt_in2 to use \D, so at least new users start with the correct
4806 4820 defaults.
4807 4821 WARNING: Users with existing ipythonrc files will need to apply
4808 4822 this fix manually!
4809 4823
4810 4824 * setup.py: make windows installer (.exe). This is finally the
4811 4825 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4812 4826 which I hadn't included because it required Python 2.3 (or recent
4813 4827 distutils).
4814 4828
4815 4829 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4816 4830 usage of new '\D' escape.
4817 4831
4818 4832 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4819 4833 lacks os.getuid())
4820 4834 (CachedOutput.set_colors): Added the ability to turn coloring
4821 4835 on/off with @colors even for manually defined prompt colors. It
4822 4836 uses a nasty global, but it works safely and via the generic color
4823 4837 handling mechanism.
4824 4838 (Prompt2.__init__): Introduced new escape '\D' for continuation
4825 4839 prompts. It represents the counter ('\#') as dots.
4826 4840 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4827 4841 need to update their ipythonrc files and replace '%n' with '\D' in
4828 4842 their prompt_in2 settings everywhere. Sorry, but there's
4829 4843 otherwise no clean way to get all prompts to properly align. The
4830 4844 ipythonrc shipped with IPython has been updated.
4831 4845
4832 4846 2004-06-07 Fernando Perez <fperez@colorado.edu>
4833 4847
4834 4848 * setup.py (isfile): Pass local_icons option to latex2html, so the
4835 4849 resulting HTML file is self-contained. Thanks to
4836 4850 dryice-AT-liu.com.cn for the tip.
4837 4851
4838 4852 * pysh.py: I created a new profile 'shell', which implements a
4839 4853 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4840 4854 system shell, nor will it become one anytime soon. It's mainly
4841 4855 meant to illustrate the use of the new flexible bash-like prompts.
4842 4856 I guess it could be used by hardy souls for true shell management,
4843 4857 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4844 4858 profile. This uses the InterpreterExec extension provided by
4845 4859 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4846 4860
4847 4861 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4848 4862 auto-align itself with the length of the previous input prompt
4849 4863 (taking into account the invisible color escapes).
4850 4864 (CachedOutput.__init__): Large restructuring of this class. Now
4851 4865 all three prompts (primary1, primary2, output) are proper objects,
4852 4866 managed by the 'parent' CachedOutput class. The code is still a
4853 4867 bit hackish (all prompts share state via a pointer to the cache),
4854 4868 but it's overall far cleaner than before.
4855 4869
4856 4870 * IPython/genutils.py (getoutputerror): modified to add verbose,
4857 4871 debug and header options. This makes the interface of all getout*
4858 4872 functions uniform.
4859 4873 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4860 4874
4861 4875 * IPython/Magic.py (Magic.default_option): added a function to
4862 4876 allow registering default options for any magic command. This
4863 4877 makes it easy to have profiles which customize the magics globally
4864 4878 for a certain use. The values set through this function are
4865 4879 picked up by the parse_options() method, which all magics should
4866 4880 use to parse their options.
4867 4881
4868 4882 * IPython/genutils.py (warn): modified the warnings framework to
4869 4883 use the Term I/O class. I'm trying to slowly unify all of
4870 4884 IPython's I/O operations to pass through Term.
4871 4885
4872 4886 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4873 4887 the secondary prompt to correctly match the length of the primary
4874 4888 one for any prompt. Now multi-line code will properly line up
4875 4889 even for path dependent prompts, such as the new ones available
4876 4890 via the prompt_specials.
4877 4891
4878 4892 2004-06-06 Fernando Perez <fperez@colorado.edu>
4879 4893
4880 4894 * IPython/Prompts.py (prompt_specials): Added the ability to have
4881 4895 bash-like special sequences in the prompts, which get
4882 4896 automatically expanded. Things like hostname, current working
4883 4897 directory and username are implemented already, but it's easy to
4884 4898 add more in the future. Thanks to a patch by W.J. van der Laan
4885 4899 <gnufnork-AT-hetdigitalegat.nl>
4886 4900 (prompt_specials): Added color support for prompt strings, so
4887 4901 users can define arbitrary color setups for their prompts.
4888 4902
4889 4903 2004-06-05 Fernando Perez <fperez@colorado.edu>
4890 4904
4891 4905 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4892 4906 code to load Gary Bishop's readline and configure it
4893 4907 automatically. Thanks to Gary for help on this.
4894 4908
4895 4909 2004-06-01 Fernando Perez <fperez@colorado.edu>
4896 4910
4897 4911 * IPython/Logger.py (Logger.create_log): fix bug for logging
4898 4912 with no filename (previous fix was incomplete).
4899 4913
4900 4914 2004-05-25 Fernando Perez <fperez@colorado.edu>
4901 4915
4902 4916 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4903 4917 parens would get passed to the shell.
4904 4918
4905 4919 2004-05-20 Fernando Perez <fperez@colorado.edu>
4906 4920
4907 4921 * IPython/Magic.py (Magic.magic_prun): changed default profile
4908 4922 sort order to 'time' (the more common profiling need).
4909 4923
4910 4924 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4911 4925 so that source code shown is guaranteed in sync with the file on
4912 4926 disk (also changed in psource). Similar fix to the one for
4913 4927 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4914 4928 <yann.ledu-AT-noos.fr>.
4915 4929
4916 4930 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4917 4931 with a single option would not be correctly parsed. Closes
4918 4932 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4919 4933 introduced in 0.6.0 (on 2004-05-06).
4920 4934
4921 4935 2004-05-13 *** Released version 0.6.0
4922 4936
4923 4937 2004-05-13 Fernando Perez <fperez@colorado.edu>
4924 4938
4925 4939 * debian/: Added debian/ directory to CVS, so that debian support
4926 4940 is publicly accessible. The debian package is maintained by Jack
4927 4941 Moffit <jack-AT-xiph.org>.
4928 4942
4929 4943 * Documentation: included the notes about an ipython-based system
4930 4944 shell (the hypothetical 'pysh') into the new_design.pdf document,
4931 4945 so that these ideas get distributed to users along with the
4932 4946 official documentation.
4933 4947
4934 4948 2004-05-10 Fernando Perez <fperez@colorado.edu>
4935 4949
4936 4950 * IPython/Logger.py (Logger.create_log): fix recently introduced
4937 4951 bug (misindented line) where logstart would fail when not given an
4938 4952 explicit filename.
4939 4953
4940 4954 2004-05-09 Fernando Perez <fperez@colorado.edu>
4941 4955
4942 4956 * IPython/Magic.py (Magic.parse_options): skip system call when
4943 4957 there are no options to look for. Faster, cleaner for the common
4944 4958 case.
4945 4959
4946 4960 * Documentation: many updates to the manual: describing Windows
4947 4961 support better, Gnuplot updates, credits, misc small stuff. Also
4948 4962 updated the new_design doc a bit.
4949 4963
4950 4964 2004-05-06 *** Released version 0.6.0.rc1
4951 4965
4952 4966 2004-05-06 Fernando Perez <fperez@colorado.edu>
4953 4967
4954 4968 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4955 4969 operations to use the vastly more efficient list/''.join() method.
4956 4970 (FormattedTB.text): Fix
4957 4971 http://www.scipy.net/roundup/ipython/issue12 - exception source
4958 4972 extract not updated after reload. Thanks to Mike Salib
4959 4973 <msalib-AT-mit.edu> for pinning the source of the problem.
4960 4974 Fortunately, the solution works inside ipython and doesn't require
4961 4975 any changes to python proper.
4962 4976
4963 4977 * IPython/Magic.py (Magic.parse_options): Improved to process the
4964 4978 argument list as a true shell would (by actually using the
4965 4979 underlying system shell). This way, all @magics automatically get
4966 4980 shell expansion for variables. Thanks to a comment by Alex
4967 4981 Schmolck.
4968 4982
4969 4983 2004-04-04 Fernando Perez <fperez@colorado.edu>
4970 4984
4971 4985 * IPython/iplib.py (InteractiveShell.interact): Added a special
4972 4986 trap for a debugger quit exception, which is basically impossible
4973 4987 to handle by normal mechanisms, given what pdb does to the stack.
4974 4988 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4975 4989
4976 4990 2004-04-03 Fernando Perez <fperez@colorado.edu>
4977 4991
4978 4992 * IPython/genutils.py (Term): Standardized the names of the Term
4979 4993 class streams to cin/cout/cerr, following C++ naming conventions
4980 4994 (I can't use in/out/err because 'in' is not a valid attribute
4981 4995 name).
4982 4996
4983 4997 * IPython/iplib.py (InteractiveShell.interact): don't increment
4984 4998 the prompt if there's no user input. By Daniel 'Dang' Griffith
4985 4999 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4986 5000 Francois Pinard.
4987 5001
4988 5002 2004-04-02 Fernando Perez <fperez@colorado.edu>
4989 5003
4990 5004 * IPython/genutils.py (Stream.__init__): Modified to survive at
4991 5005 least importing in contexts where stdin/out/err aren't true file
4992 5006 objects, such as PyCrust (they lack fileno() and mode). However,
4993 5007 the recovery facilities which rely on these things existing will
4994 5008 not work.
4995 5009
4996 5010 2004-04-01 Fernando Perez <fperez@colorado.edu>
4997 5011
4998 5012 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4999 5013 use the new getoutputerror() function, so it properly
5000 5014 distinguishes stdout/err.
5001 5015
5002 5016 * IPython/genutils.py (getoutputerror): added a function to
5003 5017 capture separately the standard output and error of a command.
5004 5018 After a comment from dang on the mailing lists. This code is
5005 5019 basically a modified version of commands.getstatusoutput(), from
5006 5020 the standard library.
5007 5021
5008 5022 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
5009 5023 '!!' as a special syntax (shorthand) to access @sx.
5010 5024
5011 5025 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
5012 5026 command and return its output as a list split on '\n'.
5013 5027
5014 5028 2004-03-31 Fernando Perez <fperez@colorado.edu>
5015 5029
5016 5030 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
5017 5031 method to dictionaries used as FakeModule instances if they lack
5018 5032 it. At least pydoc in python2.3 breaks for runtime-defined
5019 5033 functions without this hack. At some point I need to _really_
5020 5034 understand what FakeModule is doing, because it's a gross hack.
5021 5035 But it solves Arnd's problem for now...
5022 5036
5023 5037 2004-02-27 Fernando Perez <fperez@colorado.edu>
5024 5038
5025 5039 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
5026 5040 mode would behave erratically. Also increased the number of
5027 5041 possible logs in rotate mod to 999. Thanks to Rod Holland
5028 5042 <rhh@StructureLABS.com> for the report and fixes.
5029 5043
5030 5044 2004-02-26 Fernando Perez <fperez@colorado.edu>
5031 5045
5032 5046 * IPython/genutils.py (page): Check that the curses module really
5033 5047 has the initscr attribute before trying to use it. For some
5034 5048 reason, the Solaris curses module is missing this. I think this
5035 5049 should be considered a Solaris python bug, but I'm not sure.
5036 5050
5037 5051 2004-01-17 Fernando Perez <fperez@colorado.edu>
5038 5052
5039 5053 * IPython/genutils.py (Stream.__init__): Changes to try to make
5040 5054 ipython robust against stdin/out/err being closed by the user.
5041 5055 This is 'user error' (and blocks a normal python session, at least
5042 5056 the stdout case). However, Ipython should be able to survive such
5043 5057 instances of abuse as gracefully as possible. To simplify the
5044 5058 coding and maintain compatibility with Gary Bishop's Term
5045 5059 contributions, I've made use of classmethods for this. I think
5046 5060 this introduces a dependency on python 2.2.
5047 5061
5048 5062 2004-01-13 Fernando Perez <fperez@colorado.edu>
5049 5063
5050 5064 * IPython/numutils.py (exp_safe): simplified the code a bit and
5051 5065 removed the need for importing the kinds module altogether.
5052 5066
5053 5067 2004-01-06 Fernando Perez <fperez@colorado.edu>
5054 5068
5055 5069 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
5056 5070 a magic function instead, after some community feedback. No
5057 5071 special syntax will exist for it, but its name is deliberately
5058 5072 very short.
5059 5073
5060 5074 2003-12-20 Fernando Perez <fperez@colorado.edu>
5061 5075
5062 5076 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
5063 5077 new functionality, to automagically assign the result of a shell
5064 5078 command to a variable. I'll solicit some community feedback on
5065 5079 this before making it permanent.
5066 5080
5067 5081 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
5068 5082 requested about callables for which inspect couldn't obtain a
5069 5083 proper argspec. Thanks to a crash report sent by Etienne
5070 5084 Posthumus <etienne-AT-apple01.cs.vu.nl>.
5071 5085
5072 5086 2003-12-09 Fernando Perez <fperez@colorado.edu>
5073 5087
5074 5088 * IPython/genutils.py (page): patch for the pager to work across
5075 5089 various versions of Windows. By Gary Bishop.
5076 5090
5077 5091 2003-12-04 Fernando Perez <fperez@colorado.edu>
5078 5092
5079 5093 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
5080 5094 Gnuplot.py version 1.7, whose internal names changed quite a bit.
5081 5095 While I tested this and it looks ok, there may still be corner
5082 5096 cases I've missed.
5083 5097
5084 5098 2003-12-01 Fernando Perez <fperez@colorado.edu>
5085 5099
5086 5100 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
5087 5101 where a line like 'p,q=1,2' would fail because the automagic
5088 5102 system would be triggered for @p.
5089 5103
5090 5104 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
5091 5105 cleanups, code unmodified.
5092 5106
5093 5107 * IPython/genutils.py (Term): added a class for IPython to handle
5094 5108 output. In most cases it will just be a proxy for stdout/err, but
5095 5109 having this allows modifications to be made for some platforms,
5096 5110 such as handling color escapes under Windows. All of this code
5097 5111 was contributed by Gary Bishop, with minor modifications by me.
5098 5112 The actual changes affect many files.
5099 5113
5100 5114 2003-11-30 Fernando Perez <fperez@colorado.edu>
5101 5115
5102 5116 * IPython/iplib.py (file_matches): new completion code, courtesy
5103 5117 of Jeff Collins. This enables filename completion again under
5104 5118 python 2.3, which disabled it at the C level.
5105 5119
5106 5120 2003-11-11 Fernando Perez <fperez@colorado.edu>
5107 5121
5108 5122 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
5109 5123 for Numeric.array(map(...)), but often convenient.
5110 5124
5111 5125 2003-11-05 Fernando Perez <fperez@colorado.edu>
5112 5126
5113 5127 * IPython/numutils.py (frange): Changed a call from int() to
5114 5128 int(round()) to prevent a problem reported with arange() in the
5115 5129 numpy list.
5116 5130
5117 5131 2003-10-06 Fernando Perez <fperez@colorado.edu>
5118 5132
5119 5133 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
5120 5134 prevent crashes if sys lacks an argv attribute (it happens with
5121 5135 embedded interpreters which build a bare-bones sys module).
5122 5136 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
5123 5137
5124 5138 2003-09-24 Fernando Perez <fperez@colorado.edu>
5125 5139
5126 5140 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
5127 5141 to protect against poorly written user objects where __getattr__
5128 5142 raises exceptions other than AttributeError. Thanks to a bug
5129 5143 report by Oliver Sander <osander-AT-gmx.de>.
5130 5144
5131 5145 * IPython/FakeModule.py (FakeModule.__repr__): this method was
5132 5146 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
5133 5147
5134 5148 2003-09-09 Fernando Perez <fperez@colorado.edu>
5135 5149
5136 5150 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
5137 5151 unpacking a list whith a callable as first element would
5138 5152 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
5139 5153 Collins.
5140 5154
5141 5155 2003-08-25 *** Released version 0.5.0
5142 5156
5143 5157 2003-08-22 Fernando Perez <fperez@colorado.edu>
5144 5158
5145 5159 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
5146 5160 improperly defined user exceptions. Thanks to feedback from Mark
5147 5161 Russell <mrussell-AT-verio.net>.
5148 5162
5149 5163 2003-08-20 Fernando Perez <fperez@colorado.edu>
5150 5164
5151 5165 * IPython/OInspect.py (Inspector.pinfo): changed String Form
5152 5166 printing so that it would print multi-line string forms starting
5153 5167 with a new line. This way the formatting is better respected for
5154 5168 objects which work hard to make nice string forms.
5155 5169
5156 5170 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
5157 5171 autocall would overtake data access for objects with both
5158 5172 __getitem__ and __call__.
5159 5173
5160 5174 2003-08-19 *** Released version 0.5.0-rc1
5161 5175
5162 5176 2003-08-19 Fernando Perez <fperez@colorado.edu>
5163 5177
5164 5178 * IPython/deep_reload.py (load_tail): single tiny change here
5165 5179 seems to fix the long-standing bug of dreload() failing to work
5166 5180 for dotted names. But this module is pretty tricky, so I may have
5167 5181 missed some subtlety. Needs more testing!.
5168 5182
5169 5183 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
5170 5184 exceptions which have badly implemented __str__ methods.
5171 5185 (VerboseTB.text): harden against inspect.getinnerframes crashing,
5172 5186 which I've been getting reports about from Python 2.3 users. I
5173 5187 wish I had a simple test case to reproduce the problem, so I could
5174 5188 either write a cleaner workaround or file a bug report if
5175 5189 necessary.
5176 5190
5177 5191 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
5178 5192 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
5179 5193 a bug report by Tjabo Kloppenburg.
5180 5194
5181 5195 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
5182 5196 crashes. Wrapped the pdb call in a blanket try/except, since pdb
5183 5197 seems rather unstable. Thanks to a bug report by Tjabo
5184 5198 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
5185 5199
5186 5200 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
5187 5201 this out soon because of the critical fixes in the inner loop for
5188 5202 generators.
5189 5203
5190 5204 * IPython/Magic.py (Magic.getargspec): removed. This (and
5191 5205 _get_def) have been obsoleted by OInspect for a long time, I
5192 5206 hadn't noticed that they were dead code.
5193 5207 (Magic._ofind): restored _ofind functionality for a few literals
5194 5208 (those in ["''",'""','[]','{}','()']). But it won't work anymore
5195 5209 for things like "hello".capitalize?, since that would require a
5196 5210 potentially dangerous eval() again.
5197 5211
5198 5212 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
5199 5213 logic a bit more to clean up the escapes handling and minimize the
5200 5214 use of _ofind to only necessary cases. The interactive 'feel' of
5201 5215 IPython should have improved quite a bit with the changes in
5202 5216 _prefilter and _ofind (besides being far safer than before).
5203 5217
5204 5218 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
5205 5219 obscure, never reported). Edit would fail to find the object to
5206 5220 edit under some circumstances.
5207 5221 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
5208 5222 which were causing double-calling of generators. Those eval calls
5209 5223 were _very_ dangerous, since code with side effects could be
5210 5224 triggered. As they say, 'eval is evil'... These were the
5211 5225 nastiest evals in IPython. Besides, _ofind is now far simpler,
5212 5226 and it should also be quite a bit faster. Its use of inspect is
5213 5227 also safer, so perhaps some of the inspect-related crashes I've
5214 5228 seen lately with Python 2.3 might be taken care of. That will
5215 5229 need more testing.
5216 5230
5217 5231 2003-08-17 Fernando Perez <fperez@colorado.edu>
5218 5232
5219 5233 * IPython/iplib.py (InteractiveShell._prefilter): significant
5220 5234 simplifications to the logic for handling user escapes. Faster
5221 5235 and simpler code.
5222 5236
5223 5237 2003-08-14 Fernando Perez <fperez@colorado.edu>
5224 5238
5225 5239 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
5226 5240 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
5227 5241 but it should be quite a bit faster. And the recursive version
5228 5242 generated O(log N) intermediate storage for all rank>1 arrays,
5229 5243 even if they were contiguous.
5230 5244 (l1norm): Added this function.
5231 5245 (norm): Added this function for arbitrary norms (including
5232 5246 l-infinity). l1 and l2 are still special cases for convenience
5233 5247 and speed.
5234 5248
5235 5249 2003-08-03 Fernando Perez <fperez@colorado.edu>
5236 5250
5237 5251 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
5238 5252 exceptions, which now raise PendingDeprecationWarnings in Python
5239 5253 2.3. There were some in Magic and some in Gnuplot2.
5240 5254
5241 5255 2003-06-30 Fernando Perez <fperez@colorado.edu>
5242 5256
5243 5257 * IPython/genutils.py (page): modified to call curses only for
5244 5258 terminals where TERM=='xterm'. After problems under many other
5245 5259 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
5246 5260
5247 5261 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
5248 5262 would be triggered when readline was absent. This was just an old
5249 5263 debugging statement I'd forgotten to take out.
5250 5264
5251 5265 2003-06-20 Fernando Perez <fperez@colorado.edu>
5252 5266
5253 5267 * IPython/genutils.py (clock): modified to return only user time
5254 5268 (not counting system time), after a discussion on scipy. While
5255 5269 system time may be a useful quantity occasionally, it may much
5256 5270 more easily be skewed by occasional swapping or other similar
5257 5271 activity.
5258 5272
5259 5273 2003-06-05 Fernando Perez <fperez@colorado.edu>
5260 5274
5261 5275 * IPython/numutils.py (identity): new function, for building
5262 5276 arbitrary rank Kronecker deltas (mostly backwards compatible with
5263 5277 Numeric.identity)
5264 5278
5265 5279 2003-06-03 Fernando Perez <fperez@colorado.edu>
5266 5280
5267 5281 * IPython/iplib.py (InteractiveShell.handle_magic): protect
5268 5282 arguments passed to magics with spaces, to allow trailing '\' to
5269 5283 work normally (mainly for Windows users).
5270 5284
5271 5285 2003-05-29 Fernando Perez <fperez@colorado.edu>
5272 5286
5273 5287 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
5274 5288 instead of pydoc.help. This fixes a bizarre behavior where
5275 5289 printing '%s' % locals() would trigger the help system. Now
5276 5290 ipython behaves like normal python does.
5277 5291
5278 5292 Note that if one does 'from pydoc import help', the bizarre
5279 5293 behavior returns, but this will also happen in normal python, so
5280 5294 it's not an ipython bug anymore (it has to do with how pydoc.help
5281 5295 is implemented).
5282 5296
5283 5297 2003-05-22 Fernando Perez <fperez@colorado.edu>
5284 5298
5285 5299 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
5286 5300 return [] instead of None when nothing matches, also match to end
5287 5301 of line. Patch by Gary Bishop.
5288 5302
5289 5303 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
5290 5304 protection as before, for files passed on the command line. This
5291 5305 prevents the CrashHandler from kicking in if user files call into
5292 5306 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
5293 5307 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
5294 5308
5295 5309 2003-05-20 *** Released version 0.4.0
5296 5310
5297 5311 2003-05-20 Fernando Perez <fperez@colorado.edu>
5298 5312
5299 5313 * setup.py: added support for manpages. It's a bit hackish b/c of
5300 5314 a bug in the way the bdist_rpm distutils target handles gzipped
5301 5315 manpages, but it works. After a patch by Jack.
5302 5316
5303 5317 2003-05-19 Fernando Perez <fperez@colorado.edu>
5304 5318
5305 5319 * IPython/numutils.py: added a mockup of the kinds module, since
5306 5320 it was recently removed from Numeric. This way, numutils will
5307 5321 work for all users even if they are missing kinds.
5308 5322
5309 5323 * IPython/Magic.py (Magic._ofind): Harden against an inspect
5310 5324 failure, which can occur with SWIG-wrapped extensions. After a
5311 5325 crash report from Prabhu.
5312 5326
5313 5327 2003-05-16 Fernando Perez <fperez@colorado.edu>
5314 5328
5315 5329 * IPython/iplib.py (InteractiveShell.excepthook): New method to
5316 5330 protect ipython from user code which may call directly
5317 5331 sys.excepthook (this looks like an ipython crash to the user, even
5318 5332 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
5319 5333 This is especially important to help users of WxWindows, but may
5320 5334 also be useful in other cases.
5321 5335
5322 5336 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
5323 5337 an optional tb_offset to be specified, and to preserve exception
5324 5338 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
5325 5339
5326 5340 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
5327 5341
5328 5342 2003-05-15 Fernando Perez <fperez@colorado.edu>
5329 5343
5330 5344 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
5331 5345 installing for a new user under Windows.
5332 5346
5333 5347 2003-05-12 Fernando Perez <fperez@colorado.edu>
5334 5348
5335 5349 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
5336 5350 handler for Emacs comint-based lines. Currently it doesn't do
5337 5351 much (but importantly, it doesn't update the history cache). In
5338 5352 the future it may be expanded if Alex needs more functionality
5339 5353 there.
5340 5354
5341 5355 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
5342 5356 info to crash reports.
5343 5357
5344 5358 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
5345 5359 just like Python's -c. Also fixed crash with invalid -color
5346 5360 option value at startup. Thanks to Will French
5347 5361 <wfrench-AT-bestweb.net> for the bug report.
5348 5362
5349 5363 2003-05-09 Fernando Perez <fperez@colorado.edu>
5350 5364
5351 5365 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
5352 5366 to EvalDict (it's a mapping, after all) and simplified its code
5353 5367 quite a bit, after a nice discussion on c.l.py where Gustavo
5354 5368 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
5355 5369
5356 5370 2003-04-30 Fernando Perez <fperez@colorado.edu>
5357 5371
5358 5372 * IPython/genutils.py (timings_out): modified it to reduce its
5359 5373 overhead in the common reps==1 case.
5360 5374
5361 5375 2003-04-29 Fernando Perez <fperez@colorado.edu>
5362 5376
5363 5377 * IPython/genutils.py (timings_out): Modified to use the resource
5364 5378 module, which avoids the wraparound problems of time.clock().
5365 5379
5366 5380 2003-04-17 *** Released version 0.2.15pre4
5367 5381
5368 5382 2003-04-17 Fernando Perez <fperez@colorado.edu>
5369 5383
5370 5384 * setup.py (scriptfiles): Split windows-specific stuff over to a
5371 5385 separate file, in an attempt to have a Windows GUI installer.
5372 5386 That didn't work, but part of the groundwork is done.
5373 5387
5374 5388 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
5375 5389 indent/unindent with 4 spaces. Particularly useful in combination
5376 5390 with the new auto-indent option.
5377 5391
5378 5392 2003-04-16 Fernando Perez <fperez@colorado.edu>
5379 5393
5380 5394 * IPython/Magic.py: various replacements of self.rc for
5381 5395 self.shell.rc. A lot more remains to be done to fully disentangle
5382 5396 this class from the main Shell class.
5383 5397
5384 5398 * IPython/GnuplotRuntime.py: added checks for mouse support so
5385 5399 that we don't try to enable it if the current gnuplot doesn't
5386 5400 really support it. Also added checks so that we don't try to
5387 5401 enable persist under Windows (where Gnuplot doesn't recognize the
5388 5402 option).
5389 5403
5390 5404 * IPython/iplib.py (InteractiveShell.interact): Added optional
5391 5405 auto-indenting code, after a patch by King C. Shu
5392 5406 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
5393 5407 get along well with pasting indented code. If I ever figure out
5394 5408 how to make that part go well, it will become on by default.
5395 5409
5396 5410 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
5397 5411 crash ipython if there was an unmatched '%' in the user's prompt
5398 5412 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5399 5413
5400 5414 * IPython/iplib.py (InteractiveShell.interact): removed the
5401 5415 ability to ask the user whether he wants to crash or not at the
5402 5416 'last line' exception handler. Calling functions at that point
5403 5417 changes the stack, and the error reports would have incorrect
5404 5418 tracebacks.
5405 5419
5406 5420 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
5407 5421 pass through a peger a pretty-printed form of any object. After a
5408 5422 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
5409 5423
5410 5424 2003-04-14 Fernando Perez <fperez@colorado.edu>
5411 5425
5412 5426 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
5413 5427 all files in ~ would be modified at first install (instead of
5414 5428 ~/.ipython). This could be potentially disastrous, as the
5415 5429 modification (make line-endings native) could damage binary files.
5416 5430
5417 5431 2003-04-10 Fernando Perez <fperez@colorado.edu>
5418 5432
5419 5433 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
5420 5434 handle only lines which are invalid python. This now means that
5421 5435 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
5422 5436 for the bug report.
5423 5437
5424 5438 2003-04-01 Fernando Perez <fperez@colorado.edu>
5425 5439
5426 5440 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
5427 5441 where failing to set sys.last_traceback would crash pdb.pm().
5428 5442 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
5429 5443 report.
5430 5444
5431 5445 2003-03-25 Fernando Perez <fperez@colorado.edu>
5432 5446
5433 5447 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
5434 5448 before printing it (it had a lot of spurious blank lines at the
5435 5449 end).
5436 5450
5437 5451 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
5438 5452 output would be sent 21 times! Obviously people don't use this
5439 5453 too often, or I would have heard about it.
5440 5454
5441 5455 2003-03-24 Fernando Perez <fperez@colorado.edu>
5442 5456
5443 5457 * setup.py (scriptfiles): renamed the data_files parameter from
5444 5458 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
5445 5459 for the patch.
5446 5460
5447 5461 2003-03-20 Fernando Perez <fperez@colorado.edu>
5448 5462
5449 5463 * IPython/genutils.py (error): added error() and fatal()
5450 5464 functions.
5451 5465
5452 5466 2003-03-18 *** Released version 0.2.15pre3
5453 5467
5454 5468 2003-03-18 Fernando Perez <fperez@colorado.edu>
5455 5469
5456 5470 * setupext/install_data_ext.py
5457 5471 (install_data_ext.initialize_options): Class contributed by Jack
5458 5472 Moffit for fixing the old distutils hack. He is sending this to
5459 5473 the distutils folks so in the future we may not need it as a
5460 5474 private fix.
5461 5475
5462 5476 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
5463 5477 changes for Debian packaging. See his patch for full details.
5464 5478 The old distutils hack of making the ipythonrc* files carry a
5465 5479 bogus .py extension is gone, at last. Examples were moved to a
5466 5480 separate subdir under doc/, and the separate executable scripts
5467 5481 now live in their own directory. Overall a great cleanup. The
5468 5482 manual was updated to use the new files, and setup.py has been
5469 5483 fixed for this setup.
5470 5484
5471 5485 * IPython/PyColorize.py (Parser.usage): made non-executable and
5472 5486 created a pycolor wrapper around it to be included as a script.
5473 5487
5474 5488 2003-03-12 *** Released version 0.2.15pre2
5475 5489
5476 5490 2003-03-12 Fernando Perez <fperez@colorado.edu>
5477 5491
5478 5492 * IPython/ColorANSI.py (make_color_table): Finally fixed the
5479 5493 long-standing problem with garbage characters in some terminals.
5480 5494 The issue was really that the \001 and \002 escapes must _only_ be
5481 5495 passed to input prompts (which call readline), but _never_ to
5482 5496 normal text to be printed on screen. I changed ColorANSI to have
5483 5497 two classes: TermColors and InputTermColors, each with the
5484 5498 appropriate escapes for input prompts or normal text. The code in
5485 5499 Prompts.py got slightly more complicated, but this very old and
5486 5500 annoying bug is finally fixed.
5487 5501
5488 5502 All the credit for nailing down the real origin of this problem
5489 5503 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
5490 5504 *Many* thanks to him for spending quite a bit of effort on this.
5491 5505
5492 5506 2003-03-05 *** Released version 0.2.15pre1
5493 5507
5494 5508 2003-03-03 Fernando Perez <fperez@colorado.edu>
5495 5509
5496 5510 * IPython/FakeModule.py: Moved the former _FakeModule to a
5497 5511 separate file, because it's also needed by Magic (to fix a similar
5498 5512 pickle-related issue in @run).
5499 5513
5500 5514 2003-03-02 Fernando Perez <fperez@colorado.edu>
5501 5515
5502 5516 * IPython/Magic.py (Magic.magic_autocall): new magic to control
5503 5517 the autocall option at runtime.
5504 5518 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
5505 5519 across Magic.py to start separating Magic from InteractiveShell.
5506 5520 (Magic._ofind): Fixed to return proper namespace for dotted
5507 5521 names. Before, a dotted name would always return 'not currently
5508 5522 defined', because it would find the 'parent'. s.x would be found,
5509 5523 but since 'x' isn't defined by itself, it would get confused.
5510 5524 (Magic.magic_run): Fixed pickling problems reported by Ralf
5511 5525 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
5512 5526 that I'd used when Mike Heeter reported similar issues at the
5513 5527 top-level, but now for @run. It boils down to injecting the
5514 5528 namespace where code is being executed with something that looks
5515 5529 enough like a module to fool pickle.dump(). Since a pickle stores
5516 5530 a named reference to the importing module, we need this for
5517 5531 pickles to save something sensible.
5518 5532
5519 5533 * IPython/ipmaker.py (make_IPython): added an autocall option.
5520 5534
5521 5535 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
5522 5536 the auto-eval code. Now autocalling is an option, and the code is
5523 5537 also vastly safer. There is no more eval() involved at all.
5524 5538
5525 5539 2003-03-01 Fernando Perez <fperez@colorado.edu>
5526 5540
5527 5541 * IPython/Magic.py (Magic._ofind): Changed interface to return a
5528 5542 dict with named keys instead of a tuple.
5529 5543
5530 5544 * IPython: Started using CVS for IPython as of 0.2.15pre1.
5531 5545
5532 5546 * setup.py (make_shortcut): Fixed message about directories
5533 5547 created during Windows installation (the directories were ok, just
5534 5548 the printed message was misleading). Thanks to Chris Liechti
5535 5549 <cliechti-AT-gmx.net> for the heads up.
5536 5550
5537 5551 2003-02-21 Fernando Perez <fperez@colorado.edu>
5538 5552
5539 5553 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
5540 5554 of ValueError exception when checking for auto-execution. This
5541 5555 one is raised by things like Numeric arrays arr.flat when the
5542 5556 array is non-contiguous.
5543 5557
5544 5558 2003-01-31 Fernando Perez <fperez@colorado.edu>
5545 5559
5546 5560 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
5547 5561 not return any value at all (even though the command would get
5548 5562 executed).
5549 5563 (xsys): Flush stdout right after printing the command to ensure
5550 5564 proper ordering of commands and command output in the total
5551 5565 output.
5552 5566 (SystemExec/xsys/bq): Switched the names of xsys/bq and
5553 5567 system/getoutput as defaults. The old ones are kept for
5554 5568 compatibility reasons, so no code which uses this library needs
5555 5569 changing.
5556 5570
5557 5571 2003-01-27 *** Released version 0.2.14
5558 5572
5559 5573 2003-01-25 Fernando Perez <fperez@colorado.edu>
5560 5574
5561 5575 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
5562 5576 functions defined in previous edit sessions could not be re-edited
5563 5577 (because the temp files were immediately removed). Now temp files
5564 5578 are removed only at IPython's exit.
5565 5579 (Magic.magic_run): Improved @run to perform shell-like expansions
5566 5580 on its arguments (~users and $VARS). With this, @run becomes more
5567 5581 like a normal command-line.
5568 5582
5569 5583 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
5570 5584 bugs related to embedding and cleaned up that code. A fairly
5571 5585 important one was the impossibility to access the global namespace
5572 5586 through the embedded IPython (only local variables were visible).
5573 5587
5574 5588 2003-01-14 Fernando Perez <fperez@colorado.edu>
5575 5589
5576 5590 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
5577 5591 auto-calling to be a bit more conservative. Now it doesn't get
5578 5592 triggered if any of '!=()<>' are in the rest of the input line, to
5579 5593 allow comparing callables. Thanks to Alex for the heads up.
5580 5594
5581 5595 2003-01-07 Fernando Perez <fperez@colorado.edu>
5582 5596
5583 5597 * IPython/genutils.py (page): fixed estimation of the number of
5584 5598 lines in a string to be paged to simply count newlines. This
5585 5599 prevents over-guessing due to embedded escape sequences. A better
5586 5600 long-term solution would involve stripping out the control chars
5587 5601 for the count, but it's potentially so expensive I just don't
5588 5602 think it's worth doing.
5589 5603
5590 5604 2002-12-19 *** Released version 0.2.14pre50
5591 5605
5592 5606 2002-12-19 Fernando Perez <fperez@colorado.edu>
5593 5607
5594 5608 * tools/release (version): Changed release scripts to inform
5595 5609 Andrea and build a NEWS file with a list of recent changes.
5596 5610
5597 5611 * IPython/ColorANSI.py (__all__): changed terminal detection
5598 5612 code. Seems to work better for xterms without breaking
5599 5613 konsole. Will need more testing to determine if WinXP and Mac OSX
5600 5614 also work ok.
5601 5615
5602 5616 2002-12-18 *** Released version 0.2.14pre49
5603 5617
5604 5618 2002-12-18 Fernando Perez <fperez@colorado.edu>
5605 5619
5606 5620 * Docs: added new info about Mac OSX, from Andrea.
5607 5621
5608 5622 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5609 5623 allow direct plotting of python strings whose format is the same
5610 5624 of gnuplot data files.
5611 5625
5612 5626 2002-12-16 Fernando Perez <fperez@colorado.edu>
5613 5627
5614 5628 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5615 5629 value of exit question to be acknowledged.
5616 5630
5617 5631 2002-12-03 Fernando Perez <fperez@colorado.edu>
5618 5632
5619 5633 * IPython/ipmaker.py: removed generators, which had been added
5620 5634 by mistake in an earlier debugging run. This was causing trouble
5621 5635 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5622 5636 for pointing this out.
5623 5637
5624 5638 2002-11-17 Fernando Perez <fperez@colorado.edu>
5625 5639
5626 5640 * Manual: updated the Gnuplot section.
5627 5641
5628 5642 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5629 5643 a much better split of what goes in Runtime and what goes in
5630 5644 Interactive.
5631 5645
5632 5646 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5633 5647 being imported from iplib.
5634 5648
5635 5649 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5636 5650 for command-passing. Now the global Gnuplot instance is called
5637 5651 'gp' instead of 'g', which was really a far too fragile and
5638 5652 common name.
5639 5653
5640 5654 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5641 5655 bounding boxes generated by Gnuplot for square plots.
5642 5656
5643 5657 * IPython/genutils.py (popkey): new function added. I should
5644 5658 suggest this on c.l.py as a dict method, it seems useful.
5645 5659
5646 5660 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5647 5661 to transparently handle PostScript generation. MUCH better than
5648 5662 the previous plot_eps/replot_eps (which I removed now). The code
5649 5663 is also fairly clean and well documented now (including
5650 5664 docstrings).
5651 5665
5652 5666 2002-11-13 Fernando Perez <fperez@colorado.edu>
5653 5667
5654 5668 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5655 5669 (inconsistent with options).
5656 5670
5657 5671 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5658 5672 manually disabled, I don't know why. Fixed it.
5659 5673 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5660 5674 eps output.
5661 5675
5662 5676 2002-11-12 Fernando Perez <fperez@colorado.edu>
5663 5677
5664 5678 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5665 5679 don't propagate up to caller. Fixes crash reported by François
5666 5680 Pinard.
5667 5681
5668 5682 2002-11-09 Fernando Perez <fperez@colorado.edu>
5669 5683
5670 5684 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5671 5685 history file for new users.
5672 5686 (make_IPython): fixed bug where initial install would leave the
5673 5687 user running in the .ipython dir.
5674 5688 (make_IPython): fixed bug where config dir .ipython would be
5675 5689 created regardless of the given -ipythondir option. Thanks to Cory
5676 5690 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5677 5691
5678 5692 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5679 5693 type confirmations. Will need to use it in all of IPython's code
5680 5694 consistently.
5681 5695
5682 5696 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5683 5697 context to print 31 lines instead of the default 5. This will make
5684 5698 the crash reports extremely detailed in case the problem is in
5685 5699 libraries I don't have access to.
5686 5700
5687 5701 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5688 5702 line of defense' code to still crash, but giving users fair
5689 5703 warning. I don't want internal errors to go unreported: if there's
5690 5704 an internal problem, IPython should crash and generate a full
5691 5705 report.
5692 5706
5693 5707 2002-11-08 Fernando Perez <fperez@colorado.edu>
5694 5708
5695 5709 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5696 5710 otherwise uncaught exceptions which can appear if people set
5697 5711 sys.stdout to something badly broken. Thanks to a crash report
5698 5712 from henni-AT-mail.brainbot.com.
5699 5713
5700 5714 2002-11-04 Fernando Perez <fperez@colorado.edu>
5701 5715
5702 5716 * IPython/iplib.py (InteractiveShell.interact): added
5703 5717 __IPYTHON__active to the builtins. It's a flag which goes on when
5704 5718 the interaction starts and goes off again when it stops. This
5705 5719 allows embedding code to detect being inside IPython. Before this
5706 5720 was done via __IPYTHON__, but that only shows that an IPython
5707 5721 instance has been created.
5708 5722
5709 5723 * IPython/Magic.py (Magic.magic_env): I realized that in a
5710 5724 UserDict, instance.data holds the data as a normal dict. So I
5711 5725 modified @env to return os.environ.data instead of rebuilding a
5712 5726 dict by hand.
5713 5727
5714 5728 2002-11-02 Fernando Perez <fperez@colorado.edu>
5715 5729
5716 5730 * IPython/genutils.py (warn): changed so that level 1 prints no
5717 5731 header. Level 2 is now the default (with 'WARNING' header, as
5718 5732 before). I think I tracked all places where changes were needed in
5719 5733 IPython, but outside code using the old level numbering may have
5720 5734 broken.
5721 5735
5722 5736 * IPython/iplib.py (InteractiveShell.runcode): added this to
5723 5737 handle the tracebacks in SystemExit traps correctly. The previous
5724 5738 code (through interact) was printing more of the stack than
5725 5739 necessary, showing IPython internal code to the user.
5726 5740
5727 5741 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5728 5742 default. Now that the default at the confirmation prompt is yes,
5729 5743 it's not so intrusive. François' argument that ipython sessions
5730 5744 tend to be complex enough not to lose them from an accidental C-d,
5731 5745 is a valid one.
5732 5746
5733 5747 * IPython/iplib.py (InteractiveShell.interact): added a
5734 5748 showtraceback() call to the SystemExit trap, and modified the exit
5735 5749 confirmation to have yes as the default.
5736 5750
5737 5751 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5738 5752 this file. It's been gone from the code for a long time, this was
5739 5753 simply leftover junk.
5740 5754
5741 5755 2002-11-01 Fernando Perez <fperez@colorado.edu>
5742 5756
5743 5757 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5744 5758 added. If set, IPython now traps EOF and asks for
5745 5759 confirmation. After a request by François Pinard.
5746 5760
5747 5761 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5748 5762 of @abort, and with a new (better) mechanism for handling the
5749 5763 exceptions.
5750 5764
5751 5765 2002-10-27 Fernando Perez <fperez@colorado.edu>
5752 5766
5753 5767 * IPython/usage.py (__doc__): updated the --help information and
5754 5768 the ipythonrc file to indicate that -log generates
5755 5769 ./ipython.log. Also fixed the corresponding info in @logstart.
5756 5770 This and several other fixes in the manuals thanks to reports by
5757 5771 François Pinard <pinard-AT-iro.umontreal.ca>.
5758 5772
5759 5773 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5760 5774 refer to @logstart (instead of @log, which doesn't exist).
5761 5775
5762 5776 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5763 5777 AttributeError crash. Thanks to Christopher Armstrong
5764 5778 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5765 5779 introduced recently (in 0.2.14pre37) with the fix to the eval
5766 5780 problem mentioned below.
5767 5781
5768 5782 2002-10-17 Fernando Perez <fperez@colorado.edu>
5769 5783
5770 5784 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5771 5785 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5772 5786
5773 5787 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5774 5788 this function to fix a problem reported by Alex Schmolck. He saw
5775 5789 it with list comprehensions and generators, which were getting
5776 5790 called twice. The real problem was an 'eval' call in testing for
5777 5791 automagic which was evaluating the input line silently.
5778 5792
5779 5793 This is a potentially very nasty bug, if the input has side
5780 5794 effects which must not be repeated. The code is much cleaner now,
5781 5795 without any blanket 'except' left and with a regexp test for
5782 5796 actual function names.
5783 5797
5784 5798 But an eval remains, which I'm not fully comfortable with. I just
5785 5799 don't know how to find out if an expression could be a callable in
5786 5800 the user's namespace without doing an eval on the string. However
5787 5801 that string is now much more strictly checked so that no code
5788 5802 slips by, so the eval should only happen for things that can
5789 5803 really be only function/method names.
5790 5804
5791 5805 2002-10-15 Fernando Perez <fperez@colorado.edu>
5792 5806
5793 5807 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5794 5808 OSX information to main manual, removed README_Mac_OSX file from
5795 5809 distribution. Also updated credits for recent additions.
5796 5810
5797 5811 2002-10-10 Fernando Perez <fperez@colorado.edu>
5798 5812
5799 5813 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5800 5814 terminal-related issues. Many thanks to Andrea Riciputi
5801 5815 <andrea.riciputi-AT-libero.it> for writing it.
5802 5816
5803 5817 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5804 5818 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5805 5819
5806 5820 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5807 5821 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5808 5822 <syver-en-AT-online.no> who both submitted patches for this problem.
5809 5823
5810 5824 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5811 5825 global embedding to make sure that things don't overwrite user
5812 5826 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5813 5827
5814 5828 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5815 5829 compatibility. Thanks to Hayden Callow
5816 5830 <h.callow-AT-elec.canterbury.ac.nz>
5817 5831
5818 5832 2002-10-04 Fernando Perez <fperez@colorado.edu>
5819 5833
5820 5834 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5821 5835 Gnuplot.File objects.
5822 5836
5823 5837 2002-07-23 Fernando Perez <fperez@colorado.edu>
5824 5838
5825 5839 * IPython/genutils.py (timing): Added timings() and timing() for
5826 5840 quick access to the most commonly needed data, the execution
5827 5841 times. Old timing() renamed to timings_out().
5828 5842
5829 5843 2002-07-18 Fernando Perez <fperez@colorado.edu>
5830 5844
5831 5845 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5832 5846 bug with nested instances disrupting the parent's tab completion.
5833 5847
5834 5848 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5835 5849 all_completions code to begin the emacs integration.
5836 5850
5837 5851 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5838 5852 argument to allow titling individual arrays when plotting.
5839 5853
5840 5854 2002-07-15 Fernando Perez <fperez@colorado.edu>
5841 5855
5842 5856 * setup.py (make_shortcut): changed to retrieve the value of
5843 5857 'Program Files' directory from the registry (this value changes in
5844 5858 non-english versions of Windows). Thanks to Thomas Fanslau
5845 5859 <tfanslau-AT-gmx.de> for the report.
5846 5860
5847 5861 2002-07-10 Fernando Perez <fperez@colorado.edu>
5848 5862
5849 5863 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5850 5864 a bug in pdb, which crashes if a line with only whitespace is
5851 5865 entered. Bug report submitted to sourceforge.
5852 5866
5853 5867 2002-07-09 Fernando Perez <fperez@colorado.edu>
5854 5868
5855 5869 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5856 5870 reporting exceptions (it's a bug in inspect.py, I just set a
5857 5871 workaround).
5858 5872
5859 5873 2002-07-08 Fernando Perez <fperez@colorado.edu>
5860 5874
5861 5875 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5862 5876 __IPYTHON__ in __builtins__ to show up in user_ns.
5863 5877
5864 5878 2002-07-03 Fernando Perez <fperez@colorado.edu>
5865 5879
5866 5880 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5867 5881 name from @gp_set_instance to @gp_set_default.
5868 5882
5869 5883 * IPython/ipmaker.py (make_IPython): default editor value set to
5870 5884 '0' (a string), to match the rc file. Otherwise will crash when
5871 5885 .strip() is called on it.
5872 5886
5873 5887
5874 5888 2002-06-28 Fernando Perez <fperez@colorado.edu>
5875 5889
5876 5890 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5877 5891 of files in current directory when a file is executed via
5878 5892 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5879 5893
5880 5894 * setup.py (manfiles): fix for rpm builds, submitted by RA
5881 5895 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5882 5896
5883 5897 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5884 5898 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5885 5899 string!). A. Schmolck caught this one.
5886 5900
5887 5901 2002-06-27 Fernando Perez <fperez@colorado.edu>
5888 5902
5889 5903 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5890 5904 defined files at the cmd line. __name__ wasn't being set to
5891 5905 __main__.
5892 5906
5893 5907 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5894 5908 regular lists and tuples besides Numeric arrays.
5895 5909
5896 5910 * IPython/Prompts.py (CachedOutput.__call__): Added output
5897 5911 supression for input ending with ';'. Similar to Mathematica and
5898 5912 Matlab. The _* vars and Out[] list are still updated, just like
5899 5913 Mathematica behaves.
5900 5914
5901 5915 2002-06-25 Fernando Perez <fperez@colorado.edu>
5902 5916
5903 5917 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5904 5918 .ini extensions for profiels under Windows.
5905 5919
5906 5920 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5907 5921 string form. Fix contributed by Alexander Schmolck
5908 5922 <a.schmolck-AT-gmx.net>
5909 5923
5910 5924 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5911 5925 pre-configured Gnuplot instance.
5912 5926
5913 5927 2002-06-21 Fernando Perez <fperez@colorado.edu>
5914 5928
5915 5929 * IPython/numutils.py (exp_safe): new function, works around the
5916 5930 underflow problems in Numeric.
5917 5931 (log2): New fn. Safe log in base 2: returns exact integer answer
5918 5932 for exact integer powers of 2.
5919 5933
5920 5934 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5921 5935 properly.
5922 5936
5923 5937 2002-06-20 Fernando Perez <fperez@colorado.edu>
5924 5938
5925 5939 * IPython/genutils.py (timing): new function like
5926 5940 Mathematica's. Similar to time_test, but returns more info.
5927 5941
5928 5942 2002-06-18 Fernando Perez <fperez@colorado.edu>
5929 5943
5930 5944 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5931 5945 according to Mike Heeter's suggestions.
5932 5946
5933 5947 2002-06-16 Fernando Perez <fperez@colorado.edu>
5934 5948
5935 5949 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5936 5950 system. GnuplotMagic is gone as a user-directory option. New files
5937 5951 make it easier to use all the gnuplot stuff both from external
5938 5952 programs as well as from IPython. Had to rewrite part of
5939 5953 hardcopy() b/c of a strange bug: often the ps files simply don't
5940 5954 get created, and require a repeat of the command (often several
5941 5955 times).
5942 5956
5943 5957 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5944 5958 resolve output channel at call time, so that if sys.stderr has
5945 5959 been redirected by user this gets honored.
5946 5960
5947 5961 2002-06-13 Fernando Perez <fperez@colorado.edu>
5948 5962
5949 5963 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5950 5964 IPShell. Kept a copy with the old names to avoid breaking people's
5951 5965 embedded code.
5952 5966
5953 5967 * IPython/ipython: simplified it to the bare minimum after
5954 5968 Holger's suggestions. Added info about how to use it in
5955 5969 PYTHONSTARTUP.
5956 5970
5957 5971 * IPython/Shell.py (IPythonShell): changed the options passing
5958 5972 from a string with funky %s replacements to a straight list. Maybe
5959 5973 a bit more typing, but it follows sys.argv conventions, so there's
5960 5974 less special-casing to remember.
5961 5975
5962 5976 2002-06-12 Fernando Perez <fperez@colorado.edu>
5963 5977
5964 5978 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5965 5979 command. Thanks to a suggestion by Mike Heeter.
5966 5980 (Magic.magic_pfile): added behavior to look at filenames if given
5967 5981 arg is not a defined object.
5968 5982 (Magic.magic_save): New @save function to save code snippets. Also
5969 5983 a Mike Heeter idea.
5970 5984
5971 5985 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5972 5986 plot() and replot(). Much more convenient now, especially for
5973 5987 interactive use.
5974 5988
5975 5989 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5976 5990 filenames.
5977 5991
5978 5992 2002-06-02 Fernando Perez <fperez@colorado.edu>
5979 5993
5980 5994 * IPython/Struct.py (Struct.__init__): modified to admit
5981 5995 initialization via another struct.
5982 5996
5983 5997 * IPython/genutils.py (SystemExec.__init__): New stateful
5984 5998 interface to xsys and bq. Useful for writing system scripts.
5985 5999
5986 6000 2002-05-30 Fernando Perez <fperez@colorado.edu>
5987 6001
5988 6002 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5989 6003 documents. This will make the user download smaller (it's getting
5990 6004 too big).
5991 6005
5992 6006 2002-05-29 Fernando Perez <fperez@colorado.edu>
5993 6007
5994 6008 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5995 6009 fix problems with shelve and pickle. Seems to work, but I don't
5996 6010 know if corner cases break it. Thanks to Mike Heeter
5997 6011 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5998 6012
5999 6013 2002-05-24 Fernando Perez <fperez@colorado.edu>
6000 6014
6001 6015 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
6002 6016 macros having broken.
6003 6017
6004 6018 2002-05-21 Fernando Perez <fperez@colorado.edu>
6005 6019
6006 6020 * IPython/Magic.py (Magic.magic_logstart): fixed recently
6007 6021 introduced logging bug: all history before logging started was
6008 6022 being written one character per line! This came from the redesign
6009 6023 of the input history as a special list which slices to strings,
6010 6024 not to lists.
6011 6025
6012 6026 2002-05-20 Fernando Perez <fperez@colorado.edu>
6013 6027
6014 6028 * IPython/Prompts.py (CachedOutput.__init__): made the color table
6015 6029 be an attribute of all classes in this module. The design of these
6016 6030 classes needs some serious overhauling.
6017 6031
6018 6032 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
6019 6033 which was ignoring '_' in option names.
6020 6034
6021 6035 * IPython/ultraTB.py (FormattedTB.__init__): Changed
6022 6036 'Verbose_novars' to 'Context' and made it the new default. It's a
6023 6037 bit more readable and also safer than verbose.
6024 6038
6025 6039 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
6026 6040 triple-quoted strings.
6027 6041
6028 6042 * IPython/OInspect.py (__all__): new module exposing the object
6029 6043 introspection facilities. Now the corresponding magics are dummy
6030 6044 wrappers around this. Having this module will make it much easier
6031 6045 to put these functions into our modified pdb.
6032 6046 This new object inspector system uses the new colorizing module,
6033 6047 so source code and other things are nicely syntax highlighted.
6034 6048
6035 6049 2002-05-18 Fernando Perez <fperez@colorado.edu>
6036 6050
6037 6051 * IPython/ColorANSI.py: Split the coloring tools into a separate
6038 6052 module so I can use them in other code easier (they were part of
6039 6053 ultraTB).
6040 6054
6041 6055 2002-05-17 Fernando Perez <fperez@colorado.edu>
6042 6056
6043 6057 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
6044 6058 fixed it to set the global 'g' also to the called instance, as
6045 6059 long as 'g' was still a gnuplot instance (so it doesn't overwrite
6046 6060 user's 'g' variables).
6047 6061
6048 6062 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
6049 6063 global variables (aliases to _ih,_oh) so that users which expect
6050 6064 In[5] or Out[7] to work aren't unpleasantly surprised.
6051 6065 (InputList.__getslice__): new class to allow executing slices of
6052 6066 input history directly. Very simple class, complements the use of
6053 6067 macros.
6054 6068
6055 6069 2002-05-16 Fernando Perez <fperez@colorado.edu>
6056 6070
6057 6071 * setup.py (docdirbase): make doc directory be just doc/IPython
6058 6072 without version numbers, it will reduce clutter for users.
6059 6073
6060 6074 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
6061 6075 execfile call to prevent possible memory leak. See for details:
6062 6076 http://mail.python.org/pipermail/python-list/2002-February/088476.html
6063 6077
6064 6078 2002-05-15 Fernando Perez <fperez@colorado.edu>
6065 6079
6066 6080 * IPython/Magic.py (Magic.magic_psource): made the object
6067 6081 introspection names be more standard: pdoc, pdef, pfile and
6068 6082 psource. They all print/page their output, and it makes
6069 6083 remembering them easier. Kept old names for compatibility as
6070 6084 aliases.
6071 6085
6072 6086 2002-05-14 Fernando Perez <fperez@colorado.edu>
6073 6087
6074 6088 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
6075 6089 what the mouse problem was. The trick is to use gnuplot with temp
6076 6090 files and NOT with pipes (for data communication), because having
6077 6091 both pipes and the mouse on is bad news.
6078 6092
6079 6093 2002-05-13 Fernando Perez <fperez@colorado.edu>
6080 6094
6081 6095 * IPython/Magic.py (Magic._ofind): fixed namespace order search
6082 6096 bug. Information would be reported about builtins even when
6083 6097 user-defined functions overrode them.
6084 6098
6085 6099 2002-05-11 Fernando Perez <fperez@colorado.edu>
6086 6100
6087 6101 * IPython/__init__.py (__all__): removed FlexCompleter from
6088 6102 __all__ so that things don't fail in platforms without readline.
6089 6103
6090 6104 2002-05-10 Fernando Perez <fperez@colorado.edu>
6091 6105
6092 6106 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
6093 6107 it requires Numeric, effectively making Numeric a dependency for
6094 6108 IPython.
6095 6109
6096 6110 * Released 0.2.13
6097 6111
6098 6112 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
6099 6113 profiler interface. Now all the major options from the profiler
6100 6114 module are directly supported in IPython, both for single
6101 6115 expressions (@prun) and for full programs (@run -p).
6102 6116
6103 6117 2002-05-09 Fernando Perez <fperez@colorado.edu>
6104 6118
6105 6119 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
6106 6120 magic properly formatted for screen.
6107 6121
6108 6122 * setup.py (make_shortcut): Changed things to put pdf version in
6109 6123 doc/ instead of doc/manual (had to change lyxport a bit).
6110 6124
6111 6125 * IPython/Magic.py (Profile.string_stats): made profile runs go
6112 6126 through pager (they are long and a pager allows searching, saving,
6113 6127 etc.)
6114 6128
6115 6129 2002-05-08 Fernando Perez <fperez@colorado.edu>
6116 6130
6117 6131 * Released 0.2.12
6118 6132
6119 6133 2002-05-06 Fernando Perez <fperez@colorado.edu>
6120 6134
6121 6135 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
6122 6136 introduced); 'hist n1 n2' was broken.
6123 6137 (Magic.magic_pdb): added optional on/off arguments to @pdb
6124 6138 (Magic.magic_run): added option -i to @run, which executes code in
6125 6139 the IPython namespace instead of a clean one. Also added @irun as
6126 6140 an alias to @run -i.
6127 6141
6128 6142 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
6129 6143 fixed (it didn't really do anything, the namespaces were wrong).
6130 6144
6131 6145 * IPython/Debugger.py (__init__): Added workaround for python 2.1
6132 6146
6133 6147 * IPython/__init__.py (__all__): Fixed package namespace, now
6134 6148 'import IPython' does give access to IPython.<all> as
6135 6149 expected. Also renamed __release__ to Release.
6136 6150
6137 6151 * IPython/Debugger.py (__license__): created new Pdb class which
6138 6152 functions like a drop-in for the normal pdb.Pdb but does NOT
6139 6153 import readline by default. This way it doesn't muck up IPython's
6140 6154 readline handling, and now tab-completion finally works in the
6141 6155 debugger -- sort of. It completes things globally visible, but the
6142 6156 completer doesn't track the stack as pdb walks it. That's a bit
6143 6157 tricky, and I'll have to implement it later.
6144 6158
6145 6159 2002-05-05 Fernando Perez <fperez@colorado.edu>
6146 6160
6147 6161 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
6148 6162 magic docstrings when printed via ? (explicit \'s were being
6149 6163 printed).
6150 6164
6151 6165 * IPython/ipmaker.py (make_IPython): fixed namespace
6152 6166 identification bug. Now variables loaded via logs or command-line
6153 6167 files are recognized in the interactive namespace by @who.
6154 6168
6155 6169 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
6156 6170 log replay system stemming from the string form of Structs.
6157 6171
6158 6172 * IPython/Magic.py (Macro.__init__): improved macros to properly
6159 6173 handle magic commands in them.
6160 6174 (Magic.magic_logstart): usernames are now expanded so 'logstart
6161 6175 ~/mylog' now works.
6162 6176
6163 6177 * IPython/iplib.py (complete): fixed bug where paths starting with
6164 6178 '/' would be completed as magic names.
6165 6179
6166 6180 2002-05-04 Fernando Perez <fperez@colorado.edu>
6167 6181
6168 6182 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
6169 6183 allow running full programs under the profiler's control.
6170 6184
6171 6185 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
6172 6186 mode to report exceptions verbosely but without formatting
6173 6187 variables. This addresses the issue of ipython 'freezing' (it's
6174 6188 not frozen, but caught in an expensive formatting loop) when huge
6175 6189 variables are in the context of an exception.
6176 6190 (VerboseTB.text): Added '--->' markers at line where exception was
6177 6191 triggered. Much clearer to read, especially in NoColor modes.
6178 6192
6179 6193 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
6180 6194 implemented in reverse when changing to the new parse_options().
6181 6195
6182 6196 2002-05-03 Fernando Perez <fperez@colorado.edu>
6183 6197
6184 6198 * IPython/Magic.py (Magic.parse_options): new function so that
6185 6199 magics can parse options easier.
6186 6200 (Magic.magic_prun): new function similar to profile.run(),
6187 6201 suggested by Chris Hart.
6188 6202 (Magic.magic_cd): fixed behavior so that it only changes if
6189 6203 directory actually is in history.
6190 6204
6191 6205 * IPython/usage.py (__doc__): added information about potential
6192 6206 slowness of Verbose exception mode when there are huge data
6193 6207 structures to be formatted (thanks to Archie Paulson).
6194 6208
6195 6209 * IPython/ipmaker.py (make_IPython): Changed default logging
6196 6210 (when simply called with -log) to use curr_dir/ipython.log in
6197 6211 rotate mode. Fixed crash which was occuring with -log before
6198 6212 (thanks to Jim Boyle).
6199 6213
6200 6214 2002-05-01 Fernando Perez <fperez@colorado.edu>
6201 6215
6202 6216 * Released 0.2.11 for these fixes (mainly the ultraTB one which
6203 6217 was nasty -- though somewhat of a corner case).
6204 6218
6205 6219 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
6206 6220 text (was a bug).
6207 6221
6208 6222 2002-04-30 Fernando Perez <fperez@colorado.edu>
6209 6223
6210 6224 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
6211 6225 a print after ^D or ^C from the user so that the In[] prompt
6212 6226 doesn't over-run the gnuplot one.
6213 6227
6214 6228 2002-04-29 Fernando Perez <fperez@colorado.edu>
6215 6229
6216 6230 * Released 0.2.10
6217 6231
6218 6232 * IPython/__release__.py (version): get date dynamically.
6219 6233
6220 6234 * Misc. documentation updates thanks to Arnd's comments. Also ran
6221 6235 a full spellcheck on the manual (hadn't been done in a while).
6222 6236
6223 6237 2002-04-27 Fernando Perez <fperez@colorado.edu>
6224 6238
6225 6239 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
6226 6240 starting a log in mid-session would reset the input history list.
6227 6241
6228 6242 2002-04-26 Fernando Perez <fperez@colorado.edu>
6229 6243
6230 6244 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
6231 6245 all files were being included in an update. Now anything in
6232 6246 UserConfig that matches [A-Za-z]*.py will go (this excludes
6233 6247 __init__.py)
6234 6248
6235 6249 2002-04-25 Fernando Perez <fperez@colorado.edu>
6236 6250
6237 6251 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
6238 6252 to __builtins__ so that any form of embedded or imported code can
6239 6253 test for being inside IPython.
6240 6254
6241 6255 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
6242 6256 changed to GnuplotMagic because it's now an importable module,
6243 6257 this makes the name follow that of the standard Gnuplot module.
6244 6258 GnuplotMagic can now be loaded at any time in mid-session.
6245 6259
6246 6260 2002-04-24 Fernando Perez <fperez@colorado.edu>
6247 6261
6248 6262 * IPython/numutils.py: removed SIUnits. It doesn't properly set
6249 6263 the globals (IPython has its own namespace) and the
6250 6264 PhysicalQuantity stuff is much better anyway.
6251 6265
6252 6266 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
6253 6267 embedding example to standard user directory for
6254 6268 distribution. Also put it in the manual.
6255 6269
6256 6270 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
6257 6271 instance as first argument (so it doesn't rely on some obscure
6258 6272 hidden global).
6259 6273
6260 6274 * IPython/UserConfig/ipythonrc.py: put () back in accepted
6261 6275 delimiters. While it prevents ().TAB from working, it allows
6262 6276 completions in open (... expressions. This is by far a more common
6263 6277 case.
6264 6278
6265 6279 2002-04-23 Fernando Perez <fperez@colorado.edu>
6266 6280
6267 6281 * IPython/Extensions/InterpreterPasteInput.py: new
6268 6282 syntax-processing module for pasting lines with >>> or ... at the
6269 6283 start.
6270 6284
6271 6285 * IPython/Extensions/PhysicalQ_Interactive.py
6272 6286 (PhysicalQuantityInteractive.__int__): fixed to work with either
6273 6287 Numeric or math.
6274 6288
6275 6289 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
6276 6290 provided profiles. Now we have:
6277 6291 -math -> math module as * and cmath with its own namespace.
6278 6292 -numeric -> Numeric as *, plus gnuplot & grace
6279 6293 -physics -> same as before
6280 6294
6281 6295 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
6282 6296 user-defined magics wouldn't be found by @magic if they were
6283 6297 defined as class methods. Also cleaned up the namespace search
6284 6298 logic and the string building (to use %s instead of many repeated
6285 6299 string adds).
6286 6300
6287 6301 * IPython/UserConfig/example-magic.py (magic_foo): updated example
6288 6302 of user-defined magics to operate with class methods (cleaner, in
6289 6303 line with the gnuplot code).
6290 6304
6291 6305 2002-04-22 Fernando Perez <fperez@colorado.edu>
6292 6306
6293 6307 * setup.py: updated dependency list so that manual is updated when
6294 6308 all included files change.
6295 6309
6296 6310 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
6297 6311 the delimiter removal option (the fix is ugly right now).
6298 6312
6299 6313 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
6300 6314 all of the math profile (quicker loading, no conflict between
6301 6315 g-9.8 and g-gnuplot).
6302 6316
6303 6317 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
6304 6318 name of post-mortem files to IPython_crash_report.txt.
6305 6319
6306 6320 * Cleanup/update of the docs. Added all the new readline info and
6307 6321 formatted all lists as 'real lists'.
6308 6322
6309 6323 * IPython/ipmaker.py (make_IPython): removed now-obsolete
6310 6324 tab-completion options, since the full readline parse_and_bind is
6311 6325 now accessible.
6312 6326
6313 6327 * IPython/iplib.py (InteractiveShell.init_readline): Changed
6314 6328 handling of readline options. Now users can specify any string to
6315 6329 be passed to parse_and_bind(), as well as the delimiters to be
6316 6330 removed.
6317 6331 (InteractiveShell.__init__): Added __name__ to the global
6318 6332 namespace so that things like Itpl which rely on its existence
6319 6333 don't crash.
6320 6334 (InteractiveShell._prefilter): Defined the default with a _ so
6321 6335 that prefilter() is easier to override, while the default one
6322 6336 remains available.
6323 6337
6324 6338 2002-04-18 Fernando Perez <fperez@colorado.edu>
6325 6339
6326 6340 * Added information about pdb in the docs.
6327 6341
6328 6342 2002-04-17 Fernando Perez <fperez@colorado.edu>
6329 6343
6330 6344 * IPython/ipmaker.py (make_IPython): added rc_override option to
6331 6345 allow passing config options at creation time which may override
6332 6346 anything set in the config files or command line. This is
6333 6347 particularly useful for configuring embedded instances.
6334 6348
6335 6349 2002-04-15 Fernando Perez <fperez@colorado.edu>
6336 6350
6337 6351 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
6338 6352 crash embedded instances because of the input cache falling out of
6339 6353 sync with the output counter.
6340 6354
6341 6355 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
6342 6356 mode which calls pdb after an uncaught exception in IPython itself.
6343 6357
6344 6358 2002-04-14 Fernando Perez <fperez@colorado.edu>
6345 6359
6346 6360 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
6347 6361 readline, fix it back after each call.
6348 6362
6349 6363 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
6350 6364 method to force all access via __call__(), which guarantees that
6351 6365 traceback references are properly deleted.
6352 6366
6353 6367 * IPython/Prompts.py (CachedOutput._display): minor fixes to
6354 6368 improve printing when pprint is in use.
6355 6369
6356 6370 2002-04-13 Fernando Perez <fperez@colorado.edu>
6357 6371
6358 6372 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
6359 6373 exceptions aren't caught anymore. If the user triggers one, he
6360 6374 should know why he's doing it and it should go all the way up,
6361 6375 just like any other exception. So now @abort will fully kill the
6362 6376 embedded interpreter and the embedding code (unless that happens
6363 6377 to catch SystemExit).
6364 6378
6365 6379 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
6366 6380 and a debugger() method to invoke the interactive pdb debugger
6367 6381 after printing exception information. Also added the corresponding
6368 6382 -pdb option and @pdb magic to control this feature, and updated
6369 6383 the docs. After a suggestion from Christopher Hart
6370 6384 (hart-AT-caltech.edu).
6371 6385
6372 6386 2002-04-12 Fernando Perez <fperez@colorado.edu>
6373 6387
6374 6388 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
6375 6389 the exception handlers defined by the user (not the CrashHandler)
6376 6390 so that user exceptions don't trigger an ipython bug report.
6377 6391
6378 6392 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
6379 6393 configurable (it should have always been so).
6380 6394
6381 6395 2002-03-26 Fernando Perez <fperez@colorado.edu>
6382 6396
6383 6397 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
6384 6398 and there to fix embedding namespace issues. This should all be
6385 6399 done in a more elegant way.
6386 6400
6387 6401 2002-03-25 Fernando Perez <fperez@colorado.edu>
6388 6402
6389 6403 * IPython/genutils.py (get_home_dir): Try to make it work under
6390 6404 win9x also.
6391 6405
6392 6406 2002-03-20 Fernando Perez <fperez@colorado.edu>
6393 6407
6394 6408 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
6395 6409 sys.displayhook untouched upon __init__.
6396 6410
6397 6411 2002-03-19 Fernando Perez <fperez@colorado.edu>
6398 6412
6399 6413 * Released 0.2.9 (for embedding bug, basically).
6400 6414
6401 6415 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
6402 6416 exceptions so that enclosing shell's state can be restored.
6403 6417
6404 6418 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
6405 6419 naming conventions in the .ipython/ dir.
6406 6420
6407 6421 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
6408 6422 from delimiters list so filenames with - in them get expanded.
6409 6423
6410 6424 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
6411 6425 sys.displayhook not being properly restored after an embedded call.
6412 6426
6413 6427 2002-03-18 Fernando Perez <fperez@colorado.edu>
6414 6428
6415 6429 * Released 0.2.8
6416 6430
6417 6431 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
6418 6432 some files weren't being included in a -upgrade.
6419 6433 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
6420 6434 on' so that the first tab completes.
6421 6435 (InteractiveShell.handle_magic): fixed bug with spaces around
6422 6436 quotes breaking many magic commands.
6423 6437
6424 6438 * setup.py: added note about ignoring the syntax error messages at
6425 6439 installation.
6426 6440
6427 6441 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
6428 6442 streamlining the gnuplot interface, now there's only one magic @gp.
6429 6443
6430 6444 2002-03-17 Fernando Perez <fperez@colorado.edu>
6431 6445
6432 6446 * IPython/UserConfig/magic_gnuplot.py: new name for the
6433 6447 example-magic_pm.py file. Much enhanced system, now with a shell
6434 6448 for communicating directly with gnuplot, one command at a time.
6435 6449
6436 6450 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
6437 6451 setting __name__=='__main__'.
6438 6452
6439 6453 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
6440 6454 mini-shell for accessing gnuplot from inside ipython. Should
6441 6455 extend it later for grace access too. Inspired by Arnd's
6442 6456 suggestion.
6443 6457
6444 6458 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
6445 6459 calling magic functions with () in their arguments. Thanks to Arnd
6446 6460 Baecker for pointing this to me.
6447 6461
6448 6462 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
6449 6463 infinitely for integer or complex arrays (only worked with floats).
6450 6464
6451 6465 2002-03-16 Fernando Perez <fperez@colorado.edu>
6452 6466
6453 6467 * setup.py: Merged setup and setup_windows into a single script
6454 6468 which properly handles things for windows users.
6455 6469
6456 6470 2002-03-15 Fernando Perez <fperez@colorado.edu>
6457 6471
6458 6472 * Big change to the manual: now the magics are all automatically
6459 6473 documented. This information is generated from their docstrings
6460 6474 and put in a latex file included by the manual lyx file. This way
6461 6475 we get always up to date information for the magics. The manual
6462 6476 now also has proper version information, also auto-synced.
6463 6477
6464 6478 For this to work, an undocumented --magic_docstrings option was added.
6465 6479
6466 6480 2002-03-13 Fernando Perez <fperez@colorado.edu>
6467 6481
6468 6482 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
6469 6483 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
6470 6484
6471 6485 2002-03-12 Fernando Perez <fperez@colorado.edu>
6472 6486
6473 6487 * IPython/ultraTB.py (TermColors): changed color escapes again to
6474 6488 fix the (old, reintroduced) line-wrapping bug. Basically, if
6475 6489 \001..\002 aren't given in the color escapes, lines get wrapped
6476 6490 weirdly. But giving those screws up old xterms and emacs terms. So
6477 6491 I added some logic for emacs terms to be ok, but I can't identify old
6478 6492 xterms separately ($TERM=='xterm' for many terminals, like konsole).
6479 6493
6480 6494 2002-03-10 Fernando Perez <fperez@colorado.edu>
6481 6495
6482 6496 * IPython/usage.py (__doc__): Various documentation cleanups and
6483 6497 updates, both in usage docstrings and in the manual.
6484 6498
6485 6499 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
6486 6500 handling of caching. Set minimum acceptabe value for having a
6487 6501 cache at 20 values.
6488 6502
6489 6503 * IPython/iplib.py (InteractiveShell.user_setup): moved the
6490 6504 install_first_time function to a method, renamed it and added an
6491 6505 'upgrade' mode. Now people can update their config directory with
6492 6506 a simple command line switch (-upgrade, also new).
6493 6507
6494 6508 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
6495 6509 @file (convenient for automagic users under Python >= 2.2).
6496 6510 Removed @files (it seemed more like a plural than an abbrev. of
6497 6511 'file show').
6498 6512
6499 6513 * IPython/iplib.py (install_first_time): Fixed crash if there were
6500 6514 backup files ('~') in .ipython/ install directory.
6501 6515
6502 6516 * IPython/ipmaker.py (make_IPython): fixes for new prompt
6503 6517 system. Things look fine, but these changes are fairly
6504 6518 intrusive. Test them for a few days.
6505 6519
6506 6520 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
6507 6521 the prompts system. Now all in/out prompt strings are user
6508 6522 controllable. This is particularly useful for embedding, as one
6509 6523 can tag embedded instances with particular prompts.
6510 6524
6511 6525 Also removed global use of sys.ps1/2, which now allows nested
6512 6526 embeddings without any problems. Added command-line options for
6513 6527 the prompt strings.
6514 6528
6515 6529 2002-03-08 Fernando Perez <fperez@colorado.edu>
6516 6530
6517 6531 * IPython/UserConfig/example-embed-short.py (ipshell): added
6518 6532 example file with the bare minimum code for embedding.
6519 6533
6520 6534 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
6521 6535 functionality for the embeddable shell to be activated/deactivated
6522 6536 either globally or at each call.
6523 6537
6524 6538 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
6525 6539 rewriting the prompt with '--->' for auto-inputs with proper
6526 6540 coloring. Now the previous UGLY hack in handle_auto() is gone, and
6527 6541 this is handled by the prompts class itself, as it should.
6528 6542
6529 6543 2002-03-05 Fernando Perez <fperez@colorado.edu>
6530 6544
6531 6545 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
6532 6546 @logstart to avoid name clashes with the math log function.
6533 6547
6534 6548 * Big updates to X/Emacs section of the manual.
6535 6549
6536 6550 * Removed ipython_emacs. Milan explained to me how to pass
6537 6551 arguments to ipython through Emacs. Some day I'm going to end up
6538 6552 learning some lisp...
6539 6553
6540 6554 2002-03-04 Fernando Perez <fperez@colorado.edu>
6541 6555
6542 6556 * IPython/ipython_emacs: Created script to be used as the
6543 6557 py-python-command Emacs variable so we can pass IPython
6544 6558 parameters. I can't figure out how to tell Emacs directly to pass
6545 6559 parameters to IPython, so a dummy shell script will do it.
6546 6560
6547 6561 Other enhancements made for things to work better under Emacs'
6548 6562 various types of terminals. Many thanks to Milan Zamazal
6549 6563 <pdm-AT-zamazal.org> for all the suggestions and pointers.
6550 6564
6551 6565 2002-03-01 Fernando Perez <fperez@colorado.edu>
6552 6566
6553 6567 * IPython/ipmaker.py (make_IPython): added a --readline! option so
6554 6568 that loading of readline is now optional. This gives better
6555 6569 control to emacs users.
6556 6570
6557 6571 * IPython/ultraTB.py (__date__): Modified color escape sequences
6558 6572 and now things work fine under xterm and in Emacs' term buffers
6559 6573 (though not shell ones). Well, in emacs you get colors, but all
6560 6574 seem to be 'light' colors (no difference between dark and light
6561 6575 ones). But the garbage chars are gone, and also in xterms. It
6562 6576 seems that now I'm using 'cleaner' ansi sequences.
6563 6577
6564 6578 2002-02-21 Fernando Perez <fperez@colorado.edu>
6565 6579
6566 6580 * Released 0.2.7 (mainly to publish the scoping fix).
6567 6581
6568 6582 * IPython/Logger.py (Logger.logstate): added. A corresponding
6569 6583 @logstate magic was created.
6570 6584
6571 6585 * IPython/Magic.py: fixed nested scoping problem under Python
6572 6586 2.1.x (automagic wasn't working).
6573 6587
6574 6588 2002-02-20 Fernando Perez <fperez@colorado.edu>
6575 6589
6576 6590 * Released 0.2.6.
6577 6591
6578 6592 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6579 6593 option so that logs can come out without any headers at all.
6580 6594
6581 6595 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6582 6596 SciPy.
6583 6597
6584 6598 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6585 6599 that embedded IPython calls don't require vars() to be explicitly
6586 6600 passed. Now they are extracted from the caller's frame (code
6587 6601 snatched from Eric Jones' weave). Added better documentation to
6588 6602 the section on embedding and the example file.
6589 6603
6590 6604 * IPython/genutils.py (page): Changed so that under emacs, it just
6591 6605 prints the string. You can then page up and down in the emacs
6592 6606 buffer itself. This is how the builtin help() works.
6593 6607
6594 6608 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6595 6609 macro scoping: macros need to be executed in the user's namespace
6596 6610 to work as if they had been typed by the user.
6597 6611
6598 6612 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6599 6613 execute automatically (no need to type 'exec...'). They then
6600 6614 behave like 'true macros'. The printing system was also modified
6601 6615 for this to work.
6602 6616
6603 6617 2002-02-19 Fernando Perez <fperez@colorado.edu>
6604 6618
6605 6619 * IPython/genutils.py (page_file): new function for paging files
6606 6620 in an OS-independent way. Also necessary for file viewing to work
6607 6621 well inside Emacs buffers.
6608 6622 (page): Added checks for being in an emacs buffer.
6609 6623 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6610 6624 same bug in iplib.
6611 6625
6612 6626 2002-02-18 Fernando Perez <fperez@colorado.edu>
6613 6627
6614 6628 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6615 6629 of readline so that IPython can work inside an Emacs buffer.
6616 6630
6617 6631 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6618 6632 method signatures (they weren't really bugs, but it looks cleaner
6619 6633 and keeps PyChecker happy).
6620 6634
6621 6635 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6622 6636 for implementing various user-defined hooks. Currently only
6623 6637 display is done.
6624 6638
6625 6639 * IPython/Prompts.py (CachedOutput._display): changed display
6626 6640 functions so that they can be dynamically changed by users easily.
6627 6641
6628 6642 * IPython/Extensions/numeric_formats.py (num_display): added an
6629 6643 extension for printing NumPy arrays in flexible manners. It
6630 6644 doesn't do anything yet, but all the structure is in
6631 6645 place. Ultimately the plan is to implement output format control
6632 6646 like in Octave.
6633 6647
6634 6648 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6635 6649 methods are found at run-time by all the automatic machinery.
6636 6650
6637 6651 2002-02-17 Fernando Perez <fperez@colorado.edu>
6638 6652
6639 6653 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6640 6654 whole file a little.
6641 6655
6642 6656 * ToDo: closed this document. Now there's a new_design.lyx
6643 6657 document for all new ideas. Added making a pdf of it for the
6644 6658 end-user distro.
6645 6659
6646 6660 * IPython/Logger.py (Logger.switch_log): Created this to replace
6647 6661 logon() and logoff(). It also fixes a nasty crash reported by
6648 6662 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6649 6663
6650 6664 * IPython/iplib.py (complete): got auto-completion to work with
6651 6665 automagic (I had wanted this for a long time).
6652 6666
6653 6667 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6654 6668 to @file, since file() is now a builtin and clashes with automagic
6655 6669 for @file.
6656 6670
6657 6671 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6658 6672 of this was previously in iplib, which had grown to more than 2000
6659 6673 lines, way too long. No new functionality, but it makes managing
6660 6674 the code a bit easier.
6661 6675
6662 6676 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6663 6677 information to crash reports.
6664 6678
6665 6679 2002-02-12 Fernando Perez <fperez@colorado.edu>
6666 6680
6667 6681 * Released 0.2.5.
6668 6682
6669 6683 2002-02-11 Fernando Perez <fperez@colorado.edu>
6670 6684
6671 6685 * Wrote a relatively complete Windows installer. It puts
6672 6686 everything in place, creates Start Menu entries and fixes the
6673 6687 color issues. Nothing fancy, but it works.
6674 6688
6675 6689 2002-02-10 Fernando Perez <fperez@colorado.edu>
6676 6690
6677 6691 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6678 6692 os.path.expanduser() call so that we can type @run ~/myfile.py and
6679 6693 have thigs work as expected.
6680 6694
6681 6695 * IPython/genutils.py (page): fixed exception handling so things
6682 6696 work both in Unix and Windows correctly. Quitting a pager triggers
6683 6697 an IOError/broken pipe in Unix, and in windows not finding a pager
6684 6698 is also an IOError, so I had to actually look at the return value
6685 6699 of the exception, not just the exception itself. Should be ok now.
6686 6700
6687 6701 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6688 6702 modified to allow case-insensitive color scheme changes.
6689 6703
6690 6704 2002-02-09 Fernando Perez <fperez@colorado.edu>
6691 6705
6692 6706 * IPython/genutils.py (native_line_ends): new function to leave
6693 6707 user config files with os-native line-endings.
6694 6708
6695 6709 * README and manual updates.
6696 6710
6697 6711 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6698 6712 instead of StringType to catch Unicode strings.
6699 6713
6700 6714 * IPython/genutils.py (filefind): fixed bug for paths with
6701 6715 embedded spaces (very common in Windows).
6702 6716
6703 6717 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6704 6718 files under Windows, so that they get automatically associated
6705 6719 with a text editor. Windows makes it a pain to handle
6706 6720 extension-less files.
6707 6721
6708 6722 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6709 6723 warning about readline only occur for Posix. In Windows there's no
6710 6724 way to get readline, so why bother with the warning.
6711 6725
6712 6726 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6713 6727 for __str__ instead of dir(self), since dir() changed in 2.2.
6714 6728
6715 6729 * Ported to Windows! Tested on XP, I suspect it should work fine
6716 6730 on NT/2000, but I don't think it will work on 98 et al. That
6717 6731 series of Windows is such a piece of junk anyway that I won't try
6718 6732 porting it there. The XP port was straightforward, showed a few
6719 6733 bugs here and there (fixed all), in particular some string
6720 6734 handling stuff which required considering Unicode strings (which
6721 6735 Windows uses). This is good, but hasn't been too tested :) No
6722 6736 fancy installer yet, I'll put a note in the manual so people at
6723 6737 least make manually a shortcut.
6724 6738
6725 6739 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6726 6740 into a single one, "colors". This now controls both prompt and
6727 6741 exception color schemes, and can be changed both at startup
6728 6742 (either via command-line switches or via ipythonrc files) and at
6729 6743 runtime, with @colors.
6730 6744 (Magic.magic_run): renamed @prun to @run and removed the old
6731 6745 @run. The two were too similar to warrant keeping both.
6732 6746
6733 6747 2002-02-03 Fernando Perez <fperez@colorado.edu>
6734 6748
6735 6749 * IPython/iplib.py (install_first_time): Added comment on how to
6736 6750 configure the color options for first-time users. Put a <return>
6737 6751 request at the end so that small-terminal users get a chance to
6738 6752 read the startup info.
6739 6753
6740 6754 2002-01-23 Fernando Perez <fperez@colorado.edu>
6741 6755
6742 6756 * IPython/iplib.py (CachedOutput.update): Changed output memory
6743 6757 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6744 6758 input history we still use _i. Did this b/c these variable are
6745 6759 very commonly used in interactive work, so the less we need to
6746 6760 type the better off we are.
6747 6761 (Magic.magic_prun): updated @prun to better handle the namespaces
6748 6762 the file will run in, including a fix for __name__ not being set
6749 6763 before.
6750 6764
6751 6765 2002-01-20 Fernando Perez <fperez@colorado.edu>
6752 6766
6753 6767 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6754 6768 extra garbage for Python 2.2. Need to look more carefully into
6755 6769 this later.
6756 6770
6757 6771 2002-01-19 Fernando Perez <fperez@colorado.edu>
6758 6772
6759 6773 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6760 6774 display SyntaxError exceptions properly formatted when they occur
6761 6775 (they can be triggered by imported code).
6762 6776
6763 6777 2002-01-18 Fernando Perez <fperez@colorado.edu>
6764 6778
6765 6779 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6766 6780 SyntaxError exceptions are reported nicely formatted, instead of
6767 6781 spitting out only offset information as before.
6768 6782 (Magic.magic_prun): Added the @prun function for executing
6769 6783 programs with command line args inside IPython.
6770 6784
6771 6785 2002-01-16 Fernando Perez <fperez@colorado.edu>
6772 6786
6773 6787 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6774 6788 to *not* include the last item given in a range. This brings their
6775 6789 behavior in line with Python's slicing:
6776 6790 a[n1:n2] -> a[n1]...a[n2-1]
6777 6791 It may be a bit less convenient, but I prefer to stick to Python's
6778 6792 conventions *everywhere*, so users never have to wonder.
6779 6793 (Magic.magic_macro): Added @macro function to ease the creation of
6780 6794 macros.
6781 6795
6782 6796 2002-01-05 Fernando Perez <fperez@colorado.edu>
6783 6797
6784 6798 * Released 0.2.4.
6785 6799
6786 6800 * IPython/iplib.py (Magic.magic_pdef):
6787 6801 (InteractiveShell.safe_execfile): report magic lines and error
6788 6802 lines without line numbers so one can easily copy/paste them for
6789 6803 re-execution.
6790 6804
6791 6805 * Updated manual with recent changes.
6792 6806
6793 6807 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6794 6808 docstring printing when class? is called. Very handy for knowing
6795 6809 how to create class instances (as long as __init__ is well
6796 6810 documented, of course :)
6797 6811 (Magic.magic_doc): print both class and constructor docstrings.
6798 6812 (Magic.magic_pdef): give constructor info if passed a class and
6799 6813 __call__ info for callable object instances.
6800 6814
6801 6815 2002-01-04 Fernando Perez <fperez@colorado.edu>
6802 6816
6803 6817 * Made deep_reload() off by default. It doesn't always work
6804 6818 exactly as intended, so it's probably safer to have it off. It's
6805 6819 still available as dreload() anyway, so nothing is lost.
6806 6820
6807 6821 2002-01-02 Fernando Perez <fperez@colorado.edu>
6808 6822
6809 6823 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6810 6824 so I wanted an updated release).
6811 6825
6812 6826 2001-12-27 Fernando Perez <fperez@colorado.edu>
6813 6827
6814 6828 * IPython/iplib.py (InteractiveShell.interact): Added the original
6815 6829 code from 'code.py' for this module in order to change the
6816 6830 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6817 6831 the history cache would break when the user hit Ctrl-C, and
6818 6832 interact() offers no way to add any hooks to it.
6819 6833
6820 6834 2001-12-23 Fernando Perez <fperez@colorado.edu>
6821 6835
6822 6836 * setup.py: added check for 'MANIFEST' before trying to remove
6823 6837 it. Thanks to Sean Reifschneider.
6824 6838
6825 6839 2001-12-22 Fernando Perez <fperez@colorado.edu>
6826 6840
6827 6841 * Released 0.2.2.
6828 6842
6829 6843 * Finished (reasonably) writing the manual. Later will add the
6830 6844 python-standard navigation stylesheets, but for the time being
6831 6845 it's fairly complete. Distribution will include html and pdf
6832 6846 versions.
6833 6847
6834 6848 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6835 6849 (MayaVi author).
6836 6850
6837 6851 2001-12-21 Fernando Perez <fperez@colorado.edu>
6838 6852
6839 6853 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6840 6854 good public release, I think (with the manual and the distutils
6841 6855 installer). The manual can use some work, but that can go
6842 6856 slowly. Otherwise I think it's quite nice for end users. Next
6843 6857 summer, rewrite the guts of it...
6844 6858
6845 6859 * Changed format of ipythonrc files to use whitespace as the
6846 6860 separator instead of an explicit '='. Cleaner.
6847 6861
6848 6862 2001-12-20 Fernando Perez <fperez@colorado.edu>
6849 6863
6850 6864 * Started a manual in LyX. For now it's just a quick merge of the
6851 6865 various internal docstrings and READMEs. Later it may grow into a
6852 6866 nice, full-blown manual.
6853 6867
6854 6868 * Set up a distutils based installer. Installation should now be
6855 6869 trivially simple for end-users.
6856 6870
6857 6871 2001-12-11 Fernando Perez <fperez@colorado.edu>
6858 6872
6859 6873 * Released 0.2.0. First public release, announced it at
6860 6874 comp.lang.python. From now on, just bugfixes...
6861 6875
6862 6876 * Went through all the files, set copyright/license notices and
6863 6877 cleaned up things. Ready for release.
6864 6878
6865 6879 2001-12-10 Fernando Perez <fperez@colorado.edu>
6866 6880
6867 6881 * Changed the first-time installer not to use tarfiles. It's more
6868 6882 robust now and less unix-dependent. Also makes it easier for
6869 6883 people to later upgrade versions.
6870 6884
6871 6885 * Changed @exit to @abort to reflect the fact that it's pretty
6872 6886 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6873 6887 becomes significant only when IPyhton is embedded: in that case,
6874 6888 C-D closes IPython only, but @abort kills the enclosing program
6875 6889 too (unless it had called IPython inside a try catching
6876 6890 SystemExit).
6877 6891
6878 6892 * Created Shell module which exposes the actuall IPython Shell
6879 6893 classes, currently the normal and the embeddable one. This at
6880 6894 least offers a stable interface we won't need to change when
6881 6895 (later) the internals are rewritten. That rewrite will be confined
6882 6896 to iplib and ipmaker, but the Shell interface should remain as is.
6883 6897
6884 6898 * Added embed module which offers an embeddable IPShell object,
6885 6899 useful to fire up IPython *inside* a running program. Great for
6886 6900 debugging or dynamical data analysis.
6887 6901
6888 6902 2001-12-08 Fernando Perez <fperez@colorado.edu>
6889 6903
6890 6904 * Fixed small bug preventing seeing info from methods of defined
6891 6905 objects (incorrect namespace in _ofind()).
6892 6906
6893 6907 * Documentation cleanup. Moved the main usage docstrings to a
6894 6908 separate file, usage.py (cleaner to maintain, and hopefully in the
6895 6909 future some perlpod-like way of producing interactive, man and
6896 6910 html docs out of it will be found).
6897 6911
6898 6912 * Added @profile to see your profile at any time.
6899 6913
6900 6914 * Added @p as an alias for 'print'. It's especially convenient if
6901 6915 using automagic ('p x' prints x).
6902 6916
6903 6917 * Small cleanups and fixes after a pychecker run.
6904 6918
6905 6919 * Changed the @cd command to handle @cd - and @cd -<n> for
6906 6920 visiting any directory in _dh.
6907 6921
6908 6922 * Introduced _dh, a history of visited directories. @dhist prints
6909 6923 it out with numbers.
6910 6924
6911 6925 2001-12-07 Fernando Perez <fperez@colorado.edu>
6912 6926
6913 6927 * Released 0.1.22
6914 6928
6915 6929 * Made initialization a bit more robust against invalid color
6916 6930 options in user input (exit, not traceback-crash).
6917 6931
6918 6932 * Changed the bug crash reporter to write the report only in the
6919 6933 user's .ipython directory. That way IPython won't litter people's
6920 6934 hard disks with crash files all over the place. Also print on
6921 6935 screen the necessary mail command.
6922 6936
6923 6937 * With the new ultraTB, implemented LightBG color scheme for light
6924 6938 background terminals. A lot of people like white backgrounds, so I
6925 6939 guess we should at least give them something readable.
6926 6940
6927 6941 2001-12-06 Fernando Perez <fperez@colorado.edu>
6928 6942
6929 6943 * Modified the structure of ultraTB. Now there's a proper class
6930 6944 for tables of color schemes which allow adding schemes easily and
6931 6945 switching the active scheme without creating a new instance every
6932 6946 time (which was ridiculous). The syntax for creating new schemes
6933 6947 is also cleaner. I think ultraTB is finally done, with a clean
6934 6948 class structure. Names are also much cleaner (now there's proper
6935 6949 color tables, no need for every variable to also have 'color' in
6936 6950 its name).
6937 6951
6938 6952 * Broke down genutils into separate files. Now genutils only
6939 6953 contains utility functions, and classes have been moved to their
6940 6954 own files (they had enough independent functionality to warrant
6941 6955 it): ConfigLoader, OutputTrap, Struct.
6942 6956
6943 6957 2001-12-05 Fernando Perez <fperez@colorado.edu>
6944 6958
6945 6959 * IPython turns 21! Released version 0.1.21, as a candidate for
6946 6960 public consumption. If all goes well, release in a few days.
6947 6961
6948 6962 * Fixed path bug (files in Extensions/ directory wouldn't be found
6949 6963 unless IPython/ was explicitly in sys.path).
6950 6964
6951 6965 * Extended the FlexCompleter class as MagicCompleter to allow
6952 6966 completion of @-starting lines.
6953 6967
6954 6968 * Created __release__.py file as a central repository for release
6955 6969 info that other files can read from.
6956 6970
6957 6971 * Fixed small bug in logging: when logging was turned on in
6958 6972 mid-session, old lines with special meanings (!@?) were being
6959 6973 logged without the prepended comment, which is necessary since
6960 6974 they are not truly valid python syntax. This should make session
6961 6975 restores produce less errors.
6962 6976
6963 6977 * The namespace cleanup forced me to make a FlexCompleter class
6964 6978 which is nothing but a ripoff of rlcompleter, but with selectable
6965 6979 namespace (rlcompleter only works in __main__.__dict__). I'll try
6966 6980 to submit a note to the authors to see if this change can be
6967 6981 incorporated in future rlcompleter releases (Dec.6: done)
6968 6982
6969 6983 * More fixes to namespace handling. It was a mess! Now all
6970 6984 explicit references to __main__.__dict__ are gone (except when
6971 6985 really needed) and everything is handled through the namespace
6972 6986 dicts in the IPython instance. We seem to be getting somewhere
6973 6987 with this, finally...
6974 6988
6975 6989 * Small documentation updates.
6976 6990
6977 6991 * Created the Extensions directory under IPython (with an
6978 6992 __init__.py). Put the PhysicalQ stuff there. This directory should
6979 6993 be used for all special-purpose extensions.
6980 6994
6981 6995 * File renaming:
6982 6996 ipythonlib --> ipmaker
6983 6997 ipplib --> iplib
6984 6998 This makes a bit more sense in terms of what these files actually do.
6985 6999
6986 7000 * Moved all the classes and functions in ipythonlib to ipplib, so
6987 7001 now ipythonlib only has make_IPython(). This will ease up its
6988 7002 splitting in smaller functional chunks later.
6989 7003
6990 7004 * Cleaned up (done, I think) output of @whos. Better column
6991 7005 formatting, and now shows str(var) for as much as it can, which is
6992 7006 typically what one gets with a 'print var'.
6993 7007
6994 7008 2001-12-04 Fernando Perez <fperez@colorado.edu>
6995 7009
6996 7010 * Fixed namespace problems. Now builtin/IPyhton/user names get
6997 7011 properly reported in their namespace. Internal namespace handling
6998 7012 is finally getting decent (not perfect yet, but much better than
6999 7013 the ad-hoc mess we had).
7000 7014
7001 7015 * Removed -exit option. If people just want to run a python
7002 7016 script, that's what the normal interpreter is for. Less
7003 7017 unnecessary options, less chances for bugs.
7004 7018
7005 7019 * Added a crash handler which generates a complete post-mortem if
7006 7020 IPython crashes. This will help a lot in tracking bugs down the
7007 7021 road.
7008 7022
7009 7023 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
7010 7024 which were boud to functions being reassigned would bypass the
7011 7025 logger, breaking the sync of _il with the prompt counter. This
7012 7026 would then crash IPython later when a new line was logged.
7013 7027
7014 7028 2001-12-02 Fernando Perez <fperez@colorado.edu>
7015 7029
7016 7030 * Made IPython a package. This means people don't have to clutter
7017 7031 their sys.path with yet another directory. Changed the INSTALL
7018 7032 file accordingly.
7019 7033
7020 7034 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
7021 7035 sorts its output (so @who shows it sorted) and @whos formats the
7022 7036 table according to the width of the first column. Nicer, easier to
7023 7037 read. Todo: write a generic table_format() which takes a list of
7024 7038 lists and prints it nicely formatted, with optional row/column
7025 7039 separators and proper padding and justification.
7026 7040
7027 7041 * Released 0.1.20
7028 7042
7029 7043 * Fixed bug in @log which would reverse the inputcache list (a
7030 7044 copy operation was missing).
7031 7045
7032 7046 * Code cleanup. @config was changed to use page(). Better, since
7033 7047 its output is always quite long.
7034 7048
7035 7049 * Itpl is back as a dependency. I was having too many problems
7036 7050 getting the parametric aliases to work reliably, and it's just
7037 7051 easier to code weird string operations with it than playing %()s
7038 7052 games. It's only ~6k, so I don't think it's too big a deal.
7039 7053
7040 7054 * Found (and fixed) a very nasty bug with history. !lines weren't
7041 7055 getting cached, and the out of sync caches would crash
7042 7056 IPython. Fixed it by reorganizing the prefilter/handlers/logger
7043 7057 division of labor a bit better. Bug fixed, cleaner structure.
7044 7058
7045 7059 2001-12-01 Fernando Perez <fperez@colorado.edu>
7046 7060
7047 7061 * Released 0.1.19
7048 7062
7049 7063 * Added option -n to @hist to prevent line number printing. Much
7050 7064 easier to copy/paste code this way.
7051 7065
7052 7066 * Created global _il to hold the input list. Allows easy
7053 7067 re-execution of blocks of code by slicing it (inspired by Janko's
7054 7068 comment on 'macros').
7055 7069
7056 7070 * Small fixes and doc updates.
7057 7071
7058 7072 * Rewrote @history function (was @h). Renamed it to @hist, @h is
7059 7073 much too fragile with automagic. Handles properly multi-line
7060 7074 statements and takes parameters.
7061 7075
7062 7076 2001-11-30 Fernando Perez <fperez@colorado.edu>
7063 7077
7064 7078 * Version 0.1.18 released.
7065 7079
7066 7080 * Fixed nasty namespace bug in initial module imports.
7067 7081
7068 7082 * Added copyright/license notes to all code files (except
7069 7083 DPyGetOpt). For the time being, LGPL. That could change.
7070 7084
7071 7085 * Rewrote a much nicer README, updated INSTALL, cleaned up
7072 7086 ipythonrc-* samples.
7073 7087
7074 7088 * Overall code/documentation cleanup. Basically ready for
7075 7089 release. Only remaining thing: licence decision (LGPL?).
7076 7090
7077 7091 * Converted load_config to a class, ConfigLoader. Now recursion
7078 7092 control is better organized. Doesn't include the same file twice.
7079 7093
7080 7094 2001-11-29 Fernando Perez <fperez@colorado.edu>
7081 7095
7082 7096 * Got input history working. Changed output history variables from
7083 7097 _p to _o so that _i is for input and _o for output. Just cleaner
7084 7098 convention.
7085 7099
7086 7100 * Implemented parametric aliases. This pretty much allows the
7087 7101 alias system to offer full-blown shell convenience, I think.
7088 7102
7089 7103 * Version 0.1.17 released, 0.1.18 opened.
7090 7104
7091 7105 * dot_ipython/ipythonrc (alias): added documentation.
7092 7106 (xcolor): Fixed small bug (xcolors -> xcolor)
7093 7107
7094 7108 * Changed the alias system. Now alias is a magic command to define
7095 7109 aliases just like the shell. Rationale: the builtin magics should
7096 7110 be there for things deeply connected to IPython's
7097 7111 architecture. And this is a much lighter system for what I think
7098 7112 is the really important feature: allowing users to define quickly
7099 7113 magics that will do shell things for them, so they can customize
7100 7114 IPython easily to match their work habits. If someone is really
7101 7115 desperate to have another name for a builtin alias, they can
7102 7116 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
7103 7117 works.
7104 7118
7105 7119 2001-11-28 Fernando Perez <fperez@colorado.edu>
7106 7120
7107 7121 * Changed @file so that it opens the source file at the proper
7108 7122 line. Since it uses less, if your EDITOR environment is
7109 7123 configured, typing v will immediately open your editor of choice
7110 7124 right at the line where the object is defined. Not as quick as
7111 7125 having a direct @edit command, but for all intents and purposes it
7112 7126 works. And I don't have to worry about writing @edit to deal with
7113 7127 all the editors, less does that.
7114 7128
7115 7129 * Version 0.1.16 released, 0.1.17 opened.
7116 7130
7117 7131 * Fixed some nasty bugs in the page/page_dumb combo that could
7118 7132 crash IPython.
7119 7133
7120 7134 2001-11-27 Fernando Perez <fperez@colorado.edu>
7121 7135
7122 7136 * Version 0.1.15 released, 0.1.16 opened.
7123 7137
7124 7138 * Finally got ? and ?? to work for undefined things: now it's
7125 7139 possible to type {}.get? and get information about the get method
7126 7140 of dicts, or os.path? even if only os is defined (so technically
7127 7141 os.path isn't). Works at any level. For example, after import os,
7128 7142 os?, os.path?, os.path.abspath? all work. This is great, took some
7129 7143 work in _ofind.
7130 7144
7131 7145 * Fixed more bugs with logging. The sanest way to do it was to add
7132 7146 to @log a 'mode' parameter. Killed two in one shot (this mode
7133 7147 option was a request of Janko's). I think it's finally clean
7134 7148 (famous last words).
7135 7149
7136 7150 * Added a page_dumb() pager which does a decent job of paging on
7137 7151 screen, if better things (like less) aren't available. One less
7138 7152 unix dependency (someday maybe somebody will port this to
7139 7153 windows).
7140 7154
7141 7155 * Fixed problem in magic_log: would lock of logging out if log
7142 7156 creation failed (because it would still think it had succeeded).
7143 7157
7144 7158 * Improved the page() function using curses to auto-detect screen
7145 7159 size. Now it can make a much better decision on whether to print
7146 7160 or page a string. Option screen_length was modified: a value 0
7147 7161 means auto-detect, and that's the default now.
7148 7162
7149 7163 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
7150 7164 go out. I'll test it for a few days, then talk to Janko about
7151 7165 licences and announce it.
7152 7166
7153 7167 * Fixed the length of the auto-generated ---> prompt which appears
7154 7168 for auto-parens and auto-quotes. Getting this right isn't trivial,
7155 7169 with all the color escapes, different prompt types and optional
7156 7170 separators. But it seems to be working in all the combinations.
7157 7171
7158 7172 2001-11-26 Fernando Perez <fperez@colorado.edu>
7159 7173
7160 7174 * Wrote a regexp filter to get option types from the option names
7161 7175 string. This eliminates the need to manually keep two duplicate
7162 7176 lists.
7163 7177
7164 7178 * Removed the unneeded check_option_names. Now options are handled
7165 7179 in a much saner manner and it's easy to visually check that things
7166 7180 are ok.
7167 7181
7168 7182 * Updated version numbers on all files I modified to carry a
7169 7183 notice so Janko and Nathan have clear version markers.
7170 7184
7171 7185 * Updated docstring for ultraTB with my changes. I should send
7172 7186 this to Nathan.
7173 7187
7174 7188 * Lots of small fixes. Ran everything through pychecker again.
7175 7189
7176 7190 * Made loading of deep_reload an cmd line option. If it's not too
7177 7191 kosher, now people can just disable it. With -nodeep_reload it's
7178 7192 still available as dreload(), it just won't overwrite reload().
7179 7193
7180 7194 * Moved many options to the no| form (-opt and -noopt
7181 7195 accepted). Cleaner.
7182 7196
7183 7197 * Changed magic_log so that if called with no parameters, it uses
7184 7198 'rotate' mode. That way auto-generated logs aren't automatically
7185 7199 over-written. For normal logs, now a backup is made if it exists
7186 7200 (only 1 level of backups). A new 'backup' mode was added to the
7187 7201 Logger class to support this. This was a request by Janko.
7188 7202
7189 7203 * Added @logoff/@logon to stop/restart an active log.
7190 7204
7191 7205 * Fixed a lot of bugs in log saving/replay. It was pretty
7192 7206 broken. Now special lines (!@,/) appear properly in the command
7193 7207 history after a log replay.
7194 7208
7195 7209 * Tried and failed to implement full session saving via pickle. My
7196 7210 idea was to pickle __main__.__dict__, but modules can't be
7197 7211 pickled. This would be a better alternative to replaying logs, but
7198 7212 seems quite tricky to get to work. Changed -session to be called
7199 7213 -logplay, which more accurately reflects what it does. And if we
7200 7214 ever get real session saving working, -session is now available.
7201 7215
7202 7216 * Implemented color schemes for prompts also. As for tracebacks,
7203 7217 currently only NoColor and Linux are supported. But now the
7204 7218 infrastructure is in place, based on a generic ColorScheme
7205 7219 class. So writing and activating new schemes both for the prompts
7206 7220 and the tracebacks should be straightforward.
7207 7221
7208 7222 * Version 0.1.13 released, 0.1.14 opened.
7209 7223
7210 7224 * Changed handling of options for output cache. Now counter is
7211 7225 hardwired starting at 1 and one specifies the maximum number of
7212 7226 entries *in the outcache* (not the max prompt counter). This is
7213 7227 much better, since many statements won't increase the cache
7214 7228 count. It also eliminated some confusing options, now there's only
7215 7229 one: cache_size.
7216 7230
7217 7231 * Added 'alias' magic function and magic_alias option in the
7218 7232 ipythonrc file. Now the user can easily define whatever names he
7219 7233 wants for the magic functions without having to play weird
7220 7234 namespace games. This gives IPython a real shell-like feel.
7221 7235
7222 7236 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
7223 7237 @ or not).
7224 7238
7225 7239 This was one of the last remaining 'visible' bugs (that I know
7226 7240 of). I think if I can clean up the session loading so it works
7227 7241 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
7228 7242 about licensing).
7229 7243
7230 7244 2001-11-25 Fernando Perez <fperez@colorado.edu>
7231 7245
7232 7246 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
7233 7247 there's a cleaner distinction between what ? and ?? show.
7234 7248
7235 7249 * Added screen_length option. Now the user can define his own
7236 7250 screen size for page() operations.
7237 7251
7238 7252 * Implemented magic shell-like functions with automatic code
7239 7253 generation. Now adding another function is just a matter of adding
7240 7254 an entry to a dict, and the function is dynamically generated at
7241 7255 run-time. Python has some really cool features!
7242 7256
7243 7257 * Renamed many options to cleanup conventions a little. Now all
7244 7258 are lowercase, and only underscores where needed. Also in the code
7245 7259 option name tables are clearer.
7246 7260
7247 7261 * Changed prompts a little. Now input is 'In [n]:' instead of
7248 7262 'In[n]:='. This allows it the numbers to be aligned with the
7249 7263 Out[n] numbers, and removes usage of ':=' which doesn't exist in
7250 7264 Python (it was a Mathematica thing). The '...' continuation prompt
7251 7265 was also changed a little to align better.
7252 7266
7253 7267 * Fixed bug when flushing output cache. Not all _p<n> variables
7254 7268 exist, so their deletion needs to be wrapped in a try:
7255 7269
7256 7270 * Figured out how to properly use inspect.formatargspec() (it
7257 7271 requires the args preceded by *). So I removed all the code from
7258 7272 _get_pdef in Magic, which was just replicating that.
7259 7273
7260 7274 * Added test to prefilter to allow redefining magic function names
7261 7275 as variables. This is ok, since the @ form is always available,
7262 7276 but whe should allow the user to define a variable called 'ls' if
7263 7277 he needs it.
7264 7278
7265 7279 * Moved the ToDo information from README into a separate ToDo.
7266 7280
7267 7281 * General code cleanup and small bugfixes. I think it's close to a
7268 7282 state where it can be released, obviously with a big 'beta'
7269 7283 warning on it.
7270 7284
7271 7285 * Got the magic function split to work. Now all magics are defined
7272 7286 in a separate class. It just organizes things a bit, and now
7273 7287 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
7274 7288 was too long).
7275 7289
7276 7290 * Changed @clear to @reset to avoid potential confusions with
7277 7291 the shell command clear. Also renamed @cl to @clear, which does
7278 7292 exactly what people expect it to from their shell experience.
7279 7293
7280 7294 Added a check to the @reset command (since it's so
7281 7295 destructive, it's probably a good idea to ask for confirmation).
7282 7296 But now reset only works for full namespace resetting. Since the
7283 7297 del keyword is already there for deleting a few specific
7284 7298 variables, I don't see the point of having a redundant magic
7285 7299 function for the same task.
7286 7300
7287 7301 2001-11-24 Fernando Perez <fperez@colorado.edu>
7288 7302
7289 7303 * Updated the builtin docs (esp. the ? ones).
7290 7304
7291 7305 * Ran all the code through pychecker. Not terribly impressed with
7292 7306 it: lots of spurious warnings and didn't really find anything of
7293 7307 substance (just a few modules being imported and not used).
7294 7308
7295 7309 * Implemented the new ultraTB functionality into IPython. New
7296 7310 option: xcolors. This chooses color scheme. xmode now only selects
7297 7311 between Plain and Verbose. Better orthogonality.
7298 7312
7299 7313 * Large rewrite of ultraTB. Much cleaner now, with a separation of
7300 7314 mode and color scheme for the exception handlers. Now it's
7301 7315 possible to have the verbose traceback with no coloring.
7302 7316
7303 7317 2001-11-23 Fernando Perez <fperez@colorado.edu>
7304 7318
7305 7319 * Version 0.1.12 released, 0.1.13 opened.
7306 7320
7307 7321 * Removed option to set auto-quote and auto-paren escapes by
7308 7322 user. The chances of breaking valid syntax are just too high. If
7309 7323 someone *really* wants, they can always dig into the code.
7310 7324
7311 7325 * Made prompt separators configurable.
7312 7326
7313 7327 2001-11-22 Fernando Perez <fperez@colorado.edu>
7314 7328
7315 7329 * Small bugfixes in many places.
7316 7330
7317 7331 * Removed the MyCompleter class from ipplib. It seemed redundant
7318 7332 with the C-p,C-n history search functionality. Less code to
7319 7333 maintain.
7320 7334
7321 7335 * Moved all the original ipython.py code into ipythonlib.py. Right
7322 7336 now it's just one big dump into a function called make_IPython, so
7323 7337 no real modularity has been gained. But at least it makes the
7324 7338 wrapper script tiny, and since ipythonlib is a module, it gets
7325 7339 compiled and startup is much faster.
7326 7340
7327 7341 This is a reasobably 'deep' change, so we should test it for a
7328 7342 while without messing too much more with the code.
7329 7343
7330 7344 2001-11-21 Fernando Perez <fperez@colorado.edu>
7331 7345
7332 7346 * Version 0.1.11 released, 0.1.12 opened for further work.
7333 7347
7334 7348 * Removed dependency on Itpl. It was only needed in one place. It
7335 7349 would be nice if this became part of python, though. It makes life
7336 7350 *a lot* easier in some cases.
7337 7351
7338 7352 * Simplified the prefilter code a bit. Now all handlers are
7339 7353 expected to explicitly return a value (at least a blank string).
7340 7354
7341 7355 * Heavy edits in ipplib. Removed the help system altogether. Now
7342 7356 obj?/?? is used for inspecting objects, a magic @doc prints
7343 7357 docstrings, and full-blown Python help is accessed via the 'help'
7344 7358 keyword. This cleans up a lot of code (less to maintain) and does
7345 7359 the job. Since 'help' is now a standard Python component, might as
7346 7360 well use it and remove duplicate functionality.
7347 7361
7348 7362 Also removed the option to use ipplib as a standalone program. By
7349 7363 now it's too dependent on other parts of IPython to function alone.
7350 7364
7351 7365 * Fixed bug in genutils.pager. It would crash if the pager was
7352 7366 exited immediately after opening (broken pipe).
7353 7367
7354 7368 * Trimmed down the VerboseTB reporting a little. The header is
7355 7369 much shorter now and the repeated exception arguments at the end
7356 7370 have been removed. For interactive use the old header seemed a bit
7357 7371 excessive.
7358 7372
7359 7373 * Fixed small bug in output of @whos for variables with multi-word
7360 7374 types (only first word was displayed).
7361 7375
7362 7376 2001-11-17 Fernando Perez <fperez@colorado.edu>
7363 7377
7364 7378 * Version 0.1.10 released, 0.1.11 opened for further work.
7365 7379
7366 7380 * Modified dirs and friends. dirs now *returns* the stack (not
7367 7381 prints), so one can manipulate it as a variable. Convenient to
7368 7382 travel along many directories.
7369 7383
7370 7384 * Fixed bug in magic_pdef: would only work with functions with
7371 7385 arguments with default values.
7372 7386
7373 7387 2001-11-14 Fernando Perez <fperez@colorado.edu>
7374 7388
7375 7389 * Added the PhysicsInput stuff to dot_ipython so it ships as an
7376 7390 example with IPython. Various other minor fixes and cleanups.
7377 7391
7378 7392 * Version 0.1.9 released, 0.1.10 opened for further work.
7379 7393
7380 7394 * Added sys.path to the list of directories searched in the
7381 7395 execfile= option. It used to be the current directory and the
7382 7396 user's IPYTHONDIR only.
7383 7397
7384 7398 2001-11-13 Fernando Perez <fperez@colorado.edu>
7385 7399
7386 7400 * Reinstated the raw_input/prefilter separation that Janko had
7387 7401 initially. This gives a more convenient setup for extending the
7388 7402 pre-processor from the outside: raw_input always gets a string,
7389 7403 and prefilter has to process it. We can then redefine prefilter
7390 7404 from the outside and implement extensions for special
7391 7405 purposes.
7392 7406
7393 7407 Today I got one for inputting PhysicalQuantity objects
7394 7408 (from Scientific) without needing any function calls at
7395 7409 all. Extremely convenient, and it's all done as a user-level
7396 7410 extension (no IPython code was touched). Now instead of:
7397 7411 a = PhysicalQuantity(4.2,'m/s**2')
7398 7412 one can simply say
7399 7413 a = 4.2 m/s**2
7400 7414 or even
7401 7415 a = 4.2 m/s^2
7402 7416
7403 7417 I use this, but it's also a proof of concept: IPython really is
7404 7418 fully user-extensible, even at the level of the parsing of the
7405 7419 command line. It's not trivial, but it's perfectly doable.
7406 7420
7407 7421 * Added 'add_flip' method to inclusion conflict resolver. Fixes
7408 7422 the problem of modules being loaded in the inverse order in which
7409 7423 they were defined in
7410 7424
7411 7425 * Version 0.1.8 released, 0.1.9 opened for further work.
7412 7426
7413 7427 * Added magics pdef, source and file. They respectively show the
7414 7428 definition line ('prototype' in C), source code and full python
7415 7429 file for any callable object. The object inspector oinfo uses
7416 7430 these to show the same information.
7417 7431
7418 7432 * Version 0.1.7 released, 0.1.8 opened for further work.
7419 7433
7420 7434 * Separated all the magic functions into a class called Magic. The
7421 7435 InteractiveShell class was becoming too big for Xemacs to handle
7422 7436 (de-indenting a line would lock it up for 10 seconds while it
7423 7437 backtracked on the whole class!)
7424 7438
7425 7439 FIXME: didn't work. It can be done, but right now namespaces are
7426 7440 all messed up. Do it later (reverted it for now, so at least
7427 7441 everything works as before).
7428 7442
7429 7443 * Got the object introspection system (magic_oinfo) working! I
7430 7444 think this is pretty much ready for release to Janko, so he can
7431 7445 test it for a while and then announce it. Pretty much 100% of what
7432 7446 I wanted for the 'phase 1' release is ready. Happy, tired.
7433 7447
7434 7448 2001-11-12 Fernando Perez <fperez@colorado.edu>
7435 7449
7436 7450 * Version 0.1.6 released, 0.1.7 opened for further work.
7437 7451
7438 7452 * Fixed bug in printing: it used to test for truth before
7439 7453 printing, so 0 wouldn't print. Now checks for None.
7440 7454
7441 7455 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
7442 7456 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
7443 7457 reaches by hand into the outputcache. Think of a better way to do
7444 7458 this later.
7445 7459
7446 7460 * Various small fixes thanks to Nathan's comments.
7447 7461
7448 7462 * Changed magic_pprint to magic_Pprint. This way it doesn't
7449 7463 collide with pprint() and the name is consistent with the command
7450 7464 line option.
7451 7465
7452 7466 * Changed prompt counter behavior to be fully like
7453 7467 Mathematica's. That is, even input that doesn't return a result
7454 7468 raises the prompt counter. The old behavior was kind of confusing
7455 7469 (getting the same prompt number several times if the operation
7456 7470 didn't return a result).
7457 7471
7458 7472 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
7459 7473
7460 7474 * Fixed -Classic mode (wasn't working anymore).
7461 7475
7462 7476 * Added colored prompts using Nathan's new code. Colors are
7463 7477 currently hardwired, they can be user-configurable. For
7464 7478 developers, they can be chosen in file ipythonlib.py, at the
7465 7479 beginning of the CachedOutput class def.
7466 7480
7467 7481 2001-11-11 Fernando Perez <fperez@colorado.edu>
7468 7482
7469 7483 * Version 0.1.5 released, 0.1.6 opened for further work.
7470 7484
7471 7485 * Changed magic_env to *return* the environment as a dict (not to
7472 7486 print it). This way it prints, but it can also be processed.
7473 7487
7474 7488 * Added Verbose exception reporting to interactive
7475 7489 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
7476 7490 traceback. Had to make some changes to the ultraTB file. This is
7477 7491 probably the last 'big' thing in my mental todo list. This ties
7478 7492 in with the next entry:
7479 7493
7480 7494 * Changed -Xi and -Xf to a single -xmode option. Now all the user
7481 7495 has to specify is Plain, Color or Verbose for all exception
7482 7496 handling.
7483 7497
7484 7498 * Removed ShellServices option. All this can really be done via
7485 7499 the magic system. It's easier to extend, cleaner and has automatic
7486 7500 namespace protection and documentation.
7487 7501
7488 7502 2001-11-09 Fernando Perez <fperez@colorado.edu>
7489 7503
7490 7504 * Fixed bug in output cache flushing (missing parameter to
7491 7505 __init__). Other small bugs fixed (found using pychecker).
7492 7506
7493 7507 * Version 0.1.4 opened for bugfixing.
7494 7508
7495 7509 2001-11-07 Fernando Perez <fperez@colorado.edu>
7496 7510
7497 7511 * Version 0.1.3 released, mainly because of the raw_input bug.
7498 7512
7499 7513 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
7500 7514 and when testing for whether things were callable, a call could
7501 7515 actually be made to certain functions. They would get called again
7502 7516 once 'really' executed, with a resulting double call. A disaster
7503 7517 in many cases (list.reverse() would never work!).
7504 7518
7505 7519 * Removed prefilter() function, moved its code to raw_input (which
7506 7520 after all was just a near-empty caller for prefilter). This saves
7507 7521 a function call on every prompt, and simplifies the class a tiny bit.
7508 7522
7509 7523 * Fix _ip to __ip name in magic example file.
7510 7524
7511 7525 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
7512 7526 work with non-gnu versions of tar.
7513 7527
7514 7528 2001-11-06 Fernando Perez <fperez@colorado.edu>
7515 7529
7516 7530 * Version 0.1.2. Just to keep track of the recent changes.
7517 7531
7518 7532 * Fixed nasty bug in output prompt routine. It used to check 'if
7519 7533 arg != None...'. Problem is, this fails if arg implements a
7520 7534 special comparison (__cmp__) which disallows comparing to
7521 7535 None. Found it when trying to use the PhysicalQuantity module from
7522 7536 ScientificPython.
7523 7537
7524 7538 2001-11-05 Fernando Perez <fperez@colorado.edu>
7525 7539
7526 7540 * Also added dirs. Now the pushd/popd/dirs family functions
7527 7541 basically like the shell, with the added convenience of going home
7528 7542 when called with no args.
7529 7543
7530 7544 * pushd/popd slightly modified to mimic shell behavior more
7531 7545 closely.
7532 7546
7533 7547 * Added env,pushd,popd from ShellServices as magic functions. I
7534 7548 think the cleanest will be to port all desired functions from
7535 7549 ShellServices as magics and remove ShellServices altogether. This
7536 7550 will provide a single, clean way of adding functionality
7537 7551 (shell-type or otherwise) to IP.
7538 7552
7539 7553 2001-11-04 Fernando Perez <fperez@colorado.edu>
7540 7554
7541 7555 * Added .ipython/ directory to sys.path. This way users can keep
7542 7556 customizations there and access them via import.
7543 7557
7544 7558 2001-11-03 Fernando Perez <fperez@colorado.edu>
7545 7559
7546 7560 * Opened version 0.1.1 for new changes.
7547 7561
7548 7562 * Changed version number to 0.1.0: first 'public' release, sent to
7549 7563 Nathan and Janko.
7550 7564
7551 7565 * Lots of small fixes and tweaks.
7552 7566
7553 7567 * Minor changes to whos format. Now strings are shown, snipped if
7554 7568 too long.
7555 7569
7556 7570 * Changed ShellServices to work on __main__ so they show up in @who
7557 7571
7558 7572 * Help also works with ? at the end of a line:
7559 7573 ?sin and sin?
7560 7574 both produce the same effect. This is nice, as often I use the
7561 7575 tab-complete to find the name of a method, but I used to then have
7562 7576 to go to the beginning of the line to put a ? if I wanted more
7563 7577 info. Now I can just add the ? and hit return. Convenient.
7564 7578
7565 7579 2001-11-02 Fernando Perez <fperez@colorado.edu>
7566 7580
7567 7581 * Python version check (>=2.1) added.
7568 7582
7569 7583 * Added LazyPython documentation. At this point the docs are quite
7570 7584 a mess. A cleanup is in order.
7571 7585
7572 7586 * Auto-installer created. For some bizarre reason, the zipfiles
7573 7587 module isn't working on my system. So I made a tar version
7574 7588 (hopefully the command line options in various systems won't kill
7575 7589 me).
7576 7590
7577 7591 * Fixes to Struct in genutils. Now all dictionary-like methods are
7578 7592 protected (reasonably).
7579 7593
7580 7594 * Added pager function to genutils and changed ? to print usage
7581 7595 note through it (it was too long).
7582 7596
7583 7597 * Added the LazyPython functionality. Works great! I changed the
7584 7598 auto-quote escape to ';', it's on home row and next to '. But
7585 7599 both auto-quote and auto-paren (still /) escapes are command-line
7586 7600 parameters.
7587 7601
7588 7602
7589 7603 2001-11-01 Fernando Perez <fperez@colorado.edu>
7590 7604
7591 7605 * Version changed to 0.0.7. Fairly large change: configuration now
7592 7606 is all stored in a directory, by default .ipython. There, all
7593 7607 config files have normal looking names (not .names)
7594 7608
7595 7609 * Version 0.0.6 Released first to Lucas and Archie as a test
7596 7610 run. Since it's the first 'semi-public' release, change version to
7597 7611 > 0.0.6 for any changes now.
7598 7612
7599 7613 * Stuff I had put in the ipplib.py changelog:
7600 7614
7601 7615 Changes to InteractiveShell:
7602 7616
7603 7617 - Made the usage message a parameter.
7604 7618
7605 7619 - Require the name of the shell variable to be given. It's a bit
7606 7620 of a hack, but allows the name 'shell' not to be hardwired in the
7607 7621 magic (@) handler, which is problematic b/c it requires
7608 7622 polluting the global namespace with 'shell'. This in turn is
7609 7623 fragile: if a user redefines a variable called shell, things
7610 7624 break.
7611 7625
7612 7626 - magic @: all functions available through @ need to be defined
7613 7627 as magic_<name>, even though they can be called simply as
7614 7628 @<name>. This allows the special command @magic to gather
7615 7629 information automatically about all existing magic functions,
7616 7630 even if they are run-time user extensions, by parsing the shell
7617 7631 instance __dict__ looking for special magic_ names.
7618 7632
7619 7633 - mainloop: added *two* local namespace parameters. This allows
7620 7634 the class to differentiate between parameters which were there
7621 7635 before and after command line initialization was processed. This
7622 7636 way, later @who can show things loaded at startup by the
7623 7637 user. This trick was necessary to make session saving/reloading
7624 7638 really work: ideally after saving/exiting/reloading a session,
7625 7639 *everything* should look the same, including the output of @who. I
7626 7640 was only able to make this work with this double namespace
7627 7641 trick.
7628 7642
7629 7643 - added a header to the logfile which allows (almost) full
7630 7644 session restoring.
7631 7645
7632 7646 - prepend lines beginning with @ or !, with a and log
7633 7647 them. Why? !lines: may be useful to know what you did @lines:
7634 7648 they may affect session state. So when restoring a session, at
7635 7649 least inform the user of their presence. I couldn't quite get
7636 7650 them to properly re-execute, but at least the user is warned.
7637 7651
7638 7652 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now