##// END OF EJS Templates
remove dir = dir /on auto alias, it broke other dir auto aliases
vivainio -
Show More
@@ -1,2536 +1,2536 b''
1 1 # -*- coding: utf-8 -*-
2 2 """
3 3 IPython -- An enhanced Interactive Python
4 4
5 5 Requires Python 2.3 or newer.
6 6
7 7 This file contains all the classes and helper functions specific to IPython.
8 8
9 $Id: iplib.py 2719 2007-09-06 18:53:34Z vivainio $
9 $Id: iplib.py 2725 2007-09-07 08:59:10Z vivainio $
10 10 """
11 11
12 12 #*****************************************************************************
13 13 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
14 14 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
15 15 #
16 16 # Distributed under the terms of the BSD License. The full license is in
17 17 # the file COPYING, distributed as part of this software.
18 18 #
19 19 # Note: this code originally subclassed code.InteractiveConsole from the
20 20 # Python standard library. Over time, all of that class has been copied
21 21 # verbatim here for modifications which could not be accomplished by
22 22 # subclassing. At this point, there are no dependencies at all on the code
23 23 # module anymore (it is not even imported). The Python License (sec. 2)
24 24 # allows for this, but it's always nice to acknowledge credit where credit is
25 25 # due.
26 26 #*****************************************************************************
27 27
28 28 #****************************************************************************
29 29 # Modules and globals
30 30
31 31 from IPython import Release
32 32 __author__ = '%s <%s>\n%s <%s>' % \
33 33 ( Release.authors['Janko'] + Release.authors['Fernando'] )
34 34 __license__ = Release.license
35 35 __version__ = Release.version
36 36
37 37 # Python standard modules
38 38 import __main__
39 39 import __builtin__
40 40 import StringIO
41 41 import bdb
42 42 import cPickle as pickle
43 43 import codeop
44 44 import doctest
45 45 import exceptions
46 46 import glob
47 47 import inspect
48 48 import keyword
49 49 import new
50 50 import os
51 51 import pydoc
52 52 import re
53 53 import shutil
54 54 import string
55 55 import sys
56 56 import tempfile
57 57 import traceback
58 58 import types
59 59 import pickleshare
60 60 from sets import Set
61 61 from pprint import pprint, pformat
62 62
63 63 # IPython's own modules
64 64 #import IPython
65 65 from IPython import Debugger,OInspect,PyColorize,ultraTB
66 66 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
67 67 from IPython.FakeModule import FakeModule
68 68 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
69 69 from IPython.Logger import Logger
70 70 from IPython.Magic import Magic
71 71 from IPython.Prompts import CachedOutput
72 72 from IPython.ipstruct import Struct
73 73 from IPython.background_jobs import BackgroundJobManager
74 74 from IPython.usage import cmd_line_usage,interactive_usage
75 75 from IPython.genutils import *
76 76 from IPython.strdispatch import StrDispatch
77 77 import IPython.ipapi
78 78 import IPython.history
79 79 import IPython.prefilter as prefilter
80 80 import IPython.shadowns
81 81 # Globals
82 82
83 83 # store the builtin raw_input globally, and use this always, in case user code
84 84 # overwrites it (like wx.py.PyShell does)
85 85 raw_input_original = raw_input
86 86
87 87 # compiled regexps for autoindent management
88 88 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
89 89
90 90
91 91 #****************************************************************************
92 92 # Some utility function definitions
93 93
94 94 ini_spaces_re = re.compile(r'^(\s+)')
95 95
96 96 def num_ini_spaces(strng):
97 97 """Return the number of initial spaces in a string"""
98 98
99 99 ini_spaces = ini_spaces_re.match(strng)
100 100 if ini_spaces:
101 101 return ini_spaces.end()
102 102 else:
103 103 return 0
104 104
105 105 def softspace(file, newvalue):
106 106 """Copied from code.py, to remove the dependency"""
107 107
108 108 oldvalue = 0
109 109 try:
110 110 oldvalue = file.softspace
111 111 except AttributeError:
112 112 pass
113 113 try:
114 114 file.softspace = newvalue
115 115 except (AttributeError, TypeError):
116 116 # "attribute-less object" or "read-only attributes"
117 117 pass
118 118 return oldvalue
119 119
120 120
121 121 #****************************************************************************
122 122 # Local use exceptions
123 123 class SpaceInInput(exceptions.Exception): pass
124 124
125 125
126 126 #****************************************************************************
127 127 # Local use classes
128 128 class Bunch: pass
129 129
130 130 class Undefined: pass
131 131
132 132 class Quitter(object):
133 133 """Simple class to handle exit, similar to Python 2.5's.
134 134
135 135 It handles exiting in an ipython-safe manner, which the one in Python 2.5
136 136 doesn't do (obviously, since it doesn't know about ipython)."""
137 137
138 138 def __init__(self,shell,name):
139 139 self.shell = shell
140 140 self.name = name
141 141
142 142 def __repr__(self):
143 143 return 'Type %s() to exit.' % self.name
144 144 __str__ = __repr__
145 145
146 146 def __call__(self):
147 147 self.shell.exit()
148 148
149 149 class InputList(list):
150 150 """Class to store user input.
151 151
152 152 It's basically a list, but slices return a string instead of a list, thus
153 153 allowing things like (assuming 'In' is an instance):
154 154
155 155 exec In[4:7]
156 156
157 157 or
158 158
159 159 exec In[5:9] + In[14] + In[21:25]"""
160 160
161 161 def __getslice__(self,i,j):
162 162 return ''.join(list.__getslice__(self,i,j))
163 163
164 164 class SyntaxTB(ultraTB.ListTB):
165 165 """Extension which holds some state: the last exception value"""
166 166
167 167 def __init__(self,color_scheme = 'NoColor'):
168 168 ultraTB.ListTB.__init__(self,color_scheme)
169 169 self.last_syntax_error = None
170 170
171 171 def __call__(self, etype, value, elist):
172 172 self.last_syntax_error = value
173 173 ultraTB.ListTB.__call__(self,etype,value,elist)
174 174
175 175 def clear_err_state(self):
176 176 """Return the current error state and clear it"""
177 177 e = self.last_syntax_error
178 178 self.last_syntax_error = None
179 179 return e
180 180
181 181 #****************************************************************************
182 182 # Main IPython class
183 183
184 184 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
185 185 # until a full rewrite is made. I've cleaned all cross-class uses of
186 186 # attributes and methods, but too much user code out there relies on the
187 187 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
188 188 #
189 189 # But at least now, all the pieces have been separated and we could, in
190 190 # principle, stop using the mixin. This will ease the transition to the
191 191 # chainsaw branch.
192 192
193 193 # For reference, the following is the list of 'self.foo' uses in the Magic
194 194 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
195 195 # class, to prevent clashes.
196 196
197 197 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
198 198 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
199 199 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
200 200 # 'self.value']
201 201
202 202 class InteractiveShell(object,Magic):
203 203 """An enhanced console for Python."""
204 204
205 205 # class attribute to indicate whether the class supports threads or not.
206 206 # Subclasses with thread support should override this as needed.
207 207 isthreaded = False
208 208
209 209 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
210 210 user_ns = None,user_global_ns=None,banner2='',
211 211 custom_exceptions=((),None),embedded=False):
212 212
213 213 # log system
214 214 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
215 215
216 216 # some minimal strict typechecks. For some core data structures, I
217 217 # want actual basic python types, not just anything that looks like
218 218 # one. This is especially true for namespaces.
219 219 for ns in (user_ns,user_global_ns):
220 220 if ns is not None and type(ns) != types.DictType:
221 221 raise TypeError,'namespace must be a dictionary'
222 222
223 223 # Job manager (for jobs run as background threads)
224 224 self.jobs = BackgroundJobManager()
225 225
226 226 # Store the actual shell's name
227 227 self.name = name
228 228
229 229 # We need to know whether the instance is meant for embedding, since
230 230 # global/local namespaces need to be handled differently in that case
231 231 self.embedded = embedded
232 232 if embedded:
233 233 # Control variable so users can, from within the embedded instance,
234 234 # permanently deactivate it.
235 235 self.embedded_active = True
236 236
237 237 # command compiler
238 238 self.compile = codeop.CommandCompiler()
239 239
240 240 # User input buffer
241 241 self.buffer = []
242 242
243 243 # Default name given in compilation of code
244 244 self.filename = '<ipython console>'
245 245
246 246 # Install our own quitter instead of the builtins. For python2.3-2.4,
247 247 # this brings in behavior like 2.5, and for 2.5 it's identical.
248 248 __builtin__.exit = Quitter(self,'exit')
249 249 __builtin__.quit = Quitter(self,'quit')
250 250
251 251 # Make an empty namespace, which extension writers can rely on both
252 252 # existing and NEVER being used by ipython itself. This gives them a
253 253 # convenient location for storing additional information and state
254 254 # their extensions may require, without fear of collisions with other
255 255 # ipython names that may develop later.
256 256 self.meta = Struct()
257 257
258 258 # Create the namespace where the user will operate. user_ns is
259 259 # normally the only one used, and it is passed to the exec calls as
260 260 # the locals argument. But we do carry a user_global_ns namespace
261 261 # given as the exec 'globals' argument, This is useful in embedding
262 262 # situations where the ipython shell opens in a context where the
263 263 # distinction between locals and globals is meaningful.
264 264
265 265 # FIXME. For some strange reason, __builtins__ is showing up at user
266 266 # level as a dict instead of a module. This is a manual fix, but I
267 267 # should really track down where the problem is coming from. Alex
268 268 # Schmolck reported this problem first.
269 269
270 270 # A useful post by Alex Martelli on this topic:
271 271 # Re: inconsistent value from __builtins__
272 272 # Von: Alex Martelli <aleaxit@yahoo.com>
273 273 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
274 274 # Gruppen: comp.lang.python
275 275
276 276 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
277 277 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
278 278 # > <type 'dict'>
279 279 # > >>> print type(__builtins__)
280 280 # > <type 'module'>
281 281 # > Is this difference in return value intentional?
282 282
283 283 # Well, it's documented that '__builtins__' can be either a dictionary
284 284 # or a module, and it's been that way for a long time. Whether it's
285 285 # intentional (or sensible), I don't know. In any case, the idea is
286 286 # that if you need to access the built-in namespace directly, you
287 287 # should start with "import __builtin__" (note, no 's') which will
288 288 # definitely give you a module. Yeah, it's somewhat confusing:-(.
289 289
290 290 # These routines return properly built dicts as needed by the rest of
291 291 # the code, and can also be used by extension writers to generate
292 292 # properly initialized namespaces.
293 293 user_ns = IPython.ipapi.make_user_ns(user_ns)
294 294 user_global_ns = IPython.ipapi.make_user_global_ns(user_global_ns)
295 295
296 296 # Assign namespaces
297 297 # This is the namespace where all normal user variables live
298 298 self.user_ns = user_ns
299 299 # Embedded instances require a separate namespace for globals.
300 300 # Normally this one is unused by non-embedded instances.
301 301 self.user_global_ns = user_global_ns
302 302 # A namespace to keep track of internal data structures to prevent
303 303 # them from cluttering user-visible stuff. Will be updated later
304 304 self.internal_ns = {}
305 305
306 306 # Namespace of system aliases. Each entry in the alias
307 307 # table must be a 2-tuple of the form (N,name), where N is the number
308 308 # of positional arguments of the alias.
309 309 self.alias_table = {}
310 310
311 311 # A table holding all the namespaces IPython deals with, so that
312 312 # introspection facilities can search easily.
313 313 self.ns_table = {'user':user_ns,
314 314 'user_global':user_global_ns,
315 315 'alias':self.alias_table,
316 316 'internal':self.internal_ns,
317 317 'builtin':__builtin__.__dict__
318 318 }
319 319 # The user namespace MUST have a pointer to the shell itself.
320 320 self.user_ns[name] = self
321 321
322 322 # We need to insert into sys.modules something that looks like a
323 323 # module but which accesses the IPython namespace, for shelve and
324 324 # pickle to work interactively. Normally they rely on getting
325 325 # everything out of __main__, but for embedding purposes each IPython
326 326 # instance has its own private namespace, so we can't go shoving
327 327 # everything into __main__.
328 328
329 329 # note, however, that we should only do this for non-embedded
330 330 # ipythons, which really mimic the __main__.__dict__ with their own
331 331 # namespace. Embedded instances, on the other hand, should not do
332 332 # this because they need to manage the user local/global namespaces
333 333 # only, but they live within a 'normal' __main__ (meaning, they
334 334 # shouldn't overtake the execution environment of the script they're
335 335 # embedded in).
336 336
337 337 if not embedded:
338 338 try:
339 339 main_name = self.user_ns['__name__']
340 340 except KeyError:
341 341 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
342 342 else:
343 343 #print "pickle hack in place" # dbg
344 344 #print 'main_name:',main_name # dbg
345 345 sys.modules[main_name] = FakeModule(self.user_ns)
346 346
347 347 # List of input with multi-line handling.
348 348 # Fill its zero entry, user counter starts at 1
349 349 self.input_hist = InputList(['\n'])
350 350 # This one will hold the 'raw' input history, without any
351 351 # pre-processing. This will allow users to retrieve the input just as
352 352 # it was exactly typed in by the user, with %hist -r.
353 353 self.input_hist_raw = InputList(['\n'])
354 354
355 355 # list of visited directories
356 356 try:
357 357 self.dir_hist = [os.getcwd()]
358 358 except OSError:
359 359 self.dir_hist = []
360 360
361 361 # dict of output history
362 362 self.output_hist = {}
363 363
364 364 # Get system encoding at startup time. Certain terminals (like Emacs
365 365 # under Win32 have it set to None, and we need to have a known valid
366 366 # encoding to use in the raw_input() method
367 367 self.stdin_encoding = sys.stdin.encoding or 'ascii'
368 368
369 369 # dict of things NOT to alias (keywords, builtins and some magics)
370 370 no_alias = {}
371 371 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
372 372 for key in keyword.kwlist + no_alias_magics:
373 373 no_alias[key] = 1
374 374 no_alias.update(__builtin__.__dict__)
375 375 self.no_alias = no_alias
376 376
377 377 # make global variables for user access to these
378 378 self.user_ns['_ih'] = self.input_hist
379 379 self.user_ns['_oh'] = self.output_hist
380 380 self.user_ns['_dh'] = self.dir_hist
381 381
382 382 # user aliases to input and output histories
383 383 self.user_ns['In'] = self.input_hist
384 384 self.user_ns['Out'] = self.output_hist
385 385
386 386 self.user_ns['_sh'] = IPython.shadowns
387 387 # Object variable to store code object waiting execution. This is
388 388 # used mainly by the multithreaded shells, but it can come in handy in
389 389 # other situations. No need to use a Queue here, since it's a single
390 390 # item which gets cleared once run.
391 391 self.code_to_run = None
392 392
393 393 # escapes for automatic behavior on the command line
394 394 self.ESC_SHELL = '!'
395 395 self.ESC_SH_CAP = '!!'
396 396 self.ESC_HELP = '?'
397 397 self.ESC_MAGIC = '%'
398 398 self.ESC_QUOTE = ','
399 399 self.ESC_QUOTE2 = ';'
400 400 self.ESC_PAREN = '/'
401 401
402 402 # And their associated handlers
403 403 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
404 404 self.ESC_QUOTE : self.handle_auto,
405 405 self.ESC_QUOTE2 : self.handle_auto,
406 406 self.ESC_MAGIC : self.handle_magic,
407 407 self.ESC_HELP : self.handle_help,
408 408 self.ESC_SHELL : self.handle_shell_escape,
409 409 self.ESC_SH_CAP : self.handle_shell_escape,
410 410 }
411 411
412 412 # class initializations
413 413 Magic.__init__(self,self)
414 414
415 415 # Python source parser/formatter for syntax highlighting
416 416 pyformat = PyColorize.Parser().format
417 417 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
418 418
419 419 # hooks holds pointers used for user-side customizations
420 420 self.hooks = Struct()
421 421
422 422 self.strdispatchers = {}
423 423
424 424 # Set all default hooks, defined in the IPython.hooks module.
425 425 hooks = IPython.hooks
426 426 for hook_name in hooks.__all__:
427 427 # default hooks have priority 100, i.e. low; user hooks should have
428 428 # 0-100 priority
429 429 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
430 430 #print "bound hook",hook_name
431 431
432 432 # Flag to mark unconditional exit
433 433 self.exit_now = False
434 434
435 435 self.usage_min = """\
436 436 An enhanced console for Python.
437 437 Some of its features are:
438 438 - Readline support if the readline library is present.
439 439 - Tab completion in the local namespace.
440 440 - Logging of input, see command-line options.
441 441 - System shell escape via ! , eg !ls.
442 442 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
443 443 - Keeps track of locally defined variables via %who, %whos.
444 444 - Show object information with a ? eg ?x or x? (use ?? for more info).
445 445 """
446 446 if usage: self.usage = usage
447 447 else: self.usage = self.usage_min
448 448
449 449 # Storage
450 450 self.rc = rc # This will hold all configuration information
451 451 self.pager = 'less'
452 452 # temporary files used for various purposes. Deleted at exit.
453 453 self.tempfiles = []
454 454
455 455 # Keep track of readline usage (later set by init_readline)
456 456 self.has_readline = False
457 457
458 458 # template for logfile headers. It gets resolved at runtime by the
459 459 # logstart method.
460 460 self.loghead_tpl = \
461 461 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
462 462 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
463 463 #log# opts = %s
464 464 #log# args = %s
465 465 #log# It is safe to make manual edits below here.
466 466 #log#-----------------------------------------------------------------------
467 467 """
468 468 # for pushd/popd management
469 469 try:
470 470 self.home_dir = get_home_dir()
471 471 except HomeDirError,msg:
472 472 fatal(msg)
473 473
474 474 self.dir_stack = [os.getcwd().replace(self.home_dir,'~')]
475 475
476 476 # Functions to call the underlying shell.
477 477
478 478 # The first is similar to os.system, but it doesn't return a value,
479 479 # and it allows interpolation of variables in the user's namespace.
480 480 self.system = lambda cmd: \
481 481 shell(self.var_expand(cmd,depth=2),
482 482 header=self.rc.system_header,
483 483 verbose=self.rc.system_verbose)
484 484
485 485 # These are for getoutput and getoutputerror:
486 486 self.getoutput = lambda cmd: \
487 487 getoutput(self.var_expand(cmd,depth=2),
488 488 header=self.rc.system_header,
489 489 verbose=self.rc.system_verbose)
490 490
491 491 self.getoutputerror = lambda cmd: \
492 492 getoutputerror(self.var_expand(cmd,depth=2),
493 493 header=self.rc.system_header,
494 494 verbose=self.rc.system_verbose)
495 495
496 496
497 497 # keep track of where we started running (mainly for crash post-mortem)
498 498 self.starting_dir = os.getcwd()
499 499
500 500 # Various switches which can be set
501 501 self.CACHELENGTH = 5000 # this is cheap, it's just text
502 502 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
503 503 self.banner2 = banner2
504 504
505 505 # TraceBack handlers:
506 506
507 507 # Syntax error handler.
508 508 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
509 509
510 510 # The interactive one is initialized with an offset, meaning we always
511 511 # want to remove the topmost item in the traceback, which is our own
512 512 # internal code. Valid modes: ['Plain','Context','Verbose']
513 513 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
514 514 color_scheme='NoColor',
515 515 tb_offset = 1)
516 516
517 517 # IPython itself shouldn't crash. This will produce a detailed
518 518 # post-mortem if it does. But we only install the crash handler for
519 519 # non-threaded shells, the threaded ones use a normal verbose reporter
520 520 # and lose the crash handler. This is because exceptions in the main
521 521 # thread (such as in GUI code) propagate directly to sys.excepthook,
522 522 # and there's no point in printing crash dumps for every user exception.
523 523 if self.isthreaded:
524 524 ipCrashHandler = ultraTB.FormattedTB()
525 525 else:
526 526 from IPython import CrashHandler
527 527 ipCrashHandler = CrashHandler.IPythonCrashHandler(self)
528 528 self.set_crash_handler(ipCrashHandler)
529 529
530 530 # and add any custom exception handlers the user may have specified
531 531 self.set_custom_exc(*custom_exceptions)
532 532
533 533 # indentation management
534 534 self.autoindent = False
535 535 self.indent_current_nsp = 0
536 536
537 537 # Make some aliases automatically
538 538 # Prepare list of shell aliases to auto-define
539 539 if os.name == 'posix':
540 540 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
541 541 'mv mv -i','rm rm -i','cp cp -i',
542 542 'cat cat','less less','clear clear',
543 543 # a better ls
544 544 'ls ls -F',
545 545 # long ls
546 546 'll ls -lF')
547 547 # Extra ls aliases with color, which need special treatment on BSD
548 548 # variants
549 549 ls_extra = ( # color ls
550 550 'lc ls -F -o --color',
551 551 # ls normal files only
552 552 'lf ls -F -o --color %l | grep ^-',
553 553 # ls symbolic links
554 554 'lk ls -F -o --color %l | grep ^l',
555 555 # directories or links to directories,
556 556 'ldir ls -F -o --color %l | grep /$',
557 557 # things which are executable
558 558 'lx ls -F -o --color %l | grep ^-..x',
559 559 )
560 560 # The BSDs don't ship GNU ls, so they don't understand the
561 561 # --color switch out of the box
562 562 if 'bsd' in sys.platform:
563 563 ls_extra = ( # ls normal files only
564 564 'lf ls -lF | grep ^-',
565 565 # ls symbolic links
566 566 'lk ls -lF | grep ^l',
567 567 # directories or links to directories,
568 568 'ldir ls -lF | grep /$',
569 569 # things which are executable
570 570 'lx ls -lF | grep ^-..x',
571 571 )
572 572 auto_alias = auto_alias + ls_extra
573 573 elif os.name in ['nt','dos']:
574 auto_alias = ('dir dir /on', 'ls dir /on',
574 auto_alias = ('ls dir /on',
575 575 'ddir dir /ad /on', 'ldir dir /ad /on',
576 576 'mkdir mkdir','rmdir rmdir','echo echo',
577 577 'ren ren','cls cls','copy copy')
578 578 else:
579 579 auto_alias = ()
580 580 self.auto_alias = [s.split(None,1) for s in auto_alias]
581 581
582 582 # Produce a public API instance
583 583 self.api = IPython.ipapi.IPApi(self)
584 584
585 585 # Call the actual (public) initializer
586 586 self.init_auto_alias()
587 587
588 588 # track which builtins we add, so we can clean up later
589 589 self.builtins_added = {}
590 590 # This method will add the necessary builtins for operation, but
591 591 # tracking what it did via the builtins_added dict.
592 592 self.add_builtins()
593 593
594 594
595 595
596 596 # end __init__
597 597
598 598 def var_expand(self,cmd,depth=0):
599 599 """Expand python variables in a string.
600 600
601 601 The depth argument indicates how many frames above the caller should
602 602 be walked to look for the local namespace where to expand variables.
603 603
604 604 The global namespace for expansion is always the user's interactive
605 605 namespace.
606 606 """
607 607
608 608 return str(ItplNS(cmd.replace('#','\#'),
609 609 self.user_ns, # globals
610 610 # Skip our own frame in searching for locals:
611 611 sys._getframe(depth+1).f_locals # locals
612 612 ))
613 613
614 614 def pre_config_initialization(self):
615 615 """Pre-configuration init method
616 616
617 617 This is called before the configuration files are processed to
618 618 prepare the services the config files might need.
619 619
620 620 self.rc already has reasonable default values at this point.
621 621 """
622 622 rc = self.rc
623 623 try:
624 624 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
625 625 except exceptions.UnicodeDecodeError:
626 626 print "Your ipythondir can't be decoded to unicode!"
627 627 print "Please set HOME environment variable to something that"
628 628 print r"only has ASCII characters, e.g. c:\home"
629 629 print "Now it is",rc.ipythondir
630 630 sys.exit()
631 631 self.shadowhist = IPython.history.ShadowHist(self.db)
632 632
633 633
634 634 def post_config_initialization(self):
635 635 """Post configuration init method
636 636
637 637 This is called after the configuration files have been processed to
638 638 'finalize' the initialization."""
639 639
640 640 rc = self.rc
641 641
642 642 # Object inspector
643 643 self.inspector = OInspect.Inspector(OInspect.InspectColors,
644 644 PyColorize.ANSICodeColors,
645 645 'NoColor',
646 646 rc.object_info_string_level)
647 647
648 648 self.rl_next_input = None
649 649 self.rl_do_indent = False
650 650 # Load readline proper
651 651 if rc.readline:
652 652 self.init_readline()
653 653
654 654
655 655 # local shortcut, this is used a LOT
656 656 self.log = self.logger.log
657 657
658 658 # Initialize cache, set in/out prompts and printing system
659 659 self.outputcache = CachedOutput(self,
660 660 rc.cache_size,
661 661 rc.pprint,
662 662 input_sep = rc.separate_in,
663 663 output_sep = rc.separate_out,
664 664 output_sep2 = rc.separate_out2,
665 665 ps1 = rc.prompt_in1,
666 666 ps2 = rc.prompt_in2,
667 667 ps_out = rc.prompt_out,
668 668 pad_left = rc.prompts_pad_left)
669 669
670 670 # user may have over-ridden the default print hook:
671 671 try:
672 672 self.outputcache.__class__.display = self.hooks.display
673 673 except AttributeError:
674 674 pass
675 675
676 676 # I don't like assigning globally to sys, because it means when
677 677 # embedding instances, each embedded instance overrides the previous
678 678 # choice. But sys.displayhook seems to be called internally by exec,
679 679 # so I don't see a way around it. We first save the original and then
680 680 # overwrite it.
681 681 self.sys_displayhook = sys.displayhook
682 682 sys.displayhook = self.outputcache
683 683
684 684 # Monkeypatch doctest so that its core test runner method is protected
685 685 # from IPython's modified displayhook. Doctest expects the default
686 686 # displayhook behavior deep down, so our modification breaks it
687 687 # completely. For this reason, a hard monkeypatch seems like a
688 688 # reasonable solution rather than asking users to manually use a
689 689 # different doctest runner when under IPython.
690 690 try:
691 691 doctest.DocTestRunner
692 692 except AttributeError:
693 693 # This is only for python 2.3 compatibility, remove once we move to
694 694 # 2.4 only.
695 695 pass
696 696 else:
697 697 doctest.DocTestRunner.run = dhook_wrap(doctest.DocTestRunner.run)
698 698
699 699 # Set user colors (don't do it in the constructor above so that it
700 700 # doesn't crash if colors option is invalid)
701 701 self.magic_colors(rc.colors)
702 702
703 703 # Set calling of pdb on exceptions
704 704 self.call_pdb = rc.pdb
705 705
706 706 # Load user aliases
707 707 for alias in rc.alias:
708 708 self.magic_alias(alias)
709 709
710 710 self.hooks.late_startup_hook()
711 711
712 712 batchrun = False
713 713 for batchfile in [path(arg) for arg in self.rc.args
714 714 if arg.lower().endswith('.ipy')]:
715 715 if not batchfile.isfile():
716 716 print "No such batch file:", batchfile
717 717 continue
718 718 self.api.runlines(batchfile.text())
719 719 batchrun = True
720 720 # without -i option, exit after running the batch file
721 721 if batchrun and not self.rc.interact:
722 722 self.exit_now = True
723 723
724 724 def add_builtins(self):
725 725 """Store ipython references into the builtin namespace.
726 726
727 727 Some parts of ipython operate via builtins injected here, which hold a
728 728 reference to IPython itself."""
729 729
730 730 # TODO: deprecate all except _ip; 'jobs' should be installed
731 731 # by an extension and the rest are under _ip, ipalias is redundant
732 732 builtins_new = dict(__IPYTHON__ = self,
733 733 ip_set_hook = self.set_hook,
734 734 jobs = self.jobs,
735 735 ipmagic = wrap_deprecated(self.ipmagic,'_ip.magic()'),
736 736 ipalias = wrap_deprecated(self.ipalias),
737 737 ipsystem = wrap_deprecated(self.ipsystem,'_ip.system()'),
738 738 _ip = self.api
739 739 )
740 740 for biname,bival in builtins_new.items():
741 741 try:
742 742 # store the orignal value so we can restore it
743 743 self.builtins_added[biname] = __builtin__.__dict__[biname]
744 744 except KeyError:
745 745 # or mark that it wasn't defined, and we'll just delete it at
746 746 # cleanup
747 747 self.builtins_added[biname] = Undefined
748 748 __builtin__.__dict__[biname] = bival
749 749
750 750 # Keep in the builtins a flag for when IPython is active. We set it
751 751 # with setdefault so that multiple nested IPythons don't clobber one
752 752 # another. Each will increase its value by one upon being activated,
753 753 # which also gives us a way to determine the nesting level.
754 754 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
755 755
756 756 def clean_builtins(self):
757 757 """Remove any builtins which might have been added by add_builtins, or
758 758 restore overwritten ones to their previous values."""
759 759 for biname,bival in self.builtins_added.items():
760 760 if bival is Undefined:
761 761 del __builtin__.__dict__[biname]
762 762 else:
763 763 __builtin__.__dict__[biname] = bival
764 764 self.builtins_added.clear()
765 765
766 766 def set_hook(self,name,hook, priority = 50, str_key = None, re_key = None):
767 767 """set_hook(name,hook) -> sets an internal IPython hook.
768 768
769 769 IPython exposes some of its internal API as user-modifiable hooks. By
770 770 adding your function to one of these hooks, you can modify IPython's
771 771 behavior to call at runtime your own routines."""
772 772
773 773 # At some point in the future, this should validate the hook before it
774 774 # accepts it. Probably at least check that the hook takes the number
775 775 # of args it's supposed to.
776 776
777 777 f = new.instancemethod(hook,self,self.__class__)
778 778
779 779 # check if the hook is for strdispatcher first
780 780 if str_key is not None:
781 781 sdp = self.strdispatchers.get(name, StrDispatch())
782 782 sdp.add_s(str_key, f, priority )
783 783 self.strdispatchers[name] = sdp
784 784 return
785 785 if re_key is not None:
786 786 sdp = self.strdispatchers.get(name, StrDispatch())
787 787 sdp.add_re(re.compile(re_key), f, priority )
788 788 self.strdispatchers[name] = sdp
789 789 return
790 790
791 791 dp = getattr(self.hooks, name, None)
792 792 if name not in IPython.hooks.__all__:
793 793 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
794 794 if not dp:
795 795 dp = IPython.hooks.CommandChainDispatcher()
796 796
797 797 try:
798 798 dp.add(f,priority)
799 799 except AttributeError:
800 800 # it was not commandchain, plain old func - replace
801 801 dp = f
802 802
803 803 setattr(self.hooks,name, dp)
804 804
805 805
806 806 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
807 807
808 808 def set_crash_handler(self,crashHandler):
809 809 """Set the IPython crash handler.
810 810
811 811 This must be a callable with a signature suitable for use as
812 812 sys.excepthook."""
813 813
814 814 # Install the given crash handler as the Python exception hook
815 815 sys.excepthook = crashHandler
816 816
817 817 # The instance will store a pointer to this, so that runtime code
818 818 # (such as magics) can access it. This is because during the
819 819 # read-eval loop, it gets temporarily overwritten (to deal with GUI
820 820 # frameworks).
821 821 self.sys_excepthook = sys.excepthook
822 822
823 823
824 824 def set_custom_exc(self,exc_tuple,handler):
825 825 """set_custom_exc(exc_tuple,handler)
826 826
827 827 Set a custom exception handler, which will be called if any of the
828 828 exceptions in exc_tuple occur in the mainloop (specifically, in the
829 829 runcode() method.
830 830
831 831 Inputs:
832 832
833 833 - exc_tuple: a *tuple* of valid exceptions to call the defined
834 834 handler for. It is very important that you use a tuple, and NOT A
835 835 LIST here, because of the way Python's except statement works. If
836 836 you only want to trap a single exception, use a singleton tuple:
837 837
838 838 exc_tuple == (MyCustomException,)
839 839
840 840 - handler: this must be defined as a function with the following
841 841 basic interface: def my_handler(self,etype,value,tb).
842 842
843 843 This will be made into an instance method (via new.instancemethod)
844 844 of IPython itself, and it will be called if any of the exceptions
845 845 listed in the exc_tuple are caught. If the handler is None, an
846 846 internal basic one is used, which just prints basic info.
847 847
848 848 WARNING: by putting in your own exception handler into IPython's main
849 849 execution loop, you run a very good chance of nasty crashes. This
850 850 facility should only be used if you really know what you are doing."""
851 851
852 852 assert type(exc_tuple)==type(()) , \
853 853 "The custom exceptions must be given AS A TUPLE."
854 854
855 855 def dummy_handler(self,etype,value,tb):
856 856 print '*** Simple custom exception handler ***'
857 857 print 'Exception type :',etype
858 858 print 'Exception value:',value
859 859 print 'Traceback :',tb
860 860 print 'Source code :','\n'.join(self.buffer)
861 861
862 862 if handler is None: handler = dummy_handler
863 863
864 864 self.CustomTB = new.instancemethod(handler,self,self.__class__)
865 865 self.custom_exceptions = exc_tuple
866 866
867 867 def set_custom_completer(self,completer,pos=0):
868 868 """set_custom_completer(completer,pos=0)
869 869
870 870 Adds a new custom completer function.
871 871
872 872 The position argument (defaults to 0) is the index in the completers
873 873 list where you want the completer to be inserted."""
874 874
875 875 newcomp = new.instancemethod(completer,self.Completer,
876 876 self.Completer.__class__)
877 877 self.Completer.matchers.insert(pos,newcomp)
878 878
879 879 def set_completer(self):
880 880 """reset readline's completer to be our own."""
881 881 self.readline.set_completer(self.Completer.complete)
882 882
883 883 def _get_call_pdb(self):
884 884 return self._call_pdb
885 885
886 886 def _set_call_pdb(self,val):
887 887
888 888 if val not in (0,1,False,True):
889 889 raise ValueError,'new call_pdb value must be boolean'
890 890
891 891 # store value in instance
892 892 self._call_pdb = val
893 893
894 894 # notify the actual exception handlers
895 895 self.InteractiveTB.call_pdb = val
896 896 if self.isthreaded:
897 897 try:
898 898 self.sys_excepthook.call_pdb = val
899 899 except:
900 900 warn('Failed to activate pdb for threaded exception handler')
901 901
902 902 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
903 903 'Control auto-activation of pdb at exceptions')
904 904
905 905
906 906 # These special functions get installed in the builtin namespace, to
907 907 # provide programmatic (pure python) access to magics, aliases and system
908 908 # calls. This is important for logging, user scripting, and more.
909 909
910 910 # We are basically exposing, via normal python functions, the three
911 911 # mechanisms in which ipython offers special call modes (magics for
912 912 # internal control, aliases for direct system access via pre-selected
913 913 # names, and !cmd for calling arbitrary system commands).
914 914
915 915 def ipmagic(self,arg_s):
916 916 """Call a magic function by name.
917 917
918 918 Input: a string containing the name of the magic function to call and any
919 919 additional arguments to be passed to the magic.
920 920
921 921 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
922 922 prompt:
923 923
924 924 In[1]: %name -opt foo bar
925 925
926 926 To call a magic without arguments, simply use ipmagic('name').
927 927
928 928 This provides a proper Python function to call IPython's magics in any
929 929 valid Python code you can type at the interpreter, including loops and
930 930 compound statements. It is added by IPython to the Python builtin
931 931 namespace upon initialization."""
932 932
933 933 args = arg_s.split(' ',1)
934 934 magic_name = args[0]
935 935 magic_name = magic_name.lstrip(self.ESC_MAGIC)
936 936
937 937 try:
938 938 magic_args = args[1]
939 939 except IndexError:
940 940 magic_args = ''
941 941 fn = getattr(self,'magic_'+magic_name,None)
942 942 if fn is None:
943 943 error("Magic function `%s` not found." % magic_name)
944 944 else:
945 945 magic_args = self.var_expand(magic_args,1)
946 946 return fn(magic_args)
947 947
948 948 def ipalias(self,arg_s):
949 949 """Call an alias by name.
950 950
951 951 Input: a string containing the name of the alias to call and any
952 952 additional arguments to be passed to the magic.
953 953
954 954 ipalias('name -opt foo bar') is equivalent to typing at the ipython
955 955 prompt:
956 956
957 957 In[1]: name -opt foo bar
958 958
959 959 To call an alias without arguments, simply use ipalias('name').
960 960
961 961 This provides a proper Python function to call IPython's aliases in any
962 962 valid Python code you can type at the interpreter, including loops and
963 963 compound statements. It is added by IPython to the Python builtin
964 964 namespace upon initialization."""
965 965
966 966 args = arg_s.split(' ',1)
967 967 alias_name = args[0]
968 968 try:
969 969 alias_args = args[1]
970 970 except IndexError:
971 971 alias_args = ''
972 972 if alias_name in self.alias_table:
973 973 self.call_alias(alias_name,alias_args)
974 974 else:
975 975 error("Alias `%s` not found." % alias_name)
976 976
977 977 def ipsystem(self,arg_s):
978 978 """Make a system call, using IPython."""
979 979
980 980 self.system(arg_s)
981 981
982 982 def complete(self,text):
983 983 """Return a sorted list of all possible completions on text.
984 984
985 985 Inputs:
986 986
987 987 - text: a string of text to be completed on.
988 988
989 989 This is a wrapper around the completion mechanism, similar to what
990 990 readline does at the command line when the TAB key is hit. By
991 991 exposing it as a method, it can be used by other non-readline
992 992 environments (such as GUIs) for text completion.
993 993
994 994 Simple usage example:
995 995
996 996 In [1]: x = 'hello'
997 997
998 998 In [2]: __IP.complete('x.l')
999 999 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
1000 1000
1001 1001 complete = self.Completer.complete
1002 1002 state = 0
1003 1003 # use a dict so we get unique keys, since ipyhton's multiple
1004 1004 # completers can return duplicates. When we make 2.4 a requirement,
1005 1005 # start using sets instead, which are faster.
1006 1006 comps = {}
1007 1007 while True:
1008 1008 newcomp = complete(text,state,line_buffer=text)
1009 1009 if newcomp is None:
1010 1010 break
1011 1011 comps[newcomp] = 1
1012 1012 state += 1
1013 1013 outcomps = comps.keys()
1014 1014 outcomps.sort()
1015 1015 return outcomps
1016 1016
1017 1017 def set_completer_frame(self, frame=None):
1018 1018 if frame:
1019 1019 self.Completer.namespace = frame.f_locals
1020 1020 self.Completer.global_namespace = frame.f_globals
1021 1021 else:
1022 1022 self.Completer.namespace = self.user_ns
1023 1023 self.Completer.global_namespace = self.user_global_ns
1024 1024
1025 1025 def init_auto_alias(self):
1026 1026 """Define some aliases automatically.
1027 1027
1028 1028 These are ALL parameter-less aliases"""
1029 1029
1030 1030 for alias,cmd in self.auto_alias:
1031 1031 self.getapi().defalias(alias,cmd)
1032 1032
1033 1033
1034 1034 def alias_table_validate(self,verbose=0):
1035 1035 """Update information about the alias table.
1036 1036
1037 1037 In particular, make sure no Python keywords/builtins are in it."""
1038 1038
1039 1039 no_alias = self.no_alias
1040 1040 for k in self.alias_table.keys():
1041 1041 if k in no_alias:
1042 1042 del self.alias_table[k]
1043 1043 if verbose:
1044 1044 print ("Deleting alias <%s>, it's a Python "
1045 1045 "keyword or builtin." % k)
1046 1046
1047 1047 def set_autoindent(self,value=None):
1048 1048 """Set the autoindent flag, checking for readline support.
1049 1049
1050 1050 If called with no arguments, it acts as a toggle."""
1051 1051
1052 1052 if not self.has_readline:
1053 1053 if os.name == 'posix':
1054 1054 warn("The auto-indent feature requires the readline library")
1055 1055 self.autoindent = 0
1056 1056 return
1057 1057 if value is None:
1058 1058 self.autoindent = not self.autoindent
1059 1059 else:
1060 1060 self.autoindent = value
1061 1061
1062 1062 def rc_set_toggle(self,rc_field,value=None):
1063 1063 """Set or toggle a field in IPython's rc config. structure.
1064 1064
1065 1065 If called with no arguments, it acts as a toggle.
1066 1066
1067 1067 If called with a non-existent field, the resulting AttributeError
1068 1068 exception will propagate out."""
1069 1069
1070 1070 rc_val = getattr(self.rc,rc_field)
1071 1071 if value is None:
1072 1072 value = not rc_val
1073 1073 setattr(self.rc,rc_field,value)
1074 1074
1075 1075 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1076 1076 """Install the user configuration directory.
1077 1077
1078 1078 Can be called when running for the first time or to upgrade the user's
1079 1079 .ipython/ directory with the mode parameter. Valid modes are 'install'
1080 1080 and 'upgrade'."""
1081 1081
1082 1082 def wait():
1083 1083 try:
1084 1084 raw_input("Please press <RETURN> to start IPython.")
1085 1085 except EOFError:
1086 1086 print >> Term.cout
1087 1087 print '*'*70
1088 1088
1089 1089 cwd = os.getcwd() # remember where we started
1090 1090 glb = glob.glob
1091 1091 print '*'*70
1092 1092 if mode == 'install':
1093 1093 print \
1094 1094 """Welcome to IPython. I will try to create a personal configuration directory
1095 1095 where you can customize many aspects of IPython's functionality in:\n"""
1096 1096 else:
1097 1097 print 'I am going to upgrade your configuration in:'
1098 1098
1099 1099 print ipythondir
1100 1100
1101 1101 rcdirend = os.path.join('IPython','UserConfig')
1102 1102 cfg = lambda d: os.path.join(d,rcdirend)
1103 1103 try:
1104 1104 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1105 1105 except IOError:
1106 1106 warning = """
1107 1107 Installation error. IPython's directory was not found.
1108 1108
1109 1109 Check the following:
1110 1110
1111 1111 The ipython/IPython directory should be in a directory belonging to your
1112 1112 PYTHONPATH environment variable (that is, it should be in a directory
1113 1113 belonging to sys.path). You can copy it explicitly there or just link to it.
1114 1114
1115 1115 IPython will proceed with builtin defaults.
1116 1116 """
1117 1117 warn(warning)
1118 1118 wait()
1119 1119 return
1120 1120
1121 1121 if mode == 'install':
1122 1122 try:
1123 1123 shutil.copytree(rcdir,ipythondir)
1124 1124 os.chdir(ipythondir)
1125 1125 rc_files = glb("ipythonrc*")
1126 1126 for rc_file in rc_files:
1127 1127 os.rename(rc_file,rc_file+rc_suffix)
1128 1128 except:
1129 1129 warning = """
1130 1130
1131 1131 There was a problem with the installation:
1132 1132 %s
1133 1133 Try to correct it or contact the developers if you think it's a bug.
1134 1134 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1135 1135 warn(warning)
1136 1136 wait()
1137 1137 return
1138 1138
1139 1139 elif mode == 'upgrade':
1140 1140 try:
1141 1141 os.chdir(ipythondir)
1142 1142 except:
1143 1143 print """
1144 1144 Can not upgrade: changing to directory %s failed. Details:
1145 1145 %s
1146 1146 """ % (ipythondir,sys.exc_info()[1])
1147 1147 wait()
1148 1148 return
1149 1149 else:
1150 1150 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1151 1151 for new_full_path in sources:
1152 1152 new_filename = os.path.basename(new_full_path)
1153 1153 if new_filename.startswith('ipythonrc'):
1154 1154 new_filename = new_filename + rc_suffix
1155 1155 # The config directory should only contain files, skip any
1156 1156 # directories which may be there (like CVS)
1157 1157 if os.path.isdir(new_full_path):
1158 1158 continue
1159 1159 if os.path.exists(new_filename):
1160 1160 old_file = new_filename+'.old'
1161 1161 if os.path.exists(old_file):
1162 1162 os.remove(old_file)
1163 1163 os.rename(new_filename,old_file)
1164 1164 shutil.copy(new_full_path,new_filename)
1165 1165 else:
1166 1166 raise ValueError,'unrecognized mode for install:',`mode`
1167 1167
1168 1168 # Fix line-endings to those native to each platform in the config
1169 1169 # directory.
1170 1170 try:
1171 1171 os.chdir(ipythondir)
1172 1172 except:
1173 1173 print """
1174 1174 Problem: changing to directory %s failed.
1175 1175 Details:
1176 1176 %s
1177 1177
1178 1178 Some configuration files may have incorrect line endings. This should not
1179 1179 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1180 1180 wait()
1181 1181 else:
1182 1182 for fname in glb('ipythonrc*'):
1183 1183 try:
1184 1184 native_line_ends(fname,backup=0)
1185 1185 except IOError:
1186 1186 pass
1187 1187
1188 1188 if mode == 'install':
1189 1189 print """
1190 1190 Successful installation!
1191 1191
1192 1192 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1193 1193 IPython manual (there are both HTML and PDF versions supplied with the
1194 1194 distribution) to make sure that your system environment is properly configured
1195 1195 to take advantage of IPython's features.
1196 1196
1197 1197 Important note: the configuration system has changed! The old system is
1198 1198 still in place, but its setting may be partly overridden by the settings in
1199 1199 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1200 1200 if some of the new settings bother you.
1201 1201
1202 1202 """
1203 1203 else:
1204 1204 print """
1205 1205 Successful upgrade!
1206 1206
1207 1207 All files in your directory:
1208 1208 %(ipythondir)s
1209 1209 which would have been overwritten by the upgrade were backed up with a .old
1210 1210 extension. If you had made particular customizations in those files you may
1211 1211 want to merge them back into the new files.""" % locals()
1212 1212 wait()
1213 1213 os.chdir(cwd)
1214 1214 # end user_setup()
1215 1215
1216 1216 def atexit_operations(self):
1217 1217 """This will be executed at the time of exit.
1218 1218
1219 1219 Saving of persistent data should be performed here. """
1220 1220
1221 1221 #print '*** IPython exit cleanup ***' # dbg
1222 1222 # input history
1223 1223 self.savehist()
1224 1224
1225 1225 # Cleanup all tempfiles left around
1226 1226 for tfile in self.tempfiles:
1227 1227 try:
1228 1228 os.unlink(tfile)
1229 1229 except OSError:
1230 1230 pass
1231 1231
1232 1232 self.hooks.shutdown_hook()
1233 1233
1234 1234 def savehist(self):
1235 1235 """Save input history to a file (via readline library)."""
1236 1236 try:
1237 1237 self.readline.write_history_file(self.histfile)
1238 1238 except:
1239 1239 print 'Unable to save IPython command history to file: ' + \
1240 1240 `self.histfile`
1241 1241
1242 1242 def reloadhist(self):
1243 1243 """Reload the input history from disk file."""
1244 1244
1245 1245 if self.has_readline:
1246 1246 self.readline.clear_history()
1247 1247 self.readline.read_history_file(self.shell.histfile)
1248 1248
1249 1249 def history_saving_wrapper(self, func):
1250 1250 """ Wrap func for readline history saving
1251 1251
1252 1252 Convert func into callable that saves & restores
1253 1253 history around the call """
1254 1254
1255 1255 if not self.has_readline:
1256 1256 return func
1257 1257
1258 1258 def wrapper():
1259 1259 self.savehist()
1260 1260 try:
1261 1261 func()
1262 1262 finally:
1263 1263 readline.read_history_file(self.histfile)
1264 1264 return wrapper
1265 1265
1266 1266
1267 1267 def pre_readline(self):
1268 1268 """readline hook to be used at the start of each line.
1269 1269
1270 1270 Currently it handles auto-indent only."""
1271 1271
1272 1272 #debugx('self.indent_current_nsp','pre_readline:')
1273 1273
1274 1274 if self.rl_do_indent:
1275 1275 self.readline.insert_text(self.indent_current_str())
1276 1276 if self.rl_next_input is not None:
1277 1277 self.readline.insert_text(self.rl_next_input)
1278 1278 self.rl_next_input = None
1279 1279
1280 1280 def init_readline(self):
1281 1281 """Command history completion/saving/reloading."""
1282 1282
1283 1283
1284 1284 import IPython.rlineimpl as readline
1285 1285
1286 1286 if not readline.have_readline:
1287 1287 self.has_readline = 0
1288 1288 self.readline = None
1289 1289 # no point in bugging windows users with this every time:
1290 1290 warn('Readline services not available on this platform.')
1291 1291 else:
1292 1292 sys.modules['readline'] = readline
1293 1293 import atexit
1294 1294 from IPython.completer import IPCompleter
1295 1295 self.Completer = IPCompleter(self,
1296 1296 self.user_ns,
1297 1297 self.user_global_ns,
1298 1298 self.rc.readline_omit__names,
1299 1299 self.alias_table)
1300 1300 sdisp = self.strdispatchers.get('complete_command', StrDispatch())
1301 1301 self.strdispatchers['complete_command'] = sdisp
1302 1302 self.Completer.custom_completers = sdisp
1303 1303 # Platform-specific configuration
1304 1304 if os.name == 'nt':
1305 1305 self.readline_startup_hook = readline.set_pre_input_hook
1306 1306 else:
1307 1307 self.readline_startup_hook = readline.set_startup_hook
1308 1308
1309 1309 # Load user's initrc file (readline config)
1310 1310 inputrc_name = os.environ.get('INPUTRC')
1311 1311 if inputrc_name is None:
1312 1312 home_dir = get_home_dir()
1313 1313 if home_dir is not None:
1314 1314 inputrc_name = os.path.join(home_dir,'.inputrc')
1315 1315 if os.path.isfile(inputrc_name):
1316 1316 try:
1317 1317 readline.read_init_file(inputrc_name)
1318 1318 except:
1319 1319 warn('Problems reading readline initialization file <%s>'
1320 1320 % inputrc_name)
1321 1321
1322 1322 self.has_readline = 1
1323 1323 self.readline = readline
1324 1324 # save this in sys so embedded copies can restore it properly
1325 1325 sys.ipcompleter = self.Completer.complete
1326 1326 self.set_completer()
1327 1327
1328 1328 # Configure readline according to user's prefs
1329 1329 for rlcommand in self.rc.readline_parse_and_bind:
1330 1330 readline.parse_and_bind(rlcommand)
1331 1331
1332 1332 # remove some chars from the delimiters list
1333 1333 delims = readline.get_completer_delims()
1334 1334 delims = delims.translate(string._idmap,
1335 1335 self.rc.readline_remove_delims)
1336 1336 readline.set_completer_delims(delims)
1337 1337 # otherwise we end up with a monster history after a while:
1338 1338 readline.set_history_length(1000)
1339 1339 try:
1340 1340 #print '*** Reading readline history' # dbg
1341 1341 readline.read_history_file(self.histfile)
1342 1342 except IOError:
1343 1343 pass # It doesn't exist yet.
1344 1344
1345 1345 atexit.register(self.atexit_operations)
1346 1346 del atexit
1347 1347
1348 1348 # Configure auto-indent for all platforms
1349 1349 self.set_autoindent(self.rc.autoindent)
1350 1350
1351 1351 def ask_yes_no(self,prompt,default=True):
1352 1352 if self.rc.quiet:
1353 1353 return True
1354 1354 return ask_yes_no(prompt,default)
1355 1355
1356 1356 def _should_recompile(self,e):
1357 1357 """Utility routine for edit_syntax_error"""
1358 1358
1359 1359 if e.filename in ('<ipython console>','<input>','<string>',
1360 1360 '<console>','<BackgroundJob compilation>',
1361 1361 None):
1362 1362
1363 1363 return False
1364 1364 try:
1365 1365 if (self.rc.autoedit_syntax and
1366 1366 not self.ask_yes_no('Return to editor to correct syntax error? '
1367 1367 '[Y/n] ','y')):
1368 1368 return False
1369 1369 except EOFError:
1370 1370 return False
1371 1371
1372 1372 def int0(x):
1373 1373 try:
1374 1374 return int(x)
1375 1375 except TypeError:
1376 1376 return 0
1377 1377 # always pass integer line and offset values to editor hook
1378 1378 self.hooks.fix_error_editor(e.filename,
1379 1379 int0(e.lineno),int0(e.offset),e.msg)
1380 1380 return True
1381 1381
1382 1382 def edit_syntax_error(self):
1383 1383 """The bottom half of the syntax error handler called in the main loop.
1384 1384
1385 1385 Loop until syntax error is fixed or user cancels.
1386 1386 """
1387 1387
1388 1388 while self.SyntaxTB.last_syntax_error:
1389 1389 # copy and clear last_syntax_error
1390 1390 err = self.SyntaxTB.clear_err_state()
1391 1391 if not self._should_recompile(err):
1392 1392 return
1393 1393 try:
1394 1394 # may set last_syntax_error again if a SyntaxError is raised
1395 1395 self.safe_execfile(err.filename,self.user_ns)
1396 1396 except:
1397 1397 self.showtraceback()
1398 1398 else:
1399 1399 try:
1400 1400 f = file(err.filename)
1401 1401 try:
1402 1402 sys.displayhook(f.read())
1403 1403 finally:
1404 1404 f.close()
1405 1405 except:
1406 1406 self.showtraceback()
1407 1407
1408 1408 def showsyntaxerror(self, filename=None):
1409 1409 """Display the syntax error that just occurred.
1410 1410
1411 1411 This doesn't display a stack trace because there isn't one.
1412 1412
1413 1413 If a filename is given, it is stuffed in the exception instead
1414 1414 of what was there before (because Python's parser always uses
1415 1415 "<string>" when reading from a string).
1416 1416 """
1417 1417 etype, value, last_traceback = sys.exc_info()
1418 1418
1419 1419 # See note about these variables in showtraceback() below
1420 1420 sys.last_type = etype
1421 1421 sys.last_value = value
1422 1422 sys.last_traceback = last_traceback
1423 1423
1424 1424 if filename and etype is SyntaxError:
1425 1425 # Work hard to stuff the correct filename in the exception
1426 1426 try:
1427 1427 msg, (dummy_filename, lineno, offset, line) = value
1428 1428 except:
1429 1429 # Not the format we expect; leave it alone
1430 1430 pass
1431 1431 else:
1432 1432 # Stuff in the right filename
1433 1433 try:
1434 1434 # Assume SyntaxError is a class exception
1435 1435 value = SyntaxError(msg, (filename, lineno, offset, line))
1436 1436 except:
1437 1437 # If that failed, assume SyntaxError is a string
1438 1438 value = msg, (filename, lineno, offset, line)
1439 1439 self.SyntaxTB(etype,value,[])
1440 1440
1441 1441 def debugger(self,force=False):
1442 1442 """Call the pydb/pdb debugger.
1443 1443
1444 1444 Keywords:
1445 1445
1446 1446 - force(False): by default, this routine checks the instance call_pdb
1447 1447 flag and does not actually invoke the debugger if the flag is false.
1448 1448 The 'force' option forces the debugger to activate even if the flag
1449 1449 is false.
1450 1450 """
1451 1451
1452 1452 if not (force or self.call_pdb):
1453 1453 return
1454 1454
1455 1455 if not hasattr(sys,'last_traceback'):
1456 1456 error('No traceback has been produced, nothing to debug.')
1457 1457 return
1458 1458
1459 1459 # use pydb if available
1460 1460 if Debugger.has_pydb:
1461 1461 from pydb import pm
1462 1462 else:
1463 1463 # fallback to our internal debugger
1464 1464 pm = lambda : self.InteractiveTB.debugger(force=True)
1465 1465 self.history_saving_wrapper(pm)()
1466 1466
1467 1467 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1468 1468 """Display the exception that just occurred.
1469 1469
1470 1470 If nothing is known about the exception, this is the method which
1471 1471 should be used throughout the code for presenting user tracebacks,
1472 1472 rather than directly invoking the InteractiveTB object.
1473 1473
1474 1474 A specific showsyntaxerror() also exists, but this method can take
1475 1475 care of calling it if needed, so unless you are explicitly catching a
1476 1476 SyntaxError exception, don't try to analyze the stack manually and
1477 1477 simply call this method."""
1478 1478
1479 1479
1480 1480 # Though this won't be called by syntax errors in the input line,
1481 1481 # there may be SyntaxError cases whith imported code.
1482 1482
1483 1483
1484 1484 if exc_tuple is None:
1485 1485 etype, value, tb = sys.exc_info()
1486 1486 else:
1487 1487 etype, value, tb = exc_tuple
1488 1488
1489 1489 if etype is SyntaxError:
1490 1490 self.showsyntaxerror(filename)
1491 1491 else:
1492 1492 # WARNING: these variables are somewhat deprecated and not
1493 1493 # necessarily safe to use in a threaded environment, but tools
1494 1494 # like pdb depend on their existence, so let's set them. If we
1495 1495 # find problems in the field, we'll need to revisit their use.
1496 1496 sys.last_type = etype
1497 1497 sys.last_value = value
1498 1498 sys.last_traceback = tb
1499 1499
1500 1500 if etype in self.custom_exceptions:
1501 1501 self.CustomTB(etype,value,tb)
1502 1502 else:
1503 1503 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1504 1504 if self.InteractiveTB.call_pdb and self.has_readline:
1505 1505 # pdb mucks up readline, fix it back
1506 1506 self.set_completer()
1507 1507
1508 1508
1509 1509 def mainloop(self,banner=None):
1510 1510 """Creates the local namespace and starts the mainloop.
1511 1511
1512 1512 If an optional banner argument is given, it will override the
1513 1513 internally created default banner."""
1514 1514
1515 1515 if self.rc.c: # Emulate Python's -c option
1516 1516 self.exec_init_cmd()
1517 1517 if banner is None:
1518 1518 if not self.rc.banner:
1519 1519 banner = ''
1520 1520 # banner is string? Use it directly!
1521 1521 elif isinstance(self.rc.banner,basestring):
1522 1522 banner = self.rc.banner
1523 1523 else:
1524 1524 banner = self.BANNER+self.banner2
1525 1525
1526 1526 self.interact(banner)
1527 1527
1528 1528 def exec_init_cmd(self):
1529 1529 """Execute a command given at the command line.
1530 1530
1531 1531 This emulates Python's -c option."""
1532 1532
1533 1533 #sys.argv = ['-c']
1534 1534 self.push(self.prefilter(self.rc.c, False))
1535 1535 if not self.rc.interact:
1536 1536 self.exit_now = True
1537 1537
1538 1538 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1539 1539 """Embeds IPython into a running python program.
1540 1540
1541 1541 Input:
1542 1542
1543 1543 - header: An optional header message can be specified.
1544 1544
1545 1545 - local_ns, global_ns: working namespaces. If given as None, the
1546 1546 IPython-initialized one is updated with __main__.__dict__, so that
1547 1547 program variables become visible but user-specific configuration
1548 1548 remains possible.
1549 1549
1550 1550 - stack_depth: specifies how many levels in the stack to go to
1551 1551 looking for namespaces (when local_ns and global_ns are None). This
1552 1552 allows an intermediate caller to make sure that this function gets
1553 1553 the namespace from the intended level in the stack. By default (0)
1554 1554 it will get its locals and globals from the immediate caller.
1555 1555
1556 1556 Warning: it's possible to use this in a program which is being run by
1557 1557 IPython itself (via %run), but some funny things will happen (a few
1558 1558 globals get overwritten). In the future this will be cleaned up, as
1559 1559 there is no fundamental reason why it can't work perfectly."""
1560 1560
1561 1561 # Get locals and globals from caller
1562 1562 if local_ns is None or global_ns is None:
1563 1563 call_frame = sys._getframe(stack_depth).f_back
1564 1564
1565 1565 if local_ns is None:
1566 1566 local_ns = call_frame.f_locals
1567 1567 if global_ns is None:
1568 1568 global_ns = call_frame.f_globals
1569 1569
1570 1570 # Update namespaces and fire up interpreter
1571 1571
1572 1572 # The global one is easy, we can just throw it in
1573 1573 self.user_global_ns = global_ns
1574 1574
1575 1575 # but the user/local one is tricky: ipython needs it to store internal
1576 1576 # data, but we also need the locals. We'll copy locals in the user
1577 1577 # one, but will track what got copied so we can delete them at exit.
1578 1578 # This is so that a later embedded call doesn't see locals from a
1579 1579 # previous call (which most likely existed in a separate scope).
1580 1580 local_varnames = local_ns.keys()
1581 1581 self.user_ns.update(local_ns)
1582 1582
1583 1583 # Patch for global embedding to make sure that things don't overwrite
1584 1584 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1585 1585 # FIXME. Test this a bit more carefully (the if.. is new)
1586 1586 if local_ns is None and global_ns is None:
1587 1587 self.user_global_ns.update(__main__.__dict__)
1588 1588
1589 1589 # make sure the tab-completer has the correct frame information, so it
1590 1590 # actually completes using the frame's locals/globals
1591 1591 self.set_completer_frame()
1592 1592
1593 1593 # before activating the interactive mode, we need to make sure that
1594 1594 # all names in the builtin namespace needed by ipython point to
1595 1595 # ourselves, and not to other instances.
1596 1596 self.add_builtins()
1597 1597
1598 1598 self.interact(header)
1599 1599
1600 1600 # now, purge out the user namespace from anything we might have added
1601 1601 # from the caller's local namespace
1602 1602 delvar = self.user_ns.pop
1603 1603 for var in local_varnames:
1604 1604 delvar(var,None)
1605 1605 # and clean builtins we may have overridden
1606 1606 self.clean_builtins()
1607 1607
1608 1608 def interact(self, banner=None):
1609 1609 """Closely emulate the interactive Python console.
1610 1610
1611 1611 The optional banner argument specify the banner to print
1612 1612 before the first interaction; by default it prints a banner
1613 1613 similar to the one printed by the real Python interpreter,
1614 1614 followed by the current class name in parentheses (so as not
1615 1615 to confuse this with the real interpreter -- since it's so
1616 1616 close!).
1617 1617
1618 1618 """
1619 1619
1620 1620 if self.exit_now:
1621 1621 # batch run -> do not interact
1622 1622 return
1623 1623 cprt = 'Type "copyright", "credits" or "license" for more information.'
1624 1624 if banner is None:
1625 1625 self.write("Python %s on %s\n%s\n(%s)\n" %
1626 1626 (sys.version, sys.platform, cprt,
1627 1627 self.__class__.__name__))
1628 1628 else:
1629 1629 self.write(banner)
1630 1630
1631 1631 more = 0
1632 1632
1633 1633 # Mark activity in the builtins
1634 1634 __builtin__.__dict__['__IPYTHON__active'] += 1
1635 1635
1636 1636 if self.has_readline:
1637 1637 self.readline_startup_hook(self.pre_readline)
1638 1638 # exit_now is set by a call to %Exit or %Quit
1639 1639
1640 1640 while not self.exit_now:
1641 1641 if more:
1642 1642 prompt = self.hooks.generate_prompt(True)
1643 1643 if self.autoindent:
1644 1644 self.rl_do_indent = True
1645 1645
1646 1646 else:
1647 1647 prompt = self.hooks.generate_prompt(False)
1648 1648 try:
1649 1649 line = self.raw_input(prompt,more)
1650 1650 if self.exit_now:
1651 1651 # quick exit on sys.std[in|out] close
1652 1652 break
1653 1653 if self.autoindent:
1654 1654 self.rl_do_indent = False
1655 1655
1656 1656 except KeyboardInterrupt:
1657 1657 self.write('\nKeyboardInterrupt\n')
1658 1658 self.resetbuffer()
1659 1659 # keep cache in sync with the prompt counter:
1660 1660 self.outputcache.prompt_count -= 1
1661 1661
1662 1662 if self.autoindent:
1663 1663 self.indent_current_nsp = 0
1664 1664 more = 0
1665 1665 except EOFError:
1666 1666 if self.autoindent:
1667 1667 self.rl_do_indent = False
1668 1668 self.readline_startup_hook(None)
1669 1669 self.write('\n')
1670 1670 self.exit()
1671 1671 except bdb.BdbQuit:
1672 1672 warn('The Python debugger has exited with a BdbQuit exception.\n'
1673 1673 'Because of how pdb handles the stack, it is impossible\n'
1674 1674 'for IPython to properly format this particular exception.\n'
1675 1675 'IPython will resume normal operation.')
1676 1676 except:
1677 1677 # exceptions here are VERY RARE, but they can be triggered
1678 1678 # asynchronously by signal handlers, for example.
1679 1679 self.showtraceback()
1680 1680 else:
1681 1681 more = self.push(line)
1682 1682 if (self.SyntaxTB.last_syntax_error and
1683 1683 self.rc.autoedit_syntax):
1684 1684 self.edit_syntax_error()
1685 1685
1686 1686 # We are off again...
1687 1687 __builtin__.__dict__['__IPYTHON__active'] -= 1
1688 1688
1689 1689 def excepthook(self, etype, value, tb):
1690 1690 """One more defense for GUI apps that call sys.excepthook.
1691 1691
1692 1692 GUI frameworks like wxPython trap exceptions and call
1693 1693 sys.excepthook themselves. I guess this is a feature that
1694 1694 enables them to keep running after exceptions that would
1695 1695 otherwise kill their mainloop. This is a bother for IPython
1696 1696 which excepts to catch all of the program exceptions with a try:
1697 1697 except: statement.
1698 1698
1699 1699 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1700 1700 any app directly invokes sys.excepthook, it will look to the user like
1701 1701 IPython crashed. In order to work around this, we can disable the
1702 1702 CrashHandler and replace it with this excepthook instead, which prints a
1703 1703 regular traceback using our InteractiveTB. In this fashion, apps which
1704 1704 call sys.excepthook will generate a regular-looking exception from
1705 1705 IPython, and the CrashHandler will only be triggered by real IPython
1706 1706 crashes.
1707 1707
1708 1708 This hook should be used sparingly, only in places which are not likely
1709 1709 to be true IPython errors.
1710 1710 """
1711 1711 self.showtraceback((etype,value,tb),tb_offset=0)
1712 1712
1713 1713 def expand_aliases(self,fn,rest):
1714 1714 """ Expand multiple levels of aliases:
1715 1715
1716 1716 if:
1717 1717
1718 1718 alias foo bar /tmp
1719 1719 alias baz foo
1720 1720
1721 1721 then:
1722 1722
1723 1723 baz huhhahhei -> bar /tmp huhhahhei
1724 1724
1725 1725 """
1726 1726 line = fn + " " + rest
1727 1727
1728 1728 done = Set()
1729 1729 while 1:
1730 1730 pre,fn,rest = prefilter.splitUserInput(line,
1731 1731 prefilter.shell_line_split)
1732 1732 if fn in self.alias_table:
1733 1733 if fn in done:
1734 1734 warn("Cyclic alias definition, repeated '%s'" % fn)
1735 1735 return ""
1736 1736 done.add(fn)
1737 1737
1738 1738 l2 = self.transform_alias(fn,rest)
1739 1739 # dir -> dir
1740 1740 # print "alias",line, "->",l2 #dbg
1741 1741 if l2 == line:
1742 1742 break
1743 1743 # ls -> ls -F should not recurse forever
1744 1744 if l2.split(None,1)[0] == line.split(None,1)[0]:
1745 1745 line = l2
1746 1746 break
1747 1747
1748 1748 line=l2
1749 1749
1750 1750
1751 1751 # print "al expand to",line #dbg
1752 1752 else:
1753 1753 break
1754 1754
1755 1755 return line
1756 1756
1757 1757 def transform_alias(self, alias,rest=''):
1758 1758 """ Transform alias to system command string.
1759 1759 """
1760 1760 trg = self.alias_table[alias]
1761 1761
1762 1762 nargs,cmd = trg
1763 1763 # print trg #dbg
1764 1764 if ' ' in cmd and os.path.isfile(cmd):
1765 1765 cmd = '"%s"' % cmd
1766 1766
1767 1767 # Expand the %l special to be the user's input line
1768 1768 if cmd.find('%l') >= 0:
1769 1769 cmd = cmd.replace('%l',rest)
1770 1770 rest = ''
1771 1771 if nargs==0:
1772 1772 # Simple, argument-less aliases
1773 1773 cmd = '%s %s' % (cmd,rest)
1774 1774 else:
1775 1775 # Handle aliases with positional arguments
1776 1776 args = rest.split(None,nargs)
1777 1777 if len(args)< nargs:
1778 1778 error('Alias <%s> requires %s arguments, %s given.' %
1779 1779 (alias,nargs,len(args)))
1780 1780 return None
1781 1781 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1782 1782 # Now call the macro, evaluating in the user's namespace
1783 1783 #print 'new command: <%r>' % cmd # dbg
1784 1784 return cmd
1785 1785
1786 1786 def call_alias(self,alias,rest=''):
1787 1787 """Call an alias given its name and the rest of the line.
1788 1788
1789 1789 This is only used to provide backwards compatibility for users of
1790 1790 ipalias(), use of which is not recommended for anymore."""
1791 1791
1792 1792 # Now call the macro, evaluating in the user's namespace
1793 1793 cmd = self.transform_alias(alias, rest)
1794 1794 try:
1795 1795 self.system(cmd)
1796 1796 except:
1797 1797 self.showtraceback()
1798 1798
1799 1799 def indent_current_str(self):
1800 1800 """return the current level of indentation as a string"""
1801 1801 return self.indent_current_nsp * ' '
1802 1802
1803 1803 def autoindent_update(self,line):
1804 1804 """Keep track of the indent level."""
1805 1805
1806 1806 #debugx('line')
1807 1807 #debugx('self.indent_current_nsp')
1808 1808 if self.autoindent:
1809 1809 if line:
1810 1810 inisp = num_ini_spaces(line)
1811 1811 if inisp < self.indent_current_nsp:
1812 1812 self.indent_current_nsp = inisp
1813 1813
1814 1814 if line[-1] == ':':
1815 1815 self.indent_current_nsp += 4
1816 1816 elif dedent_re.match(line):
1817 1817 self.indent_current_nsp -= 4
1818 1818 else:
1819 1819 self.indent_current_nsp = 0
1820 1820 def runlines(self,lines):
1821 1821 """Run a string of one or more lines of source.
1822 1822
1823 1823 This method is capable of running a string containing multiple source
1824 1824 lines, as if they had been entered at the IPython prompt. Since it
1825 1825 exposes IPython's processing machinery, the given strings can contain
1826 1826 magic calls (%magic), special shell access (!cmd), etc."""
1827 1827
1828 1828 # We must start with a clean buffer, in case this is run from an
1829 1829 # interactive IPython session (via a magic, for example).
1830 1830 self.resetbuffer()
1831 1831 lines = lines.split('\n')
1832 1832 more = 0
1833 1833
1834 1834 for line in lines:
1835 1835 # skip blank lines so we don't mess up the prompt counter, but do
1836 1836 # NOT skip even a blank line if we are in a code block (more is
1837 1837 # true)
1838 1838
1839 1839
1840 1840 if line or more:
1841 1841 # push to raw history, so hist line numbers stay in sync
1842 1842 self.input_hist_raw.append("# " + line + "\n")
1843 1843 more = self.push(self.prefilter(line,more))
1844 1844 # IPython's runsource returns None if there was an error
1845 1845 # compiling the code. This allows us to stop processing right
1846 1846 # away, so the user gets the error message at the right place.
1847 1847 if more is None:
1848 1848 break
1849 1849 else:
1850 1850 self.input_hist_raw.append("\n")
1851 1851 # final newline in case the input didn't have it, so that the code
1852 1852 # actually does get executed
1853 1853 if more:
1854 1854 self.push('\n')
1855 1855
1856 1856 def runsource(self, source, filename='<input>', symbol='single'):
1857 1857 """Compile and run some source in the interpreter.
1858 1858
1859 1859 Arguments are as for compile_command().
1860 1860
1861 1861 One several things can happen:
1862 1862
1863 1863 1) The input is incorrect; compile_command() raised an
1864 1864 exception (SyntaxError or OverflowError). A syntax traceback
1865 1865 will be printed by calling the showsyntaxerror() method.
1866 1866
1867 1867 2) The input is incomplete, and more input is required;
1868 1868 compile_command() returned None. Nothing happens.
1869 1869
1870 1870 3) The input is complete; compile_command() returned a code
1871 1871 object. The code is executed by calling self.runcode() (which
1872 1872 also handles run-time exceptions, except for SystemExit).
1873 1873
1874 1874 The return value is:
1875 1875
1876 1876 - True in case 2
1877 1877
1878 1878 - False in the other cases, unless an exception is raised, where
1879 1879 None is returned instead. This can be used by external callers to
1880 1880 know whether to continue feeding input or not.
1881 1881
1882 1882 The return value can be used to decide whether to use sys.ps1 or
1883 1883 sys.ps2 to prompt the next line."""
1884 1884
1885 1885 # if the source code has leading blanks, add 'if 1:\n' to it
1886 1886 # this allows execution of indented pasted code. It is tempting
1887 1887 # to add '\n' at the end of source to run commands like ' a=1'
1888 1888 # directly, but this fails for more complicated scenarios
1889 1889 if source[:1] in [' ', '\t']:
1890 1890 source = 'if 1:\n%s' % source
1891 1891
1892 1892 try:
1893 1893 code = self.compile(source,filename,symbol)
1894 1894 except (OverflowError, SyntaxError, ValueError):
1895 1895 # Case 1
1896 1896 self.showsyntaxerror(filename)
1897 1897 return None
1898 1898
1899 1899 if code is None:
1900 1900 # Case 2
1901 1901 return True
1902 1902
1903 1903 # Case 3
1904 1904 # We store the code object so that threaded shells and
1905 1905 # custom exception handlers can access all this info if needed.
1906 1906 # The source corresponding to this can be obtained from the
1907 1907 # buffer attribute as '\n'.join(self.buffer).
1908 1908 self.code_to_run = code
1909 1909 # now actually execute the code object
1910 1910 if self.runcode(code) == 0:
1911 1911 return False
1912 1912 else:
1913 1913 return None
1914 1914
1915 1915 def runcode(self,code_obj):
1916 1916 """Execute a code object.
1917 1917
1918 1918 When an exception occurs, self.showtraceback() is called to display a
1919 1919 traceback.
1920 1920
1921 1921 Return value: a flag indicating whether the code to be run completed
1922 1922 successfully:
1923 1923
1924 1924 - 0: successful execution.
1925 1925 - 1: an error occurred.
1926 1926 """
1927 1927
1928 1928 # Set our own excepthook in case the user code tries to call it
1929 1929 # directly, so that the IPython crash handler doesn't get triggered
1930 1930 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1931 1931
1932 1932 # we save the original sys.excepthook in the instance, in case config
1933 1933 # code (such as magics) needs access to it.
1934 1934 self.sys_excepthook = old_excepthook
1935 1935 outflag = 1 # happens in more places, so it's easier as default
1936 1936 try:
1937 1937 try:
1938 1938 # Embedded instances require separate global/local namespaces
1939 1939 # so they can see both the surrounding (local) namespace and
1940 1940 # the module-level globals when called inside another function.
1941 1941 if self.embedded:
1942 1942 exec code_obj in self.user_global_ns, self.user_ns
1943 1943 # Normal (non-embedded) instances should only have a single
1944 1944 # namespace for user code execution, otherwise functions won't
1945 1945 # see interactive top-level globals.
1946 1946 else:
1947 1947 exec code_obj in self.user_ns
1948 1948 finally:
1949 1949 # Reset our crash handler in place
1950 1950 sys.excepthook = old_excepthook
1951 1951 except SystemExit:
1952 1952 self.resetbuffer()
1953 1953 self.showtraceback()
1954 1954 warn("Type %exit or %quit to exit IPython "
1955 1955 "(%Exit or %Quit do so unconditionally).",level=1)
1956 1956 except self.custom_exceptions:
1957 1957 etype,value,tb = sys.exc_info()
1958 1958 self.CustomTB(etype,value,tb)
1959 1959 except:
1960 1960 self.showtraceback()
1961 1961 else:
1962 1962 outflag = 0
1963 1963 if softspace(sys.stdout, 0):
1964 1964 print
1965 1965 # Flush out code object which has been run (and source)
1966 1966 self.code_to_run = None
1967 1967 return outflag
1968 1968
1969 1969 def push(self, line):
1970 1970 """Push a line to the interpreter.
1971 1971
1972 1972 The line should not have a trailing newline; it may have
1973 1973 internal newlines. The line is appended to a buffer and the
1974 1974 interpreter's runsource() method is called with the
1975 1975 concatenated contents of the buffer as source. If this
1976 1976 indicates that the command was executed or invalid, the buffer
1977 1977 is reset; otherwise, the command is incomplete, and the buffer
1978 1978 is left as it was after the line was appended. The return
1979 1979 value is 1 if more input is required, 0 if the line was dealt
1980 1980 with in some way (this is the same as runsource()).
1981 1981 """
1982 1982
1983 1983 # autoindent management should be done here, and not in the
1984 1984 # interactive loop, since that one is only seen by keyboard input. We
1985 1985 # need this done correctly even for code run via runlines (which uses
1986 1986 # push).
1987 1987
1988 1988 #print 'push line: <%s>' % line # dbg
1989 1989 for subline in line.splitlines():
1990 1990 self.autoindent_update(subline)
1991 1991 self.buffer.append(line)
1992 1992 more = self.runsource('\n'.join(self.buffer), self.filename)
1993 1993 if not more:
1994 1994 self.resetbuffer()
1995 1995 return more
1996 1996
1997 1997 def split_user_input(self, line):
1998 1998 # This is really a hold-over to support ipapi and some extensions
1999 1999 return prefilter.splitUserInput(line)
2000 2000
2001 2001 def resetbuffer(self):
2002 2002 """Reset the input buffer."""
2003 2003 self.buffer[:] = []
2004 2004
2005 2005 def raw_input(self,prompt='',continue_prompt=False):
2006 2006 """Write a prompt and read a line.
2007 2007
2008 2008 The returned line does not include the trailing newline.
2009 2009 When the user enters the EOF key sequence, EOFError is raised.
2010 2010
2011 2011 Optional inputs:
2012 2012
2013 2013 - prompt(''): a string to be printed to prompt the user.
2014 2014
2015 2015 - continue_prompt(False): whether this line is the first one or a
2016 2016 continuation in a sequence of inputs.
2017 2017 """
2018 2018
2019 2019 # Code run by the user may have modified the readline completer state.
2020 2020 # We must ensure that our completer is back in place.
2021 2021 if self.has_readline:
2022 2022 self.set_completer()
2023 2023
2024 2024 try:
2025 2025 line = raw_input_original(prompt).decode(self.stdin_encoding)
2026 2026 except ValueError:
2027 2027 warn("\n********\nYou or a %run:ed script called sys.stdin.close()"
2028 2028 " or sys.stdout.close()!\nExiting IPython!")
2029 2029 self.exit_now = True
2030 2030 return ""
2031 2031
2032 2032 # Try to be reasonably smart about not re-indenting pasted input more
2033 2033 # than necessary. We do this by trimming out the auto-indent initial
2034 2034 # spaces, if the user's actual input started itself with whitespace.
2035 2035 #debugx('self.buffer[-1]')
2036 2036
2037 2037 if self.autoindent:
2038 2038 if num_ini_spaces(line) > self.indent_current_nsp:
2039 2039 line = line[self.indent_current_nsp:]
2040 2040 self.indent_current_nsp = 0
2041 2041
2042 2042 # store the unfiltered input before the user has any chance to modify
2043 2043 # it.
2044 2044 if line.strip():
2045 2045 if continue_prompt:
2046 2046 self.input_hist_raw[-1] += '%s\n' % line
2047 2047 if self.has_readline: # and some config option is set?
2048 2048 try:
2049 2049 histlen = self.readline.get_current_history_length()
2050 2050 newhist = self.input_hist_raw[-1].rstrip()
2051 2051 self.readline.remove_history_item(histlen-1)
2052 2052 self.readline.replace_history_item(histlen-2,newhist)
2053 2053 except AttributeError:
2054 2054 pass # re{move,place}_history_item are new in 2.4.
2055 2055 else:
2056 2056 self.input_hist_raw.append('%s\n' % line)
2057 2057 # only entries starting at first column go to shadow history
2058 2058 if line.lstrip() == line:
2059 2059 self.shadowhist.add(line.strip())
2060 2060 elif not continue_prompt:
2061 2061 self.input_hist_raw.append('\n')
2062 2062 try:
2063 2063 lineout = self.prefilter(line,continue_prompt)
2064 2064 except:
2065 2065 # blanket except, in case a user-defined prefilter crashes, so it
2066 2066 # can't take all of ipython with it.
2067 2067 self.showtraceback()
2068 2068 return ''
2069 2069 else:
2070 2070 return lineout
2071 2071
2072 2072 def _prefilter(self, line, continue_prompt):
2073 2073 """Calls different preprocessors, depending on the form of line."""
2074 2074
2075 2075 # All handlers *must* return a value, even if it's blank ('').
2076 2076
2077 2077 # Lines are NOT logged here. Handlers should process the line as
2078 2078 # needed, update the cache AND log it (so that the input cache array
2079 2079 # stays synced).
2080 2080
2081 2081 #.....................................................................
2082 2082 # Code begins
2083 2083
2084 2084 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
2085 2085
2086 2086 # save the line away in case we crash, so the post-mortem handler can
2087 2087 # record it
2088 2088 self._last_input_line = line
2089 2089
2090 2090 #print '***line: <%s>' % line # dbg
2091 2091
2092 2092 if not line:
2093 2093 # Return immediately on purely empty lines, so that if the user
2094 2094 # previously typed some whitespace that started a continuation
2095 2095 # prompt, he can break out of that loop with just an empty line.
2096 2096 # This is how the default python prompt works.
2097 2097
2098 2098 # Only return if the accumulated input buffer was just whitespace!
2099 2099 if ''.join(self.buffer).isspace():
2100 2100 self.buffer[:] = []
2101 2101 return ''
2102 2102
2103 2103 line_info = prefilter.LineInfo(line, continue_prompt)
2104 2104
2105 2105 # the input history needs to track even empty lines
2106 2106 stripped = line.strip()
2107 2107
2108 2108 if not stripped:
2109 2109 if not continue_prompt:
2110 2110 self.outputcache.prompt_count -= 1
2111 2111 return self.handle_normal(line_info)
2112 2112
2113 2113 # print '***cont',continue_prompt # dbg
2114 2114 # special handlers are only allowed for single line statements
2115 2115 if continue_prompt and not self.rc.multi_line_specials:
2116 2116 return self.handle_normal(line_info)
2117 2117
2118 2118
2119 2119 # See whether any pre-existing handler can take care of it
2120 2120 rewritten = self.hooks.input_prefilter(stripped)
2121 2121 if rewritten != stripped: # ok, some prefilter did something
2122 2122 rewritten = line_info.pre + rewritten # add indentation
2123 2123 return self.handle_normal(prefilter.LineInfo(rewritten,
2124 2124 continue_prompt))
2125 2125
2126 2126 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2127 2127
2128 2128 return prefilter.prefilter(line_info, self)
2129 2129
2130 2130
2131 2131 def _prefilter_dumb(self, line, continue_prompt):
2132 2132 """simple prefilter function, for debugging"""
2133 2133 return self.handle_normal(line,continue_prompt)
2134 2134
2135 2135
2136 2136 def multiline_prefilter(self, line, continue_prompt):
2137 2137 """ Run _prefilter for each line of input
2138 2138
2139 2139 Covers cases where there are multiple lines in the user entry,
2140 2140 which is the case when the user goes back to a multiline history
2141 2141 entry and presses enter.
2142 2142
2143 2143 """
2144 2144 out = []
2145 2145 for l in line.rstrip('\n').split('\n'):
2146 2146 out.append(self._prefilter(l, continue_prompt))
2147 2147 return '\n'.join(out)
2148 2148
2149 2149 # Set the default prefilter() function (this can be user-overridden)
2150 2150 prefilter = multiline_prefilter
2151 2151
2152 2152 def handle_normal(self,line_info):
2153 2153 """Handle normal input lines. Use as a template for handlers."""
2154 2154
2155 2155 # With autoindent on, we need some way to exit the input loop, and I
2156 2156 # don't want to force the user to have to backspace all the way to
2157 2157 # clear the line. The rule will be in this case, that either two
2158 2158 # lines of pure whitespace in a row, or a line of pure whitespace but
2159 2159 # of a size different to the indent level, will exit the input loop.
2160 2160 line = line_info.line
2161 2161 continue_prompt = line_info.continue_prompt
2162 2162
2163 2163 if (continue_prompt and self.autoindent and line.isspace() and
2164 2164 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2165 2165 (self.buffer[-1]).isspace() )):
2166 2166 line = ''
2167 2167
2168 2168 self.log(line,line,continue_prompt)
2169 2169 return line
2170 2170
2171 2171 def handle_alias(self,line_info):
2172 2172 """Handle alias input lines. """
2173 2173 tgt = self.alias_table[line_info.iFun]
2174 2174 # print "=>",tgt #dbg
2175 2175 if callable(tgt):
2176 2176 if '$' in line_info.line:
2177 2177 call_meth = '(_ip, _ip.itpl(%s))'
2178 2178 else:
2179 2179 call_meth = '(_ip,%s)'
2180 2180 line_out = ("%s_sh.%s" + call_meth) % (line_info.preWhitespace,
2181 2181 line_info.iFun,
2182 2182 make_quoted_expr(line_info.line))
2183 2183 else:
2184 2184 transformed = self.expand_aliases(line_info.iFun,line_info.theRest)
2185 2185
2186 2186 # pre is needed, because it carries the leading whitespace. Otherwise
2187 2187 # aliases won't work in indented sections.
2188 2188 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2189 2189 make_quoted_expr( transformed ))
2190 2190
2191 2191 self.log(line_info.line,line_out,line_info.continue_prompt)
2192 2192 #print 'line out:',line_out # dbg
2193 2193 return line_out
2194 2194
2195 2195 def handle_shell_escape(self, line_info):
2196 2196 """Execute the line in a shell, empty return value"""
2197 2197 #print 'line in :', `line` # dbg
2198 2198 line = line_info.line
2199 2199 if line.lstrip().startswith('!!'):
2200 2200 # rewrite LineInfo's line, iFun and theRest to properly hold the
2201 2201 # call to %sx and the actual command to be executed, so
2202 2202 # handle_magic can work correctly. Note that this works even if
2203 2203 # the line is indented, so it handles multi_line_specials
2204 2204 # properly.
2205 2205 new_rest = line.lstrip()[2:]
2206 2206 line_info.line = '%ssx %s' % (self.ESC_MAGIC,new_rest)
2207 2207 line_info.iFun = 'sx'
2208 2208 line_info.theRest = new_rest
2209 2209 return self.handle_magic(line_info)
2210 2210 else:
2211 2211 cmd = line.lstrip().lstrip('!')
2212 2212 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2213 2213 make_quoted_expr(cmd))
2214 2214 # update cache/log and return
2215 2215 self.log(line,line_out,line_info.continue_prompt)
2216 2216 return line_out
2217 2217
2218 2218 def handle_magic(self, line_info):
2219 2219 """Execute magic functions."""
2220 2220 iFun = line_info.iFun
2221 2221 theRest = line_info.theRest
2222 2222 cmd = '%s_ip.magic(%s)' % (line_info.preWhitespace,
2223 2223 make_quoted_expr(iFun + " " + theRest))
2224 2224 self.log(line_info.line,cmd,line_info.continue_prompt)
2225 2225 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2226 2226 return cmd
2227 2227
2228 2228 def handle_auto(self, line_info):
2229 2229 """Hande lines which can be auto-executed, quoting if requested."""
2230 2230
2231 2231 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2232 2232 line = line_info.line
2233 2233 iFun = line_info.iFun
2234 2234 theRest = line_info.theRest
2235 2235 pre = line_info.pre
2236 2236 continue_prompt = line_info.continue_prompt
2237 2237 obj = line_info.ofind(self)['obj']
2238 2238
2239 2239 # This should only be active for single-line input!
2240 2240 if continue_prompt:
2241 2241 self.log(line,line,continue_prompt)
2242 2242 return line
2243 2243
2244 2244 force_auto = isinstance(obj, IPython.ipapi.IPyAutocall)
2245 2245 auto_rewrite = True
2246 2246
2247 2247 if pre == self.ESC_QUOTE:
2248 2248 # Auto-quote splitting on whitespace
2249 2249 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2250 2250 elif pre == self.ESC_QUOTE2:
2251 2251 # Auto-quote whole string
2252 2252 newcmd = '%s("%s")' % (iFun,theRest)
2253 2253 elif pre == self.ESC_PAREN:
2254 2254 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2255 2255 else:
2256 2256 # Auto-paren.
2257 2257 # We only apply it to argument-less calls if the autocall
2258 2258 # parameter is set to 2. We only need to check that autocall is <
2259 2259 # 2, since this function isn't called unless it's at least 1.
2260 2260 if not theRest and (self.rc.autocall < 2) and not force_auto:
2261 2261 newcmd = '%s %s' % (iFun,theRest)
2262 2262 auto_rewrite = False
2263 2263 else:
2264 2264 if not force_auto and theRest.startswith('['):
2265 2265 if hasattr(obj,'__getitem__'):
2266 2266 # Don't autocall in this case: item access for an object
2267 2267 # which is BOTH callable and implements __getitem__.
2268 2268 newcmd = '%s %s' % (iFun,theRest)
2269 2269 auto_rewrite = False
2270 2270 else:
2271 2271 # if the object doesn't support [] access, go ahead and
2272 2272 # autocall
2273 2273 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2274 2274 elif theRest.endswith(';'):
2275 2275 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2276 2276 else:
2277 2277 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2278 2278
2279 2279 if auto_rewrite:
2280 2280 rw = self.outputcache.prompt1.auto_rewrite() + newcmd
2281 2281
2282 2282 try:
2283 2283 # plain ascii works better w/ pyreadline, on some machines, so
2284 2284 # we use it and only print uncolored rewrite if we have unicode
2285 2285 rw = str(rw)
2286 2286 print >>Term.cout, rw
2287 2287 except UnicodeEncodeError:
2288 2288 print "-------------->" + newcmd
2289 2289
2290 2290 # log what is now valid Python, not the actual user input (without the
2291 2291 # final newline)
2292 2292 self.log(line,newcmd,continue_prompt)
2293 2293 return newcmd
2294 2294
2295 2295 def handle_help(self, line_info):
2296 2296 """Try to get some help for the object.
2297 2297
2298 2298 obj? or ?obj -> basic information.
2299 2299 obj?? or ??obj -> more details.
2300 2300 """
2301 2301
2302 2302 line = line_info.line
2303 2303 # We need to make sure that we don't process lines which would be
2304 2304 # otherwise valid python, such as "x=1 # what?"
2305 2305 try:
2306 2306 codeop.compile_command(line)
2307 2307 except SyntaxError:
2308 2308 # We should only handle as help stuff which is NOT valid syntax
2309 2309 if line[0]==self.ESC_HELP:
2310 2310 line = line[1:]
2311 2311 elif line[-1]==self.ESC_HELP:
2312 2312 line = line[:-1]
2313 2313 self.log(line,'#?'+line,line_info.continue_prompt)
2314 2314 if line:
2315 2315 #print 'line:<%r>' % line # dbg
2316 2316 self.magic_pinfo(line)
2317 2317 else:
2318 2318 page(self.usage,screen_lines=self.rc.screen_length)
2319 2319 return '' # Empty string is needed here!
2320 2320 except:
2321 2321 # Pass any other exceptions through to the normal handler
2322 2322 return self.handle_normal(line_info)
2323 2323 else:
2324 2324 # If the code compiles ok, we should handle it normally
2325 2325 return self.handle_normal(line_info)
2326 2326
2327 2327 def getapi(self):
2328 2328 """ Get an IPApi object for this shell instance
2329 2329
2330 2330 Getting an IPApi object is always preferable to accessing the shell
2331 2331 directly, but this holds true especially for extensions.
2332 2332
2333 2333 It should always be possible to implement an extension with IPApi
2334 2334 alone. If not, contact maintainer to request an addition.
2335 2335
2336 2336 """
2337 2337 return self.api
2338 2338
2339 2339 def handle_emacs(self, line_info):
2340 2340 """Handle input lines marked by python-mode."""
2341 2341
2342 2342 # Currently, nothing is done. Later more functionality can be added
2343 2343 # here if needed.
2344 2344
2345 2345 # The input cache shouldn't be updated
2346 2346 return line_info.line
2347 2347
2348 2348
2349 2349 def mktempfile(self,data=None):
2350 2350 """Make a new tempfile and return its filename.
2351 2351
2352 2352 This makes a call to tempfile.mktemp, but it registers the created
2353 2353 filename internally so ipython cleans it up at exit time.
2354 2354
2355 2355 Optional inputs:
2356 2356
2357 2357 - data(None): if data is given, it gets written out to the temp file
2358 2358 immediately, and the file is closed again."""
2359 2359
2360 2360 filename = tempfile.mktemp('.py','ipython_edit_')
2361 2361 self.tempfiles.append(filename)
2362 2362
2363 2363 if data:
2364 2364 tmp_file = open(filename,'w')
2365 2365 tmp_file.write(data)
2366 2366 tmp_file.close()
2367 2367 return filename
2368 2368
2369 2369 def write(self,data):
2370 2370 """Write a string to the default output"""
2371 2371 Term.cout.write(data)
2372 2372
2373 2373 def write_err(self,data):
2374 2374 """Write a string to the default error output"""
2375 2375 Term.cerr.write(data)
2376 2376
2377 2377 def exit(self):
2378 2378 """Handle interactive exit.
2379 2379
2380 2380 This method sets the exit_now attribute."""
2381 2381
2382 2382 if self.rc.confirm_exit:
2383 2383 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2384 2384 self.exit_now = True
2385 2385 else:
2386 2386 self.exit_now = True
2387 2387
2388 2388 def safe_execfile(self,fname,*where,**kw):
2389 2389 """A safe version of the builtin execfile().
2390 2390
2391 2391 This version will never throw an exception, and knows how to handle
2392 2392 ipython logs as well."""
2393 2393
2394 2394 def syspath_cleanup():
2395 2395 """Internal cleanup routine for sys.path."""
2396 2396 if add_dname:
2397 2397 try:
2398 2398 sys.path.remove(dname)
2399 2399 except ValueError:
2400 2400 # For some reason the user has already removed it, ignore.
2401 2401 pass
2402 2402
2403 2403 fname = os.path.expanduser(fname)
2404 2404
2405 2405 # Find things also in current directory. This is needed to mimic the
2406 2406 # behavior of running a script from the system command line, where
2407 2407 # Python inserts the script's directory into sys.path
2408 2408 dname = os.path.dirname(os.path.abspath(fname))
2409 2409 add_dname = False
2410 2410 if dname not in sys.path:
2411 2411 sys.path.insert(0,dname)
2412 2412 add_dname = True
2413 2413
2414 2414 try:
2415 2415 xfile = open(fname)
2416 2416 except:
2417 2417 print >> Term.cerr, \
2418 2418 'Could not open file <%s> for safe execution.' % fname
2419 2419 syspath_cleanup()
2420 2420 return None
2421 2421
2422 2422 kw.setdefault('islog',0)
2423 2423 kw.setdefault('quiet',1)
2424 2424 kw.setdefault('exit_ignore',0)
2425 2425 first = xfile.readline()
2426 2426 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2427 2427 xfile.close()
2428 2428 # line by line execution
2429 2429 if first.startswith(loghead) or kw['islog']:
2430 2430 print 'Loading log file <%s> one line at a time...' % fname
2431 2431 if kw['quiet']:
2432 2432 stdout_save = sys.stdout
2433 2433 sys.stdout = StringIO.StringIO()
2434 2434 try:
2435 2435 globs,locs = where[0:2]
2436 2436 except:
2437 2437 try:
2438 2438 globs = locs = where[0]
2439 2439 except:
2440 2440 globs = locs = globals()
2441 2441 badblocks = []
2442 2442
2443 2443 # we also need to identify indented blocks of code when replaying
2444 2444 # logs and put them together before passing them to an exec
2445 2445 # statement. This takes a bit of regexp and look-ahead work in the
2446 2446 # file. It's easiest if we swallow the whole thing in memory
2447 2447 # first, and manually walk through the lines list moving the
2448 2448 # counter ourselves.
2449 2449 indent_re = re.compile('\s+\S')
2450 2450 xfile = open(fname)
2451 2451 filelines = xfile.readlines()
2452 2452 xfile.close()
2453 2453 nlines = len(filelines)
2454 2454 lnum = 0
2455 2455 while lnum < nlines:
2456 2456 line = filelines[lnum]
2457 2457 lnum += 1
2458 2458 # don't re-insert logger status info into cache
2459 2459 if line.startswith('#log#'):
2460 2460 continue
2461 2461 else:
2462 2462 # build a block of code (maybe a single line) for execution
2463 2463 block = line
2464 2464 try:
2465 2465 next = filelines[lnum] # lnum has already incremented
2466 2466 except:
2467 2467 next = None
2468 2468 while next and indent_re.match(next):
2469 2469 block += next
2470 2470 lnum += 1
2471 2471 try:
2472 2472 next = filelines[lnum]
2473 2473 except:
2474 2474 next = None
2475 2475 # now execute the block of one or more lines
2476 2476 try:
2477 2477 exec block in globs,locs
2478 2478 except SystemExit:
2479 2479 pass
2480 2480 except:
2481 2481 badblocks.append(block.rstrip())
2482 2482 if kw['quiet']: # restore stdout
2483 2483 sys.stdout.close()
2484 2484 sys.stdout = stdout_save
2485 2485 print 'Finished replaying log file <%s>' % fname
2486 2486 if badblocks:
2487 2487 print >> sys.stderr, ('\nThe following lines/blocks in file '
2488 2488 '<%s> reported errors:' % fname)
2489 2489
2490 2490 for badline in badblocks:
2491 2491 print >> sys.stderr, badline
2492 2492 else: # regular file execution
2493 2493 try:
2494 2494 if sys.platform == 'win32' and sys.version_info < (2,5,1):
2495 2495 # Work around a bug in Python for Windows. The bug was
2496 2496 # fixed in in Python 2.5 r54159 and 54158, but that's still
2497 2497 # SVN Python as of March/07. For details, see:
2498 2498 # http://projects.scipy.org/ipython/ipython/ticket/123
2499 2499 try:
2500 2500 globs,locs = where[0:2]
2501 2501 except:
2502 2502 try:
2503 2503 globs = locs = where[0]
2504 2504 except:
2505 2505 globs = locs = globals()
2506 2506 exec file(fname) in globs,locs
2507 2507 else:
2508 2508 execfile(fname,*where)
2509 2509 except SyntaxError:
2510 2510 self.showsyntaxerror()
2511 2511 warn('Failure executing file: <%s>' % fname)
2512 2512 except SystemExit,status:
2513 2513 # Code that correctly sets the exit status flag to success (0)
2514 2514 # shouldn't be bothered with a traceback. Note that a plain
2515 2515 # sys.exit() does NOT set the message to 0 (it's empty) so that
2516 2516 # will still get a traceback. Note that the structure of the
2517 2517 # SystemExit exception changed between Python 2.4 and 2.5, so
2518 2518 # the checks must be done in a version-dependent way.
2519 2519 show = False
2520 2520
2521 2521 if sys.version_info[:2] > (2,5):
2522 2522 if status.message!=0 and not kw['exit_ignore']:
2523 2523 show = True
2524 2524 else:
2525 2525 if status.code and not kw['exit_ignore']:
2526 2526 show = True
2527 2527 if show:
2528 2528 self.showtraceback()
2529 2529 warn('Failure executing file: <%s>' % fname)
2530 2530 except:
2531 2531 self.showtraceback()
2532 2532 warn('Failure executing file: <%s>' % fname)
2533 2533
2534 2534 syspath_cleanup()
2535 2535
2536 2536 #************************* end of file <iplib.py> *****************************
@@ -1,7139 +1,7144 b''
1 2007-09-07 Ville Vainio <vivainio@gmail.com>
2
3 * iplib.py: do not auto-alias "dir", it screws up other dir auto
4 aliases.
5
1 6 2007-09-07 Fernando Perez <Fernando.Perez@colorado.edu>
2 7
3 8 * IPython/OInspect.py (Inspector.pinfo): fixed bug that was
4 9 preventing source display in certain cases. In reality I think
5 10 the problem is with Ubuntu's Python build, but this change works
6 11 around the issue in some cases (not in all, unfortunately). I'd
7 12 filed a Python bug on this with more details, but in the change of
8 13 bug trackers it seems to have been lost.
9 14
10 15 * IPython/Magic.py (magic_dhist): restore %dhist. No, cd -TAB is
11 16 not the same, it's not self-documenting, doesn't allow range
12 17 selection, and sorts alphabetically instead of numerically.
13 18 (magic_r): restore %r. No, "up + enter. One char magic" is not
14 19 the same thing, since %r takes parameters to allow fast retrieval
15 20 of old commands. I've received emails from users who use this a
16 21 LOT, so it stays.
17 22 (magic_automagic): restore %automagic. "use _ip.option.automagic"
18 23 is not a valid replacement b/c it doesn't provide an complete
19 24 explanation (which the automagic docstring does).
20 25 (magic_autocall): restore %autocall, with improved docstring.
21 26 Same argument as for others, "use _ip.options.autocall" is not a
22 27 valid replacement.
23 28 (magic_pdef): restore %pdef & friends. Used widely, mentioned in
24 29 tutorials and online docs.
25 30
26 31 2007-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
27 32
28 33 * IPython/usage.py (quick_reference): mention magics in quickref,
29 34 modified main banner to mention %quickref.
30 35
31 36 * IPython/FakeModule.py (FakeModule): fixes for doctest compatibility.
32 37
33 38 2007-09-06 Ville Vainio <vivainio@gmail.com>
34 39
35 40 * ipy_rehashdir.py, ipy_workdir.py, ipy_fsops.py, iplib.py:
36 41 Callable aliases now pass the _ip as first arg. This breaks
37 42 compatibility with earlier 0.8.2.svn series! (though they should
38 43 not have been in use yet outside these few extensions)
39 44
40 45 2007-09-05 Ville Vainio <vivainio@gmail.com>
41 46
42 47 * external/mglob.py: expand('dirname') => ['dirname'], instead
43 48 of ['dirname/foo','dirname/bar', ...].
44 49
45 50 * Extensions/ipy_fsops.py: added, has usefull shell utils for plain
46 51 win32 installations: icp, imv, imkdir, igrep, irm, collect (collect
47 52 is useful for others as well).
48 53
49 54 * iplib.py: on callable aliases (as opposed to old style aliases),
50 55 do var_expand() immediately, and use make_quoted_expr instead
51 56 of hardcoded r"""
52 57
53 58 * Extensions/ipy_profile_sh.py: Try to detect cygwin on win32,
54 59 if not available load ipy_fsops.py for cp, mv, etc. replacements
55 60
56 61 * OInspect.py, ipy_which.py: improve %which and obj? for callable
57 62 aliases
58 63
59 64 2007-09-04 Ville Vainio <vivainio@gmail.com>
60 65
61 66 * ipy_profile_zope.py: add zope profile, by Stefan Eletzhofer.
62 67 Relicensed under BSD with the authors approval.
63 68
64 69 * ipmaker.py, usage.py: Remove %magic from default banner, improve
65 70 %quickref
66 71
67 72 2007-09-03 Ville Vainio <vivainio@gmail.com>
68 73
69 74 * Magic.py: %time now passes expression through prefilter,
70 75 allowing IPython syntax.
71 76
72 77 2007-09-01 Ville Vainio <vivainio@gmail.com>
73 78
74 79 * ipmaker.py: Always show full traceback when newstyle config fails
75 80
76 81 2007-08-27 Ville Vainio <vivainio@gmail.com>
77 82
78 83 * Magic.py: fix %cd for nonexistent dir when dhist is empty, close #180
79 84
80 85 2007-08-26 Ville Vainio <vivainio@gmail.com>
81 86
82 87 * ipmaker.py: Command line args have the highest priority again
83 88
84 89 * iplib.py, ipmaker.py: -i command line argument now behaves as in
85 90 normal python, i.e. leaves the IPython session running after -c
86 91 command or running a batch file from command line.
87 92
88 93 2007-08-22 Ville Vainio <vivainio@gmail.com>
89 94
90 95 * iplib.py: no extra empty (last) line in raw hist w/ multiline
91 96 statements
92 97
93 98 * logger.py: Fix bug where blank lines in history were not
94 99 added until AFTER adding the current line; translated and raw
95 100 history should finally be in sync with prompt now.
96 101
97 102 * ipy_completers.py: quick_completer now makes it easy to create
98 103 trivial custom completers
99 104
100 105 * clearcmd.py: shadow history compression & erasing, fixed input hist
101 106 clearing.
102 107
103 108 * envpersist.py, history.py: %env (sh profile only), %hist completers
104 109
105 110 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
106 111 term title now include the drive letter, and always use / instead of
107 112 os.sep (as per recommended approach for win32 ipython in general).
108 113
109 114 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
110 115 plain python scripts from ipykit command line by running
111 116 "py myscript.py", even w/o installed python.
112 117
113 118 2007-08-21 Ville Vainio <vivainio@gmail.com>
114 119
115 120 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
116 121 (for backwards compatibility)
117 122
118 123 * history.py: switch back to %hist -t from %hist -r as default.
119 124 At least until raw history is fixed for good.
120 125
121 126 2007-08-20 Ville Vainio <vivainio@gmail.com>
122 127
123 128 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
124 129 locate alias redeclarations etc. Also, avoid handling
125 130 _ip.IP.alias_table directly, prefer using _ip.defalias.
126 131
127 132
128 133 2007-08-15 Ville Vainio <vivainio@gmail.com>
129 134
130 135 * prefilter.py: ! is now always served first
131 136
132 137 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
133 138
134 139 * IPython/iplib.py (safe_execfile): fix the SystemExit
135 140 auto-suppression code to work in Python2.4 (the internal structure
136 141 of that exception changed and I'd only tested the code with 2.5).
137 142 Bug reported by a SciPy attendee.
138 143
139 144 2007-08-13 Ville Vainio <vivainio@gmail.com>
140 145
141 146 * prefilter.py: reverted !c:/bin/foo fix, made % in
142 147 multiline specials work again
143 148
144 149 2007-08-13 Ville Vainio <vivainio@gmail.com>
145 150
146 151 * prefilter.py: Take more care to special-case !, so that
147 152 !c:/bin/foo.exe works.
148 153
149 154 * setup.py: if we are building eggs, strip all docs and
150 155 examples (it doesn't make sense to bytecompile examples,
151 156 and docs would be in an awkward place anyway).
152 157
153 158 * Ryan Krauss' patch fixes start menu shortcuts when IPython
154 159 is installed into a directory that has spaces in the name.
155 160
156 161 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
157 162
158 163 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
159 164 doctest profile and %doctest_mode, so they actually generate the
160 165 blank lines needed by doctest to separate individual tests.
161 166
162 167 * IPython/iplib.py (safe_execfile): modify so that running code
163 168 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
164 169 doesn't get a printed traceback. Any other value in sys.exit(),
165 170 including the empty call, still generates a traceback. This
166 171 enables use of %run without having to pass '-e' for codes that
167 172 correctly set the exit status flag.
168 173
169 174 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
170 175
171 176 * IPython/iplib.py (InteractiveShell.post_config_initialization):
172 177 fix problems with doctests failing when run inside IPython due to
173 178 IPython's modifications of sys.displayhook.
174 179
175 180 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
176 181
177 182 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
178 183 a string with names.
179 184
180 185 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
181 186
182 187 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
183 188 magic to toggle on/off the doctest pasting support without having
184 189 to leave a session to switch to a separate profile.
185 190
186 191 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
187 192
188 193 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
189 194 introduce a blank line between inputs, to conform to doctest
190 195 requirements.
191 196
192 197 * IPython/OInspect.py (Inspector.pinfo): fix another part where
193 198 auto-generated docstrings for new-style classes were showing up.
194 199
195 200 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
196 201
197 202 * api_changes: Add new file to track backward-incompatible
198 203 user-visible changes.
199 204
200 205 2007-08-06 Ville Vainio <vivainio@gmail.com>
201 206
202 207 * ipmaker.py: fix bug where user_config_ns didn't exist at all
203 208 before all the config files were handled.
204 209
205 210 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
206 211
207 212 * IPython/irunner.py (RunnerFactory): Add new factory class for
208 213 creating reusable runners based on filenames.
209 214
210 215 * IPython/Extensions/ipy_profile_doctest.py: New profile for
211 216 doctest support. It sets prompts/exceptions as similar to
212 217 standard Python as possible, so that ipython sessions in this
213 218 profile can be easily pasted as doctests with minimal
214 219 modifications. It also enables pasting of doctests from external
215 220 sources (even if they have leading whitespace), so that you can
216 221 rerun doctests from existing sources.
217 222
218 223 * IPython/iplib.py (_prefilter): fix a buglet where after entering
219 224 some whitespace, the prompt would become a continuation prompt
220 225 with no way of exiting it other than Ctrl-C. This fix brings us
221 226 into conformity with how the default python prompt works.
222 227
223 228 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
224 229 Add support for pasting not only lines that start with '>>>', but
225 230 also with ' >>>'. That is, arbitrary whitespace can now precede
226 231 the prompts. This makes the system useful for pasting doctests
227 232 from docstrings back into a normal session.
228 233
229 234 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
230 235
231 236 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
232 237 r1357, which had killed multiple invocations of an embedded
233 238 ipython (this means that example-embed has been broken for over 1
234 239 year!!!). Rather than possibly breaking the batch stuff for which
235 240 the code in iplib.py/interact was introduced, I worked around the
236 241 problem in the embedding class in Shell.py. We really need a
237 242 bloody test suite for this code, I'm sick of finding stuff that
238 243 used to work breaking left and right every time I use an old
239 244 feature I hadn't touched in a few months.
240 245 (kill_embedded): Add a new magic that only shows up in embedded
241 246 mode, to allow users to permanently deactivate an embedded instance.
242 247
243 248 2007-08-01 Ville Vainio <vivainio@gmail.com>
244 249
245 250 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
246 251 history gets out of sync on runlines (e.g. when running macros).
247 252
248 253 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
249 254
250 255 * IPython/Magic.py (magic_colors): fix win32-related error message
251 256 that could appear under *nix when readline was missing. Patch by
252 257 Scott Jackson, closes #175.
253 258
254 259 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
255 260
256 261 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
257 262 completer that it traits-aware, so that traits objects don't show
258 263 all of their internal attributes all the time.
259 264
260 265 * IPython/genutils.py (dir2): moved this code from inside
261 266 completer.py to expose it publicly, so I could use it in the
262 267 wildcards bugfix.
263 268
264 269 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
265 270 Stefan with Traits.
266 271
267 272 * IPython/completer.py (Completer.attr_matches): change internal
268 273 var name from 'object' to 'obj', since 'object' is now a builtin
269 274 and this can lead to weird bugs if reusing this code elsewhere.
270 275
271 276 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
272 277
273 278 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
274 279 'foo?' and update the code to prevent printing of default
275 280 docstrings that started appearing after I added support for
276 281 new-style classes. The approach I'm using isn't ideal (I just
277 282 special-case those strings) but I'm not sure how to more robustly
278 283 differentiate between truly user-written strings and Python's
279 284 automatic ones.
280 285
281 286 2007-07-09 Ville Vainio <vivainio@gmail.com>
282 287
283 288 * completer.py: Applied Matthew Neeley's patch:
284 289 Dynamic attributes from trait_names and _getAttributeNames are added
285 290 to the list of tab completions, but when this happens, the attribute
286 291 list is turned into a set, so the attributes are unordered when
287 292 printed, which makes it hard to find the right completion. This patch
288 293 turns this set back into a list and sort it.
289 294
290 295 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
291 296
292 297 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
293 298 classes in various inspector functions.
294 299
295 300 2007-06-28 Ville Vainio <vivainio@gmail.com>
296 301
297 302 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
298 303 Implement "shadow" namespace, and callable aliases that reside there.
299 304 Use them by:
300 305
301 306 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
302 307
303 308 foo hello world
304 309 (gets translated to:)
305 310 _sh.foo(r"""hello world""")
306 311
307 312 In practice, this kind of alias can take the role of a magic function
308 313
309 314 * New generic inspect_object, called on obj? and obj??
310 315
311 316 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
312 317
313 318 * IPython/ultraTB.py (findsource): fix a problem with
314 319 inspect.getfile that can cause crashes during traceback construction.
315 320
316 321 2007-06-14 Ville Vainio <vivainio@gmail.com>
317 322
318 323 * iplib.py (handle_auto): Try to use ascii for printing "--->"
319 324 autocall rewrite indication, becausesometimes unicode fails to print
320 325 properly (and you get ' - - - '). Use plain uncoloured ---> for
321 326 unicode.
322 327
323 328 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
324 329
325 330 . pickleshare 'hash' commands (hget, hset, hcompress,
326 331 hdict) for efficient shadow history storage.
327 332
328 333 2007-06-13 Ville Vainio <vivainio@gmail.com>
329 334
330 335 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
331 336 Added kw arg 'interactive', tell whether vars should be visible
332 337 with %whos.
333 338
334 339 2007-06-11 Ville Vainio <vivainio@gmail.com>
335 340
336 341 * pspersistence.py, Magic.py, iplib.py: directory history now saved
337 342 to db
338 343
339 344 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
340 345 Also, it exits IPython immediately after evaluating the command (just like
341 346 std python)
342 347
343 348 2007-06-05 Walter Doerwald <walter@livinglogic.de>
344 349
345 350 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
346 351 Python string and captures the output. (Idea and original patch by
347 352 Stefan van der Walt)
348 353
349 354 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
350 355
351 356 * IPython/ultraTB.py (VerboseTB.text): update printing of
352 357 exception types for Python 2.5 (now all exceptions in the stdlib
353 358 are new-style classes).
354 359
355 360 2007-05-31 Walter Doerwald <walter@livinglogic.de>
356 361
357 362 * IPython/Extensions/igrid.py: Add new commands refresh and
358 363 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
359 364 the iterator once (refresh) or after every x seconds (refresh_timer).
360 365 Add a working implementation of "searchexpression", where the text
361 366 entered is not the text to search for, but an expression that must
362 367 be true. Added display of shortcuts to the menu. Added commands "pickinput"
363 368 and "pickinputattr" that put the object or attribute under the cursor
364 369 in the input line. Split the statusbar to be able to display the currently
365 370 active refresh interval. (Patch by Nik Tautenhahn)
366 371
367 372 2007-05-29 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
368 373
369 374 * fixing set_term_title to use ctypes as default
370 375
371 376 * fixing set_term_title fallback to work when curent dir
372 377 is on a windows network share
373 378
374 379 2007-05-28 Ville Vainio <vivainio@gmail.com>
375 380
376 381 * %cpaste: strip + with > from left (diffs).
377 382
378 383 * iplib.py: Fix crash when readline not installed
379 384
380 385 2007-05-26 Ville Vainio <vivainio@gmail.com>
381 386
382 387 * generics.py: intruduce easy to extend result_display generic
383 388 function (using simplegeneric.py).
384 389
385 390 * Fixed the append functionality of %set.
386 391
387 392 2007-05-25 Ville Vainio <vivainio@gmail.com>
388 393
389 394 * New magic: %rep (fetch / run old commands from history)
390 395
391 396 * New extension: mglob (%mglob magic), for powerful glob / find /filter
392 397 like functionality
393 398
394 399 % maghistory.py: %hist -g PATTERM greps the history for pattern
395 400
396 401 2007-05-24 Walter Doerwald <walter@livinglogic.de>
397 402
398 403 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
399 404 browse the IPython input history
400 405
401 406 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
402 407 (mapped to "i") can be used to put the object under the curser in the input
403 408 line. pickinputattr (mapped to "I") does the same for the attribute under
404 409 the cursor.
405 410
406 411 2007-05-24 Ville Vainio <vivainio@gmail.com>
407 412
408 413 * Grand magic cleansing (changeset [2380]):
409 414
410 415 * Introduce ipy_legacy.py where the following magics were
411 416 moved:
412 417
413 418 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
414 419
415 420 If you need them, either use default profile or "import ipy_legacy"
416 421 in your ipy_user_conf.py
417 422
418 423 * Move sh and scipy profile to Extensions from UserConfig. this implies
419 424 you should not edit them, but you don't need to run %upgrade when
420 425 upgrading IPython anymore.
421 426
422 427 * %hist/%history now operates in "raw" mode by default. To get the old
423 428 behaviour, run '%hist -n' (native mode).
424 429
425 430 * split ipy_stock_completers.py to ipy_stock_completers.py and
426 431 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
427 432 installed as default.
428 433
429 434 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
430 435 handling.
431 436
432 437 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
433 438 input if readline is available.
434 439
435 440 2007-05-23 Ville Vainio <vivainio@gmail.com>
436 441
437 442 * macro.py: %store uses __getstate__ properly
438 443
439 444 * exesetup.py: added new setup script for creating
440 445 standalone IPython executables with py2exe (i.e.
441 446 no python installation required).
442 447
443 448 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
444 449 its place.
445 450
446 451 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
447 452
448 453 2007-05-21 Ville Vainio <vivainio@gmail.com>
449 454
450 455 * platutil_win32.py (set_term_title): handle
451 456 failure of 'title' system call properly.
452 457
453 458 2007-05-17 Walter Doerwald <walter@livinglogic.de>
454 459
455 460 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
456 461 (Bug detected by Paul Mueller).
457 462
458 463 2007-05-16 Ville Vainio <vivainio@gmail.com>
459 464
460 465 * ipy_profile_sci.py, ipython_win_post_install.py: Create
461 466 new "sci" profile, effectively a modern version of the old
462 467 "scipy" profile (which is now slated for deprecation).
463 468
464 469 2007-05-15 Ville Vainio <vivainio@gmail.com>
465 470
466 471 * pycolorize.py, pycolor.1: Paul Mueller's patches that
467 472 make pycolorize read input from stdin when run without arguments.
468 473
469 474 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
470 475
471 476 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
472 477 it in sh profile (instead of ipy_system_conf.py).
473 478
474 479 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
475 480 aliases are now lower case on windows (MyCommand.exe => mycommand).
476 481
477 482 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
478 483 Macros are now callable objects that inherit from ipapi.IPyAutocall,
479 484 i.e. get autocalled regardless of system autocall setting.
480 485
481 486 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
482 487
483 488 * IPython/rlineimpl.py: check for clear_history in readline and
484 489 make it a dummy no-op if not available. This function isn't
485 490 guaranteed to be in the API and appeared in Python 2.4, so we need
486 491 to check it ourselves. Also, clean up this file quite a bit.
487 492
488 493 * ipython.1: update man page and full manual with information
489 494 about threads (remove outdated warning). Closes #151.
490 495
491 496 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
492 497
493 498 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
494 499 in trunk (note that this made it into the 0.8.1 release already,
495 500 but the changelogs didn't get coordinated). Many thanks to Gael
496 501 Varoquaux <gael.varoquaux-AT-normalesup.org>
497 502
498 503 2007-05-09 *** Released version 0.8.1
499 504
500 505 2007-05-10 Walter Doerwald <walter@livinglogic.de>
501 506
502 507 * IPython/Extensions/igrid.py: Incorporate html help into
503 508 the module, so we don't have to search for the file.
504 509
505 510 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
506 511
507 512 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
508 513
509 514 2007-04-30 Ville Vainio <vivainio@gmail.com>
510 515
511 516 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
512 517 user has illegal (non-ascii) home directory name
513 518
514 519 2007-04-27 Ville Vainio <vivainio@gmail.com>
515 520
516 521 * platutils_win32.py: implement set_term_title for windows
517 522
518 523 * Update version number
519 524
520 525 * ipy_profile_sh.py: more informative prompt (2 dir levels)
521 526
522 527 2007-04-26 Walter Doerwald <walter@livinglogic.de>
523 528
524 529 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
525 530 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
526 531 bug discovered by Ville).
527 532
528 533 2007-04-26 Ville Vainio <vivainio@gmail.com>
529 534
530 535 * Extensions/ipy_completers.py: Olivier's module completer now
531 536 saves the list of root modules if it takes > 4 secs on the first run.
532 537
533 538 * Magic.py (%rehashx): %rehashx now clears the completer cache
534 539
535 540
536 541 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
537 542
538 543 * ipython.el: fix incorrect color scheme, reported by Stefan.
539 544 Closes #149.
540 545
541 546 * IPython/PyColorize.py (Parser.format2): fix state-handling
542 547 logic. I still don't like how that code handles state, but at
543 548 least now it should be correct, if inelegant. Closes #146.
544 549
545 550 2007-04-25 Ville Vainio <vivainio@gmail.com>
546 551
547 552 * Extensions/ipy_which.py: added extension for %which magic, works
548 553 a lot like unix 'which' but also finds and expands aliases, and
549 554 allows wildcards.
550 555
551 556 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
552 557 as opposed to returning nothing.
553 558
554 559 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
555 560 ipy_stock_completers on default profile, do import on sh profile.
556 561
557 562 2007-04-22 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
558 563
559 564 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
560 565 like ipython.py foo.py which raised a IndexError.
561 566
562 567 2007-04-21 Ville Vainio <vivainio@gmail.com>
563 568
564 569 * Extensions/ipy_extutil.py: added extension to manage other ipython
565 570 extensions. Now only supports 'ls' == list extensions.
566 571
567 572 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
568 573
569 574 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
570 575 would prevent use of the exception system outside of a running
571 576 IPython instance.
572 577
573 578 2007-04-20 Ville Vainio <vivainio@gmail.com>
574 579
575 580 * Extensions/ipy_render.py: added extension for easy
576 581 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
577 582 'Iptl' template notation,
578 583
579 584 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
580 585 safer & faster 'import' completer.
581 586
582 587 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
583 588 and _ip.defalias(name, command).
584 589
585 590 * Extensions/ipy_exportdb.py: New extension for exporting all the
586 591 %store'd data in a portable format (normal ipapi calls like
587 592 defmacro() etc.)
588 593
589 594 2007-04-19 Ville Vainio <vivainio@gmail.com>
590 595
591 596 * upgrade_dir.py: skip junk files like *.pyc
592 597
593 598 * Release.py: version number to 0.8.1
594 599
595 600 2007-04-18 Ville Vainio <vivainio@gmail.com>
596 601
597 602 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
598 603 and later on win32.
599 604
600 605 2007-04-16 Ville Vainio <vivainio@gmail.com>
601 606
602 607 * iplib.py (showtraceback): Do not crash when running w/o readline.
603 608
604 609 2007-04-12 Walter Doerwald <walter@livinglogic.de>
605 610
606 611 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
607 612 sorted (case sensitive with files and dirs mixed).
608 613
609 614 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
610 615
611 616 * IPython/Release.py (version): Open trunk for 0.8.1 development.
612 617
613 618 2007-04-10 *** Released version 0.8.0
614 619
615 620 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
616 621
617 622 * Tag 0.8.0 for release.
618 623
619 624 * IPython/iplib.py (reloadhist): add API function to cleanly
620 625 reload the readline history, which was growing inappropriately on
621 626 every %run call.
622 627
623 628 * win32_manual_post_install.py (run): apply last part of Nicolas
624 629 Pernetty's patch (I'd accidentally applied it in a different
625 630 directory and this particular file didn't get patched).
626 631
627 632 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
628 633
629 634 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
630 635 find the main thread id and use the proper API call. Thanks to
631 636 Stefan for the fix.
632 637
633 638 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
634 639 unit tests to reflect fixed ticket #52, and add more tests sent by
635 640 him.
636 641
637 642 * IPython/iplib.py (raw_input): restore the readline completer
638 643 state on every input, in case third-party code messed it up.
639 644 (_prefilter): revert recent addition of early-escape checks which
640 645 prevent many valid alias calls from working.
641 646
642 647 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
643 648 flag for sigint handler so we don't run a full signal() call on
644 649 each runcode access.
645 650
646 651 * IPython/Magic.py (magic_whos): small improvement to diagnostic
647 652 message.
648 653
649 654 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
650 655
651 656 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
652 657 asynchronous exceptions working, i.e., Ctrl-C can actually
653 658 interrupt long-running code in the multithreaded shells.
654 659
655 660 This is using Tomer Filiba's great ctypes-based trick:
656 661 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
657 662 this in the past, but hadn't been able to make it work before. So
658 663 far it looks like it's actually running, but this needs more
659 664 testing. If it really works, I'll be *very* happy, and we'll owe
660 665 a huge thank you to Tomer. My current implementation is ugly,
661 666 hackish and uses nasty globals, but I don't want to try and clean
662 667 anything up until we know if it actually works.
663 668
664 669 NOTE: this feature needs ctypes to work. ctypes is included in
665 670 Python2.5, but 2.4 users will need to manually install it. This
666 671 feature makes multi-threaded shells so much more usable that it's
667 672 a minor price to pay (ctypes is very easy to install, already a
668 673 requirement for win32 and available in major linux distros).
669 674
670 675 2007-04-04 Ville Vainio <vivainio@gmail.com>
671 676
672 677 * Extensions/ipy_completers.py, ipy_stock_completers.py:
673 678 Moved implementations of 'bundled' completers to ipy_completers.py,
674 679 they are only enabled in ipy_stock_completers.py.
675 680
676 681 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
677 682
678 683 * IPython/PyColorize.py (Parser.format2): Fix identation of
679 684 colorzied output and return early if color scheme is NoColor, to
680 685 avoid unnecessary and expensive tokenization. Closes #131.
681 686
682 687 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
683 688
684 689 * IPython/Debugger.py: disable the use of pydb version 1.17. It
685 690 has a critical bug (a missing import that makes post-mortem not
686 691 work at all). Unfortunately as of this time, this is the version
687 692 shipped with Ubuntu Edgy, so quite a few people have this one. I
688 693 hope Edgy will update to a more recent package.
689 694
690 695 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
691 696
692 697 * IPython/iplib.py (_prefilter): close #52, second part of a patch
693 698 set by Stefan (only the first part had been applied before).
694 699
695 700 * IPython/Extensions/ipy_stock_completers.py (module_completer):
696 701 remove usage of the dangerous pkgutil.walk_packages(). See
697 702 details in comments left in the code.
698 703
699 704 * IPython/Magic.py (magic_whos): add support for numpy arrays
700 705 similar to what we had for Numeric.
701 706
702 707 * IPython/completer.py (IPCompleter.complete): extend the
703 708 complete() call API to support completions by other mechanisms
704 709 than readline. Closes #109.
705 710
706 711 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
707 712 protect against a bug in Python's execfile(). Closes #123.
708 713
709 714 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
710 715
711 716 * IPython/iplib.py (split_user_input): ensure that when splitting
712 717 user input, the part that can be treated as a python name is pure
713 718 ascii (Python identifiers MUST be pure ascii). Part of the
714 719 ongoing Unicode support work.
715 720
716 721 * IPython/Prompts.py (prompt_specials_color): Add \N for the
717 722 actual prompt number, without any coloring. This allows users to
718 723 produce numbered prompts with their own colors. Added after a
719 724 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
720 725
721 726 2007-03-31 Walter Doerwald <walter@livinglogic.de>
722 727
723 728 * IPython/Extensions/igrid.py: Map the return key
724 729 to enter() and shift-return to enterattr().
725 730
726 731 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
727 732
728 733 * IPython/Magic.py (magic_psearch): add unicode support by
729 734 encoding to ascii the input, since this routine also only deals
730 735 with valid Python names. Fixes a bug reported by Stefan.
731 736
732 737 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
733 738
734 739 * IPython/Magic.py (_inspect): convert unicode input into ascii
735 740 before trying to evaluate it as a Python identifier. This fixes a
736 741 problem that the new unicode support had introduced when analyzing
737 742 long definition lines for functions.
738 743
739 744 2007-03-24 Walter Doerwald <walter@livinglogic.de>
740 745
741 746 * IPython/Extensions/igrid.py: Fix picking. Using
742 747 igrid with wxPython 2.6 and -wthread should work now.
743 748 igrid.display() simply tries to create a frame without
744 749 an application. Only if this fails an application is created.
745 750
746 751 2007-03-23 Walter Doerwald <walter@livinglogic.de>
747 752
748 753 * IPython/Extensions/path.py: Updated to version 2.2.
749 754
750 755 2007-03-23 Ville Vainio <vivainio@gmail.com>
751 756
752 757 * iplib.py: recursive alias expansion now works better, so that
753 758 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
754 759 doesn't trip up the process, if 'd' has been aliased to 'ls'.
755 760
756 761 * Extensions/ipy_gnuglobal.py added, provides %global magic
757 762 for users of http://www.gnu.org/software/global
758 763
759 764 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
760 765 Closes #52. Patch by Stefan van der Walt.
761 766
762 767 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
763 768
764 769 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
765 770 respect the __file__ attribute when using %run. Thanks to a bug
766 771 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
767 772
768 773 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
769 774
770 775 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
771 776 input. Patch sent by Stefan.
772 777
773 778 2007-03-20 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
774 779 * IPython/Extensions/ipy_stock_completer.py
775 780 shlex_split, fix bug in shlex_split. len function
776 781 call was missing an if statement. Caused shlex_split to
777 782 sometimes return "" as last element.
778 783
779 784 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
780 785
781 786 * IPython/completer.py
782 787 (IPCompleter.file_matches.single_dir_expand): fix a problem
783 788 reported by Stefan, where directories containign a single subdir
784 789 would be completed too early.
785 790
786 791 * IPython/Shell.py (_load_pylab): Make the execution of 'from
787 792 pylab import *' when -pylab is given be optional. A new flag,
788 793 pylab_import_all controls this behavior, the default is True for
789 794 backwards compatibility.
790 795
791 796 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
792 797 modified) R. Bernstein's patch for fully syntax highlighted
793 798 tracebacks. The functionality is also available under ultraTB for
794 799 non-ipython users (someone using ultraTB but outside an ipython
795 800 session). They can select the color scheme by setting the
796 801 module-level global DEFAULT_SCHEME. The highlight functionality
797 802 also works when debugging.
798 803
799 804 * IPython/genutils.py (IOStream.close): small patch by
800 805 R. Bernstein for improved pydb support.
801 806
802 807 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
803 808 DaveS <davls@telus.net> to improve support of debugging under
804 809 NTEmacs, including improved pydb behavior.
805 810
806 811 * IPython/Magic.py (magic_prun): Fix saving of profile info for
807 812 Python 2.5, where the stats object API changed a little. Thanks
808 813 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
809 814
810 815 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
811 816 Pernetty's patch to improve support for (X)Emacs under Win32.
812 817
813 818 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
814 819
815 820 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
816 821 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
817 822 a report by Nik Tautenhahn.
818 823
819 824 2007-03-16 Walter Doerwald <walter@livinglogic.de>
820 825
821 826 * setup.py: Add the igrid help files to the list of data files
822 827 to be installed alongside igrid.
823 828 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
824 829 Show the input object of the igrid browser as the window tile.
825 830 Show the object the cursor is on in the statusbar.
826 831
827 832 2007-03-15 Ville Vainio <vivainio@gmail.com>
828 833
829 834 * Extensions/ipy_stock_completers.py: Fixed exception
830 835 on mismatching quotes in %run completer. Patch by
831 836 Jorgen Stenarson. Closes #127.
832 837
833 838 2007-03-14 Ville Vainio <vivainio@gmail.com>
834 839
835 840 * Extensions/ext_rehashdir.py: Do not do auto_alias
836 841 in %rehashdir, it clobbers %store'd aliases.
837 842
838 843 * UserConfig/ipy_profile_sh.py: envpersist.py extension
839 844 (beefed up %env) imported for sh profile.
840 845
841 846 2007-03-10 Walter Doerwald <walter@livinglogic.de>
842 847
843 848 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
844 849 as the default browser.
845 850 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
846 851 As igrid displays all attributes it ever encounters, fetch() (which has
847 852 been renamed to _fetch()) doesn't have to recalculate the display attributes
848 853 every time a new item is fetched. This should speed up scrolling.
849 854
850 855 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
851 856
852 857 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
853 858 Schmolck's recently reported tab-completion bug (my previous one
854 859 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
855 860
856 861 2007-03-09 Walter Doerwald <walter@livinglogic.de>
857 862
858 863 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
859 864 Close help window if exiting igrid.
860 865
861 866 2007-03-02 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
862 867
863 868 * IPython/Extensions/ipy_defaults.py: Check if readline is available
864 869 before calling functions from readline.
865 870
866 871 2007-03-02 Walter Doerwald <walter@livinglogic.de>
867 872
868 873 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
869 874 igrid is a wxPython-based display object for ipipe. If your system has
870 875 wx installed igrid will be the default display. Without wx ipipe falls
871 876 back to ibrowse (which needs curses). If no curses is installed ipipe
872 877 falls back to idump.
873 878
874 879 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
875 880
876 881 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
877 882 my changes from yesterday, they introduced bugs. Will reactivate
878 883 once I get a correct solution, which will be much easier thanks to
879 884 Dan Milstein's new prefilter test suite.
880 885
881 886 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
882 887
883 888 * IPython/iplib.py (split_user_input): fix input splitting so we
884 889 don't attempt attribute accesses on things that can't possibly be
885 890 valid Python attributes. After a bug report by Alex Schmolck.
886 891 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
887 892 %magic with explicit % prefix.
888 893
889 894 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
890 895
891 896 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
892 897 avoid a DeprecationWarning from GTK.
893 898
894 899 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
895 900
896 901 * IPython/genutils.py (clock): I modified clock() to return total
897 902 time, user+system. This is a more commonly needed metric. I also
898 903 introduced the new clocku/clocks to get only user/system time if
899 904 one wants those instead.
900 905
901 906 ***WARNING: API CHANGE*** clock() used to return only user time,
902 907 so if you want exactly the same results as before, use clocku
903 908 instead.
904 909
905 910 2007-02-22 Ville Vainio <vivainio@gmail.com>
906 911
907 912 * IPython/Extensions/ipy_p4.py: Extension for improved
908 913 p4 (perforce version control system) experience.
909 914 Adds %p4 magic with p4 command completion and
910 915 automatic -G argument (marshall output as python dict)
911 916
912 917 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
913 918
914 919 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
915 920 stop marks.
916 921 (ClearingMixin): a simple mixin to easily make a Demo class clear
917 922 the screen in between blocks and have empty marquees. The
918 923 ClearDemo and ClearIPDemo classes that use it are included.
919 924
920 925 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
921 926
922 927 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
923 928 protect against exceptions at Python shutdown time. Patch
924 929 sumbmitted to upstream.
925 930
926 931 2007-02-14 Walter Doerwald <walter@livinglogic.de>
927 932
928 933 * IPython/Extensions/ibrowse.py: If entering the first object level
929 934 (i.e. the object for which the browser has been started) fails,
930 935 now the error is raised directly (aborting the browser) instead of
931 936 running into an empty levels list later.
932 937
933 938 2007-02-03 Walter Doerwald <walter@livinglogic.de>
934 939
935 940 * IPython/Extensions/ipipe.py: Add an xrepr implementation
936 941 for the noitem object.
937 942
938 943 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
939 944
940 945 * IPython/completer.py (Completer.attr_matches): Fix small
941 946 tab-completion bug with Enthought Traits objects with units.
942 947 Thanks to a bug report by Tom Denniston
943 948 <tom.denniston-AT-alum.dartmouth.org>.
944 949
945 950 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
946 951
947 952 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
948 953 bug where only .ipy or .py would be completed. Once the first
949 954 argument to %run has been given, all completions are valid because
950 955 they are the arguments to the script, which may well be non-python
951 956 filenames.
952 957
953 958 * IPython/irunner.py (InteractiveRunner.run_source): major updates
954 959 to irunner to allow it to correctly support real doctesting of
955 960 out-of-process ipython code.
956 961
957 962 * IPython/Magic.py (magic_cd): Make the setting of the terminal
958 963 title an option (-noterm_title) because it completely breaks
959 964 doctesting.
960 965
961 966 * IPython/demo.py: fix IPythonDemo class that was not actually working.
962 967
963 968 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
964 969
965 970 * IPython/irunner.py (main): fix small bug where extensions were
966 971 not being correctly recognized.
967 972
968 973 2007-01-23 Walter Doerwald <walter@livinglogic.de>
969 974
970 975 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
971 976 a string containing a single line yields the string itself as the
972 977 only item.
973 978
974 979 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
975 980 object if it's the same as the one on the last level (This avoids
976 981 infinite recursion for one line strings).
977 982
978 983 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
979 984
980 985 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
981 986 all output streams before printing tracebacks. This ensures that
982 987 user output doesn't end up interleaved with traceback output.
983 988
984 989 2007-01-10 Ville Vainio <vivainio@gmail.com>
985 990
986 991 * Extensions/envpersist.py: Turbocharged %env that remembers
987 992 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
988 993 "%env VISUAL=jed".
989 994
990 995 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
991 996
992 997 * IPython/iplib.py (showtraceback): ensure that we correctly call
993 998 custom handlers in all cases (some with pdb were slipping through,
994 999 but I'm not exactly sure why).
995 1000
996 1001 * IPython/Debugger.py (Tracer.__init__): added new class to
997 1002 support set_trace-like usage of IPython's enhanced debugger.
998 1003
999 1004 2006-12-24 Ville Vainio <vivainio@gmail.com>
1000 1005
1001 1006 * ipmaker.py: more informative message when ipy_user_conf
1002 1007 import fails (suggest running %upgrade).
1003 1008
1004 1009 * tools/run_ipy_in_profiler.py: Utility to see where
1005 1010 the time during IPython startup is spent.
1006 1011
1007 1012 2006-12-20 Ville Vainio <vivainio@gmail.com>
1008 1013
1009 1014 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
1010 1015
1011 1016 * ipapi.py: Add new ipapi method, expand_alias.
1012 1017
1013 1018 * Release.py: Bump up version to 0.7.4.svn
1014 1019
1015 1020 2006-12-17 Ville Vainio <vivainio@gmail.com>
1016 1021
1017 1022 * Extensions/jobctrl.py: Fixed &cmd arg arg...
1018 1023 to work properly on posix too
1019 1024
1020 1025 * Release.py: Update revnum (version is still just 0.7.3).
1021 1026
1022 1027 2006-12-15 Ville Vainio <vivainio@gmail.com>
1023 1028
1024 1029 * scripts/ipython_win_post_install: create ipython.py in
1025 1030 prefix + "/scripts".
1026 1031
1027 1032 * Release.py: Update version to 0.7.3.
1028 1033
1029 1034 2006-12-14 Ville Vainio <vivainio@gmail.com>
1030 1035
1031 1036 * scripts/ipython_win_post_install: Overwrite old shortcuts
1032 1037 if they already exist
1033 1038
1034 1039 * Release.py: release 0.7.3rc2
1035 1040
1036 1041 2006-12-13 Ville Vainio <vivainio@gmail.com>
1037 1042
1038 1043 * Branch and update Release.py for 0.7.3rc1
1039 1044
1040 1045 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
1041 1046
1042 1047 * IPython/Shell.py (IPShellWX): update for current WX naming
1043 1048 conventions, to avoid a deprecation warning with current WX
1044 1049 versions. Thanks to a report by Danny Shevitz.
1045 1050
1046 1051 2006-12-12 Ville Vainio <vivainio@gmail.com>
1047 1052
1048 1053 * ipmaker.py: apply david cournapeau's patch to make
1049 1054 import_some work properly even when ipythonrc does
1050 1055 import_some on empty list (it was an old bug!).
1051 1056
1052 1057 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
1053 1058 Add deprecation note to ipythonrc and a url to wiki
1054 1059 in ipy_user_conf.py
1055 1060
1056 1061
1057 1062 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
1058 1063 as if it was typed on IPython command prompt, i.e.
1059 1064 as IPython script.
1060 1065
1061 1066 * example-magic.py, magic_grepl.py: remove outdated examples
1062 1067
1063 1068 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
1064 1069
1065 1070 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
1066 1071 is called before any exception has occurred.
1067 1072
1068 1073 2006-12-08 Ville Vainio <vivainio@gmail.com>
1069 1074
1070 1075 * Extensions/ipy_stock_completers.py: fix cd completer
1071 1076 to translate /'s to \'s again.
1072 1077
1073 1078 * completer.py: prevent traceback on file completions w/
1074 1079 backslash.
1075 1080
1076 1081 * Release.py: Update release number to 0.7.3b3 for release
1077 1082
1078 1083 2006-12-07 Ville Vainio <vivainio@gmail.com>
1079 1084
1080 1085 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1081 1086 while executing external code. Provides more shell-like behaviour
1082 1087 and overall better response to ctrl + C / ctrl + break.
1083 1088
1084 1089 * tools/make_tarball.py: new script to create tarball straight from svn
1085 1090 (setup.py sdist doesn't work on win32).
1086 1091
1087 1092 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1088 1093 on dirnames with spaces and use the default completer instead.
1089 1094
1090 1095 * Revision.py: Change version to 0.7.3b2 for release.
1091 1096
1092 1097 2006-12-05 Ville Vainio <vivainio@gmail.com>
1093 1098
1094 1099 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1095 1100 pydb patch 4 (rm debug printing, py 2.5 checking)
1096 1101
1097 1102 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1098 1103 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1099 1104 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1100 1105 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1101 1106 object the cursor was on before the refresh. The command "markrange" is
1102 1107 mapped to "%" now.
1103 1108 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1104 1109
1105 1110 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1106 1111
1107 1112 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1108 1113 interactive debugger on the last traceback, without having to call
1109 1114 %pdb and rerun your code. Made minor changes in various modules,
1110 1115 should automatically recognize pydb if available.
1111 1116
1112 1117 2006-11-28 Ville Vainio <vivainio@gmail.com>
1113 1118
1114 1119 * completer.py: If the text start with !, show file completions
1115 1120 properly. This helps when trying to complete command name
1116 1121 for shell escapes.
1117 1122
1118 1123 2006-11-27 Ville Vainio <vivainio@gmail.com>
1119 1124
1120 1125 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1121 1126 der Walt. Clean up svn and hg completers by using a common
1122 1127 vcs_completer.
1123 1128
1124 1129 2006-11-26 Ville Vainio <vivainio@gmail.com>
1125 1130
1126 1131 * Remove ipconfig and %config; you should use _ip.options structure
1127 1132 directly instead!
1128 1133
1129 1134 * genutils.py: add wrap_deprecated function for deprecating callables
1130 1135
1131 1136 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1132 1137 _ip.system instead. ipalias is redundant.
1133 1138
1134 1139 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1135 1140 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1136 1141 explicit.
1137 1142
1138 1143 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1139 1144 completer. Try it by entering 'hg ' and pressing tab.
1140 1145
1141 1146 * macro.py: Give Macro a useful __repr__ method
1142 1147
1143 1148 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1144 1149
1145 1150 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1146 1151 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1147 1152 we don't get a duplicate ipipe module, where registration of the xrepr
1148 1153 implementation for Text is useless.
1149 1154
1150 1155 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1151 1156
1152 1157 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1153 1158
1154 1159 2006-11-24 Ville Vainio <vivainio@gmail.com>
1155 1160
1156 1161 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1157 1162 try to use "cProfile" instead of the slower pure python
1158 1163 "profile"
1159 1164
1160 1165 2006-11-23 Ville Vainio <vivainio@gmail.com>
1161 1166
1162 1167 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1163 1168 Qt+IPython+Designer link in documentation.
1164 1169
1165 1170 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1166 1171 correct Pdb object to %pydb.
1167 1172
1168 1173
1169 1174 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1170 1175 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1171 1176 generic xrepr(), otherwise the list implementation would kick in.
1172 1177
1173 1178 2006-11-21 Ville Vainio <vivainio@gmail.com>
1174 1179
1175 1180 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1176 1181 with one from UserConfig.
1177 1182
1178 1183 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1179 1184 it was missing which broke the sh profile.
1180 1185
1181 1186 * completer.py: file completer now uses explicit '/' instead
1182 1187 of os.path.join, expansion of 'foo' was broken on win32
1183 1188 if there was one directory with name 'foobar'.
1184 1189
1185 1190 * A bunch of patches from Kirill Smelkov:
1186 1191
1187 1192 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1188 1193
1189 1194 * [patch 7/9] Implement %page -r (page in raw mode) -
1190 1195
1191 1196 * [patch 5/9] ScientificPython webpage has moved
1192 1197
1193 1198 * [patch 4/9] The manual mentions %ds, should be %dhist
1194 1199
1195 1200 * [patch 3/9] Kill old bits from %prun doc.
1196 1201
1197 1202 * [patch 1/9] Fix typos here and there.
1198 1203
1199 1204 2006-11-08 Ville Vainio <vivainio@gmail.com>
1200 1205
1201 1206 * completer.py (attr_matches): catch all exceptions raised
1202 1207 by eval of expr with dots.
1203 1208
1204 1209 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1205 1210
1206 1211 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1207 1212 input if it starts with whitespace. This allows you to paste
1208 1213 indented input from any editor without manually having to type in
1209 1214 the 'if 1:', which is convenient when working interactively.
1210 1215 Slightly modifed version of a patch by Bo Peng
1211 1216 <bpeng-AT-rice.edu>.
1212 1217
1213 1218 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1214 1219
1215 1220 * IPython/irunner.py (main): modified irunner so it automatically
1216 1221 recognizes the right runner to use based on the extension (.py for
1217 1222 python, .ipy for ipython and .sage for sage).
1218 1223
1219 1224 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1220 1225 visible in ipapi as ip.config(), to programatically control the
1221 1226 internal rc object. There's an accompanying %config magic for
1222 1227 interactive use, which has been enhanced to match the
1223 1228 funtionality in ipconfig.
1224 1229
1225 1230 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1226 1231 so it's not just a toggle, it now takes an argument. Add support
1227 1232 for a customizable header when making system calls, as the new
1228 1233 system_header variable in the ipythonrc file.
1229 1234
1230 1235 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1231 1236
1232 1237 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1233 1238 generic functions (using Philip J. Eby's simplegeneric package).
1234 1239 This makes it possible to customize the display of third-party classes
1235 1240 without having to monkeypatch them. xiter() no longer supports a mode
1236 1241 argument and the XMode class has been removed. The same functionality can
1237 1242 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1238 1243 One consequence of the switch to generic functions is that xrepr() and
1239 1244 xattrs() implementation must define the default value for the mode
1240 1245 argument themselves and xattrs() implementations must return real
1241 1246 descriptors.
1242 1247
1243 1248 * IPython/external: This new subpackage will contain all third-party
1244 1249 packages that are bundled with IPython. (The first one is simplegeneric).
1245 1250
1246 1251 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1247 1252 directory which as been dropped in r1703.
1248 1253
1249 1254 * IPython/Extensions/ipipe.py (iless): Fixed.
1250 1255
1251 1256 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1252 1257
1253 1258 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1254 1259
1255 1260 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1256 1261 handling in variable expansion so that shells and magics recognize
1257 1262 function local scopes correctly. Bug reported by Brian.
1258 1263
1259 1264 * scripts/ipython: remove the very first entry in sys.path which
1260 1265 Python auto-inserts for scripts, so that sys.path under IPython is
1261 1266 as similar as possible to that under plain Python.
1262 1267
1263 1268 * IPython/completer.py (IPCompleter.file_matches): Fix
1264 1269 tab-completion so that quotes are not closed unless the completion
1265 1270 is unambiguous. After a request by Stefan. Minor cleanups in
1266 1271 ipy_stock_completers.
1267 1272
1268 1273 2006-11-02 Ville Vainio <vivainio@gmail.com>
1269 1274
1270 1275 * ipy_stock_completers.py: Add %run and %cd completers.
1271 1276
1272 1277 * completer.py: Try running custom completer for both
1273 1278 "foo" and "%foo" if the command is just "foo". Ignore case
1274 1279 when filtering possible completions.
1275 1280
1276 1281 * UserConfig/ipy_user_conf.py: install stock completers as default
1277 1282
1278 1283 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1279 1284 simplified readline history save / restore through a wrapper
1280 1285 function
1281 1286
1282 1287
1283 1288 2006-10-31 Ville Vainio <vivainio@gmail.com>
1284 1289
1285 1290 * strdispatch.py, completer.py, ipy_stock_completers.py:
1286 1291 Allow str_key ("command") in completer hooks. Implement
1287 1292 trivial completer for 'import' (stdlib modules only). Rename
1288 1293 ipy_linux_package_managers.py to ipy_stock_completers.py.
1289 1294 SVN completer.
1290 1295
1291 1296 * Extensions/ledit.py: %magic line editor for easily and
1292 1297 incrementally manipulating lists of strings. The magic command
1293 1298 name is %led.
1294 1299
1295 1300 2006-10-30 Ville Vainio <vivainio@gmail.com>
1296 1301
1297 1302 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1298 1303 Bernsteins's patches for pydb integration.
1299 1304 http://bashdb.sourceforge.net/pydb/
1300 1305
1301 1306 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1302 1307 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1303 1308 custom completer hook to allow the users to implement their own
1304 1309 completers. See ipy_linux_package_managers.py for example. The
1305 1310 hook name is 'complete_command'.
1306 1311
1307 1312 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1308 1313
1309 1314 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1310 1315 Numeric leftovers.
1311 1316
1312 1317 * ipython.el (py-execute-region): apply Stefan's patch to fix
1313 1318 garbled results if the python shell hasn't been previously started.
1314 1319
1315 1320 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1316 1321 pretty generic function and useful for other things.
1317 1322
1318 1323 * IPython/OInspect.py (getsource): Add customizable source
1319 1324 extractor. After a request/patch form W. Stein (SAGE).
1320 1325
1321 1326 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1322 1327 window size to a more reasonable value from what pexpect does,
1323 1328 since their choice causes wrapping bugs with long input lines.
1324 1329
1325 1330 2006-10-28 Ville Vainio <vivainio@gmail.com>
1326 1331
1327 1332 * Magic.py (%run): Save and restore the readline history from
1328 1333 file around %run commands to prevent side effects from
1329 1334 %runned programs that might use readline (e.g. pydb).
1330 1335
1331 1336 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1332 1337 invoking the pydb enhanced debugger.
1333 1338
1334 1339 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1335 1340
1336 1341 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1337 1342 call the base class method and propagate the return value to
1338 1343 ifile. This is now done by path itself.
1339 1344
1340 1345 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1341 1346
1342 1347 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1343 1348 api: set_crash_handler(), to expose the ability to change the
1344 1349 internal crash handler.
1345 1350
1346 1351 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1347 1352 the various parameters of the crash handler so that apps using
1348 1353 IPython as their engine can customize crash handling. Ipmlemented
1349 1354 at the request of SAGE.
1350 1355
1351 1356 2006-10-14 Ville Vainio <vivainio@gmail.com>
1352 1357
1353 1358 * Magic.py, ipython.el: applied first "safe" part of Rocky
1354 1359 Bernstein's patch set for pydb integration.
1355 1360
1356 1361 * Magic.py (%unalias, %alias): %store'd aliases can now be
1357 1362 removed with '%unalias'. %alias w/o args now shows most
1358 1363 interesting (stored / manually defined) aliases last
1359 1364 where they catch the eye w/o scrolling.
1360 1365
1361 1366 * Magic.py (%rehashx), ext_rehashdir.py: files with
1362 1367 'py' extension are always considered executable, even
1363 1368 when not in PATHEXT environment variable.
1364 1369
1365 1370 2006-10-12 Ville Vainio <vivainio@gmail.com>
1366 1371
1367 1372 * jobctrl.py: Add new "jobctrl" extension for spawning background
1368 1373 processes with "&find /". 'import jobctrl' to try it out. Requires
1369 1374 'subprocess' module, standard in python 2.4+.
1370 1375
1371 1376 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1372 1377 so if foo -> bar and bar -> baz, then foo -> baz.
1373 1378
1374 1379 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1375 1380
1376 1381 * IPython/Magic.py (Magic.parse_options): add a new posix option
1377 1382 to allow parsing of input args in magics that doesn't strip quotes
1378 1383 (if posix=False). This also closes %timeit bug reported by
1379 1384 Stefan.
1380 1385
1381 1386 2006-10-03 Ville Vainio <vivainio@gmail.com>
1382 1387
1383 1388 * iplib.py (raw_input, interact): Return ValueError catching for
1384 1389 raw_input. Fixes infinite loop for sys.stdin.close() or
1385 1390 sys.stdout.close().
1386 1391
1387 1392 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1388 1393
1389 1394 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1390 1395 to help in handling doctests. irunner is now pretty useful for
1391 1396 running standalone scripts and simulate a full interactive session
1392 1397 in a format that can be then pasted as a doctest.
1393 1398
1394 1399 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1395 1400 on top of the default (useless) ones. This also fixes the nasty
1396 1401 way in which 2.5's Quitter() exits (reverted [1785]).
1397 1402
1398 1403 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1399 1404 2.5.
1400 1405
1401 1406 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1402 1407 color scheme is updated as well when color scheme is changed
1403 1408 interactively.
1404 1409
1405 1410 2006-09-27 Ville Vainio <vivainio@gmail.com>
1406 1411
1407 1412 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1408 1413 infinite loop and just exit. It's a hack, but will do for a while.
1409 1414
1410 1415 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1411 1416
1412 1417 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1413 1418 the constructor, this makes it possible to get a list of only directories
1414 1419 or only files.
1415 1420
1416 1421 2006-08-12 Ville Vainio <vivainio@gmail.com>
1417 1422
1418 1423 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1419 1424 they broke unittest
1420 1425
1421 1426 2006-08-11 Ville Vainio <vivainio@gmail.com>
1422 1427
1423 1428 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1424 1429 by resolving issue properly, i.e. by inheriting FakeModule
1425 1430 from types.ModuleType. Pickling ipython interactive data
1426 1431 should still work as usual (testing appreciated).
1427 1432
1428 1433 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1429 1434
1430 1435 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1431 1436 running under python 2.3 with code from 2.4 to fix a bug with
1432 1437 help(). Reported by the Debian maintainers, Norbert Tretkowski
1433 1438 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1434 1439 <afayolle-AT-debian.org>.
1435 1440
1436 1441 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1437 1442
1438 1443 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1439 1444 (which was displaying "quit" twice).
1440 1445
1441 1446 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1442 1447
1443 1448 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1444 1449 the mode argument).
1445 1450
1446 1451 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1447 1452
1448 1453 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1449 1454 not running under IPython.
1450 1455
1451 1456 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1452 1457 and make it iterable (iterating over the attribute itself). Add two new
1453 1458 magic strings for __xattrs__(): If the string starts with "-", the attribute
1454 1459 will not be displayed in ibrowse's detail view (but it can still be
1455 1460 iterated over). This makes it possible to add attributes that are large
1456 1461 lists or generator methods to the detail view. Replace magic attribute names
1457 1462 and _attrname() and _getattr() with "descriptors": For each type of magic
1458 1463 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1459 1464 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1460 1465 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1461 1466 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1462 1467 are still supported.
1463 1468
1464 1469 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1465 1470 fails in ibrowse.fetch(), the exception object is added as the last item
1466 1471 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1467 1472 a generator throws an exception midway through execution.
1468 1473
1469 1474 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1470 1475 encoding into methods.
1471 1476
1472 1477 2006-07-26 Ville Vainio <vivainio@gmail.com>
1473 1478
1474 1479 * iplib.py: history now stores multiline input as single
1475 1480 history entries. Patch by Jorgen Cederlof.
1476 1481
1477 1482 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1478 1483
1479 1484 * IPython/Extensions/ibrowse.py: Make cursor visible over
1480 1485 non existing attributes.
1481 1486
1482 1487 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1483 1488
1484 1489 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1485 1490 error output of the running command doesn't mess up the screen.
1486 1491
1487 1492 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1488 1493
1489 1494 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1490 1495 argument. This sorts the items themselves.
1491 1496
1492 1497 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1493 1498
1494 1499 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1495 1500 Compile expression strings into code objects. This should speed
1496 1501 up ifilter and friends somewhat.
1497 1502
1498 1503 2006-07-08 Ville Vainio <vivainio@gmail.com>
1499 1504
1500 1505 * Magic.py: %cpaste now strips > from the beginning of lines
1501 1506 to ease pasting quoted code from emails. Contributed by
1502 1507 Stefan van der Walt.
1503 1508
1504 1509 2006-06-29 Ville Vainio <vivainio@gmail.com>
1505 1510
1506 1511 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1507 1512 mode, patch contributed by Darren Dale. NEEDS TESTING!
1508 1513
1509 1514 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1510 1515
1511 1516 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1512 1517 a blue background. Fix fetching new display rows when the browser
1513 1518 scrolls more than a screenful (e.g. by using the goto command).
1514 1519
1515 1520 2006-06-27 Ville Vainio <vivainio@gmail.com>
1516 1521
1517 1522 * Magic.py (_inspect, _ofind) Apply David Huard's
1518 1523 patch for displaying the correct docstring for 'property'
1519 1524 attributes.
1520 1525
1521 1526 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1522 1527
1523 1528 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1524 1529 commands into the methods implementing them.
1525 1530
1526 1531 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1527 1532
1528 1533 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1529 1534 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1530 1535 autoindent support was authored by Jin Liu.
1531 1536
1532 1537 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1533 1538
1534 1539 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1535 1540 for keymaps with a custom class that simplifies handling.
1536 1541
1537 1542 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1538 1543
1539 1544 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1540 1545 resizing. This requires Python 2.5 to work.
1541 1546
1542 1547 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1543 1548
1544 1549 * IPython/Extensions/ibrowse.py: Add two new commands to
1545 1550 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1546 1551 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1547 1552 attributes again. Remapped the help command to "?". Display
1548 1553 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1549 1554 as keys for the "home" and "end" commands. Add three new commands
1550 1555 to the input mode for "find" and friends: "delend" (CTRL-K)
1551 1556 deletes to the end of line. "incsearchup" searches upwards in the
1552 1557 command history for an input that starts with the text before the cursor.
1553 1558 "incsearchdown" does the same downwards. Removed a bogus mapping of
1554 1559 the x key to "delete".
1555 1560
1556 1561 2006-06-15 Ville Vainio <vivainio@gmail.com>
1557 1562
1558 1563 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1559 1564 used to create prompts dynamically, instead of the "old" way of
1560 1565 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1561 1566 way still works (it's invoked by the default hook), of course.
1562 1567
1563 1568 * Prompts.py: added generate_output_prompt hook for altering output
1564 1569 prompt
1565 1570
1566 1571 * Release.py: Changed version string to 0.7.3.svn.
1567 1572
1568 1573 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1569 1574
1570 1575 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1571 1576 the call to fetch() always tries to fetch enough data for at least one
1572 1577 full screen. This makes it possible to simply call moveto(0,0,True) in
1573 1578 the constructor. Fix typos and removed the obsolete goto attribute.
1574 1579
1575 1580 2006-06-12 Ville Vainio <vivainio@gmail.com>
1576 1581
1577 1582 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1578 1583 allowing $variable interpolation within multiline statements,
1579 1584 though so far only with "sh" profile for a testing period.
1580 1585 The patch also enables splitting long commands with \ but it
1581 1586 doesn't work properly yet.
1582 1587
1583 1588 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1584 1589
1585 1590 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1586 1591 input history and the position of the cursor in the input history for
1587 1592 the find, findbackwards and goto command.
1588 1593
1589 1594 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1590 1595
1591 1596 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1592 1597 implements the basic functionality of browser commands that require
1593 1598 input. Reimplement the goto, find and findbackwards commands as
1594 1599 subclasses of _CommandInput. Add an input history and keymaps to those
1595 1600 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1596 1601 execute commands.
1597 1602
1598 1603 2006-06-07 Ville Vainio <vivainio@gmail.com>
1599 1604
1600 1605 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1601 1606 running the batch files instead of leaving the session open.
1602 1607
1603 1608 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1604 1609
1605 1610 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1606 1611 the original fix was incomplete. Patch submitted by W. Maier.
1607 1612
1608 1613 2006-06-07 Ville Vainio <vivainio@gmail.com>
1609 1614
1610 1615 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1611 1616 Confirmation prompts can be supressed by 'quiet' option.
1612 1617 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1613 1618
1614 1619 2006-06-06 *** Released version 0.7.2
1615 1620
1616 1621 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1617 1622
1618 1623 * IPython/Release.py (version): Made 0.7.2 final for release.
1619 1624 Repo tagged and release cut.
1620 1625
1621 1626 2006-06-05 Ville Vainio <vivainio@gmail.com>
1622 1627
1623 1628 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1624 1629 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1625 1630
1626 1631 * upgrade_dir.py: try import 'path' module a bit harder
1627 1632 (for %upgrade)
1628 1633
1629 1634 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1630 1635
1631 1636 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1632 1637 instead of looping 20 times.
1633 1638
1634 1639 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1635 1640 correctly at initialization time. Bug reported by Krishna Mohan
1636 1641 Gundu <gkmohan-AT-gmail.com> on the user list.
1637 1642
1638 1643 * IPython/Release.py (version): Mark 0.7.2 version to start
1639 1644 testing for release on 06/06.
1640 1645
1641 1646 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1642 1647
1643 1648 * scripts/irunner: thin script interface so users don't have to
1644 1649 find the module and call it as an executable, since modules rarely
1645 1650 live in people's PATH.
1646 1651
1647 1652 * IPython/irunner.py (InteractiveRunner.__init__): added
1648 1653 delaybeforesend attribute to control delays with newer versions of
1649 1654 pexpect. Thanks to detailed help from pexpect's author, Noah
1650 1655 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1651 1656 correctly (it works in NoColor mode).
1652 1657
1653 1658 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1654 1659 SAGE list, from improper log() calls.
1655 1660
1656 1661 2006-05-31 Ville Vainio <vivainio@gmail.com>
1657 1662
1658 1663 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1659 1664 with args in parens to work correctly with dirs that have spaces.
1660 1665
1661 1666 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1662 1667
1663 1668 * IPython/Logger.py (Logger.logstart): add option to log raw input
1664 1669 instead of the processed one. A -r flag was added to the
1665 1670 %logstart magic used for controlling logging.
1666 1671
1667 1672 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1668 1673
1669 1674 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1670 1675 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1671 1676 recognize the option. After a bug report by Will Maier. This
1672 1677 closes #64 (will do it after confirmation from W. Maier).
1673 1678
1674 1679 * IPython/irunner.py: New module to run scripts as if manually
1675 1680 typed into an interactive environment, based on pexpect. After a
1676 1681 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1677 1682 ipython-user list. Simple unittests in the tests/ directory.
1678 1683
1679 1684 * tools/release: add Will Maier, OpenBSD port maintainer, to
1680 1685 recepients list. We are now officially part of the OpenBSD ports:
1681 1686 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1682 1687 work.
1683 1688
1684 1689 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1685 1690
1686 1691 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1687 1692 so that it doesn't break tkinter apps.
1688 1693
1689 1694 * IPython/iplib.py (_prefilter): fix bug where aliases would
1690 1695 shadow variables when autocall was fully off. Reported by SAGE
1691 1696 author William Stein.
1692 1697
1693 1698 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1694 1699 at what detail level strings are computed when foo? is requested.
1695 1700 This allows users to ask for example that the string form of an
1696 1701 object is only computed when foo?? is called, or even never, by
1697 1702 setting the object_info_string_level >= 2 in the configuration
1698 1703 file. This new option has been added and documented. After a
1699 1704 request by SAGE to be able to control the printing of very large
1700 1705 objects more easily.
1701 1706
1702 1707 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1703 1708
1704 1709 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1705 1710 from sys.argv, to be 100% consistent with how Python itself works
1706 1711 (as seen for example with python -i file.py). After a bug report
1707 1712 by Jeffrey Collins.
1708 1713
1709 1714 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1710 1715 nasty bug which was preventing custom namespaces with -pylab,
1711 1716 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1712 1717 compatibility (long gone from mpl).
1713 1718
1714 1719 * IPython/ipapi.py (make_session): name change: create->make. We
1715 1720 use make in other places (ipmaker,...), it's shorter and easier to
1716 1721 type and say, etc. I'm trying to clean things before 0.7.2 so
1717 1722 that I can keep things stable wrt to ipapi in the chainsaw branch.
1718 1723
1719 1724 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1720 1725 python-mode recognizes our debugger mode. Add support for
1721 1726 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1722 1727 <m.liu.jin-AT-gmail.com> originally written by
1723 1728 doxgen-AT-newsmth.net (with minor modifications for xemacs
1724 1729 compatibility)
1725 1730
1726 1731 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1727 1732 tracebacks when walking the stack so that the stack tracking system
1728 1733 in emacs' python-mode can identify the frames correctly.
1729 1734
1730 1735 * IPython/ipmaker.py (make_IPython): make the internal (and
1731 1736 default config) autoedit_syntax value false by default. Too many
1732 1737 users have complained to me (both on and off-list) about problems
1733 1738 with this option being on by default, so I'm making it default to
1734 1739 off. It can still be enabled by anyone via the usual mechanisms.
1735 1740
1736 1741 * IPython/completer.py (Completer.attr_matches): add support for
1737 1742 PyCrust-style _getAttributeNames magic method. Patch contributed
1738 1743 by <mscott-AT-goldenspud.com>. Closes #50.
1739 1744
1740 1745 * IPython/iplib.py (InteractiveShell.__init__): remove the
1741 1746 deletion of exit/quit from __builtin__, which can break
1742 1747 third-party tools like the Zope debugging console. The
1743 1748 %exit/%quit magics remain. In general, it's probably a good idea
1744 1749 not to delete anything from __builtin__, since we never know what
1745 1750 that will break. In any case, python now (for 2.5) will support
1746 1751 'real' exit/quit, so this issue is moot. Closes #55.
1747 1752
1748 1753 * IPython/genutils.py (with_obj): rename the 'with' function to
1749 1754 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1750 1755 becomes a language keyword. Closes #53.
1751 1756
1752 1757 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1753 1758 __file__ attribute to this so it fools more things into thinking
1754 1759 it is a real module. Closes #59.
1755 1760
1756 1761 * IPython/Magic.py (magic_edit): add -n option to open the editor
1757 1762 at a specific line number. After a patch by Stefan van der Walt.
1758 1763
1759 1764 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1760 1765
1761 1766 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1762 1767 reason the file could not be opened. After automatic crash
1763 1768 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1764 1769 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1765 1770 (_should_recompile): Don't fire editor if using %bg, since there
1766 1771 is no file in the first place. From the same report as above.
1767 1772 (raw_input): protect against faulty third-party prefilters. After
1768 1773 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1769 1774 while running under SAGE.
1770 1775
1771 1776 2006-05-23 Ville Vainio <vivainio@gmail.com>
1772 1777
1773 1778 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1774 1779 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1775 1780 now returns None (again), unless dummy is specifically allowed by
1776 1781 ipapi.get(allow_dummy=True).
1777 1782
1778 1783 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1779 1784
1780 1785 * IPython: remove all 2.2-compatibility objects and hacks from
1781 1786 everywhere, since we only support 2.3 at this point. Docs
1782 1787 updated.
1783 1788
1784 1789 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1785 1790 Anything requiring extra validation can be turned into a Python
1786 1791 property in the future. I used a property for the db one b/c
1787 1792 there was a nasty circularity problem with the initialization
1788 1793 order, which right now I don't have time to clean up.
1789 1794
1790 1795 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1791 1796 another locking bug reported by Jorgen. I'm not 100% sure though,
1792 1797 so more testing is needed...
1793 1798
1794 1799 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1795 1800
1796 1801 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1797 1802 local variables from any routine in user code (typically executed
1798 1803 with %run) directly into the interactive namespace. Very useful
1799 1804 when doing complex debugging.
1800 1805 (IPythonNotRunning): Changed the default None object to a dummy
1801 1806 whose attributes can be queried as well as called without
1802 1807 exploding, to ease writing code which works transparently both in
1803 1808 and out of ipython and uses some of this API.
1804 1809
1805 1810 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1806 1811
1807 1812 * IPython/hooks.py (result_display): Fix the fact that our display
1808 1813 hook was using str() instead of repr(), as the default python
1809 1814 console does. This had gone unnoticed b/c it only happened if
1810 1815 %Pprint was off, but the inconsistency was there.
1811 1816
1812 1817 2006-05-15 Ville Vainio <vivainio@gmail.com>
1813 1818
1814 1819 * Oinspect.py: Only show docstring for nonexisting/binary files
1815 1820 when doing object??, closing ticket #62
1816 1821
1817 1822 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1818 1823
1819 1824 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1820 1825 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1821 1826 was being released in a routine which hadn't checked if it had
1822 1827 been the one to acquire it.
1823 1828
1824 1829 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1825 1830
1826 1831 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1827 1832
1828 1833 2006-04-11 Ville Vainio <vivainio@gmail.com>
1829 1834
1830 1835 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1831 1836 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1832 1837 prefilters, allowing stuff like magics and aliases in the file.
1833 1838
1834 1839 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1835 1840 added. Supported now are "%clear in" and "%clear out" (clear input and
1836 1841 output history, respectively). Also fixed CachedOutput.flush to
1837 1842 properly flush the output cache.
1838 1843
1839 1844 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1840 1845 half-success (and fail explicitly).
1841 1846
1842 1847 2006-03-28 Ville Vainio <vivainio@gmail.com>
1843 1848
1844 1849 * iplib.py: Fix quoting of aliases so that only argless ones
1845 1850 are quoted
1846 1851
1847 1852 2006-03-28 Ville Vainio <vivainio@gmail.com>
1848 1853
1849 1854 * iplib.py: Quote aliases with spaces in the name.
1850 1855 "c:\program files\blah\bin" is now legal alias target.
1851 1856
1852 1857 * ext_rehashdir.py: Space no longer allowed as arg
1853 1858 separator, since space is legal in path names.
1854 1859
1855 1860 2006-03-16 Ville Vainio <vivainio@gmail.com>
1856 1861
1857 1862 * upgrade_dir.py: Take path.py from Extensions, correcting
1858 1863 %upgrade magic
1859 1864
1860 1865 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1861 1866
1862 1867 * hooks.py: Only enclose editor binary in quotes if legal and
1863 1868 necessary (space in the name, and is an existing file). Fixes a bug
1864 1869 reported by Zachary Pincus.
1865 1870
1866 1871 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1867 1872
1868 1873 * Manual: thanks to a tip on proper color handling for Emacs, by
1869 1874 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1870 1875
1871 1876 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1872 1877 by applying the provided patch. Thanks to Liu Jin
1873 1878 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1874 1879 XEmacs/Linux, I'm trusting the submitter that it actually helps
1875 1880 under win32/GNU Emacs. Will revisit if any problems are reported.
1876 1881
1877 1882 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1878 1883
1879 1884 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1880 1885 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1881 1886
1882 1887 2006-03-12 Ville Vainio <vivainio@gmail.com>
1883 1888
1884 1889 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1885 1890 Torsten Marek.
1886 1891
1887 1892 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1888 1893
1889 1894 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1890 1895 line ranges works again.
1891 1896
1892 1897 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1893 1898
1894 1899 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1895 1900 and friends, after a discussion with Zach Pincus on ipython-user.
1896 1901 I'm not 100% sure, but after thinking about it quite a bit, it may
1897 1902 be OK. Testing with the multithreaded shells didn't reveal any
1898 1903 problems, but let's keep an eye out.
1899 1904
1900 1905 In the process, I fixed a few things which were calling
1901 1906 self.InteractiveTB() directly (like safe_execfile), which is a
1902 1907 mistake: ALL exception reporting should be done by calling
1903 1908 self.showtraceback(), which handles state and tab-completion and
1904 1909 more.
1905 1910
1906 1911 2006-03-01 Ville Vainio <vivainio@gmail.com>
1907 1912
1908 1913 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1909 1914 To use, do "from ipipe import *".
1910 1915
1911 1916 2006-02-24 Ville Vainio <vivainio@gmail.com>
1912 1917
1913 1918 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1914 1919 "cleanly" and safely than the older upgrade mechanism.
1915 1920
1916 1921 2006-02-21 Ville Vainio <vivainio@gmail.com>
1917 1922
1918 1923 * Magic.py: %save works again.
1919 1924
1920 1925 2006-02-15 Ville Vainio <vivainio@gmail.com>
1921 1926
1922 1927 * Magic.py: %Pprint works again
1923 1928
1924 1929 * Extensions/ipy_sane_defaults.py: Provide everything provided
1925 1930 in default ipythonrc, to make it possible to have a completely empty
1926 1931 ipythonrc (and thus completely rc-file free configuration)
1927 1932
1928 1933 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1929 1934
1930 1935 * IPython/hooks.py (editor): quote the call to the editor command,
1931 1936 to allow commands with spaces in them. Problem noted by watching
1932 1937 Ian Oswald's video about textpad under win32 at
1933 1938 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1934 1939
1935 1940 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1936 1941 describing magics (we haven't used @ for a loong time).
1937 1942
1938 1943 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1939 1944 contributed by marienz to close
1940 1945 http://www.scipy.net/roundup/ipython/issue53.
1941 1946
1942 1947 2006-02-10 Ville Vainio <vivainio@gmail.com>
1943 1948
1944 1949 * genutils.py: getoutput now works in win32 too
1945 1950
1946 1951 * completer.py: alias and magic completion only invoked
1947 1952 at the first "item" in the line, to avoid "cd %store"
1948 1953 nonsense.
1949 1954
1950 1955 2006-02-09 Ville Vainio <vivainio@gmail.com>
1951 1956
1952 1957 * test/*: Added a unit testing framework (finally).
1953 1958 '%run runtests.py' to run test_*.
1954 1959
1955 1960 * ipapi.py: Exposed runlines and set_custom_exc
1956 1961
1957 1962 2006-02-07 Ville Vainio <vivainio@gmail.com>
1958 1963
1959 1964 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1960 1965 instead use "f(1 2)" as before.
1961 1966
1962 1967 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1963 1968
1964 1969 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1965 1970 facilities, for demos processed by the IPython input filter
1966 1971 (IPythonDemo), and for running a script one-line-at-a-time as a
1967 1972 demo, both for pure Python (LineDemo) and for IPython-processed
1968 1973 input (IPythonLineDemo). After a request by Dave Kohel, from the
1969 1974 SAGE team.
1970 1975 (Demo.edit): added an edit() method to the demo objects, to edit
1971 1976 the in-memory copy of the last executed block.
1972 1977
1973 1978 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1974 1979 processing to %edit, %macro and %save. These commands can now be
1975 1980 invoked on the unprocessed input as it was typed by the user
1976 1981 (without any prefilters applied). After requests by the SAGE team
1977 1982 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1978 1983
1979 1984 2006-02-01 Ville Vainio <vivainio@gmail.com>
1980 1985
1981 1986 * setup.py, eggsetup.py: easy_install ipython==dev works
1982 1987 correctly now (on Linux)
1983 1988
1984 1989 * ipy_user_conf,ipmaker: user config changes, removed spurious
1985 1990 warnings
1986 1991
1987 1992 * iplib: if rc.banner is string, use it as is.
1988 1993
1989 1994 * Magic: %pycat accepts a string argument and pages it's contents.
1990 1995
1991 1996
1992 1997 2006-01-30 Ville Vainio <vivainio@gmail.com>
1993 1998
1994 1999 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1995 2000 Now %store and bookmarks work through PickleShare, meaning that
1996 2001 concurrent access is possible and all ipython sessions see the
1997 2002 same database situation all the time, instead of snapshot of
1998 2003 the situation when the session was started. Hence, %bookmark
1999 2004 results are immediately accessible from othes sessions. The database
2000 2005 is also available for use by user extensions. See:
2001 2006 http://www.python.org/pypi/pickleshare
2002 2007
2003 2008 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
2004 2009
2005 2010 * aliases can now be %store'd
2006 2011
2007 2012 * path.py moved to Extensions so that pickleshare does not need
2008 2013 IPython-specific import. Extensions added to pythonpath right
2009 2014 at __init__.
2010 2015
2011 2016 * iplib.py: ipalias deprecated/redundant; aliases are converted and
2012 2017 called with _ip.system and the pre-transformed command string.
2013 2018
2014 2019 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
2015 2020
2016 2021 * IPython/iplib.py (interact): Fix that we were not catching
2017 2022 KeyboardInterrupt exceptions properly. I'm not quite sure why the
2018 2023 logic here had to change, but it's fixed now.
2019 2024
2020 2025 2006-01-29 Ville Vainio <vivainio@gmail.com>
2021 2026
2022 2027 * iplib.py: Try to import pyreadline on Windows.
2023 2028
2024 2029 2006-01-27 Ville Vainio <vivainio@gmail.com>
2025 2030
2026 2031 * iplib.py: Expose ipapi as _ip in builtin namespace.
2027 2032 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
2028 2033 and ip_set_hook (-> _ip.set_hook) redundant. % and !
2029 2034 syntax now produce _ip.* variant of the commands.
2030 2035
2031 2036 * "_ip.options().autoedit_syntax = 2" automatically throws
2032 2037 user to editor for syntax error correction without prompting.
2033 2038
2034 2039 2006-01-27 Ville Vainio <vivainio@gmail.com>
2035 2040
2036 2041 * ipmaker.py: Give "realistic" sys.argv for scripts (without
2037 2042 'ipython' at argv[0]) executed through command line.
2038 2043 NOTE: this DEPRECATES calling ipython with multiple scripts
2039 2044 ("ipython a.py b.py c.py")
2040 2045
2041 2046 * iplib.py, hooks.py: Added configurable input prefilter,
2042 2047 named 'input_prefilter'. See ext_rescapture.py for example
2043 2048 usage.
2044 2049
2045 2050 * ext_rescapture.py, Magic.py: Better system command output capture
2046 2051 through 'var = !ls' (deprecates user-visible %sc). Same notation
2047 2052 applies for magics, 'var = %alias' assigns alias list to var.
2048 2053
2049 2054 * ipapi.py: added meta() for accessing extension-usable data store.
2050 2055
2051 2056 * iplib.py: added InteractiveShell.getapi(). New magics should be
2052 2057 written doing self.getapi() instead of using the shell directly.
2053 2058
2054 2059 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
2055 2060 %store foo >> ~/myfoo.txt to store variables to files (in clean
2056 2061 textual form, not a restorable pickle).
2057 2062
2058 2063 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
2059 2064
2060 2065 * usage.py, Magic.py: added %quickref
2061 2066
2062 2067 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
2063 2068
2064 2069 * GetoptErrors when invoking magics etc. with wrong args
2065 2070 are now more helpful:
2066 2071 GetoptError: option -l not recognized (allowed: "qb" )
2067 2072
2068 2073 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
2069 2074
2070 2075 * IPython/demo.py (Demo.show): Flush stdout after each block, so
2071 2076 computationally intensive blocks don't appear to stall the demo.
2072 2077
2073 2078 2006-01-24 Ville Vainio <vivainio@gmail.com>
2074 2079
2075 2080 * iplib.py, hooks.py: 'result_display' hook can return a non-None
2076 2081 value to manipulate resulting history entry.
2077 2082
2078 2083 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2079 2084 to instance methods of IPApi class, to make extending an embedded
2080 2085 IPython feasible. See ext_rehashdir.py for example usage.
2081 2086
2082 2087 * Merged 1071-1076 from branches/0.7.1
2083 2088
2084 2089
2085 2090 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2086 2091
2087 2092 * tools/release (daystamp): Fix build tools to use the new
2088 2093 eggsetup.py script to build lightweight eggs.
2089 2094
2090 2095 * Applied changesets 1062 and 1064 before 0.7.1 release.
2091 2096
2092 2097 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2093 2098 see the raw input history (without conversions like %ls ->
2094 2099 ipmagic("ls")). After a request from W. Stein, SAGE
2095 2100 (http://modular.ucsd.edu/sage) developer. This information is
2096 2101 stored in the input_hist_raw attribute of the IPython instance, so
2097 2102 developers can access it if needed (it's an InputList instance).
2098 2103
2099 2104 * Versionstring = 0.7.2.svn
2100 2105
2101 2106 * eggsetup.py: A separate script for constructing eggs, creates
2102 2107 proper launch scripts even on Windows (an .exe file in
2103 2108 \python24\scripts).
2104 2109
2105 2110 * ipapi.py: launch_new_instance, launch entry point needed for the
2106 2111 egg.
2107 2112
2108 2113 2006-01-23 Ville Vainio <vivainio@gmail.com>
2109 2114
2110 2115 * Added %cpaste magic for pasting python code
2111 2116
2112 2117 2006-01-22 Ville Vainio <vivainio@gmail.com>
2113 2118
2114 2119 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2115 2120
2116 2121 * Versionstring = 0.7.2.svn
2117 2122
2118 2123 * eggsetup.py: A separate script for constructing eggs, creates
2119 2124 proper launch scripts even on Windows (an .exe file in
2120 2125 \python24\scripts).
2121 2126
2122 2127 * ipapi.py: launch_new_instance, launch entry point needed for the
2123 2128 egg.
2124 2129
2125 2130 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2126 2131
2127 2132 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2128 2133 %pfile foo would print the file for foo even if it was a binary.
2129 2134 Now, extensions '.so' and '.dll' are skipped.
2130 2135
2131 2136 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2132 2137 bug, where macros would fail in all threaded modes. I'm not 100%
2133 2138 sure, so I'm going to put out an rc instead of making a release
2134 2139 today, and wait for feedback for at least a few days.
2135 2140
2136 2141 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2137 2142 it...) the handling of pasting external code with autoindent on.
2138 2143 To get out of a multiline input, the rule will appear for most
2139 2144 users unchanged: two blank lines or change the indent level
2140 2145 proposed by IPython. But there is a twist now: you can
2141 2146 add/subtract only *one or two spaces*. If you add/subtract three
2142 2147 or more (unless you completely delete the line), IPython will
2143 2148 accept that line, and you'll need to enter a second one of pure
2144 2149 whitespace. I know it sounds complicated, but I can't find a
2145 2150 different solution that covers all the cases, with the right
2146 2151 heuristics. Hopefully in actual use, nobody will really notice
2147 2152 all these strange rules and things will 'just work'.
2148 2153
2149 2154 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2150 2155
2151 2156 * IPython/iplib.py (interact): catch exceptions which can be
2152 2157 triggered asynchronously by signal handlers. Thanks to an
2153 2158 automatic crash report, submitted by Colin Kingsley
2154 2159 <tercel-AT-gentoo.org>.
2155 2160
2156 2161 2006-01-20 Ville Vainio <vivainio@gmail.com>
2157 2162
2158 2163 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2159 2164 (%rehashdir, very useful, try it out) of how to extend ipython
2160 2165 with new magics. Also added Extensions dir to pythonpath to make
2161 2166 importing extensions easy.
2162 2167
2163 2168 * %store now complains when trying to store interactively declared
2164 2169 classes / instances of those classes.
2165 2170
2166 2171 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2167 2172 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2168 2173 if they exist, and ipy_user_conf.py with some defaults is created for
2169 2174 the user.
2170 2175
2171 2176 * Startup rehashing done by the config file, not InterpreterExec.
2172 2177 This means system commands are available even without selecting the
2173 2178 pysh profile. It's the sensible default after all.
2174 2179
2175 2180 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2176 2181
2177 2182 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2178 2183 multiline code with autoindent on working. But I am really not
2179 2184 sure, so this needs more testing. Will commit a debug-enabled
2180 2185 version for now, while I test it some more, so that Ville and
2181 2186 others may also catch any problems. Also made
2182 2187 self.indent_current_str() a method, to ensure that there's no
2183 2188 chance of the indent space count and the corresponding string
2184 2189 falling out of sync. All code needing the string should just call
2185 2190 the method.
2186 2191
2187 2192 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2188 2193
2189 2194 * IPython/Magic.py (magic_edit): fix check for when users don't
2190 2195 save their output files, the try/except was in the wrong section.
2191 2196
2192 2197 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2193 2198
2194 2199 * IPython/Magic.py (magic_run): fix __file__ global missing from
2195 2200 script's namespace when executed via %run. After a report by
2196 2201 Vivian.
2197 2202
2198 2203 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2199 2204 when using python 2.4. The parent constructor changed in 2.4, and
2200 2205 we need to track it directly (we can't call it, as it messes up
2201 2206 readline and tab-completion inside our pdb would stop working).
2202 2207 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2203 2208
2204 2209 2006-01-16 Ville Vainio <vivainio@gmail.com>
2205 2210
2206 2211 * Ipython/magic.py: Reverted back to old %edit functionality
2207 2212 that returns file contents on exit.
2208 2213
2209 2214 * IPython/path.py: Added Jason Orendorff's "path" module to
2210 2215 IPython tree, http://www.jorendorff.com/articles/python/path/.
2211 2216 You can get path objects conveniently through %sc, and !!, e.g.:
2212 2217 sc files=ls
2213 2218 for p in files.paths: # or files.p
2214 2219 print p,p.mtime
2215 2220
2216 2221 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2217 2222 now work again without considering the exclusion regexp -
2218 2223 hence, things like ',foo my/path' turn to 'foo("my/path")'
2219 2224 instead of syntax error.
2220 2225
2221 2226
2222 2227 2006-01-14 Ville Vainio <vivainio@gmail.com>
2223 2228
2224 2229 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2225 2230 ipapi decorators for python 2.4 users, options() provides access to rc
2226 2231 data.
2227 2232
2228 2233 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2229 2234 as path separators (even on Linux ;-). Space character after
2230 2235 backslash (as yielded by tab completer) is still space;
2231 2236 "%cd long\ name" works as expected.
2232 2237
2233 2238 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2234 2239 as "chain of command", with priority. API stays the same,
2235 2240 TryNext exception raised by a hook function signals that
2236 2241 current hook failed and next hook should try handling it, as
2237 2242 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2238 2243 requested configurable display hook, which is now implemented.
2239 2244
2240 2245 2006-01-13 Ville Vainio <vivainio@gmail.com>
2241 2246
2242 2247 * IPython/platutils*.py: platform specific utility functions,
2243 2248 so far only set_term_title is implemented (change terminal
2244 2249 label in windowing systems). %cd now changes the title to
2245 2250 current dir.
2246 2251
2247 2252 * IPython/Release.py: Added myself to "authors" list,
2248 2253 had to create new files.
2249 2254
2250 2255 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2251 2256 shell escape; not a known bug but had potential to be one in the
2252 2257 future.
2253 2258
2254 2259 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2255 2260 extension API for IPython! See the module for usage example. Fix
2256 2261 OInspect for docstring-less magic functions.
2257 2262
2258 2263
2259 2264 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2260 2265
2261 2266 * IPython/iplib.py (raw_input): temporarily deactivate all
2262 2267 attempts at allowing pasting of code with autoindent on. It
2263 2268 introduced bugs (reported by Prabhu) and I can't seem to find a
2264 2269 robust combination which works in all cases. Will have to revisit
2265 2270 later.
2266 2271
2267 2272 * IPython/genutils.py: remove isspace() function. We've dropped
2268 2273 2.2 compatibility, so it's OK to use the string method.
2269 2274
2270 2275 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2271 2276
2272 2277 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2273 2278 matching what NOT to autocall on, to include all python binary
2274 2279 operators (including things like 'and', 'or', 'is' and 'in').
2275 2280 Prompted by a bug report on 'foo & bar', but I realized we had
2276 2281 many more potential bug cases with other operators. The regexp is
2277 2282 self.re_exclude_auto, it's fairly commented.
2278 2283
2279 2284 2006-01-12 Ville Vainio <vivainio@gmail.com>
2280 2285
2281 2286 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2282 2287 Prettified and hardened string/backslash quoting with ipsystem(),
2283 2288 ipalias() and ipmagic(). Now even \ characters are passed to
2284 2289 %magics, !shell escapes and aliases exactly as they are in the
2285 2290 ipython command line. Should improve backslash experience,
2286 2291 particularly in Windows (path delimiter for some commands that
2287 2292 won't understand '/'), but Unix benefits as well (regexps). %cd
2288 2293 magic still doesn't support backslash path delimiters, though. Also
2289 2294 deleted all pretense of supporting multiline command strings in
2290 2295 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2291 2296
2292 2297 * doc/build_doc_instructions.txt added. Documentation on how to
2293 2298 use doc/update_manual.py, added yesterday. Both files contributed
2294 2299 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2295 2300 doc/*.sh for deprecation at a later date.
2296 2301
2297 2302 * /ipython.py Added ipython.py to root directory for
2298 2303 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2299 2304 ipython.py) and development convenience (no need to keep doing
2300 2305 "setup.py install" between changes).
2301 2306
2302 2307 * Made ! and !! shell escapes work (again) in multiline expressions:
2303 2308 if 1:
2304 2309 !ls
2305 2310 !!ls
2306 2311
2307 2312 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2308 2313
2309 2314 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2310 2315 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2311 2316 module in case-insensitive installation. Was causing crashes
2312 2317 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2313 2318
2314 2319 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2315 2320 <marienz-AT-gentoo.org>, closes
2316 2321 http://www.scipy.net/roundup/ipython/issue51.
2317 2322
2318 2323 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2319 2324
2320 2325 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2321 2326 problem of excessive CPU usage under *nix and keyboard lag under
2322 2327 win32.
2323 2328
2324 2329 2006-01-10 *** Released version 0.7.0
2325 2330
2326 2331 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2327 2332
2328 2333 * IPython/Release.py (revision): tag version number to 0.7.0,
2329 2334 ready for release.
2330 2335
2331 2336 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2332 2337 it informs the user of the name of the temp. file used. This can
2333 2338 help if you decide later to reuse that same file, so you know
2334 2339 where to copy the info from.
2335 2340
2336 2341 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2337 2342
2338 2343 * setup_bdist_egg.py: little script to build an egg. Added
2339 2344 support in the release tools as well.
2340 2345
2341 2346 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2342 2347
2343 2348 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2344 2349 version selection (new -wxversion command line and ipythonrc
2345 2350 parameter). Patch contributed by Arnd Baecker
2346 2351 <arnd.baecker-AT-web.de>.
2347 2352
2348 2353 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2349 2354 embedded instances, for variables defined at the interactive
2350 2355 prompt of the embedded ipython. Reported by Arnd.
2351 2356
2352 2357 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2353 2358 it can be used as a (stateful) toggle, or with a direct parameter.
2354 2359
2355 2360 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2356 2361 could be triggered in certain cases and cause the traceback
2357 2362 printer not to work.
2358 2363
2359 2364 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2360 2365
2361 2366 * IPython/iplib.py (_should_recompile): Small fix, closes
2362 2367 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2363 2368
2364 2369 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2365 2370
2366 2371 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2367 2372 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2368 2373 Moad for help with tracking it down.
2369 2374
2370 2375 * IPython/iplib.py (handle_auto): fix autocall handling for
2371 2376 objects which support BOTH __getitem__ and __call__ (so that f [x]
2372 2377 is left alone, instead of becoming f([x]) automatically).
2373 2378
2374 2379 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2375 2380 Ville's patch.
2376 2381
2377 2382 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2378 2383
2379 2384 * IPython/iplib.py (handle_auto): changed autocall semantics to
2380 2385 include 'smart' mode, where the autocall transformation is NOT
2381 2386 applied if there are no arguments on the line. This allows you to
2382 2387 just type 'foo' if foo is a callable to see its internal form,
2383 2388 instead of having it called with no arguments (typically a
2384 2389 mistake). The old 'full' autocall still exists: for that, you
2385 2390 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2386 2391
2387 2392 * IPython/completer.py (Completer.attr_matches): add
2388 2393 tab-completion support for Enthoughts' traits. After a report by
2389 2394 Arnd and a patch by Prabhu.
2390 2395
2391 2396 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2392 2397
2393 2398 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2394 2399 Schmolck's patch to fix inspect.getinnerframes().
2395 2400
2396 2401 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2397 2402 for embedded instances, regarding handling of namespaces and items
2398 2403 added to the __builtin__ one. Multiple embedded instances and
2399 2404 recursive embeddings should work better now (though I'm not sure
2400 2405 I've got all the corner cases fixed, that code is a bit of a brain
2401 2406 twister).
2402 2407
2403 2408 * IPython/Magic.py (magic_edit): added support to edit in-memory
2404 2409 macros (automatically creates the necessary temp files). %edit
2405 2410 also doesn't return the file contents anymore, it's just noise.
2406 2411
2407 2412 * IPython/completer.py (Completer.attr_matches): revert change to
2408 2413 complete only on attributes listed in __all__. I realized it
2409 2414 cripples the tab-completion system as a tool for exploring the
2410 2415 internals of unknown libraries (it renders any non-__all__
2411 2416 attribute off-limits). I got bit by this when trying to see
2412 2417 something inside the dis module.
2413 2418
2414 2419 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2415 2420
2416 2421 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2417 2422 namespace for users and extension writers to hold data in. This
2418 2423 follows the discussion in
2419 2424 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2420 2425
2421 2426 * IPython/completer.py (IPCompleter.complete): small patch to help
2422 2427 tab-completion under Emacs, after a suggestion by John Barnard
2423 2428 <barnarj-AT-ccf.org>.
2424 2429
2425 2430 * IPython/Magic.py (Magic.extract_input_slices): added support for
2426 2431 the slice notation in magics to use N-M to represent numbers N...M
2427 2432 (closed endpoints). This is used by %macro and %save.
2428 2433
2429 2434 * IPython/completer.py (Completer.attr_matches): for modules which
2430 2435 define __all__, complete only on those. After a patch by Jeffrey
2431 2436 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2432 2437 speed up this routine.
2433 2438
2434 2439 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2435 2440 don't know if this is the end of it, but the behavior now is
2436 2441 certainly much more correct. Note that coupled with macros,
2437 2442 slightly surprising (at first) behavior may occur: a macro will in
2438 2443 general expand to multiple lines of input, so upon exiting, the
2439 2444 in/out counters will both be bumped by the corresponding amount
2440 2445 (as if the macro's contents had been typed interactively). Typing
2441 2446 %hist will reveal the intermediate (silently processed) lines.
2442 2447
2443 2448 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2444 2449 pickle to fail (%run was overwriting __main__ and not restoring
2445 2450 it, but pickle relies on __main__ to operate).
2446 2451
2447 2452 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2448 2453 using properties, but forgot to make the main InteractiveShell
2449 2454 class a new-style class. Properties fail silently, and
2450 2455 mysteriously, with old-style class (getters work, but
2451 2456 setters don't do anything).
2452 2457
2453 2458 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2454 2459
2455 2460 * IPython/Magic.py (magic_history): fix history reporting bug (I
2456 2461 know some nasties are still there, I just can't seem to find a
2457 2462 reproducible test case to track them down; the input history is
2458 2463 falling out of sync...)
2459 2464
2460 2465 * IPython/iplib.py (handle_shell_escape): fix bug where both
2461 2466 aliases and system accesses where broken for indented code (such
2462 2467 as loops).
2463 2468
2464 2469 * IPython/genutils.py (shell): fix small but critical bug for
2465 2470 win32 system access.
2466 2471
2467 2472 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2468 2473
2469 2474 * IPython/iplib.py (showtraceback): remove use of the
2470 2475 sys.last_{type/value/traceback} structures, which are non
2471 2476 thread-safe.
2472 2477 (_prefilter): change control flow to ensure that we NEVER
2473 2478 introspect objects when autocall is off. This will guarantee that
2474 2479 having an input line of the form 'x.y', where access to attribute
2475 2480 'y' has side effects, doesn't trigger the side effect TWICE. It
2476 2481 is important to note that, with autocall on, these side effects
2477 2482 can still happen.
2478 2483 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2479 2484 trio. IPython offers these three kinds of special calls which are
2480 2485 not python code, and it's a good thing to have their call method
2481 2486 be accessible as pure python functions (not just special syntax at
2482 2487 the command line). It gives us a better internal implementation
2483 2488 structure, as well as exposing these for user scripting more
2484 2489 cleanly.
2485 2490
2486 2491 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2487 2492 file. Now that they'll be more likely to be used with the
2488 2493 persistance system (%store), I want to make sure their module path
2489 2494 doesn't change in the future, so that we don't break things for
2490 2495 users' persisted data.
2491 2496
2492 2497 * IPython/iplib.py (autoindent_update): move indentation
2493 2498 management into the _text_ processing loop, not the keyboard
2494 2499 interactive one. This is necessary to correctly process non-typed
2495 2500 multiline input (such as macros).
2496 2501
2497 2502 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2498 2503 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2499 2504 which was producing problems in the resulting manual.
2500 2505 (magic_whos): improve reporting of instances (show their class,
2501 2506 instead of simply printing 'instance' which isn't terribly
2502 2507 informative).
2503 2508
2504 2509 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2505 2510 (minor mods) to support network shares under win32.
2506 2511
2507 2512 * IPython/winconsole.py (get_console_size): add new winconsole
2508 2513 module and fixes to page_dumb() to improve its behavior under
2509 2514 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2510 2515
2511 2516 * IPython/Magic.py (Macro): simplified Macro class to just
2512 2517 subclass list. We've had only 2.2 compatibility for a very long
2513 2518 time, yet I was still avoiding subclassing the builtin types. No
2514 2519 more (I'm also starting to use properties, though I won't shift to
2515 2520 2.3-specific features quite yet).
2516 2521 (magic_store): added Ville's patch for lightweight variable
2517 2522 persistence, after a request on the user list by Matt Wilkie
2518 2523 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2519 2524 details.
2520 2525
2521 2526 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2522 2527 changed the default logfile name from 'ipython.log' to
2523 2528 'ipython_log.py'. These logs are real python files, and now that
2524 2529 we have much better multiline support, people are more likely to
2525 2530 want to use them as such. Might as well name them correctly.
2526 2531
2527 2532 * IPython/Magic.py: substantial cleanup. While we can't stop
2528 2533 using magics as mixins, due to the existing customizations 'out
2529 2534 there' which rely on the mixin naming conventions, at least I
2530 2535 cleaned out all cross-class name usage. So once we are OK with
2531 2536 breaking compatibility, the two systems can be separated.
2532 2537
2533 2538 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2534 2539 anymore, and the class is a fair bit less hideous as well. New
2535 2540 features were also introduced: timestamping of input, and logging
2536 2541 of output results. These are user-visible with the -t and -o
2537 2542 options to %logstart. Closes
2538 2543 http://www.scipy.net/roundup/ipython/issue11 and a request by
2539 2544 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2540 2545
2541 2546 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2542 2547
2543 2548 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2544 2549 better handle backslashes in paths. See the thread 'More Windows
2545 2550 questions part 2 - \/ characters revisited' on the iypthon user
2546 2551 list:
2547 2552 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2548 2553
2549 2554 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2550 2555
2551 2556 (InteractiveShell.__init__): change threaded shells to not use the
2552 2557 ipython crash handler. This was causing more problems than not,
2553 2558 as exceptions in the main thread (GUI code, typically) would
2554 2559 always show up as a 'crash', when they really weren't.
2555 2560
2556 2561 The colors and exception mode commands (%colors/%xmode) have been
2557 2562 synchronized to also take this into account, so users can get
2558 2563 verbose exceptions for their threaded code as well. I also added
2559 2564 support for activating pdb inside this exception handler as well,
2560 2565 so now GUI authors can use IPython's enhanced pdb at runtime.
2561 2566
2562 2567 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2563 2568 true by default, and add it to the shipped ipythonrc file. Since
2564 2569 this asks the user before proceeding, I think it's OK to make it
2565 2570 true by default.
2566 2571
2567 2572 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2568 2573 of the previous special-casing of input in the eval loop. I think
2569 2574 this is cleaner, as they really are commands and shouldn't have
2570 2575 a special role in the middle of the core code.
2571 2576
2572 2577 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2573 2578
2574 2579 * IPython/iplib.py (edit_syntax_error): added support for
2575 2580 automatically reopening the editor if the file had a syntax error
2576 2581 in it. Thanks to scottt who provided the patch at:
2577 2582 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2578 2583 version committed).
2579 2584
2580 2585 * IPython/iplib.py (handle_normal): add suport for multi-line
2581 2586 input with emtpy lines. This fixes
2582 2587 http://www.scipy.net/roundup/ipython/issue43 and a similar
2583 2588 discussion on the user list.
2584 2589
2585 2590 WARNING: a behavior change is necessarily introduced to support
2586 2591 blank lines: now a single blank line with whitespace does NOT
2587 2592 break the input loop, which means that when autoindent is on, by
2588 2593 default hitting return on the next (indented) line does NOT exit.
2589 2594
2590 2595 Instead, to exit a multiline input you can either have:
2591 2596
2592 2597 - TWO whitespace lines (just hit return again), or
2593 2598 - a single whitespace line of a different length than provided
2594 2599 by the autoindent (add or remove a space).
2595 2600
2596 2601 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2597 2602 module to better organize all readline-related functionality.
2598 2603 I've deleted FlexCompleter and put all completion clases here.
2599 2604
2600 2605 * IPython/iplib.py (raw_input): improve indentation management.
2601 2606 It is now possible to paste indented code with autoindent on, and
2602 2607 the code is interpreted correctly (though it still looks bad on
2603 2608 screen, due to the line-oriented nature of ipython).
2604 2609 (MagicCompleter.complete): change behavior so that a TAB key on an
2605 2610 otherwise empty line actually inserts a tab, instead of completing
2606 2611 on the entire global namespace. This makes it easier to use the
2607 2612 TAB key for indentation. After a request by Hans Meine
2608 2613 <hans_meine-AT-gmx.net>
2609 2614 (_prefilter): add support so that typing plain 'exit' or 'quit'
2610 2615 does a sensible thing. Originally I tried to deviate as little as
2611 2616 possible from the default python behavior, but even that one may
2612 2617 change in this direction (thread on python-dev to that effect).
2613 2618 Regardless, ipython should do the right thing even if CPython's
2614 2619 '>>>' prompt doesn't.
2615 2620 (InteractiveShell): removed subclassing code.InteractiveConsole
2616 2621 class. By now we'd overridden just about all of its methods: I've
2617 2622 copied the remaining two over, and now ipython is a standalone
2618 2623 class. This will provide a clearer picture for the chainsaw
2619 2624 branch refactoring.
2620 2625
2621 2626 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2622 2627
2623 2628 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2624 2629 failures for objects which break when dir() is called on them.
2625 2630
2626 2631 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2627 2632 distinct local and global namespaces in the completer API. This
2628 2633 change allows us to properly handle completion with distinct
2629 2634 scopes, including in embedded instances (this had never really
2630 2635 worked correctly).
2631 2636
2632 2637 Note: this introduces a change in the constructor for
2633 2638 MagicCompleter, as a new global_namespace parameter is now the
2634 2639 second argument (the others were bumped one position).
2635 2640
2636 2641 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2637 2642
2638 2643 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2639 2644 embedded instances (which can be done now thanks to Vivian's
2640 2645 frame-handling fixes for pdb).
2641 2646 (InteractiveShell.__init__): Fix namespace handling problem in
2642 2647 embedded instances. We were overwriting __main__ unconditionally,
2643 2648 and this should only be done for 'full' (non-embedded) IPython;
2644 2649 embedded instances must respect the caller's __main__. Thanks to
2645 2650 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2646 2651
2647 2652 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2648 2653
2649 2654 * setup.py: added download_url to setup(). This registers the
2650 2655 download address at PyPI, which is not only useful to humans
2651 2656 browsing the site, but is also picked up by setuptools (the Eggs
2652 2657 machinery). Thanks to Ville and R. Kern for the info/discussion
2653 2658 on this.
2654 2659
2655 2660 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2656 2661
2657 2662 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2658 2663 This brings a lot of nice functionality to the pdb mode, which now
2659 2664 has tab-completion, syntax highlighting, and better stack handling
2660 2665 than before. Many thanks to Vivian De Smedt
2661 2666 <vivian-AT-vdesmedt.com> for the original patches.
2662 2667
2663 2668 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2664 2669
2665 2670 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2666 2671 sequence to consistently accept the banner argument. The
2667 2672 inconsistency was tripping SAGE, thanks to Gary Zablackis
2668 2673 <gzabl-AT-yahoo.com> for the report.
2669 2674
2670 2675 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2671 2676
2672 2677 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2673 2678 Fix bug where a naked 'alias' call in the ipythonrc file would
2674 2679 cause a crash. Bug reported by Jorgen Stenarson.
2675 2680
2676 2681 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2677 2682
2678 2683 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2679 2684 startup time.
2680 2685
2681 2686 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2682 2687 instances had introduced a bug with globals in normal code. Now
2683 2688 it's working in all cases.
2684 2689
2685 2690 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2686 2691 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2687 2692 has been introduced to set the default case sensitivity of the
2688 2693 searches. Users can still select either mode at runtime on a
2689 2694 per-search basis.
2690 2695
2691 2696 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2692 2697
2693 2698 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2694 2699 attributes in wildcard searches for subclasses. Modified version
2695 2700 of a patch by Jorgen.
2696 2701
2697 2702 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2698 2703
2699 2704 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2700 2705 embedded instances. I added a user_global_ns attribute to the
2701 2706 InteractiveShell class to handle this.
2702 2707
2703 2708 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2704 2709
2705 2710 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2706 2711 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2707 2712 (reported under win32, but may happen also in other platforms).
2708 2713 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2709 2714
2710 2715 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2711 2716
2712 2717 * IPython/Magic.py (magic_psearch): new support for wildcard
2713 2718 patterns. Now, typing ?a*b will list all names which begin with a
2714 2719 and end in b, for example. The %psearch magic has full
2715 2720 docstrings. Many thanks to JΓΆrgen Stenarson
2716 2721 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2717 2722 implementing this functionality.
2718 2723
2719 2724 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2720 2725
2721 2726 * Manual: fixed long-standing annoyance of double-dashes (as in
2722 2727 --prefix=~, for example) being stripped in the HTML version. This
2723 2728 is a latex2html bug, but a workaround was provided. Many thanks
2724 2729 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2725 2730 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2726 2731 rolling. This seemingly small issue had tripped a number of users
2727 2732 when first installing, so I'm glad to see it gone.
2728 2733
2729 2734 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2730 2735
2731 2736 * IPython/Extensions/numeric_formats.py: fix missing import,
2732 2737 reported by Stephen Walton.
2733 2738
2734 2739 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2735 2740
2736 2741 * IPython/demo.py: finish demo module, fully documented now.
2737 2742
2738 2743 * IPython/genutils.py (file_read): simple little utility to read a
2739 2744 file and ensure it's closed afterwards.
2740 2745
2741 2746 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2742 2747
2743 2748 * IPython/demo.py (Demo.__init__): added support for individually
2744 2749 tagging blocks for automatic execution.
2745 2750
2746 2751 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2747 2752 syntax-highlighted python sources, requested by John.
2748 2753
2749 2754 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2750 2755
2751 2756 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2752 2757 finishing.
2753 2758
2754 2759 * IPython/genutils.py (shlex_split): moved from Magic to here,
2755 2760 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2756 2761
2757 2762 * IPython/demo.py (Demo.__init__): added support for silent
2758 2763 blocks, improved marks as regexps, docstrings written.
2759 2764 (Demo.__init__): better docstring, added support for sys.argv.
2760 2765
2761 2766 * IPython/genutils.py (marquee): little utility used by the demo
2762 2767 code, handy in general.
2763 2768
2764 2769 * IPython/demo.py (Demo.__init__): new class for interactive
2765 2770 demos. Not documented yet, I just wrote it in a hurry for
2766 2771 scipy'05. Will docstring later.
2767 2772
2768 2773 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2769 2774
2770 2775 * IPython/Shell.py (sigint_handler): Drastic simplification which
2771 2776 also seems to make Ctrl-C work correctly across threads! This is
2772 2777 so simple, that I can't beleive I'd missed it before. Needs more
2773 2778 testing, though.
2774 2779 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2775 2780 like this before...
2776 2781
2777 2782 * IPython/genutils.py (get_home_dir): add protection against
2778 2783 non-dirs in win32 registry.
2779 2784
2780 2785 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2781 2786 bug where dict was mutated while iterating (pysh crash).
2782 2787
2783 2788 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2784 2789
2785 2790 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2786 2791 spurious newlines added by this routine. After a report by
2787 2792 F. Mantegazza.
2788 2793
2789 2794 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2790 2795
2791 2796 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2792 2797 calls. These were a leftover from the GTK 1.x days, and can cause
2793 2798 problems in certain cases (after a report by John Hunter).
2794 2799
2795 2800 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2796 2801 os.getcwd() fails at init time. Thanks to patch from David Remahl
2797 2802 <chmod007-AT-mac.com>.
2798 2803 (InteractiveShell.__init__): prevent certain special magics from
2799 2804 being shadowed by aliases. Closes
2800 2805 http://www.scipy.net/roundup/ipython/issue41.
2801 2806
2802 2807 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2803 2808
2804 2809 * IPython/iplib.py (InteractiveShell.complete): Added new
2805 2810 top-level completion method to expose the completion mechanism
2806 2811 beyond readline-based environments.
2807 2812
2808 2813 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2809 2814
2810 2815 * tools/ipsvnc (svnversion): fix svnversion capture.
2811 2816
2812 2817 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2813 2818 attribute to self, which was missing. Before, it was set by a
2814 2819 routine which in certain cases wasn't being called, so the
2815 2820 instance could end up missing the attribute. This caused a crash.
2816 2821 Closes http://www.scipy.net/roundup/ipython/issue40.
2817 2822
2818 2823 2005-08-16 Fernando Perez <fperez@colorado.edu>
2819 2824
2820 2825 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2821 2826 contains non-string attribute. Closes
2822 2827 http://www.scipy.net/roundup/ipython/issue38.
2823 2828
2824 2829 2005-08-14 Fernando Perez <fperez@colorado.edu>
2825 2830
2826 2831 * tools/ipsvnc: Minor improvements, to add changeset info.
2827 2832
2828 2833 2005-08-12 Fernando Perez <fperez@colorado.edu>
2829 2834
2830 2835 * IPython/iplib.py (runsource): remove self.code_to_run_src
2831 2836 attribute. I realized this is nothing more than
2832 2837 '\n'.join(self.buffer), and having the same data in two different
2833 2838 places is just asking for synchronization bugs. This may impact
2834 2839 people who have custom exception handlers, so I need to warn
2835 2840 ipython-dev about it (F. Mantegazza may use them).
2836 2841
2837 2842 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2838 2843
2839 2844 * IPython/genutils.py: fix 2.2 compatibility (generators)
2840 2845
2841 2846 2005-07-18 Fernando Perez <fperez@colorado.edu>
2842 2847
2843 2848 * IPython/genutils.py (get_home_dir): fix to help users with
2844 2849 invalid $HOME under win32.
2845 2850
2846 2851 2005-07-17 Fernando Perez <fperez@colorado.edu>
2847 2852
2848 2853 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2849 2854 some old hacks and clean up a bit other routines; code should be
2850 2855 simpler and a bit faster.
2851 2856
2852 2857 * IPython/iplib.py (interact): removed some last-resort attempts
2853 2858 to survive broken stdout/stderr. That code was only making it
2854 2859 harder to abstract out the i/o (necessary for gui integration),
2855 2860 and the crashes it could prevent were extremely rare in practice
2856 2861 (besides being fully user-induced in a pretty violent manner).
2857 2862
2858 2863 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2859 2864 Nothing major yet, but the code is simpler to read; this should
2860 2865 make it easier to do more serious modifications in the future.
2861 2866
2862 2867 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2863 2868 which broke in .15 (thanks to a report by Ville).
2864 2869
2865 2870 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2866 2871 be quite correct, I know next to nothing about unicode). This
2867 2872 will allow unicode strings to be used in prompts, amongst other
2868 2873 cases. It also will prevent ipython from crashing when unicode
2869 2874 shows up unexpectedly in many places. If ascii encoding fails, we
2870 2875 assume utf_8. Currently the encoding is not a user-visible
2871 2876 setting, though it could be made so if there is demand for it.
2872 2877
2873 2878 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2874 2879
2875 2880 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2876 2881
2877 2882 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2878 2883
2879 2884 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2880 2885 code can work transparently for 2.2/2.3.
2881 2886
2882 2887 2005-07-16 Fernando Perez <fperez@colorado.edu>
2883 2888
2884 2889 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2885 2890 out of the color scheme table used for coloring exception
2886 2891 tracebacks. This allows user code to add new schemes at runtime.
2887 2892 This is a minimally modified version of the patch at
2888 2893 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2889 2894 for the contribution.
2890 2895
2891 2896 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2892 2897 slightly modified version of the patch in
2893 2898 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2894 2899 to remove the previous try/except solution (which was costlier).
2895 2900 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2896 2901
2897 2902 2005-06-08 Fernando Perez <fperez@colorado.edu>
2898 2903
2899 2904 * IPython/iplib.py (write/write_err): Add methods to abstract all
2900 2905 I/O a bit more.
2901 2906
2902 2907 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2903 2908 warning, reported by Aric Hagberg, fix by JD Hunter.
2904 2909
2905 2910 2005-06-02 *** Released version 0.6.15
2906 2911
2907 2912 2005-06-01 Fernando Perez <fperez@colorado.edu>
2908 2913
2909 2914 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2910 2915 tab-completion of filenames within open-quoted strings. Note that
2911 2916 this requires that in ~/.ipython/ipythonrc, users change the
2912 2917 readline delimiters configuration to read:
2913 2918
2914 2919 readline_remove_delims -/~
2915 2920
2916 2921
2917 2922 2005-05-31 *** Released version 0.6.14
2918 2923
2919 2924 2005-05-29 Fernando Perez <fperez@colorado.edu>
2920 2925
2921 2926 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2922 2927 with files not on the filesystem. Reported by Eliyahu Sandler
2923 2928 <eli@gondolin.net>
2924 2929
2925 2930 2005-05-22 Fernando Perez <fperez@colorado.edu>
2926 2931
2927 2932 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2928 2933 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2929 2934
2930 2935 2005-05-19 Fernando Perez <fperez@colorado.edu>
2931 2936
2932 2937 * IPython/iplib.py (safe_execfile): close a file which could be
2933 2938 left open (causing problems in win32, which locks open files).
2934 2939 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2935 2940
2936 2941 2005-05-18 Fernando Perez <fperez@colorado.edu>
2937 2942
2938 2943 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2939 2944 keyword arguments correctly to safe_execfile().
2940 2945
2941 2946 2005-05-13 Fernando Perez <fperez@colorado.edu>
2942 2947
2943 2948 * ipython.1: Added info about Qt to manpage, and threads warning
2944 2949 to usage page (invoked with --help).
2945 2950
2946 2951 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2947 2952 new matcher (it goes at the end of the priority list) to do
2948 2953 tab-completion on named function arguments. Submitted by George
2949 2954 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2950 2955 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2951 2956 for more details.
2952 2957
2953 2958 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2954 2959 SystemExit exceptions in the script being run. Thanks to a report
2955 2960 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2956 2961 producing very annoying behavior when running unit tests.
2957 2962
2958 2963 2005-05-12 Fernando Perez <fperez@colorado.edu>
2959 2964
2960 2965 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2961 2966 which I'd broken (again) due to a changed regexp. In the process,
2962 2967 added ';' as an escape to auto-quote the whole line without
2963 2968 splitting its arguments. Thanks to a report by Jerry McRae
2964 2969 <qrs0xyc02-AT-sneakemail.com>.
2965 2970
2966 2971 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2967 2972 possible crashes caused by a TokenError. Reported by Ed Schofield
2968 2973 <schofield-AT-ftw.at>.
2969 2974
2970 2975 2005-05-06 Fernando Perez <fperez@colorado.edu>
2971 2976
2972 2977 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2973 2978
2974 2979 2005-04-29 Fernando Perez <fperez@colorado.edu>
2975 2980
2976 2981 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2977 2982 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2978 2983 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2979 2984 which provides support for Qt interactive usage (similar to the
2980 2985 existing one for WX and GTK). This had been often requested.
2981 2986
2982 2987 2005-04-14 *** Released version 0.6.13
2983 2988
2984 2989 2005-04-08 Fernando Perez <fperez@colorado.edu>
2985 2990
2986 2991 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2987 2992 from _ofind, which gets called on almost every input line. Now,
2988 2993 we only try to get docstrings if they are actually going to be
2989 2994 used (the overhead of fetching unnecessary docstrings can be
2990 2995 noticeable for certain objects, such as Pyro proxies).
2991 2996
2992 2997 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2993 2998 for completers. For some reason I had been passing them the state
2994 2999 variable, which completers never actually need, and was in
2995 3000 conflict with the rlcompleter API. Custom completers ONLY need to
2996 3001 take the text parameter.
2997 3002
2998 3003 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2999 3004 work correctly in pysh. I've also moved all the logic which used
3000 3005 to be in pysh.py here, which will prevent problems with future
3001 3006 upgrades. However, this time I must warn users to update their
3002 3007 pysh profile to include the line
3003 3008
3004 3009 import_all IPython.Extensions.InterpreterExec
3005 3010
3006 3011 because otherwise things won't work for them. They MUST also
3007 3012 delete pysh.py and the line
3008 3013
3009 3014 execfile pysh.py
3010 3015
3011 3016 from their ipythonrc-pysh.
3012 3017
3013 3018 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
3014 3019 robust in the face of objects whose dir() returns non-strings
3015 3020 (which it shouldn't, but some broken libs like ITK do). Thanks to
3016 3021 a patch by John Hunter (implemented differently, though). Also
3017 3022 minor improvements by using .extend instead of + on lists.
3018 3023
3019 3024 * pysh.py:
3020 3025
3021 3026 2005-04-06 Fernando Perez <fperez@colorado.edu>
3022 3027
3023 3028 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
3024 3029 by default, so that all users benefit from it. Those who don't
3025 3030 want it can still turn it off.
3026 3031
3027 3032 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
3028 3033 config file, I'd forgotten about this, so users were getting it
3029 3034 off by default.
3030 3035
3031 3036 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
3032 3037 consistency. Now magics can be called in multiline statements,
3033 3038 and python variables can be expanded in magic calls via $var.
3034 3039 This makes the magic system behave just like aliases or !system
3035 3040 calls.
3036 3041
3037 3042 2005-03-28 Fernando Perez <fperez@colorado.edu>
3038 3043
3039 3044 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
3040 3045 expensive string additions for building command. Add support for
3041 3046 trailing ';' when autocall is used.
3042 3047
3043 3048 2005-03-26 Fernando Perez <fperez@colorado.edu>
3044 3049
3045 3050 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
3046 3051 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
3047 3052 ipython.el robust against prompts with any number of spaces
3048 3053 (including 0) after the ':' character.
3049 3054
3050 3055 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
3051 3056 continuation prompt, which misled users to think the line was
3052 3057 already indented. Closes debian Bug#300847, reported to me by
3053 3058 Norbert Tretkowski <tretkowski-AT-inittab.de>.
3054 3059
3055 3060 2005-03-23 Fernando Perez <fperez@colorado.edu>
3056 3061
3057 3062 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
3058 3063 properly aligned if they have embedded newlines.
3059 3064
3060 3065 * IPython/iplib.py (runlines): Add a public method to expose
3061 3066 IPython's code execution machinery, so that users can run strings
3062 3067 as if they had been typed at the prompt interactively.
3063 3068 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
3064 3069 methods which can call the system shell, but with python variable
3065 3070 expansion. The three such methods are: __IPYTHON__.system,
3066 3071 .getoutput and .getoutputerror. These need to be documented in a
3067 3072 'public API' section (to be written) of the manual.
3068 3073
3069 3074 2005-03-20 Fernando Perez <fperez@colorado.edu>
3070 3075
3071 3076 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
3072 3077 for custom exception handling. This is quite powerful, and it
3073 3078 allows for user-installable exception handlers which can trap
3074 3079 custom exceptions at runtime and treat them separately from
3075 3080 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
3076 3081 Mantegazza <mantegazza-AT-ill.fr>.
3077 3082 (InteractiveShell.set_custom_completer): public API function to
3078 3083 add new completers at runtime.
3079 3084
3080 3085 2005-03-19 Fernando Perez <fperez@colorado.edu>
3081 3086
3082 3087 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3083 3088 allow objects which provide their docstrings via non-standard
3084 3089 mechanisms (like Pyro proxies) to still be inspected by ipython's
3085 3090 ? system.
3086 3091
3087 3092 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3088 3093 automatic capture system. I tried quite hard to make it work
3089 3094 reliably, and simply failed. I tried many combinations with the
3090 3095 subprocess module, but eventually nothing worked in all needed
3091 3096 cases (not blocking stdin for the child, duplicating stdout
3092 3097 without blocking, etc). The new %sc/%sx still do capture to these
3093 3098 magical list/string objects which make shell use much more
3094 3099 conveninent, so not all is lost.
3095 3100
3096 3101 XXX - FIX MANUAL for the change above!
3097 3102
3098 3103 (runsource): I copied code.py's runsource() into ipython to modify
3099 3104 it a bit. Now the code object and source to be executed are
3100 3105 stored in ipython. This makes this info accessible to third-party
3101 3106 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
3102 3107 Mantegazza <mantegazza-AT-ill.fr>.
3103 3108
3104 3109 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3105 3110 history-search via readline (like C-p/C-n). I'd wanted this for a
3106 3111 long time, but only recently found out how to do it. For users
3107 3112 who already have their ipythonrc files made and want this, just
3108 3113 add:
3109 3114
3110 3115 readline_parse_and_bind "\e[A": history-search-backward
3111 3116 readline_parse_and_bind "\e[B": history-search-forward
3112 3117
3113 3118 2005-03-18 Fernando Perez <fperez@colorado.edu>
3114 3119
3115 3120 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3116 3121 LSString and SList classes which allow transparent conversions
3117 3122 between list mode and whitespace-separated string.
3118 3123 (magic_r): Fix recursion problem in %r.
3119 3124
3120 3125 * IPython/genutils.py (LSString): New class to be used for
3121 3126 automatic storage of the results of all alias/system calls in _o
3122 3127 and _e (stdout/err). These provide a .l/.list attribute which
3123 3128 does automatic splitting on newlines. This means that for most
3124 3129 uses, you'll never need to do capturing of output with %sc/%sx
3125 3130 anymore, since ipython keeps this always done for you. Note that
3126 3131 only the LAST results are stored, the _o/e variables are
3127 3132 overwritten on each call. If you need to save their contents
3128 3133 further, simply bind them to any other name.
3129 3134
3130 3135 2005-03-17 Fernando Perez <fperez@colorado.edu>
3131 3136
3132 3137 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3133 3138 prompt namespace handling.
3134 3139
3135 3140 2005-03-16 Fernando Perez <fperez@colorado.edu>
3136 3141
3137 3142 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3138 3143 classic prompts to be '>>> ' (final space was missing, and it
3139 3144 trips the emacs python mode).
3140 3145 (BasePrompt.__str__): Added safe support for dynamic prompt
3141 3146 strings. Now you can set your prompt string to be '$x', and the
3142 3147 value of x will be printed from your interactive namespace. The
3143 3148 interpolation syntax includes the full Itpl support, so
3144 3149 ${foo()+x+bar()} is a valid prompt string now, and the function
3145 3150 calls will be made at runtime.
3146 3151
3147 3152 2005-03-15 Fernando Perez <fperez@colorado.edu>
3148 3153
3149 3154 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3150 3155 avoid name clashes in pylab. %hist still works, it just forwards
3151 3156 the call to %history.
3152 3157
3153 3158 2005-03-02 *** Released version 0.6.12
3154 3159
3155 3160 2005-03-02 Fernando Perez <fperez@colorado.edu>
3156 3161
3157 3162 * IPython/iplib.py (handle_magic): log magic calls properly as
3158 3163 ipmagic() function calls.
3159 3164
3160 3165 * IPython/Magic.py (magic_time): Improved %time to support
3161 3166 statements and provide wall-clock as well as CPU time.
3162 3167
3163 3168 2005-02-27 Fernando Perez <fperez@colorado.edu>
3164 3169
3165 3170 * IPython/hooks.py: New hooks module, to expose user-modifiable
3166 3171 IPython functionality in a clean manner. For now only the editor
3167 3172 hook is actually written, and other thigns which I intend to turn
3168 3173 into proper hooks aren't yet there. The display and prefilter
3169 3174 stuff, for example, should be hooks. But at least now the
3170 3175 framework is in place, and the rest can be moved here with more
3171 3176 time later. IPython had had a .hooks variable for a long time for
3172 3177 this purpose, but I'd never actually used it for anything.
3173 3178
3174 3179 2005-02-26 Fernando Perez <fperez@colorado.edu>
3175 3180
3176 3181 * IPython/ipmaker.py (make_IPython): make the default ipython
3177 3182 directory be called _ipython under win32, to follow more the
3178 3183 naming peculiarities of that platform (where buggy software like
3179 3184 Visual Sourcesafe breaks with .named directories). Reported by
3180 3185 Ville Vainio.
3181 3186
3182 3187 2005-02-23 Fernando Perez <fperez@colorado.edu>
3183 3188
3184 3189 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3185 3190 auto_aliases for win32 which were causing problems. Users can
3186 3191 define the ones they personally like.
3187 3192
3188 3193 2005-02-21 Fernando Perez <fperez@colorado.edu>
3189 3194
3190 3195 * IPython/Magic.py (magic_time): new magic to time execution of
3191 3196 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3192 3197
3193 3198 2005-02-19 Fernando Perez <fperez@colorado.edu>
3194 3199
3195 3200 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3196 3201 into keys (for prompts, for example).
3197 3202
3198 3203 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3199 3204 prompts in case users want them. This introduces a small behavior
3200 3205 change: ipython does not automatically add a space to all prompts
3201 3206 anymore. To get the old prompts with a space, users should add it
3202 3207 manually to their ipythonrc file, so for example prompt_in1 should
3203 3208 now read 'In [\#]: ' instead of 'In [\#]:'.
3204 3209 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3205 3210 file) to control left-padding of secondary prompts.
3206 3211
3207 3212 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3208 3213 the profiler can't be imported. Fix for Debian, which removed
3209 3214 profile.py because of License issues. I applied a slightly
3210 3215 modified version of the original Debian patch at
3211 3216 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3212 3217
3213 3218 2005-02-17 Fernando Perez <fperez@colorado.edu>
3214 3219
3215 3220 * IPython/genutils.py (native_line_ends): Fix bug which would
3216 3221 cause improper line-ends under win32 b/c I was not opening files
3217 3222 in binary mode. Bug report and fix thanks to Ville.
3218 3223
3219 3224 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3220 3225 trying to catch spurious foo[1] autocalls. My fix actually broke
3221 3226 ',/' autoquote/call with explicit escape (bad regexp).
3222 3227
3223 3228 2005-02-15 *** Released version 0.6.11
3224 3229
3225 3230 2005-02-14 Fernando Perez <fperez@colorado.edu>
3226 3231
3227 3232 * IPython/background_jobs.py: New background job management
3228 3233 subsystem. This is implemented via a new set of classes, and
3229 3234 IPython now provides a builtin 'jobs' object for background job
3230 3235 execution. A convenience %bg magic serves as a lightweight
3231 3236 frontend for starting the more common type of calls. This was
3232 3237 inspired by discussions with B. Granger and the BackgroundCommand
3233 3238 class described in the book Python Scripting for Computational
3234 3239 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3235 3240 (although ultimately no code from this text was used, as IPython's
3236 3241 system is a separate implementation).
3237 3242
3238 3243 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3239 3244 to control the completion of single/double underscore names
3240 3245 separately. As documented in the example ipytonrc file, the
3241 3246 readline_omit__names variable can now be set to 2, to omit even
3242 3247 single underscore names. Thanks to a patch by Brian Wong
3243 3248 <BrianWong-AT-AirgoNetworks.Com>.
3244 3249 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3245 3250 be autocalled as foo([1]) if foo were callable. A problem for
3246 3251 things which are both callable and implement __getitem__.
3247 3252 (init_readline): Fix autoindentation for win32. Thanks to a patch
3248 3253 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3249 3254
3250 3255 2005-02-12 Fernando Perez <fperez@colorado.edu>
3251 3256
3252 3257 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3253 3258 which I had written long ago to sort out user error messages which
3254 3259 may occur during startup. This seemed like a good idea initially,
3255 3260 but it has proven a disaster in retrospect. I don't want to
3256 3261 change much code for now, so my fix is to set the internal 'debug'
3257 3262 flag to true everywhere, whose only job was precisely to control
3258 3263 this subsystem. This closes issue 28 (as well as avoiding all
3259 3264 sorts of strange hangups which occur from time to time).
3260 3265
3261 3266 2005-02-07 Fernando Perez <fperez@colorado.edu>
3262 3267
3263 3268 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3264 3269 previous call produced a syntax error.
3265 3270
3266 3271 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3267 3272 classes without constructor.
3268 3273
3269 3274 2005-02-06 Fernando Perez <fperez@colorado.edu>
3270 3275
3271 3276 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3272 3277 completions with the results of each matcher, so we return results
3273 3278 to the user from all namespaces. This breaks with ipython
3274 3279 tradition, but I think it's a nicer behavior. Now you get all
3275 3280 possible completions listed, from all possible namespaces (python,
3276 3281 filesystem, magics...) After a request by John Hunter
3277 3282 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3278 3283
3279 3284 2005-02-05 Fernando Perez <fperez@colorado.edu>
3280 3285
3281 3286 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3282 3287 the call had quote characters in it (the quotes were stripped).
3283 3288
3284 3289 2005-01-31 Fernando Perez <fperez@colorado.edu>
3285 3290
3286 3291 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3287 3292 Itpl.itpl() to make the code more robust against psyco
3288 3293 optimizations.
3289 3294
3290 3295 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3291 3296 of causing an exception. Quicker, cleaner.
3292 3297
3293 3298 2005-01-28 Fernando Perez <fperez@colorado.edu>
3294 3299
3295 3300 * scripts/ipython_win_post_install.py (install): hardcode
3296 3301 sys.prefix+'python.exe' as the executable path. It turns out that
3297 3302 during the post-installation run, sys.executable resolves to the
3298 3303 name of the binary installer! I should report this as a distutils
3299 3304 bug, I think. I updated the .10 release with this tiny fix, to
3300 3305 avoid annoying the lists further.
3301 3306
3302 3307 2005-01-27 *** Released version 0.6.10
3303 3308
3304 3309 2005-01-27 Fernando Perez <fperez@colorado.edu>
3305 3310
3306 3311 * IPython/numutils.py (norm): Added 'inf' as optional name for
3307 3312 L-infinity norm, included references to mathworld.com for vector
3308 3313 norm definitions.
3309 3314 (amin/amax): added amin/amax for array min/max. Similar to what
3310 3315 pylab ships with after the recent reorganization of names.
3311 3316 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3312 3317
3313 3318 * ipython.el: committed Alex's recent fixes and improvements.
3314 3319 Tested with python-mode from CVS, and it looks excellent. Since
3315 3320 python-mode hasn't released anything in a while, I'm temporarily
3316 3321 putting a copy of today's CVS (v 4.70) of python-mode in:
3317 3322 http://ipython.scipy.org/tmp/python-mode.el
3318 3323
3319 3324 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3320 3325 sys.executable for the executable name, instead of assuming it's
3321 3326 called 'python.exe' (the post-installer would have produced broken
3322 3327 setups on systems with a differently named python binary).
3323 3328
3324 3329 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3325 3330 references to os.linesep, to make the code more
3326 3331 platform-independent. This is also part of the win32 coloring
3327 3332 fixes.
3328 3333
3329 3334 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3330 3335 lines, which actually cause coloring bugs because the length of
3331 3336 the line is very difficult to correctly compute with embedded
3332 3337 escapes. This was the source of all the coloring problems under
3333 3338 Win32. I think that _finally_, Win32 users have a properly
3334 3339 working ipython in all respects. This would never have happened
3335 3340 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3336 3341
3337 3342 2005-01-26 *** Released version 0.6.9
3338 3343
3339 3344 2005-01-25 Fernando Perez <fperez@colorado.edu>
3340 3345
3341 3346 * setup.py: finally, we have a true Windows installer, thanks to
3342 3347 the excellent work of Viktor Ransmayr
3343 3348 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3344 3349 Windows users. The setup routine is quite a bit cleaner thanks to
3345 3350 this, and the post-install script uses the proper functions to
3346 3351 allow a clean de-installation using the standard Windows Control
3347 3352 Panel.
3348 3353
3349 3354 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3350 3355 environment variable under all OSes (including win32) if
3351 3356 available. This will give consistency to win32 users who have set
3352 3357 this variable for any reason. If os.environ['HOME'] fails, the
3353 3358 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3354 3359
3355 3360 2005-01-24 Fernando Perez <fperez@colorado.edu>
3356 3361
3357 3362 * IPython/numutils.py (empty_like): add empty_like(), similar to
3358 3363 zeros_like() but taking advantage of the new empty() Numeric routine.
3359 3364
3360 3365 2005-01-23 *** Released version 0.6.8
3361 3366
3362 3367 2005-01-22 Fernando Perez <fperez@colorado.edu>
3363 3368
3364 3369 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3365 3370 automatic show() calls. After discussing things with JDH, it
3366 3371 turns out there are too many corner cases where this can go wrong.
3367 3372 It's best not to try to be 'too smart', and simply have ipython
3368 3373 reproduce as much as possible the default behavior of a normal
3369 3374 python shell.
3370 3375
3371 3376 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3372 3377 line-splitting regexp and _prefilter() to avoid calling getattr()
3373 3378 on assignments. This closes
3374 3379 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3375 3380 readline uses getattr(), so a simple <TAB> keypress is still
3376 3381 enough to trigger getattr() calls on an object.
3377 3382
3378 3383 2005-01-21 Fernando Perez <fperez@colorado.edu>
3379 3384
3380 3385 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3381 3386 docstring under pylab so it doesn't mask the original.
3382 3387
3383 3388 2005-01-21 *** Released version 0.6.7
3384 3389
3385 3390 2005-01-21 Fernando Perez <fperez@colorado.edu>
3386 3391
3387 3392 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3388 3393 signal handling for win32 users in multithreaded mode.
3389 3394
3390 3395 2005-01-17 Fernando Perez <fperez@colorado.edu>
3391 3396
3392 3397 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3393 3398 instances with no __init__. After a crash report by Norbert Nemec
3394 3399 <Norbert-AT-nemec-online.de>.
3395 3400
3396 3401 2005-01-14 Fernando Perez <fperez@colorado.edu>
3397 3402
3398 3403 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3399 3404 names for verbose exceptions, when multiple dotted names and the
3400 3405 'parent' object were present on the same line.
3401 3406
3402 3407 2005-01-11 Fernando Perez <fperez@colorado.edu>
3403 3408
3404 3409 * IPython/genutils.py (flag_calls): new utility to trap and flag
3405 3410 calls in functions. I need it to clean up matplotlib support.
3406 3411 Also removed some deprecated code in genutils.
3407 3412
3408 3413 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3409 3414 that matplotlib scripts called with %run, which don't call show()
3410 3415 themselves, still have their plotting windows open.
3411 3416
3412 3417 2005-01-05 Fernando Perez <fperez@colorado.edu>
3413 3418
3414 3419 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3415 3420 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3416 3421
3417 3422 2004-12-19 Fernando Perez <fperez@colorado.edu>
3418 3423
3419 3424 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3420 3425 parent_runcode, which was an eyesore. The same result can be
3421 3426 obtained with Python's regular superclass mechanisms.
3422 3427
3423 3428 2004-12-17 Fernando Perez <fperez@colorado.edu>
3424 3429
3425 3430 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3426 3431 reported by Prabhu.
3427 3432 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3428 3433 sys.stderr) instead of explicitly calling sys.stderr. This helps
3429 3434 maintain our I/O abstractions clean, for future GUI embeddings.
3430 3435
3431 3436 * IPython/genutils.py (info): added new utility for sys.stderr
3432 3437 unified info message handling (thin wrapper around warn()).
3433 3438
3434 3439 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3435 3440 composite (dotted) names on verbose exceptions.
3436 3441 (VerboseTB.nullrepr): harden against another kind of errors which
3437 3442 Python's inspect module can trigger, and which were crashing
3438 3443 IPython. Thanks to a report by Marco Lombardi
3439 3444 <mlombard-AT-ma010192.hq.eso.org>.
3440 3445
3441 3446 2004-12-13 *** Released version 0.6.6
3442 3447
3443 3448 2004-12-12 Fernando Perez <fperez@colorado.edu>
3444 3449
3445 3450 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3446 3451 generated by pygtk upon initialization if it was built without
3447 3452 threads (for matplotlib users). After a crash reported by
3448 3453 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3449 3454
3450 3455 * IPython/ipmaker.py (make_IPython): fix small bug in the
3451 3456 import_some parameter for multiple imports.
3452 3457
3453 3458 * IPython/iplib.py (ipmagic): simplified the interface of
3454 3459 ipmagic() to take a single string argument, just as it would be
3455 3460 typed at the IPython cmd line.
3456 3461 (ipalias): Added new ipalias() with an interface identical to
3457 3462 ipmagic(). This completes exposing a pure python interface to the
3458 3463 alias and magic system, which can be used in loops or more complex
3459 3464 code where IPython's automatic line mangling is not active.
3460 3465
3461 3466 * IPython/genutils.py (timing): changed interface of timing to
3462 3467 simply run code once, which is the most common case. timings()
3463 3468 remains unchanged, for the cases where you want multiple runs.
3464 3469
3465 3470 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3466 3471 bug where Python2.2 crashes with exec'ing code which does not end
3467 3472 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3468 3473 before.
3469 3474
3470 3475 2004-12-10 Fernando Perez <fperez@colorado.edu>
3471 3476
3472 3477 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3473 3478 -t to -T, to accomodate the new -t flag in %run (the %run and
3474 3479 %prun options are kind of intermixed, and it's not easy to change
3475 3480 this with the limitations of python's getopt).
3476 3481
3477 3482 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3478 3483 the execution of scripts. It's not as fine-tuned as timeit.py,
3479 3484 but it works from inside ipython (and under 2.2, which lacks
3480 3485 timeit.py). Optionally a number of runs > 1 can be given for
3481 3486 timing very short-running code.
3482 3487
3483 3488 * IPython/genutils.py (uniq_stable): new routine which returns a
3484 3489 list of unique elements in any iterable, but in stable order of
3485 3490 appearance. I needed this for the ultraTB fixes, and it's a handy
3486 3491 utility.
3487 3492
3488 3493 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3489 3494 dotted names in Verbose exceptions. This had been broken since
3490 3495 the very start, now x.y will properly be printed in a Verbose
3491 3496 traceback, instead of x being shown and y appearing always as an
3492 3497 'undefined global'. Getting this to work was a bit tricky,
3493 3498 because by default python tokenizers are stateless. Saved by
3494 3499 python's ability to easily add a bit of state to an arbitrary
3495 3500 function (without needing to build a full-blown callable object).
3496 3501
3497 3502 Also big cleanup of this code, which had horrendous runtime
3498 3503 lookups of zillions of attributes for colorization. Moved all
3499 3504 this code into a few templates, which make it cleaner and quicker.
3500 3505
3501 3506 Printout quality was also improved for Verbose exceptions: one
3502 3507 variable per line, and memory addresses are printed (this can be
3503 3508 quite handy in nasty debugging situations, which is what Verbose
3504 3509 is for).
3505 3510
3506 3511 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3507 3512 the command line as scripts to be loaded by embedded instances.
3508 3513 Doing so has the potential for an infinite recursion if there are
3509 3514 exceptions thrown in the process. This fixes a strange crash
3510 3515 reported by Philippe MULLER <muller-AT-irit.fr>.
3511 3516
3512 3517 2004-12-09 Fernando Perez <fperez@colorado.edu>
3513 3518
3514 3519 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3515 3520 to reflect new names in matplotlib, which now expose the
3516 3521 matlab-compatible interface via a pylab module instead of the
3517 3522 'matlab' name. The new code is backwards compatible, so users of
3518 3523 all matplotlib versions are OK. Patch by J. Hunter.
3519 3524
3520 3525 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3521 3526 of __init__ docstrings for instances (class docstrings are already
3522 3527 automatically printed). Instances with customized docstrings
3523 3528 (indep. of the class) are also recognized and all 3 separate
3524 3529 docstrings are printed (instance, class, constructor). After some
3525 3530 comments/suggestions by J. Hunter.
3526 3531
3527 3532 2004-12-05 Fernando Perez <fperez@colorado.edu>
3528 3533
3529 3534 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3530 3535 warnings when tab-completion fails and triggers an exception.
3531 3536
3532 3537 2004-12-03 Fernando Perez <fperez@colorado.edu>
3533 3538
3534 3539 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3535 3540 be triggered when using 'run -p'. An incorrect option flag was
3536 3541 being set ('d' instead of 'D').
3537 3542 (manpage): fix missing escaped \- sign.
3538 3543
3539 3544 2004-11-30 *** Released version 0.6.5
3540 3545
3541 3546 2004-11-30 Fernando Perez <fperez@colorado.edu>
3542 3547
3543 3548 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3544 3549 setting with -d option.
3545 3550
3546 3551 * setup.py (docfiles): Fix problem where the doc glob I was using
3547 3552 was COMPLETELY BROKEN. It was giving the right files by pure
3548 3553 accident, but failed once I tried to include ipython.el. Note:
3549 3554 glob() does NOT allow you to do exclusion on multiple endings!
3550 3555
3551 3556 2004-11-29 Fernando Perez <fperez@colorado.edu>
3552 3557
3553 3558 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3554 3559 the manpage as the source. Better formatting & consistency.
3555 3560
3556 3561 * IPython/Magic.py (magic_run): Added new -d option, to run
3557 3562 scripts under the control of the python pdb debugger. Note that
3558 3563 this required changing the %prun option -d to -D, to avoid a clash
3559 3564 (since %run must pass options to %prun, and getopt is too dumb to
3560 3565 handle options with string values with embedded spaces). Thanks
3561 3566 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3562 3567 (magic_who_ls): added type matching to %who and %whos, so that one
3563 3568 can filter their output to only include variables of certain
3564 3569 types. Another suggestion by Matthew.
3565 3570 (magic_whos): Added memory summaries in kb and Mb for arrays.
3566 3571 (magic_who): Improve formatting (break lines every 9 vars).
3567 3572
3568 3573 2004-11-28 Fernando Perez <fperez@colorado.edu>
3569 3574
3570 3575 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3571 3576 cache when empty lines were present.
3572 3577
3573 3578 2004-11-24 Fernando Perez <fperez@colorado.edu>
3574 3579
3575 3580 * IPython/usage.py (__doc__): document the re-activated threading
3576 3581 options for WX and GTK.
3577 3582
3578 3583 2004-11-23 Fernando Perez <fperez@colorado.edu>
3579 3584
3580 3585 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3581 3586 the -wthread and -gthread options, along with a new -tk one to try
3582 3587 and coordinate Tk threading with wx/gtk. The tk support is very
3583 3588 platform dependent, since it seems to require Tcl and Tk to be
3584 3589 built with threads (Fedora1/2 appears NOT to have it, but in
3585 3590 Prabhu's Debian boxes it works OK). But even with some Tk
3586 3591 limitations, this is a great improvement.
3587 3592
3588 3593 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3589 3594 info in user prompts. Patch by Prabhu.
3590 3595
3591 3596 2004-11-18 Fernando Perez <fperez@colorado.edu>
3592 3597
3593 3598 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3594 3599 EOFErrors and bail, to avoid infinite loops if a non-terminating
3595 3600 file is fed into ipython. Patch submitted in issue 19 by user,
3596 3601 many thanks.
3597 3602
3598 3603 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3599 3604 autoquote/parens in continuation prompts, which can cause lots of
3600 3605 problems. Closes roundup issue 20.
3601 3606
3602 3607 2004-11-17 Fernando Perez <fperez@colorado.edu>
3603 3608
3604 3609 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3605 3610 reported as debian bug #280505. I'm not sure my local changelog
3606 3611 entry has the proper debian format (Jack?).
3607 3612
3608 3613 2004-11-08 *** Released version 0.6.4
3609 3614
3610 3615 2004-11-08 Fernando Perez <fperez@colorado.edu>
3611 3616
3612 3617 * IPython/iplib.py (init_readline): Fix exit message for Windows
3613 3618 when readline is active. Thanks to a report by Eric Jones
3614 3619 <eric-AT-enthought.com>.
3615 3620
3616 3621 2004-11-07 Fernando Perez <fperez@colorado.edu>
3617 3622
3618 3623 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3619 3624 sometimes seen by win2k/cygwin users.
3620 3625
3621 3626 2004-11-06 Fernando Perez <fperez@colorado.edu>
3622 3627
3623 3628 * IPython/iplib.py (interact): Change the handling of %Exit from
3624 3629 trying to propagate a SystemExit to an internal ipython flag.
3625 3630 This is less elegant than using Python's exception mechanism, but
3626 3631 I can't get that to work reliably with threads, so under -pylab
3627 3632 %Exit was hanging IPython. Cross-thread exception handling is
3628 3633 really a bitch. Thaks to a bug report by Stephen Walton
3629 3634 <stephen.walton-AT-csun.edu>.
3630 3635
3631 3636 2004-11-04 Fernando Perez <fperez@colorado.edu>
3632 3637
3633 3638 * IPython/iplib.py (raw_input_original): store a pointer to the
3634 3639 true raw_input to harden against code which can modify it
3635 3640 (wx.py.PyShell does this and would otherwise crash ipython).
3636 3641 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3637 3642
3638 3643 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3639 3644 Ctrl-C problem, which does not mess up the input line.
3640 3645
3641 3646 2004-11-03 Fernando Perez <fperez@colorado.edu>
3642 3647
3643 3648 * IPython/Release.py: Changed licensing to BSD, in all files.
3644 3649 (name): lowercase name for tarball/RPM release.
3645 3650
3646 3651 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3647 3652 use throughout ipython.
3648 3653
3649 3654 * IPython/Magic.py (Magic._ofind): Switch to using the new
3650 3655 OInspect.getdoc() function.
3651 3656
3652 3657 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3653 3658 of the line currently being canceled via Ctrl-C. It's extremely
3654 3659 ugly, but I don't know how to do it better (the problem is one of
3655 3660 handling cross-thread exceptions).
3656 3661
3657 3662 2004-10-28 Fernando Perez <fperez@colorado.edu>
3658 3663
3659 3664 * IPython/Shell.py (signal_handler): add signal handlers to trap
3660 3665 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3661 3666 report by Francesc Alted.
3662 3667
3663 3668 2004-10-21 Fernando Perez <fperez@colorado.edu>
3664 3669
3665 3670 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3666 3671 to % for pysh syntax extensions.
3667 3672
3668 3673 2004-10-09 Fernando Perez <fperez@colorado.edu>
3669 3674
3670 3675 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3671 3676 arrays to print a more useful summary, without calling str(arr).
3672 3677 This avoids the problem of extremely lengthy computations which
3673 3678 occur if arr is large, and appear to the user as a system lockup
3674 3679 with 100% cpu activity. After a suggestion by Kristian Sandberg
3675 3680 <Kristian.Sandberg@colorado.edu>.
3676 3681 (Magic.__init__): fix bug in global magic escapes not being
3677 3682 correctly set.
3678 3683
3679 3684 2004-10-08 Fernando Perez <fperez@colorado.edu>
3680 3685
3681 3686 * IPython/Magic.py (__license__): change to absolute imports of
3682 3687 ipython's own internal packages, to start adapting to the absolute
3683 3688 import requirement of PEP-328.
3684 3689
3685 3690 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3686 3691 files, and standardize author/license marks through the Release
3687 3692 module instead of having per/file stuff (except for files with
3688 3693 particular licenses, like the MIT/PSF-licensed codes).
3689 3694
3690 3695 * IPython/Debugger.py: remove dead code for python 2.1
3691 3696
3692 3697 2004-10-04 Fernando Perez <fperez@colorado.edu>
3693 3698
3694 3699 * IPython/iplib.py (ipmagic): New function for accessing magics
3695 3700 via a normal python function call.
3696 3701
3697 3702 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3698 3703 from '@' to '%', to accomodate the new @decorator syntax of python
3699 3704 2.4.
3700 3705
3701 3706 2004-09-29 Fernando Perez <fperez@colorado.edu>
3702 3707
3703 3708 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3704 3709 matplotlib.use to prevent running scripts which try to switch
3705 3710 interactive backends from within ipython. This will just crash
3706 3711 the python interpreter, so we can't allow it (but a detailed error
3707 3712 is given to the user).
3708 3713
3709 3714 2004-09-28 Fernando Perez <fperez@colorado.edu>
3710 3715
3711 3716 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3712 3717 matplotlib-related fixes so that using @run with non-matplotlib
3713 3718 scripts doesn't pop up spurious plot windows. This requires
3714 3719 matplotlib >= 0.63, where I had to make some changes as well.
3715 3720
3716 3721 * IPython/ipmaker.py (make_IPython): update version requirement to
3717 3722 python 2.2.
3718 3723
3719 3724 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3720 3725 banner arg for embedded customization.
3721 3726
3722 3727 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3723 3728 explicit uses of __IP as the IPython's instance name. Now things
3724 3729 are properly handled via the shell.name value. The actual code
3725 3730 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3726 3731 is much better than before. I'll clean things completely when the
3727 3732 magic stuff gets a real overhaul.
3728 3733
3729 3734 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3730 3735 minor changes to debian dir.
3731 3736
3732 3737 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3733 3738 pointer to the shell itself in the interactive namespace even when
3734 3739 a user-supplied dict is provided. This is needed for embedding
3735 3740 purposes (found by tests with Michel Sanner).
3736 3741
3737 3742 2004-09-27 Fernando Perez <fperez@colorado.edu>
3738 3743
3739 3744 * IPython/UserConfig/ipythonrc: remove []{} from
3740 3745 readline_remove_delims, so that things like [modname.<TAB> do
3741 3746 proper completion. This disables [].TAB, but that's a less common
3742 3747 case than module names in list comprehensions, for example.
3743 3748 Thanks to a report by Andrea Riciputi.
3744 3749
3745 3750 2004-09-09 Fernando Perez <fperez@colorado.edu>
3746 3751
3747 3752 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3748 3753 blocking problems in win32 and osx. Fix by John.
3749 3754
3750 3755 2004-09-08 Fernando Perez <fperez@colorado.edu>
3751 3756
3752 3757 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3753 3758 for Win32 and OSX. Fix by John Hunter.
3754 3759
3755 3760 2004-08-30 *** Released version 0.6.3
3756 3761
3757 3762 2004-08-30 Fernando Perez <fperez@colorado.edu>
3758 3763
3759 3764 * setup.py (isfile): Add manpages to list of dependent files to be
3760 3765 updated.
3761 3766
3762 3767 2004-08-27 Fernando Perez <fperez@colorado.edu>
3763 3768
3764 3769 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3765 3770 for now. They don't really work with standalone WX/GTK code
3766 3771 (though matplotlib IS working fine with both of those backends).
3767 3772 This will neeed much more testing. I disabled most things with
3768 3773 comments, so turning it back on later should be pretty easy.
3769 3774
3770 3775 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3771 3776 autocalling of expressions like r'foo', by modifying the line
3772 3777 split regexp. Closes
3773 3778 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3774 3779 Riley <ipythonbugs-AT-sabi.net>.
3775 3780 (InteractiveShell.mainloop): honor --nobanner with banner
3776 3781 extensions.
3777 3782
3778 3783 * IPython/Shell.py: Significant refactoring of all classes, so
3779 3784 that we can really support ALL matplotlib backends and threading
3780 3785 models (John spotted a bug with Tk which required this). Now we
3781 3786 should support single-threaded, WX-threads and GTK-threads, both
3782 3787 for generic code and for matplotlib.
3783 3788
3784 3789 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3785 3790 -pylab, to simplify things for users. Will also remove the pylab
3786 3791 profile, since now all of matplotlib configuration is directly
3787 3792 handled here. This also reduces startup time.
3788 3793
3789 3794 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3790 3795 shell wasn't being correctly called. Also in IPShellWX.
3791 3796
3792 3797 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3793 3798 fine-tune banner.
3794 3799
3795 3800 * IPython/numutils.py (spike): Deprecate these spike functions,
3796 3801 delete (long deprecated) gnuplot_exec handler.
3797 3802
3798 3803 2004-08-26 Fernando Perez <fperez@colorado.edu>
3799 3804
3800 3805 * ipython.1: Update for threading options, plus some others which
3801 3806 were missing.
3802 3807
3803 3808 * IPython/ipmaker.py (__call__): Added -wthread option for
3804 3809 wxpython thread handling. Make sure threading options are only
3805 3810 valid at the command line.
3806 3811
3807 3812 * scripts/ipython: moved shell selection into a factory function
3808 3813 in Shell.py, to keep the starter script to a minimum.
3809 3814
3810 3815 2004-08-25 Fernando Perez <fperez@colorado.edu>
3811 3816
3812 3817 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3813 3818 John. Along with some recent changes he made to matplotlib, the
3814 3819 next versions of both systems should work very well together.
3815 3820
3816 3821 2004-08-24 Fernando Perez <fperez@colorado.edu>
3817 3822
3818 3823 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3819 3824 tried to switch the profiling to using hotshot, but I'm getting
3820 3825 strange errors from prof.runctx() there. I may be misreading the
3821 3826 docs, but it looks weird. For now the profiling code will
3822 3827 continue to use the standard profiler.
3823 3828
3824 3829 2004-08-23 Fernando Perez <fperez@colorado.edu>
3825 3830
3826 3831 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3827 3832 threaded shell, by John Hunter. It's not quite ready yet, but
3828 3833 close.
3829 3834
3830 3835 2004-08-22 Fernando Perez <fperez@colorado.edu>
3831 3836
3832 3837 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3833 3838 in Magic and ultraTB.
3834 3839
3835 3840 * ipython.1: document threading options in manpage.
3836 3841
3837 3842 * scripts/ipython: Changed name of -thread option to -gthread,
3838 3843 since this is GTK specific. I want to leave the door open for a
3839 3844 -wthread option for WX, which will most likely be necessary. This
3840 3845 change affects usage and ipmaker as well.
3841 3846
3842 3847 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3843 3848 handle the matplotlib shell issues. Code by John Hunter
3844 3849 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3845 3850 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3846 3851 broken (and disabled for end users) for now, but it puts the
3847 3852 infrastructure in place.
3848 3853
3849 3854 2004-08-21 Fernando Perez <fperez@colorado.edu>
3850 3855
3851 3856 * ipythonrc-pylab: Add matplotlib support.
3852 3857
3853 3858 * matplotlib_config.py: new files for matplotlib support, part of
3854 3859 the pylab profile.
3855 3860
3856 3861 * IPython/usage.py (__doc__): documented the threading options.
3857 3862
3858 3863 2004-08-20 Fernando Perez <fperez@colorado.edu>
3859 3864
3860 3865 * ipython: Modified the main calling routine to handle the -thread
3861 3866 and -mpthread options. This needs to be done as a top-level hack,
3862 3867 because it determines which class to instantiate for IPython
3863 3868 itself.
3864 3869
3865 3870 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3866 3871 classes to support multithreaded GTK operation without blocking,
3867 3872 and matplotlib with all backends. This is a lot of still very
3868 3873 experimental code, and threads are tricky. So it may still have a
3869 3874 few rough edges... This code owes a lot to
3870 3875 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3871 3876 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3872 3877 to John Hunter for all the matplotlib work.
3873 3878
3874 3879 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3875 3880 options for gtk thread and matplotlib support.
3876 3881
3877 3882 2004-08-16 Fernando Perez <fperez@colorado.edu>
3878 3883
3879 3884 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3880 3885 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3881 3886 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3882 3887
3883 3888 2004-08-11 Fernando Perez <fperez@colorado.edu>
3884 3889
3885 3890 * setup.py (isfile): Fix build so documentation gets updated for
3886 3891 rpms (it was only done for .tgz builds).
3887 3892
3888 3893 2004-08-10 Fernando Perez <fperez@colorado.edu>
3889 3894
3890 3895 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3891 3896
3892 3897 * iplib.py : Silence syntax error exceptions in tab-completion.
3893 3898
3894 3899 2004-08-05 Fernando Perez <fperez@colorado.edu>
3895 3900
3896 3901 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3897 3902 'color off' mark for continuation prompts. This was causing long
3898 3903 continuation lines to mis-wrap.
3899 3904
3900 3905 2004-08-01 Fernando Perez <fperez@colorado.edu>
3901 3906
3902 3907 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3903 3908 for building ipython to be a parameter. All this is necessary
3904 3909 right now to have a multithreaded version, but this insane
3905 3910 non-design will be cleaned up soon. For now, it's a hack that
3906 3911 works.
3907 3912
3908 3913 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3909 3914 args in various places. No bugs so far, but it's a dangerous
3910 3915 practice.
3911 3916
3912 3917 2004-07-31 Fernando Perez <fperez@colorado.edu>
3913 3918
3914 3919 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3915 3920 fix completion of files with dots in their names under most
3916 3921 profiles (pysh was OK because the completion order is different).
3917 3922
3918 3923 2004-07-27 Fernando Perez <fperez@colorado.edu>
3919 3924
3920 3925 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3921 3926 keywords manually, b/c the one in keyword.py was removed in python
3922 3927 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3923 3928 This is NOT a bug under python 2.3 and earlier.
3924 3929
3925 3930 2004-07-26 Fernando Perez <fperez@colorado.edu>
3926 3931
3927 3932 * IPython/ultraTB.py (VerboseTB.text): Add another
3928 3933 linecache.checkcache() call to try to prevent inspect.py from
3929 3934 crashing under python 2.3. I think this fixes
3930 3935 http://www.scipy.net/roundup/ipython/issue17.
3931 3936
3932 3937 2004-07-26 *** Released version 0.6.2
3933 3938
3934 3939 2004-07-26 Fernando Perez <fperez@colorado.edu>
3935 3940
3936 3941 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3937 3942 fail for any number.
3938 3943 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3939 3944 empty bookmarks.
3940 3945
3941 3946 2004-07-26 *** Released version 0.6.1
3942 3947
3943 3948 2004-07-26 Fernando Perez <fperez@colorado.edu>
3944 3949
3945 3950 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3946 3951
3947 3952 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3948 3953 escaping '()[]{}' in filenames.
3949 3954
3950 3955 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3951 3956 Python 2.2 users who lack a proper shlex.split.
3952 3957
3953 3958 2004-07-19 Fernando Perez <fperez@colorado.edu>
3954 3959
3955 3960 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3956 3961 for reading readline's init file. I follow the normal chain:
3957 3962 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3958 3963 report by Mike Heeter. This closes
3959 3964 http://www.scipy.net/roundup/ipython/issue16.
3960 3965
3961 3966 2004-07-18 Fernando Perez <fperez@colorado.edu>
3962 3967
3963 3968 * IPython/iplib.py (__init__): Add better handling of '\' under
3964 3969 Win32 for filenames. After a patch by Ville.
3965 3970
3966 3971 2004-07-17 Fernando Perez <fperez@colorado.edu>
3967 3972
3968 3973 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3969 3974 autocalling would be triggered for 'foo is bar' if foo is
3970 3975 callable. I also cleaned up the autocall detection code to use a
3971 3976 regexp, which is faster. Bug reported by Alexander Schmolck.
3972 3977
3973 3978 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3974 3979 '?' in them would confuse the help system. Reported by Alex
3975 3980 Schmolck.
3976 3981
3977 3982 2004-07-16 Fernando Perez <fperez@colorado.edu>
3978 3983
3979 3984 * IPython/GnuplotInteractive.py (__all__): added plot2.
3980 3985
3981 3986 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3982 3987 plotting dictionaries, lists or tuples of 1d arrays.
3983 3988
3984 3989 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3985 3990 optimizations.
3986 3991
3987 3992 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3988 3993 the information which was there from Janko's original IPP code:
3989 3994
3990 3995 03.05.99 20:53 porto.ifm.uni-kiel.de
3991 3996 --Started changelog.
3992 3997 --make clear do what it say it does
3993 3998 --added pretty output of lines from inputcache
3994 3999 --Made Logger a mixin class, simplifies handling of switches
3995 4000 --Added own completer class. .string<TAB> expands to last history
3996 4001 line which starts with string. The new expansion is also present
3997 4002 with Ctrl-r from the readline library. But this shows, who this
3998 4003 can be done for other cases.
3999 4004 --Added convention that all shell functions should accept a
4000 4005 parameter_string This opens the door for different behaviour for
4001 4006 each function. @cd is a good example of this.
4002 4007
4003 4008 04.05.99 12:12 porto.ifm.uni-kiel.de
4004 4009 --added logfile rotation
4005 4010 --added new mainloop method which freezes first the namespace
4006 4011
4007 4012 07.05.99 21:24 porto.ifm.uni-kiel.de
4008 4013 --added the docreader classes. Now there is a help system.
4009 4014 -This is only a first try. Currently it's not easy to put new
4010 4015 stuff in the indices. But this is the way to go. Info would be
4011 4016 better, but HTML is every where and not everybody has an info
4012 4017 system installed and it's not so easy to change html-docs to info.
4013 4018 --added global logfile option
4014 4019 --there is now a hook for object inspection method pinfo needs to
4015 4020 be provided for this. Can be reached by two '??'.
4016 4021
4017 4022 08.05.99 20:51 porto.ifm.uni-kiel.de
4018 4023 --added a README
4019 4024 --bug in rc file. Something has changed so functions in the rc
4020 4025 file need to reference the shell and not self. Not clear if it's a
4021 4026 bug or feature.
4022 4027 --changed rc file for new behavior
4023 4028
4024 4029 2004-07-15 Fernando Perez <fperez@colorado.edu>
4025 4030
4026 4031 * IPython/Logger.py (Logger.log): fixed recent bug where the input
4027 4032 cache was falling out of sync in bizarre manners when multi-line
4028 4033 input was present. Minor optimizations and cleanup.
4029 4034
4030 4035 (Logger): Remove old Changelog info for cleanup. This is the
4031 4036 information which was there from Janko's original code:
4032 4037
4033 4038 Changes to Logger: - made the default log filename a parameter
4034 4039
4035 4040 - put a check for lines beginning with !@? in log(). Needed
4036 4041 (even if the handlers properly log their lines) for mid-session
4037 4042 logging activation to work properly. Without this, lines logged
4038 4043 in mid session, which get read from the cache, would end up
4039 4044 'bare' (with !@? in the open) in the log. Now they are caught
4040 4045 and prepended with a #.
4041 4046
4042 4047 * IPython/iplib.py (InteractiveShell.init_readline): added check
4043 4048 in case MagicCompleter fails to be defined, so we don't crash.
4044 4049
4045 4050 2004-07-13 Fernando Perez <fperez@colorado.edu>
4046 4051
4047 4052 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
4048 4053 of EPS if the requested filename ends in '.eps'.
4049 4054
4050 4055 2004-07-04 Fernando Perez <fperez@colorado.edu>
4051 4056
4052 4057 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
4053 4058 escaping of quotes when calling the shell.
4054 4059
4055 4060 2004-07-02 Fernando Perez <fperez@colorado.edu>
4056 4061
4057 4062 * IPython/Prompts.py (CachedOutput.update): Fix problem with
4058 4063 gettext not working because we were clobbering '_'. Fixes
4059 4064 http://www.scipy.net/roundup/ipython/issue6.
4060 4065
4061 4066 2004-07-01 Fernando Perez <fperez@colorado.edu>
4062 4067
4063 4068 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
4064 4069 into @cd. Patch by Ville.
4065 4070
4066 4071 * IPython/iplib.py (InteractiveShell.post_config_initialization):
4067 4072 new function to store things after ipmaker runs. Patch by Ville.
4068 4073 Eventually this will go away once ipmaker is removed and the class
4069 4074 gets cleaned up, but for now it's ok. Key functionality here is
4070 4075 the addition of the persistent storage mechanism, a dict for
4071 4076 keeping data across sessions (for now just bookmarks, but more can
4072 4077 be implemented later).
4073 4078
4074 4079 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
4075 4080 persistent across sections. Patch by Ville, I modified it
4076 4081 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
4077 4082 added a '-l' option to list all bookmarks.
4078 4083
4079 4084 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4080 4085 center for cleanup. Registered with atexit.register(). I moved
4081 4086 here the old exit_cleanup(). After a patch by Ville.
4082 4087
4083 4088 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4084 4089 characters in the hacked shlex_split for python 2.2.
4085 4090
4086 4091 * IPython/iplib.py (file_matches): more fixes to filenames with
4087 4092 whitespace in them. It's not perfect, but limitations in python's
4088 4093 readline make it impossible to go further.
4089 4094
4090 4095 2004-06-29 Fernando Perez <fperez@colorado.edu>
4091 4096
4092 4097 * IPython/iplib.py (file_matches): escape whitespace correctly in
4093 4098 filename completions. Bug reported by Ville.
4094 4099
4095 4100 2004-06-28 Fernando Perez <fperez@colorado.edu>
4096 4101
4097 4102 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4098 4103 the history file will be called 'history-PROFNAME' (or just
4099 4104 'history' if no profile is loaded). I was getting annoyed at
4100 4105 getting my Numerical work history clobbered by pysh sessions.
4101 4106
4102 4107 * IPython/iplib.py (InteractiveShell.__init__): Internal
4103 4108 getoutputerror() function so that we can honor the system_verbose
4104 4109 flag for _all_ system calls. I also added escaping of #
4105 4110 characters here to avoid confusing Itpl.
4106 4111
4107 4112 * IPython/Magic.py (shlex_split): removed call to shell in
4108 4113 parse_options and replaced it with shlex.split(). The annoying
4109 4114 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4110 4115 to backport it from 2.3, with several frail hacks (the shlex
4111 4116 module is rather limited in 2.2). Thanks to a suggestion by Ville
4112 4117 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4113 4118 problem.
4114 4119
4115 4120 (Magic.magic_system_verbose): new toggle to print the actual
4116 4121 system calls made by ipython. Mainly for debugging purposes.
4117 4122
4118 4123 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4119 4124 doesn't support persistence. Reported (and fix suggested) by
4120 4125 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4121 4126
4122 4127 2004-06-26 Fernando Perez <fperez@colorado.edu>
4123 4128
4124 4129 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4125 4130 continue prompts.
4126 4131
4127 4132 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4128 4133 function (basically a big docstring) and a few more things here to
4129 4134 speedup startup. pysh.py is now very lightweight. We want because
4130 4135 it gets execfile'd, while InterpreterExec gets imported, so
4131 4136 byte-compilation saves time.
4132 4137
4133 4138 2004-06-25 Fernando Perez <fperez@colorado.edu>
4134 4139
4135 4140 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4136 4141 -NUM', which was recently broken.
4137 4142
4138 4143 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4139 4144 in multi-line input (but not !!, which doesn't make sense there).
4140 4145
4141 4146 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4142 4147 It's just too useful, and people can turn it off in the less
4143 4148 common cases where it's a problem.
4144 4149
4145 4150 2004-06-24 Fernando Perez <fperez@colorado.edu>
4146 4151
4147 4152 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4148 4153 special syntaxes (like alias calling) is now allied in multi-line
4149 4154 input. This is still _very_ experimental, but it's necessary for
4150 4155 efficient shell usage combining python looping syntax with system
4151 4156 calls. For now it's restricted to aliases, I don't think it
4152 4157 really even makes sense to have this for magics.
4153 4158
4154 4159 2004-06-23 Fernando Perez <fperez@colorado.edu>
4155 4160
4156 4161 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4157 4162 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4158 4163
4159 4164 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4160 4165 extensions under Windows (after code sent by Gary Bishop). The
4161 4166 extensions considered 'executable' are stored in IPython's rc
4162 4167 structure as win_exec_ext.
4163 4168
4164 4169 * IPython/genutils.py (shell): new function, like system() but
4165 4170 without return value. Very useful for interactive shell work.
4166 4171
4167 4172 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4168 4173 delete aliases.
4169 4174
4170 4175 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4171 4176 sure that the alias table doesn't contain python keywords.
4172 4177
4173 4178 2004-06-21 Fernando Perez <fperez@colorado.edu>
4174 4179
4175 4180 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4176 4181 non-existent items are found in $PATH. Reported by Thorsten.
4177 4182
4178 4183 2004-06-20 Fernando Perez <fperez@colorado.edu>
4179 4184
4180 4185 * IPython/iplib.py (complete): modified the completer so that the
4181 4186 order of priorities can be easily changed at runtime.
4182 4187
4183 4188 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4184 4189 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4185 4190
4186 4191 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4187 4192 expand Python variables prepended with $ in all system calls. The
4188 4193 same was done to InteractiveShell.handle_shell_escape. Now all
4189 4194 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4190 4195 expansion of python variables and expressions according to the
4191 4196 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4192 4197
4193 4198 Though PEP-215 has been rejected, a similar (but simpler) one
4194 4199 seems like it will go into Python 2.4, PEP-292 -
4195 4200 http://www.python.org/peps/pep-0292.html.
4196 4201
4197 4202 I'll keep the full syntax of PEP-215, since IPython has since the
4198 4203 start used Ka-Ping Yee's reference implementation discussed there
4199 4204 (Itpl), and I actually like the powerful semantics it offers.
4200 4205
4201 4206 In order to access normal shell variables, the $ has to be escaped
4202 4207 via an extra $. For example:
4203 4208
4204 4209 In [7]: PATH='a python variable'
4205 4210
4206 4211 In [8]: !echo $PATH
4207 4212 a python variable
4208 4213
4209 4214 In [9]: !echo $$PATH
4210 4215 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4211 4216
4212 4217 (Magic.parse_options): escape $ so the shell doesn't evaluate
4213 4218 things prematurely.
4214 4219
4215 4220 * IPython/iplib.py (InteractiveShell.call_alias): added the
4216 4221 ability for aliases to expand python variables via $.
4217 4222
4218 4223 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4219 4224 system, now there's a @rehash/@rehashx pair of magics. These work
4220 4225 like the csh rehash command, and can be invoked at any time. They
4221 4226 build a table of aliases to everything in the user's $PATH
4222 4227 (@rehash uses everything, @rehashx is slower but only adds
4223 4228 executable files). With this, the pysh.py-based shell profile can
4224 4229 now simply call rehash upon startup, and full access to all
4225 4230 programs in the user's path is obtained.
4226 4231
4227 4232 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4228 4233 functionality is now fully in place. I removed the old dynamic
4229 4234 code generation based approach, in favor of a much lighter one
4230 4235 based on a simple dict. The advantage is that this allows me to
4231 4236 now have thousands of aliases with negligible cost (unthinkable
4232 4237 with the old system).
4233 4238
4234 4239 2004-06-19 Fernando Perez <fperez@colorado.edu>
4235 4240
4236 4241 * IPython/iplib.py (__init__): extended MagicCompleter class to
4237 4242 also complete (last in priority) on user aliases.
4238 4243
4239 4244 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4240 4245 call to eval.
4241 4246 (ItplNS.__init__): Added a new class which functions like Itpl,
4242 4247 but allows configuring the namespace for the evaluation to occur
4243 4248 in.
4244 4249
4245 4250 2004-06-18 Fernando Perez <fperez@colorado.edu>
4246 4251
4247 4252 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4248 4253 better message when 'exit' or 'quit' are typed (a common newbie
4249 4254 confusion).
4250 4255
4251 4256 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4252 4257 check for Windows users.
4253 4258
4254 4259 * IPython/iplib.py (InteractiveShell.user_setup): removed
4255 4260 disabling of colors for Windows. I'll test at runtime and issue a
4256 4261 warning if Gary's readline isn't found, as to nudge users to
4257 4262 download it.
4258 4263
4259 4264 2004-06-16 Fernando Perez <fperez@colorado.edu>
4260 4265
4261 4266 * IPython/genutils.py (Stream.__init__): changed to print errors
4262 4267 to sys.stderr. I had a circular dependency here. Now it's
4263 4268 possible to run ipython as IDLE's shell (consider this pre-alpha,
4264 4269 since true stdout things end up in the starting terminal instead
4265 4270 of IDLE's out).
4266 4271
4267 4272 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4268 4273 users who haven't # updated their prompt_in2 definitions. Remove
4269 4274 eventually.
4270 4275 (multiple_replace): added credit to original ASPN recipe.
4271 4276
4272 4277 2004-06-15 Fernando Perez <fperez@colorado.edu>
4273 4278
4274 4279 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4275 4280 list of auto-defined aliases.
4276 4281
4277 4282 2004-06-13 Fernando Perez <fperez@colorado.edu>
4278 4283
4279 4284 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4280 4285 install was really requested (so setup.py can be used for other
4281 4286 things under Windows).
4282 4287
4283 4288 2004-06-10 Fernando Perez <fperez@colorado.edu>
4284 4289
4285 4290 * IPython/Logger.py (Logger.create_log): Manually remove any old
4286 4291 backup, since os.remove may fail under Windows. Fixes bug
4287 4292 reported by Thorsten.
4288 4293
4289 4294 2004-06-09 Fernando Perez <fperez@colorado.edu>
4290 4295
4291 4296 * examples/example-embed.py: fixed all references to %n (replaced
4292 4297 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4293 4298 for all examples and the manual as well.
4294 4299
4295 4300 2004-06-08 Fernando Perez <fperez@colorado.edu>
4296 4301
4297 4302 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4298 4303 alignment and color management. All 3 prompt subsystems now
4299 4304 inherit from BasePrompt.
4300 4305
4301 4306 * tools/release: updates for windows installer build and tag rpms
4302 4307 with python version (since paths are fixed).
4303 4308
4304 4309 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4305 4310 which will become eventually obsolete. Also fixed the default
4306 4311 prompt_in2 to use \D, so at least new users start with the correct
4307 4312 defaults.
4308 4313 WARNING: Users with existing ipythonrc files will need to apply
4309 4314 this fix manually!
4310 4315
4311 4316 * setup.py: make windows installer (.exe). This is finally the
4312 4317 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4313 4318 which I hadn't included because it required Python 2.3 (or recent
4314 4319 distutils).
4315 4320
4316 4321 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4317 4322 usage of new '\D' escape.
4318 4323
4319 4324 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4320 4325 lacks os.getuid())
4321 4326 (CachedOutput.set_colors): Added the ability to turn coloring
4322 4327 on/off with @colors even for manually defined prompt colors. It
4323 4328 uses a nasty global, but it works safely and via the generic color
4324 4329 handling mechanism.
4325 4330 (Prompt2.__init__): Introduced new escape '\D' for continuation
4326 4331 prompts. It represents the counter ('\#') as dots.
4327 4332 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4328 4333 need to update their ipythonrc files and replace '%n' with '\D' in
4329 4334 their prompt_in2 settings everywhere. Sorry, but there's
4330 4335 otherwise no clean way to get all prompts to properly align. The
4331 4336 ipythonrc shipped with IPython has been updated.
4332 4337
4333 4338 2004-06-07 Fernando Perez <fperez@colorado.edu>
4334 4339
4335 4340 * setup.py (isfile): Pass local_icons option to latex2html, so the
4336 4341 resulting HTML file is self-contained. Thanks to
4337 4342 dryice-AT-liu.com.cn for the tip.
4338 4343
4339 4344 * pysh.py: I created a new profile 'shell', which implements a
4340 4345 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4341 4346 system shell, nor will it become one anytime soon. It's mainly
4342 4347 meant to illustrate the use of the new flexible bash-like prompts.
4343 4348 I guess it could be used by hardy souls for true shell management,
4344 4349 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4345 4350 profile. This uses the InterpreterExec extension provided by
4346 4351 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4347 4352
4348 4353 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4349 4354 auto-align itself with the length of the previous input prompt
4350 4355 (taking into account the invisible color escapes).
4351 4356 (CachedOutput.__init__): Large restructuring of this class. Now
4352 4357 all three prompts (primary1, primary2, output) are proper objects,
4353 4358 managed by the 'parent' CachedOutput class. The code is still a
4354 4359 bit hackish (all prompts share state via a pointer to the cache),
4355 4360 but it's overall far cleaner than before.
4356 4361
4357 4362 * IPython/genutils.py (getoutputerror): modified to add verbose,
4358 4363 debug and header options. This makes the interface of all getout*
4359 4364 functions uniform.
4360 4365 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4361 4366
4362 4367 * IPython/Magic.py (Magic.default_option): added a function to
4363 4368 allow registering default options for any magic command. This
4364 4369 makes it easy to have profiles which customize the magics globally
4365 4370 for a certain use. The values set through this function are
4366 4371 picked up by the parse_options() method, which all magics should
4367 4372 use to parse their options.
4368 4373
4369 4374 * IPython/genutils.py (warn): modified the warnings framework to
4370 4375 use the Term I/O class. I'm trying to slowly unify all of
4371 4376 IPython's I/O operations to pass through Term.
4372 4377
4373 4378 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4374 4379 the secondary prompt to correctly match the length of the primary
4375 4380 one for any prompt. Now multi-line code will properly line up
4376 4381 even for path dependent prompts, such as the new ones available
4377 4382 via the prompt_specials.
4378 4383
4379 4384 2004-06-06 Fernando Perez <fperez@colorado.edu>
4380 4385
4381 4386 * IPython/Prompts.py (prompt_specials): Added the ability to have
4382 4387 bash-like special sequences in the prompts, which get
4383 4388 automatically expanded. Things like hostname, current working
4384 4389 directory and username are implemented already, but it's easy to
4385 4390 add more in the future. Thanks to a patch by W.J. van der Laan
4386 4391 <gnufnork-AT-hetdigitalegat.nl>
4387 4392 (prompt_specials): Added color support for prompt strings, so
4388 4393 users can define arbitrary color setups for their prompts.
4389 4394
4390 4395 2004-06-05 Fernando Perez <fperez@colorado.edu>
4391 4396
4392 4397 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4393 4398 code to load Gary Bishop's readline and configure it
4394 4399 automatically. Thanks to Gary for help on this.
4395 4400
4396 4401 2004-06-01 Fernando Perez <fperez@colorado.edu>
4397 4402
4398 4403 * IPython/Logger.py (Logger.create_log): fix bug for logging
4399 4404 with no filename (previous fix was incomplete).
4400 4405
4401 4406 2004-05-25 Fernando Perez <fperez@colorado.edu>
4402 4407
4403 4408 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4404 4409 parens would get passed to the shell.
4405 4410
4406 4411 2004-05-20 Fernando Perez <fperez@colorado.edu>
4407 4412
4408 4413 * IPython/Magic.py (Magic.magic_prun): changed default profile
4409 4414 sort order to 'time' (the more common profiling need).
4410 4415
4411 4416 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4412 4417 so that source code shown is guaranteed in sync with the file on
4413 4418 disk (also changed in psource). Similar fix to the one for
4414 4419 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4415 4420 <yann.ledu-AT-noos.fr>.
4416 4421
4417 4422 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4418 4423 with a single option would not be correctly parsed. Closes
4419 4424 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4420 4425 introduced in 0.6.0 (on 2004-05-06).
4421 4426
4422 4427 2004-05-13 *** Released version 0.6.0
4423 4428
4424 4429 2004-05-13 Fernando Perez <fperez@colorado.edu>
4425 4430
4426 4431 * debian/: Added debian/ directory to CVS, so that debian support
4427 4432 is publicly accessible. The debian package is maintained by Jack
4428 4433 Moffit <jack-AT-xiph.org>.
4429 4434
4430 4435 * Documentation: included the notes about an ipython-based system
4431 4436 shell (the hypothetical 'pysh') into the new_design.pdf document,
4432 4437 so that these ideas get distributed to users along with the
4433 4438 official documentation.
4434 4439
4435 4440 2004-05-10 Fernando Perez <fperez@colorado.edu>
4436 4441
4437 4442 * IPython/Logger.py (Logger.create_log): fix recently introduced
4438 4443 bug (misindented line) where logstart would fail when not given an
4439 4444 explicit filename.
4440 4445
4441 4446 2004-05-09 Fernando Perez <fperez@colorado.edu>
4442 4447
4443 4448 * IPython/Magic.py (Magic.parse_options): skip system call when
4444 4449 there are no options to look for. Faster, cleaner for the common
4445 4450 case.
4446 4451
4447 4452 * Documentation: many updates to the manual: describing Windows
4448 4453 support better, Gnuplot updates, credits, misc small stuff. Also
4449 4454 updated the new_design doc a bit.
4450 4455
4451 4456 2004-05-06 *** Released version 0.6.0.rc1
4452 4457
4453 4458 2004-05-06 Fernando Perez <fperez@colorado.edu>
4454 4459
4455 4460 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4456 4461 operations to use the vastly more efficient list/''.join() method.
4457 4462 (FormattedTB.text): Fix
4458 4463 http://www.scipy.net/roundup/ipython/issue12 - exception source
4459 4464 extract not updated after reload. Thanks to Mike Salib
4460 4465 <msalib-AT-mit.edu> for pinning the source of the problem.
4461 4466 Fortunately, the solution works inside ipython and doesn't require
4462 4467 any changes to python proper.
4463 4468
4464 4469 * IPython/Magic.py (Magic.parse_options): Improved to process the
4465 4470 argument list as a true shell would (by actually using the
4466 4471 underlying system shell). This way, all @magics automatically get
4467 4472 shell expansion for variables. Thanks to a comment by Alex
4468 4473 Schmolck.
4469 4474
4470 4475 2004-04-04 Fernando Perez <fperez@colorado.edu>
4471 4476
4472 4477 * IPython/iplib.py (InteractiveShell.interact): Added a special
4473 4478 trap for a debugger quit exception, which is basically impossible
4474 4479 to handle by normal mechanisms, given what pdb does to the stack.
4475 4480 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4476 4481
4477 4482 2004-04-03 Fernando Perez <fperez@colorado.edu>
4478 4483
4479 4484 * IPython/genutils.py (Term): Standardized the names of the Term
4480 4485 class streams to cin/cout/cerr, following C++ naming conventions
4481 4486 (I can't use in/out/err because 'in' is not a valid attribute
4482 4487 name).
4483 4488
4484 4489 * IPython/iplib.py (InteractiveShell.interact): don't increment
4485 4490 the prompt if there's no user input. By Daniel 'Dang' Griffith
4486 4491 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4487 4492 Francois Pinard.
4488 4493
4489 4494 2004-04-02 Fernando Perez <fperez@colorado.edu>
4490 4495
4491 4496 * IPython/genutils.py (Stream.__init__): Modified to survive at
4492 4497 least importing in contexts where stdin/out/err aren't true file
4493 4498 objects, such as PyCrust (they lack fileno() and mode). However,
4494 4499 the recovery facilities which rely on these things existing will
4495 4500 not work.
4496 4501
4497 4502 2004-04-01 Fernando Perez <fperez@colorado.edu>
4498 4503
4499 4504 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4500 4505 use the new getoutputerror() function, so it properly
4501 4506 distinguishes stdout/err.
4502 4507
4503 4508 * IPython/genutils.py (getoutputerror): added a function to
4504 4509 capture separately the standard output and error of a command.
4505 4510 After a comment from dang on the mailing lists. This code is
4506 4511 basically a modified version of commands.getstatusoutput(), from
4507 4512 the standard library.
4508 4513
4509 4514 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4510 4515 '!!' as a special syntax (shorthand) to access @sx.
4511 4516
4512 4517 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4513 4518 command and return its output as a list split on '\n'.
4514 4519
4515 4520 2004-03-31 Fernando Perez <fperez@colorado.edu>
4516 4521
4517 4522 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4518 4523 method to dictionaries used as FakeModule instances if they lack
4519 4524 it. At least pydoc in python2.3 breaks for runtime-defined
4520 4525 functions without this hack. At some point I need to _really_
4521 4526 understand what FakeModule is doing, because it's a gross hack.
4522 4527 But it solves Arnd's problem for now...
4523 4528
4524 4529 2004-02-27 Fernando Perez <fperez@colorado.edu>
4525 4530
4526 4531 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4527 4532 mode would behave erratically. Also increased the number of
4528 4533 possible logs in rotate mod to 999. Thanks to Rod Holland
4529 4534 <rhh@StructureLABS.com> for the report and fixes.
4530 4535
4531 4536 2004-02-26 Fernando Perez <fperez@colorado.edu>
4532 4537
4533 4538 * IPython/genutils.py (page): Check that the curses module really
4534 4539 has the initscr attribute before trying to use it. For some
4535 4540 reason, the Solaris curses module is missing this. I think this
4536 4541 should be considered a Solaris python bug, but I'm not sure.
4537 4542
4538 4543 2004-01-17 Fernando Perez <fperez@colorado.edu>
4539 4544
4540 4545 * IPython/genutils.py (Stream.__init__): Changes to try to make
4541 4546 ipython robust against stdin/out/err being closed by the user.
4542 4547 This is 'user error' (and blocks a normal python session, at least
4543 4548 the stdout case). However, Ipython should be able to survive such
4544 4549 instances of abuse as gracefully as possible. To simplify the
4545 4550 coding and maintain compatibility with Gary Bishop's Term
4546 4551 contributions, I've made use of classmethods for this. I think
4547 4552 this introduces a dependency on python 2.2.
4548 4553
4549 4554 2004-01-13 Fernando Perez <fperez@colorado.edu>
4550 4555
4551 4556 * IPython/numutils.py (exp_safe): simplified the code a bit and
4552 4557 removed the need for importing the kinds module altogether.
4553 4558
4554 4559 2004-01-06 Fernando Perez <fperez@colorado.edu>
4555 4560
4556 4561 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4557 4562 a magic function instead, after some community feedback. No
4558 4563 special syntax will exist for it, but its name is deliberately
4559 4564 very short.
4560 4565
4561 4566 2003-12-20 Fernando Perez <fperez@colorado.edu>
4562 4567
4563 4568 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4564 4569 new functionality, to automagically assign the result of a shell
4565 4570 command to a variable. I'll solicit some community feedback on
4566 4571 this before making it permanent.
4567 4572
4568 4573 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4569 4574 requested about callables for which inspect couldn't obtain a
4570 4575 proper argspec. Thanks to a crash report sent by Etienne
4571 4576 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4572 4577
4573 4578 2003-12-09 Fernando Perez <fperez@colorado.edu>
4574 4579
4575 4580 * IPython/genutils.py (page): patch for the pager to work across
4576 4581 various versions of Windows. By Gary Bishop.
4577 4582
4578 4583 2003-12-04 Fernando Perez <fperez@colorado.edu>
4579 4584
4580 4585 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4581 4586 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4582 4587 While I tested this and it looks ok, there may still be corner
4583 4588 cases I've missed.
4584 4589
4585 4590 2003-12-01 Fernando Perez <fperez@colorado.edu>
4586 4591
4587 4592 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4588 4593 where a line like 'p,q=1,2' would fail because the automagic
4589 4594 system would be triggered for @p.
4590 4595
4591 4596 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4592 4597 cleanups, code unmodified.
4593 4598
4594 4599 * IPython/genutils.py (Term): added a class for IPython to handle
4595 4600 output. In most cases it will just be a proxy for stdout/err, but
4596 4601 having this allows modifications to be made for some platforms,
4597 4602 such as handling color escapes under Windows. All of this code
4598 4603 was contributed by Gary Bishop, with minor modifications by me.
4599 4604 The actual changes affect many files.
4600 4605
4601 4606 2003-11-30 Fernando Perez <fperez@colorado.edu>
4602 4607
4603 4608 * IPython/iplib.py (file_matches): new completion code, courtesy
4604 4609 of Jeff Collins. This enables filename completion again under
4605 4610 python 2.3, which disabled it at the C level.
4606 4611
4607 4612 2003-11-11 Fernando Perez <fperez@colorado.edu>
4608 4613
4609 4614 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4610 4615 for Numeric.array(map(...)), but often convenient.
4611 4616
4612 4617 2003-11-05 Fernando Perez <fperez@colorado.edu>
4613 4618
4614 4619 * IPython/numutils.py (frange): Changed a call from int() to
4615 4620 int(round()) to prevent a problem reported with arange() in the
4616 4621 numpy list.
4617 4622
4618 4623 2003-10-06 Fernando Perez <fperez@colorado.edu>
4619 4624
4620 4625 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4621 4626 prevent crashes if sys lacks an argv attribute (it happens with
4622 4627 embedded interpreters which build a bare-bones sys module).
4623 4628 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4624 4629
4625 4630 2003-09-24 Fernando Perez <fperez@colorado.edu>
4626 4631
4627 4632 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4628 4633 to protect against poorly written user objects where __getattr__
4629 4634 raises exceptions other than AttributeError. Thanks to a bug
4630 4635 report by Oliver Sander <osander-AT-gmx.de>.
4631 4636
4632 4637 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4633 4638 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4634 4639
4635 4640 2003-09-09 Fernando Perez <fperez@colorado.edu>
4636 4641
4637 4642 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4638 4643 unpacking a list whith a callable as first element would
4639 4644 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4640 4645 Collins.
4641 4646
4642 4647 2003-08-25 *** Released version 0.5.0
4643 4648
4644 4649 2003-08-22 Fernando Perez <fperez@colorado.edu>
4645 4650
4646 4651 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4647 4652 improperly defined user exceptions. Thanks to feedback from Mark
4648 4653 Russell <mrussell-AT-verio.net>.
4649 4654
4650 4655 2003-08-20 Fernando Perez <fperez@colorado.edu>
4651 4656
4652 4657 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4653 4658 printing so that it would print multi-line string forms starting
4654 4659 with a new line. This way the formatting is better respected for
4655 4660 objects which work hard to make nice string forms.
4656 4661
4657 4662 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4658 4663 autocall would overtake data access for objects with both
4659 4664 __getitem__ and __call__.
4660 4665
4661 4666 2003-08-19 *** Released version 0.5.0-rc1
4662 4667
4663 4668 2003-08-19 Fernando Perez <fperez@colorado.edu>
4664 4669
4665 4670 * IPython/deep_reload.py (load_tail): single tiny change here
4666 4671 seems to fix the long-standing bug of dreload() failing to work
4667 4672 for dotted names. But this module is pretty tricky, so I may have
4668 4673 missed some subtlety. Needs more testing!.
4669 4674
4670 4675 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4671 4676 exceptions which have badly implemented __str__ methods.
4672 4677 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4673 4678 which I've been getting reports about from Python 2.3 users. I
4674 4679 wish I had a simple test case to reproduce the problem, so I could
4675 4680 either write a cleaner workaround or file a bug report if
4676 4681 necessary.
4677 4682
4678 4683 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4679 4684 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4680 4685 a bug report by Tjabo Kloppenburg.
4681 4686
4682 4687 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4683 4688 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4684 4689 seems rather unstable. Thanks to a bug report by Tjabo
4685 4690 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4686 4691
4687 4692 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4688 4693 this out soon because of the critical fixes in the inner loop for
4689 4694 generators.
4690 4695
4691 4696 * IPython/Magic.py (Magic.getargspec): removed. This (and
4692 4697 _get_def) have been obsoleted by OInspect for a long time, I
4693 4698 hadn't noticed that they were dead code.
4694 4699 (Magic._ofind): restored _ofind functionality for a few literals
4695 4700 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4696 4701 for things like "hello".capitalize?, since that would require a
4697 4702 potentially dangerous eval() again.
4698 4703
4699 4704 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4700 4705 logic a bit more to clean up the escapes handling and minimize the
4701 4706 use of _ofind to only necessary cases. The interactive 'feel' of
4702 4707 IPython should have improved quite a bit with the changes in
4703 4708 _prefilter and _ofind (besides being far safer than before).
4704 4709
4705 4710 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4706 4711 obscure, never reported). Edit would fail to find the object to
4707 4712 edit under some circumstances.
4708 4713 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4709 4714 which were causing double-calling of generators. Those eval calls
4710 4715 were _very_ dangerous, since code with side effects could be
4711 4716 triggered. As they say, 'eval is evil'... These were the
4712 4717 nastiest evals in IPython. Besides, _ofind is now far simpler,
4713 4718 and it should also be quite a bit faster. Its use of inspect is
4714 4719 also safer, so perhaps some of the inspect-related crashes I've
4715 4720 seen lately with Python 2.3 might be taken care of. That will
4716 4721 need more testing.
4717 4722
4718 4723 2003-08-17 Fernando Perez <fperez@colorado.edu>
4719 4724
4720 4725 * IPython/iplib.py (InteractiveShell._prefilter): significant
4721 4726 simplifications to the logic for handling user escapes. Faster
4722 4727 and simpler code.
4723 4728
4724 4729 2003-08-14 Fernando Perez <fperez@colorado.edu>
4725 4730
4726 4731 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4727 4732 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4728 4733 but it should be quite a bit faster. And the recursive version
4729 4734 generated O(log N) intermediate storage for all rank>1 arrays,
4730 4735 even if they were contiguous.
4731 4736 (l1norm): Added this function.
4732 4737 (norm): Added this function for arbitrary norms (including
4733 4738 l-infinity). l1 and l2 are still special cases for convenience
4734 4739 and speed.
4735 4740
4736 4741 2003-08-03 Fernando Perez <fperez@colorado.edu>
4737 4742
4738 4743 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4739 4744 exceptions, which now raise PendingDeprecationWarnings in Python
4740 4745 2.3. There were some in Magic and some in Gnuplot2.
4741 4746
4742 4747 2003-06-30 Fernando Perez <fperez@colorado.edu>
4743 4748
4744 4749 * IPython/genutils.py (page): modified to call curses only for
4745 4750 terminals where TERM=='xterm'. After problems under many other
4746 4751 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4747 4752
4748 4753 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4749 4754 would be triggered when readline was absent. This was just an old
4750 4755 debugging statement I'd forgotten to take out.
4751 4756
4752 4757 2003-06-20 Fernando Perez <fperez@colorado.edu>
4753 4758
4754 4759 * IPython/genutils.py (clock): modified to return only user time
4755 4760 (not counting system time), after a discussion on scipy. While
4756 4761 system time may be a useful quantity occasionally, it may much
4757 4762 more easily be skewed by occasional swapping or other similar
4758 4763 activity.
4759 4764
4760 4765 2003-06-05 Fernando Perez <fperez@colorado.edu>
4761 4766
4762 4767 * IPython/numutils.py (identity): new function, for building
4763 4768 arbitrary rank Kronecker deltas (mostly backwards compatible with
4764 4769 Numeric.identity)
4765 4770
4766 4771 2003-06-03 Fernando Perez <fperez@colorado.edu>
4767 4772
4768 4773 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4769 4774 arguments passed to magics with spaces, to allow trailing '\' to
4770 4775 work normally (mainly for Windows users).
4771 4776
4772 4777 2003-05-29 Fernando Perez <fperez@colorado.edu>
4773 4778
4774 4779 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4775 4780 instead of pydoc.help. This fixes a bizarre behavior where
4776 4781 printing '%s' % locals() would trigger the help system. Now
4777 4782 ipython behaves like normal python does.
4778 4783
4779 4784 Note that if one does 'from pydoc import help', the bizarre
4780 4785 behavior returns, but this will also happen in normal python, so
4781 4786 it's not an ipython bug anymore (it has to do with how pydoc.help
4782 4787 is implemented).
4783 4788
4784 4789 2003-05-22 Fernando Perez <fperez@colorado.edu>
4785 4790
4786 4791 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4787 4792 return [] instead of None when nothing matches, also match to end
4788 4793 of line. Patch by Gary Bishop.
4789 4794
4790 4795 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4791 4796 protection as before, for files passed on the command line. This
4792 4797 prevents the CrashHandler from kicking in if user files call into
4793 4798 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4794 4799 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4795 4800
4796 4801 2003-05-20 *** Released version 0.4.0
4797 4802
4798 4803 2003-05-20 Fernando Perez <fperez@colorado.edu>
4799 4804
4800 4805 * setup.py: added support for manpages. It's a bit hackish b/c of
4801 4806 a bug in the way the bdist_rpm distutils target handles gzipped
4802 4807 manpages, but it works. After a patch by Jack.
4803 4808
4804 4809 2003-05-19 Fernando Perez <fperez@colorado.edu>
4805 4810
4806 4811 * IPython/numutils.py: added a mockup of the kinds module, since
4807 4812 it was recently removed from Numeric. This way, numutils will
4808 4813 work for all users even if they are missing kinds.
4809 4814
4810 4815 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4811 4816 failure, which can occur with SWIG-wrapped extensions. After a
4812 4817 crash report from Prabhu.
4813 4818
4814 4819 2003-05-16 Fernando Perez <fperez@colorado.edu>
4815 4820
4816 4821 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4817 4822 protect ipython from user code which may call directly
4818 4823 sys.excepthook (this looks like an ipython crash to the user, even
4819 4824 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4820 4825 This is especially important to help users of WxWindows, but may
4821 4826 also be useful in other cases.
4822 4827
4823 4828 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4824 4829 an optional tb_offset to be specified, and to preserve exception
4825 4830 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4826 4831
4827 4832 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4828 4833
4829 4834 2003-05-15 Fernando Perez <fperez@colorado.edu>
4830 4835
4831 4836 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4832 4837 installing for a new user under Windows.
4833 4838
4834 4839 2003-05-12 Fernando Perez <fperez@colorado.edu>
4835 4840
4836 4841 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4837 4842 handler for Emacs comint-based lines. Currently it doesn't do
4838 4843 much (but importantly, it doesn't update the history cache). In
4839 4844 the future it may be expanded if Alex needs more functionality
4840 4845 there.
4841 4846
4842 4847 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4843 4848 info to crash reports.
4844 4849
4845 4850 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4846 4851 just like Python's -c. Also fixed crash with invalid -color
4847 4852 option value at startup. Thanks to Will French
4848 4853 <wfrench-AT-bestweb.net> for the bug report.
4849 4854
4850 4855 2003-05-09 Fernando Perez <fperez@colorado.edu>
4851 4856
4852 4857 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4853 4858 to EvalDict (it's a mapping, after all) and simplified its code
4854 4859 quite a bit, after a nice discussion on c.l.py where Gustavo
4855 4860 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4856 4861
4857 4862 2003-04-30 Fernando Perez <fperez@colorado.edu>
4858 4863
4859 4864 * IPython/genutils.py (timings_out): modified it to reduce its
4860 4865 overhead in the common reps==1 case.
4861 4866
4862 4867 2003-04-29 Fernando Perez <fperez@colorado.edu>
4863 4868
4864 4869 * IPython/genutils.py (timings_out): Modified to use the resource
4865 4870 module, which avoids the wraparound problems of time.clock().
4866 4871
4867 4872 2003-04-17 *** Released version 0.2.15pre4
4868 4873
4869 4874 2003-04-17 Fernando Perez <fperez@colorado.edu>
4870 4875
4871 4876 * setup.py (scriptfiles): Split windows-specific stuff over to a
4872 4877 separate file, in an attempt to have a Windows GUI installer.
4873 4878 That didn't work, but part of the groundwork is done.
4874 4879
4875 4880 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4876 4881 indent/unindent with 4 spaces. Particularly useful in combination
4877 4882 with the new auto-indent option.
4878 4883
4879 4884 2003-04-16 Fernando Perez <fperez@colorado.edu>
4880 4885
4881 4886 * IPython/Magic.py: various replacements of self.rc for
4882 4887 self.shell.rc. A lot more remains to be done to fully disentangle
4883 4888 this class from the main Shell class.
4884 4889
4885 4890 * IPython/GnuplotRuntime.py: added checks for mouse support so
4886 4891 that we don't try to enable it if the current gnuplot doesn't
4887 4892 really support it. Also added checks so that we don't try to
4888 4893 enable persist under Windows (where Gnuplot doesn't recognize the
4889 4894 option).
4890 4895
4891 4896 * IPython/iplib.py (InteractiveShell.interact): Added optional
4892 4897 auto-indenting code, after a patch by King C. Shu
4893 4898 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4894 4899 get along well with pasting indented code. If I ever figure out
4895 4900 how to make that part go well, it will become on by default.
4896 4901
4897 4902 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4898 4903 crash ipython if there was an unmatched '%' in the user's prompt
4899 4904 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4900 4905
4901 4906 * IPython/iplib.py (InteractiveShell.interact): removed the
4902 4907 ability to ask the user whether he wants to crash or not at the
4903 4908 'last line' exception handler. Calling functions at that point
4904 4909 changes the stack, and the error reports would have incorrect
4905 4910 tracebacks.
4906 4911
4907 4912 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4908 4913 pass through a peger a pretty-printed form of any object. After a
4909 4914 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4910 4915
4911 4916 2003-04-14 Fernando Perez <fperez@colorado.edu>
4912 4917
4913 4918 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4914 4919 all files in ~ would be modified at first install (instead of
4915 4920 ~/.ipython). This could be potentially disastrous, as the
4916 4921 modification (make line-endings native) could damage binary files.
4917 4922
4918 4923 2003-04-10 Fernando Perez <fperez@colorado.edu>
4919 4924
4920 4925 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4921 4926 handle only lines which are invalid python. This now means that
4922 4927 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4923 4928 for the bug report.
4924 4929
4925 4930 2003-04-01 Fernando Perez <fperez@colorado.edu>
4926 4931
4927 4932 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4928 4933 where failing to set sys.last_traceback would crash pdb.pm().
4929 4934 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4930 4935 report.
4931 4936
4932 4937 2003-03-25 Fernando Perez <fperez@colorado.edu>
4933 4938
4934 4939 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4935 4940 before printing it (it had a lot of spurious blank lines at the
4936 4941 end).
4937 4942
4938 4943 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4939 4944 output would be sent 21 times! Obviously people don't use this
4940 4945 too often, or I would have heard about it.
4941 4946
4942 4947 2003-03-24 Fernando Perez <fperez@colorado.edu>
4943 4948
4944 4949 * setup.py (scriptfiles): renamed the data_files parameter from
4945 4950 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4946 4951 for the patch.
4947 4952
4948 4953 2003-03-20 Fernando Perez <fperez@colorado.edu>
4949 4954
4950 4955 * IPython/genutils.py (error): added error() and fatal()
4951 4956 functions.
4952 4957
4953 4958 2003-03-18 *** Released version 0.2.15pre3
4954 4959
4955 4960 2003-03-18 Fernando Perez <fperez@colorado.edu>
4956 4961
4957 4962 * setupext/install_data_ext.py
4958 4963 (install_data_ext.initialize_options): Class contributed by Jack
4959 4964 Moffit for fixing the old distutils hack. He is sending this to
4960 4965 the distutils folks so in the future we may not need it as a
4961 4966 private fix.
4962 4967
4963 4968 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4964 4969 changes for Debian packaging. See his patch for full details.
4965 4970 The old distutils hack of making the ipythonrc* files carry a
4966 4971 bogus .py extension is gone, at last. Examples were moved to a
4967 4972 separate subdir under doc/, and the separate executable scripts
4968 4973 now live in their own directory. Overall a great cleanup. The
4969 4974 manual was updated to use the new files, and setup.py has been
4970 4975 fixed for this setup.
4971 4976
4972 4977 * IPython/PyColorize.py (Parser.usage): made non-executable and
4973 4978 created a pycolor wrapper around it to be included as a script.
4974 4979
4975 4980 2003-03-12 *** Released version 0.2.15pre2
4976 4981
4977 4982 2003-03-12 Fernando Perez <fperez@colorado.edu>
4978 4983
4979 4984 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4980 4985 long-standing problem with garbage characters in some terminals.
4981 4986 The issue was really that the \001 and \002 escapes must _only_ be
4982 4987 passed to input prompts (which call readline), but _never_ to
4983 4988 normal text to be printed on screen. I changed ColorANSI to have
4984 4989 two classes: TermColors and InputTermColors, each with the
4985 4990 appropriate escapes for input prompts or normal text. The code in
4986 4991 Prompts.py got slightly more complicated, but this very old and
4987 4992 annoying bug is finally fixed.
4988 4993
4989 4994 All the credit for nailing down the real origin of this problem
4990 4995 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4991 4996 *Many* thanks to him for spending quite a bit of effort on this.
4992 4997
4993 4998 2003-03-05 *** Released version 0.2.15pre1
4994 4999
4995 5000 2003-03-03 Fernando Perez <fperez@colorado.edu>
4996 5001
4997 5002 * IPython/FakeModule.py: Moved the former _FakeModule to a
4998 5003 separate file, because it's also needed by Magic (to fix a similar
4999 5004 pickle-related issue in @run).
5000 5005
5001 5006 2003-03-02 Fernando Perez <fperez@colorado.edu>
5002 5007
5003 5008 * IPython/Magic.py (Magic.magic_autocall): new magic to control
5004 5009 the autocall option at runtime.
5005 5010 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
5006 5011 across Magic.py to start separating Magic from InteractiveShell.
5007 5012 (Magic._ofind): Fixed to return proper namespace for dotted
5008 5013 names. Before, a dotted name would always return 'not currently
5009 5014 defined', because it would find the 'parent'. s.x would be found,
5010 5015 but since 'x' isn't defined by itself, it would get confused.
5011 5016 (Magic.magic_run): Fixed pickling problems reported by Ralf
5012 5017 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
5013 5018 that I'd used when Mike Heeter reported similar issues at the
5014 5019 top-level, but now for @run. It boils down to injecting the
5015 5020 namespace where code is being executed with something that looks
5016 5021 enough like a module to fool pickle.dump(). Since a pickle stores
5017 5022 a named reference to the importing module, we need this for
5018 5023 pickles to save something sensible.
5019 5024
5020 5025 * IPython/ipmaker.py (make_IPython): added an autocall option.
5021 5026
5022 5027 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
5023 5028 the auto-eval code. Now autocalling is an option, and the code is
5024 5029 also vastly safer. There is no more eval() involved at all.
5025 5030
5026 5031 2003-03-01 Fernando Perez <fperez@colorado.edu>
5027 5032
5028 5033 * IPython/Magic.py (Magic._ofind): Changed interface to return a
5029 5034 dict with named keys instead of a tuple.
5030 5035
5031 5036 * IPython: Started using CVS for IPython as of 0.2.15pre1.
5032 5037
5033 5038 * setup.py (make_shortcut): Fixed message about directories
5034 5039 created during Windows installation (the directories were ok, just
5035 5040 the printed message was misleading). Thanks to Chris Liechti
5036 5041 <cliechti-AT-gmx.net> for the heads up.
5037 5042
5038 5043 2003-02-21 Fernando Perez <fperez@colorado.edu>
5039 5044
5040 5045 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
5041 5046 of ValueError exception when checking for auto-execution. This
5042 5047 one is raised by things like Numeric arrays arr.flat when the
5043 5048 array is non-contiguous.
5044 5049
5045 5050 2003-01-31 Fernando Perez <fperez@colorado.edu>
5046 5051
5047 5052 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
5048 5053 not return any value at all (even though the command would get
5049 5054 executed).
5050 5055 (xsys): Flush stdout right after printing the command to ensure
5051 5056 proper ordering of commands and command output in the total
5052 5057 output.
5053 5058 (SystemExec/xsys/bq): Switched the names of xsys/bq and
5054 5059 system/getoutput as defaults. The old ones are kept for
5055 5060 compatibility reasons, so no code which uses this library needs
5056 5061 changing.
5057 5062
5058 5063 2003-01-27 *** Released version 0.2.14
5059 5064
5060 5065 2003-01-25 Fernando Perez <fperez@colorado.edu>
5061 5066
5062 5067 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
5063 5068 functions defined in previous edit sessions could not be re-edited
5064 5069 (because the temp files were immediately removed). Now temp files
5065 5070 are removed only at IPython's exit.
5066 5071 (Magic.magic_run): Improved @run to perform shell-like expansions
5067 5072 on its arguments (~users and $VARS). With this, @run becomes more
5068 5073 like a normal command-line.
5069 5074
5070 5075 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
5071 5076 bugs related to embedding and cleaned up that code. A fairly
5072 5077 important one was the impossibility to access the global namespace
5073 5078 through the embedded IPython (only local variables were visible).
5074 5079
5075 5080 2003-01-14 Fernando Perez <fperez@colorado.edu>
5076 5081
5077 5082 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
5078 5083 auto-calling to be a bit more conservative. Now it doesn't get
5079 5084 triggered if any of '!=()<>' are in the rest of the input line, to
5080 5085 allow comparing callables. Thanks to Alex for the heads up.
5081 5086
5082 5087 2003-01-07 Fernando Perez <fperez@colorado.edu>
5083 5088
5084 5089 * IPython/genutils.py (page): fixed estimation of the number of
5085 5090 lines in a string to be paged to simply count newlines. This
5086 5091 prevents over-guessing due to embedded escape sequences. A better
5087 5092 long-term solution would involve stripping out the control chars
5088 5093 for the count, but it's potentially so expensive I just don't
5089 5094 think it's worth doing.
5090 5095
5091 5096 2002-12-19 *** Released version 0.2.14pre50
5092 5097
5093 5098 2002-12-19 Fernando Perez <fperez@colorado.edu>
5094 5099
5095 5100 * tools/release (version): Changed release scripts to inform
5096 5101 Andrea and build a NEWS file with a list of recent changes.
5097 5102
5098 5103 * IPython/ColorANSI.py (__all__): changed terminal detection
5099 5104 code. Seems to work better for xterms without breaking
5100 5105 konsole. Will need more testing to determine if WinXP and Mac OSX
5101 5106 also work ok.
5102 5107
5103 5108 2002-12-18 *** Released version 0.2.14pre49
5104 5109
5105 5110 2002-12-18 Fernando Perez <fperez@colorado.edu>
5106 5111
5107 5112 * Docs: added new info about Mac OSX, from Andrea.
5108 5113
5109 5114 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5110 5115 allow direct plotting of python strings whose format is the same
5111 5116 of gnuplot data files.
5112 5117
5113 5118 2002-12-16 Fernando Perez <fperez@colorado.edu>
5114 5119
5115 5120 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5116 5121 value of exit question to be acknowledged.
5117 5122
5118 5123 2002-12-03 Fernando Perez <fperez@colorado.edu>
5119 5124
5120 5125 * IPython/ipmaker.py: removed generators, which had been added
5121 5126 by mistake in an earlier debugging run. This was causing trouble
5122 5127 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5123 5128 for pointing this out.
5124 5129
5125 5130 2002-11-17 Fernando Perez <fperez@colorado.edu>
5126 5131
5127 5132 * Manual: updated the Gnuplot section.
5128 5133
5129 5134 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5130 5135 a much better split of what goes in Runtime and what goes in
5131 5136 Interactive.
5132 5137
5133 5138 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5134 5139 being imported from iplib.
5135 5140
5136 5141 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5137 5142 for command-passing. Now the global Gnuplot instance is called
5138 5143 'gp' instead of 'g', which was really a far too fragile and
5139 5144 common name.
5140 5145
5141 5146 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5142 5147 bounding boxes generated by Gnuplot for square plots.
5143 5148
5144 5149 * IPython/genutils.py (popkey): new function added. I should
5145 5150 suggest this on c.l.py as a dict method, it seems useful.
5146 5151
5147 5152 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5148 5153 to transparently handle PostScript generation. MUCH better than
5149 5154 the previous plot_eps/replot_eps (which I removed now). The code
5150 5155 is also fairly clean and well documented now (including
5151 5156 docstrings).
5152 5157
5153 5158 2002-11-13 Fernando Perez <fperez@colorado.edu>
5154 5159
5155 5160 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5156 5161 (inconsistent with options).
5157 5162
5158 5163 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5159 5164 manually disabled, I don't know why. Fixed it.
5160 5165 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5161 5166 eps output.
5162 5167
5163 5168 2002-11-12 Fernando Perez <fperez@colorado.edu>
5164 5169
5165 5170 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5166 5171 don't propagate up to caller. Fixes crash reported by François
5167 5172 Pinard.
5168 5173
5169 5174 2002-11-09 Fernando Perez <fperez@colorado.edu>
5170 5175
5171 5176 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5172 5177 history file for new users.
5173 5178 (make_IPython): fixed bug where initial install would leave the
5174 5179 user running in the .ipython dir.
5175 5180 (make_IPython): fixed bug where config dir .ipython would be
5176 5181 created regardless of the given -ipythondir option. Thanks to Cory
5177 5182 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5178 5183
5179 5184 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5180 5185 type confirmations. Will need to use it in all of IPython's code
5181 5186 consistently.
5182 5187
5183 5188 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5184 5189 context to print 31 lines instead of the default 5. This will make
5185 5190 the crash reports extremely detailed in case the problem is in
5186 5191 libraries I don't have access to.
5187 5192
5188 5193 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5189 5194 line of defense' code to still crash, but giving users fair
5190 5195 warning. I don't want internal errors to go unreported: if there's
5191 5196 an internal problem, IPython should crash and generate a full
5192 5197 report.
5193 5198
5194 5199 2002-11-08 Fernando Perez <fperez@colorado.edu>
5195 5200
5196 5201 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5197 5202 otherwise uncaught exceptions which can appear if people set
5198 5203 sys.stdout to something badly broken. Thanks to a crash report
5199 5204 from henni-AT-mail.brainbot.com.
5200 5205
5201 5206 2002-11-04 Fernando Perez <fperez@colorado.edu>
5202 5207
5203 5208 * IPython/iplib.py (InteractiveShell.interact): added
5204 5209 __IPYTHON__active to the builtins. It's a flag which goes on when
5205 5210 the interaction starts and goes off again when it stops. This
5206 5211 allows embedding code to detect being inside IPython. Before this
5207 5212 was done via __IPYTHON__, but that only shows that an IPython
5208 5213 instance has been created.
5209 5214
5210 5215 * IPython/Magic.py (Magic.magic_env): I realized that in a
5211 5216 UserDict, instance.data holds the data as a normal dict. So I
5212 5217 modified @env to return os.environ.data instead of rebuilding a
5213 5218 dict by hand.
5214 5219
5215 5220 2002-11-02 Fernando Perez <fperez@colorado.edu>
5216 5221
5217 5222 * IPython/genutils.py (warn): changed so that level 1 prints no
5218 5223 header. Level 2 is now the default (with 'WARNING' header, as
5219 5224 before). I think I tracked all places where changes were needed in
5220 5225 IPython, but outside code using the old level numbering may have
5221 5226 broken.
5222 5227
5223 5228 * IPython/iplib.py (InteractiveShell.runcode): added this to
5224 5229 handle the tracebacks in SystemExit traps correctly. The previous
5225 5230 code (through interact) was printing more of the stack than
5226 5231 necessary, showing IPython internal code to the user.
5227 5232
5228 5233 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5229 5234 default. Now that the default at the confirmation prompt is yes,
5230 5235 it's not so intrusive. François' argument that ipython sessions
5231 5236 tend to be complex enough not to lose them from an accidental C-d,
5232 5237 is a valid one.
5233 5238
5234 5239 * IPython/iplib.py (InteractiveShell.interact): added a
5235 5240 showtraceback() call to the SystemExit trap, and modified the exit
5236 5241 confirmation to have yes as the default.
5237 5242
5238 5243 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5239 5244 this file. It's been gone from the code for a long time, this was
5240 5245 simply leftover junk.
5241 5246
5242 5247 2002-11-01 Fernando Perez <fperez@colorado.edu>
5243 5248
5244 5249 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5245 5250 added. If set, IPython now traps EOF and asks for
5246 5251 confirmation. After a request by François Pinard.
5247 5252
5248 5253 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5249 5254 of @abort, and with a new (better) mechanism for handling the
5250 5255 exceptions.
5251 5256
5252 5257 2002-10-27 Fernando Perez <fperez@colorado.edu>
5253 5258
5254 5259 * IPython/usage.py (__doc__): updated the --help information and
5255 5260 the ipythonrc file to indicate that -log generates
5256 5261 ./ipython.log. Also fixed the corresponding info in @logstart.
5257 5262 This and several other fixes in the manuals thanks to reports by
5258 5263 François Pinard <pinard-AT-iro.umontreal.ca>.
5259 5264
5260 5265 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5261 5266 refer to @logstart (instead of @log, which doesn't exist).
5262 5267
5263 5268 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5264 5269 AttributeError crash. Thanks to Christopher Armstrong
5265 5270 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5266 5271 introduced recently (in 0.2.14pre37) with the fix to the eval
5267 5272 problem mentioned below.
5268 5273
5269 5274 2002-10-17 Fernando Perez <fperez@colorado.edu>
5270 5275
5271 5276 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5272 5277 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5273 5278
5274 5279 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5275 5280 this function to fix a problem reported by Alex Schmolck. He saw
5276 5281 it with list comprehensions and generators, which were getting
5277 5282 called twice. The real problem was an 'eval' call in testing for
5278 5283 automagic which was evaluating the input line silently.
5279 5284
5280 5285 This is a potentially very nasty bug, if the input has side
5281 5286 effects which must not be repeated. The code is much cleaner now,
5282 5287 without any blanket 'except' left and with a regexp test for
5283 5288 actual function names.
5284 5289
5285 5290 But an eval remains, which I'm not fully comfortable with. I just
5286 5291 don't know how to find out if an expression could be a callable in
5287 5292 the user's namespace without doing an eval on the string. However
5288 5293 that string is now much more strictly checked so that no code
5289 5294 slips by, so the eval should only happen for things that can
5290 5295 really be only function/method names.
5291 5296
5292 5297 2002-10-15 Fernando Perez <fperez@colorado.edu>
5293 5298
5294 5299 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5295 5300 OSX information to main manual, removed README_Mac_OSX file from
5296 5301 distribution. Also updated credits for recent additions.
5297 5302
5298 5303 2002-10-10 Fernando Perez <fperez@colorado.edu>
5299 5304
5300 5305 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5301 5306 terminal-related issues. Many thanks to Andrea Riciputi
5302 5307 <andrea.riciputi-AT-libero.it> for writing it.
5303 5308
5304 5309 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5305 5310 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5306 5311
5307 5312 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5308 5313 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5309 5314 <syver-en-AT-online.no> who both submitted patches for this problem.
5310 5315
5311 5316 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5312 5317 global embedding to make sure that things don't overwrite user
5313 5318 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5314 5319
5315 5320 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5316 5321 compatibility. Thanks to Hayden Callow
5317 5322 <h.callow-AT-elec.canterbury.ac.nz>
5318 5323
5319 5324 2002-10-04 Fernando Perez <fperez@colorado.edu>
5320 5325
5321 5326 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5322 5327 Gnuplot.File objects.
5323 5328
5324 5329 2002-07-23 Fernando Perez <fperez@colorado.edu>
5325 5330
5326 5331 * IPython/genutils.py (timing): Added timings() and timing() for
5327 5332 quick access to the most commonly needed data, the execution
5328 5333 times. Old timing() renamed to timings_out().
5329 5334
5330 5335 2002-07-18 Fernando Perez <fperez@colorado.edu>
5331 5336
5332 5337 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5333 5338 bug with nested instances disrupting the parent's tab completion.
5334 5339
5335 5340 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5336 5341 all_completions code to begin the emacs integration.
5337 5342
5338 5343 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5339 5344 argument to allow titling individual arrays when plotting.
5340 5345
5341 5346 2002-07-15 Fernando Perez <fperez@colorado.edu>
5342 5347
5343 5348 * setup.py (make_shortcut): changed to retrieve the value of
5344 5349 'Program Files' directory from the registry (this value changes in
5345 5350 non-english versions of Windows). Thanks to Thomas Fanslau
5346 5351 <tfanslau-AT-gmx.de> for the report.
5347 5352
5348 5353 2002-07-10 Fernando Perez <fperez@colorado.edu>
5349 5354
5350 5355 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5351 5356 a bug in pdb, which crashes if a line with only whitespace is
5352 5357 entered. Bug report submitted to sourceforge.
5353 5358
5354 5359 2002-07-09 Fernando Perez <fperez@colorado.edu>
5355 5360
5356 5361 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5357 5362 reporting exceptions (it's a bug in inspect.py, I just set a
5358 5363 workaround).
5359 5364
5360 5365 2002-07-08 Fernando Perez <fperez@colorado.edu>
5361 5366
5362 5367 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5363 5368 __IPYTHON__ in __builtins__ to show up in user_ns.
5364 5369
5365 5370 2002-07-03 Fernando Perez <fperez@colorado.edu>
5366 5371
5367 5372 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5368 5373 name from @gp_set_instance to @gp_set_default.
5369 5374
5370 5375 * IPython/ipmaker.py (make_IPython): default editor value set to
5371 5376 '0' (a string), to match the rc file. Otherwise will crash when
5372 5377 .strip() is called on it.
5373 5378
5374 5379
5375 5380 2002-06-28 Fernando Perez <fperez@colorado.edu>
5376 5381
5377 5382 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5378 5383 of files in current directory when a file is executed via
5379 5384 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5380 5385
5381 5386 * setup.py (manfiles): fix for rpm builds, submitted by RA
5382 5387 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5383 5388
5384 5389 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5385 5390 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5386 5391 string!). A. Schmolck caught this one.
5387 5392
5388 5393 2002-06-27 Fernando Perez <fperez@colorado.edu>
5389 5394
5390 5395 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5391 5396 defined files at the cmd line. __name__ wasn't being set to
5392 5397 __main__.
5393 5398
5394 5399 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5395 5400 regular lists and tuples besides Numeric arrays.
5396 5401
5397 5402 * IPython/Prompts.py (CachedOutput.__call__): Added output
5398 5403 supression for input ending with ';'. Similar to Mathematica and
5399 5404 Matlab. The _* vars and Out[] list are still updated, just like
5400 5405 Mathematica behaves.
5401 5406
5402 5407 2002-06-25 Fernando Perez <fperez@colorado.edu>
5403 5408
5404 5409 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5405 5410 .ini extensions for profiels under Windows.
5406 5411
5407 5412 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5408 5413 string form. Fix contributed by Alexander Schmolck
5409 5414 <a.schmolck-AT-gmx.net>
5410 5415
5411 5416 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5412 5417 pre-configured Gnuplot instance.
5413 5418
5414 5419 2002-06-21 Fernando Perez <fperez@colorado.edu>
5415 5420
5416 5421 * IPython/numutils.py (exp_safe): new function, works around the
5417 5422 underflow problems in Numeric.
5418 5423 (log2): New fn. Safe log in base 2: returns exact integer answer
5419 5424 for exact integer powers of 2.
5420 5425
5421 5426 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5422 5427 properly.
5423 5428
5424 5429 2002-06-20 Fernando Perez <fperez@colorado.edu>
5425 5430
5426 5431 * IPython/genutils.py (timing): new function like
5427 5432 Mathematica's. Similar to time_test, but returns more info.
5428 5433
5429 5434 2002-06-18 Fernando Perez <fperez@colorado.edu>
5430 5435
5431 5436 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5432 5437 according to Mike Heeter's suggestions.
5433 5438
5434 5439 2002-06-16 Fernando Perez <fperez@colorado.edu>
5435 5440
5436 5441 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5437 5442 system. GnuplotMagic is gone as a user-directory option. New files
5438 5443 make it easier to use all the gnuplot stuff both from external
5439 5444 programs as well as from IPython. Had to rewrite part of
5440 5445 hardcopy() b/c of a strange bug: often the ps files simply don't
5441 5446 get created, and require a repeat of the command (often several
5442 5447 times).
5443 5448
5444 5449 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5445 5450 resolve output channel at call time, so that if sys.stderr has
5446 5451 been redirected by user this gets honored.
5447 5452
5448 5453 2002-06-13 Fernando Perez <fperez@colorado.edu>
5449 5454
5450 5455 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5451 5456 IPShell. Kept a copy with the old names to avoid breaking people's
5452 5457 embedded code.
5453 5458
5454 5459 * IPython/ipython: simplified it to the bare minimum after
5455 5460 Holger's suggestions. Added info about how to use it in
5456 5461 PYTHONSTARTUP.
5457 5462
5458 5463 * IPython/Shell.py (IPythonShell): changed the options passing
5459 5464 from a string with funky %s replacements to a straight list. Maybe
5460 5465 a bit more typing, but it follows sys.argv conventions, so there's
5461 5466 less special-casing to remember.
5462 5467
5463 5468 2002-06-12 Fernando Perez <fperez@colorado.edu>
5464 5469
5465 5470 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5466 5471 command. Thanks to a suggestion by Mike Heeter.
5467 5472 (Magic.magic_pfile): added behavior to look at filenames if given
5468 5473 arg is not a defined object.
5469 5474 (Magic.magic_save): New @save function to save code snippets. Also
5470 5475 a Mike Heeter idea.
5471 5476
5472 5477 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5473 5478 plot() and replot(). Much more convenient now, especially for
5474 5479 interactive use.
5475 5480
5476 5481 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5477 5482 filenames.
5478 5483
5479 5484 2002-06-02 Fernando Perez <fperez@colorado.edu>
5480 5485
5481 5486 * IPython/Struct.py (Struct.__init__): modified to admit
5482 5487 initialization via another struct.
5483 5488
5484 5489 * IPython/genutils.py (SystemExec.__init__): New stateful
5485 5490 interface to xsys and bq. Useful for writing system scripts.
5486 5491
5487 5492 2002-05-30 Fernando Perez <fperez@colorado.edu>
5488 5493
5489 5494 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5490 5495 documents. This will make the user download smaller (it's getting
5491 5496 too big).
5492 5497
5493 5498 2002-05-29 Fernando Perez <fperez@colorado.edu>
5494 5499
5495 5500 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5496 5501 fix problems with shelve and pickle. Seems to work, but I don't
5497 5502 know if corner cases break it. Thanks to Mike Heeter
5498 5503 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5499 5504
5500 5505 2002-05-24 Fernando Perez <fperez@colorado.edu>
5501 5506
5502 5507 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5503 5508 macros having broken.
5504 5509
5505 5510 2002-05-21 Fernando Perez <fperez@colorado.edu>
5506 5511
5507 5512 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5508 5513 introduced logging bug: all history before logging started was
5509 5514 being written one character per line! This came from the redesign
5510 5515 of the input history as a special list which slices to strings,
5511 5516 not to lists.
5512 5517
5513 5518 2002-05-20 Fernando Perez <fperez@colorado.edu>
5514 5519
5515 5520 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5516 5521 be an attribute of all classes in this module. The design of these
5517 5522 classes needs some serious overhauling.
5518 5523
5519 5524 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5520 5525 which was ignoring '_' in option names.
5521 5526
5522 5527 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5523 5528 'Verbose_novars' to 'Context' and made it the new default. It's a
5524 5529 bit more readable and also safer than verbose.
5525 5530
5526 5531 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5527 5532 triple-quoted strings.
5528 5533
5529 5534 * IPython/OInspect.py (__all__): new module exposing the object
5530 5535 introspection facilities. Now the corresponding magics are dummy
5531 5536 wrappers around this. Having this module will make it much easier
5532 5537 to put these functions into our modified pdb.
5533 5538 This new object inspector system uses the new colorizing module,
5534 5539 so source code and other things are nicely syntax highlighted.
5535 5540
5536 5541 2002-05-18 Fernando Perez <fperez@colorado.edu>
5537 5542
5538 5543 * IPython/ColorANSI.py: Split the coloring tools into a separate
5539 5544 module so I can use them in other code easier (they were part of
5540 5545 ultraTB).
5541 5546
5542 5547 2002-05-17 Fernando Perez <fperez@colorado.edu>
5543 5548
5544 5549 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5545 5550 fixed it to set the global 'g' also to the called instance, as
5546 5551 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5547 5552 user's 'g' variables).
5548 5553
5549 5554 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5550 5555 global variables (aliases to _ih,_oh) so that users which expect
5551 5556 In[5] or Out[7] to work aren't unpleasantly surprised.
5552 5557 (InputList.__getslice__): new class to allow executing slices of
5553 5558 input history directly. Very simple class, complements the use of
5554 5559 macros.
5555 5560
5556 5561 2002-05-16 Fernando Perez <fperez@colorado.edu>
5557 5562
5558 5563 * setup.py (docdirbase): make doc directory be just doc/IPython
5559 5564 without version numbers, it will reduce clutter for users.
5560 5565
5561 5566 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5562 5567 execfile call to prevent possible memory leak. See for details:
5563 5568 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5564 5569
5565 5570 2002-05-15 Fernando Perez <fperez@colorado.edu>
5566 5571
5567 5572 * IPython/Magic.py (Magic.magic_psource): made the object
5568 5573 introspection names be more standard: pdoc, pdef, pfile and
5569 5574 psource. They all print/page their output, and it makes
5570 5575 remembering them easier. Kept old names for compatibility as
5571 5576 aliases.
5572 5577
5573 5578 2002-05-14 Fernando Perez <fperez@colorado.edu>
5574 5579
5575 5580 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5576 5581 what the mouse problem was. The trick is to use gnuplot with temp
5577 5582 files and NOT with pipes (for data communication), because having
5578 5583 both pipes and the mouse on is bad news.
5579 5584
5580 5585 2002-05-13 Fernando Perez <fperez@colorado.edu>
5581 5586
5582 5587 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5583 5588 bug. Information would be reported about builtins even when
5584 5589 user-defined functions overrode them.
5585 5590
5586 5591 2002-05-11 Fernando Perez <fperez@colorado.edu>
5587 5592
5588 5593 * IPython/__init__.py (__all__): removed FlexCompleter from
5589 5594 __all__ so that things don't fail in platforms without readline.
5590 5595
5591 5596 2002-05-10 Fernando Perez <fperez@colorado.edu>
5592 5597
5593 5598 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5594 5599 it requires Numeric, effectively making Numeric a dependency for
5595 5600 IPython.
5596 5601
5597 5602 * Released 0.2.13
5598 5603
5599 5604 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5600 5605 profiler interface. Now all the major options from the profiler
5601 5606 module are directly supported in IPython, both for single
5602 5607 expressions (@prun) and for full programs (@run -p).
5603 5608
5604 5609 2002-05-09 Fernando Perez <fperez@colorado.edu>
5605 5610
5606 5611 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5607 5612 magic properly formatted for screen.
5608 5613
5609 5614 * setup.py (make_shortcut): Changed things to put pdf version in
5610 5615 doc/ instead of doc/manual (had to change lyxport a bit).
5611 5616
5612 5617 * IPython/Magic.py (Profile.string_stats): made profile runs go
5613 5618 through pager (they are long and a pager allows searching, saving,
5614 5619 etc.)
5615 5620
5616 5621 2002-05-08 Fernando Perez <fperez@colorado.edu>
5617 5622
5618 5623 * Released 0.2.12
5619 5624
5620 5625 2002-05-06 Fernando Perez <fperez@colorado.edu>
5621 5626
5622 5627 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5623 5628 introduced); 'hist n1 n2' was broken.
5624 5629 (Magic.magic_pdb): added optional on/off arguments to @pdb
5625 5630 (Magic.magic_run): added option -i to @run, which executes code in
5626 5631 the IPython namespace instead of a clean one. Also added @irun as
5627 5632 an alias to @run -i.
5628 5633
5629 5634 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5630 5635 fixed (it didn't really do anything, the namespaces were wrong).
5631 5636
5632 5637 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5633 5638
5634 5639 * IPython/__init__.py (__all__): Fixed package namespace, now
5635 5640 'import IPython' does give access to IPython.<all> as
5636 5641 expected. Also renamed __release__ to Release.
5637 5642
5638 5643 * IPython/Debugger.py (__license__): created new Pdb class which
5639 5644 functions like a drop-in for the normal pdb.Pdb but does NOT
5640 5645 import readline by default. This way it doesn't muck up IPython's
5641 5646 readline handling, and now tab-completion finally works in the
5642 5647 debugger -- sort of. It completes things globally visible, but the
5643 5648 completer doesn't track the stack as pdb walks it. That's a bit
5644 5649 tricky, and I'll have to implement it later.
5645 5650
5646 5651 2002-05-05 Fernando Perez <fperez@colorado.edu>
5647 5652
5648 5653 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5649 5654 magic docstrings when printed via ? (explicit \'s were being
5650 5655 printed).
5651 5656
5652 5657 * IPython/ipmaker.py (make_IPython): fixed namespace
5653 5658 identification bug. Now variables loaded via logs or command-line
5654 5659 files are recognized in the interactive namespace by @who.
5655 5660
5656 5661 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5657 5662 log replay system stemming from the string form of Structs.
5658 5663
5659 5664 * IPython/Magic.py (Macro.__init__): improved macros to properly
5660 5665 handle magic commands in them.
5661 5666 (Magic.magic_logstart): usernames are now expanded so 'logstart
5662 5667 ~/mylog' now works.
5663 5668
5664 5669 * IPython/iplib.py (complete): fixed bug where paths starting with
5665 5670 '/' would be completed as magic names.
5666 5671
5667 5672 2002-05-04 Fernando Perez <fperez@colorado.edu>
5668 5673
5669 5674 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5670 5675 allow running full programs under the profiler's control.
5671 5676
5672 5677 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5673 5678 mode to report exceptions verbosely but without formatting
5674 5679 variables. This addresses the issue of ipython 'freezing' (it's
5675 5680 not frozen, but caught in an expensive formatting loop) when huge
5676 5681 variables are in the context of an exception.
5677 5682 (VerboseTB.text): Added '--->' markers at line where exception was
5678 5683 triggered. Much clearer to read, especially in NoColor modes.
5679 5684
5680 5685 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5681 5686 implemented in reverse when changing to the new parse_options().
5682 5687
5683 5688 2002-05-03 Fernando Perez <fperez@colorado.edu>
5684 5689
5685 5690 * IPython/Magic.py (Magic.parse_options): new function so that
5686 5691 magics can parse options easier.
5687 5692 (Magic.magic_prun): new function similar to profile.run(),
5688 5693 suggested by Chris Hart.
5689 5694 (Magic.magic_cd): fixed behavior so that it only changes if
5690 5695 directory actually is in history.
5691 5696
5692 5697 * IPython/usage.py (__doc__): added information about potential
5693 5698 slowness of Verbose exception mode when there are huge data
5694 5699 structures to be formatted (thanks to Archie Paulson).
5695 5700
5696 5701 * IPython/ipmaker.py (make_IPython): Changed default logging
5697 5702 (when simply called with -log) to use curr_dir/ipython.log in
5698 5703 rotate mode. Fixed crash which was occuring with -log before
5699 5704 (thanks to Jim Boyle).
5700 5705
5701 5706 2002-05-01 Fernando Perez <fperez@colorado.edu>
5702 5707
5703 5708 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5704 5709 was nasty -- though somewhat of a corner case).
5705 5710
5706 5711 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5707 5712 text (was a bug).
5708 5713
5709 5714 2002-04-30 Fernando Perez <fperez@colorado.edu>
5710 5715
5711 5716 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5712 5717 a print after ^D or ^C from the user so that the In[] prompt
5713 5718 doesn't over-run the gnuplot one.
5714 5719
5715 5720 2002-04-29 Fernando Perez <fperez@colorado.edu>
5716 5721
5717 5722 * Released 0.2.10
5718 5723
5719 5724 * IPython/__release__.py (version): get date dynamically.
5720 5725
5721 5726 * Misc. documentation updates thanks to Arnd's comments. Also ran
5722 5727 a full spellcheck on the manual (hadn't been done in a while).
5723 5728
5724 5729 2002-04-27 Fernando Perez <fperez@colorado.edu>
5725 5730
5726 5731 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5727 5732 starting a log in mid-session would reset the input history list.
5728 5733
5729 5734 2002-04-26 Fernando Perez <fperez@colorado.edu>
5730 5735
5731 5736 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5732 5737 all files were being included in an update. Now anything in
5733 5738 UserConfig that matches [A-Za-z]*.py will go (this excludes
5734 5739 __init__.py)
5735 5740
5736 5741 2002-04-25 Fernando Perez <fperez@colorado.edu>
5737 5742
5738 5743 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5739 5744 to __builtins__ so that any form of embedded or imported code can
5740 5745 test for being inside IPython.
5741 5746
5742 5747 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5743 5748 changed to GnuplotMagic because it's now an importable module,
5744 5749 this makes the name follow that of the standard Gnuplot module.
5745 5750 GnuplotMagic can now be loaded at any time in mid-session.
5746 5751
5747 5752 2002-04-24 Fernando Perez <fperez@colorado.edu>
5748 5753
5749 5754 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5750 5755 the globals (IPython has its own namespace) and the
5751 5756 PhysicalQuantity stuff is much better anyway.
5752 5757
5753 5758 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5754 5759 embedding example to standard user directory for
5755 5760 distribution. Also put it in the manual.
5756 5761
5757 5762 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5758 5763 instance as first argument (so it doesn't rely on some obscure
5759 5764 hidden global).
5760 5765
5761 5766 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5762 5767 delimiters. While it prevents ().TAB from working, it allows
5763 5768 completions in open (... expressions. This is by far a more common
5764 5769 case.
5765 5770
5766 5771 2002-04-23 Fernando Perez <fperez@colorado.edu>
5767 5772
5768 5773 * IPython/Extensions/InterpreterPasteInput.py: new
5769 5774 syntax-processing module for pasting lines with >>> or ... at the
5770 5775 start.
5771 5776
5772 5777 * IPython/Extensions/PhysicalQ_Interactive.py
5773 5778 (PhysicalQuantityInteractive.__int__): fixed to work with either
5774 5779 Numeric or math.
5775 5780
5776 5781 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5777 5782 provided profiles. Now we have:
5778 5783 -math -> math module as * and cmath with its own namespace.
5779 5784 -numeric -> Numeric as *, plus gnuplot & grace
5780 5785 -physics -> same as before
5781 5786
5782 5787 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5783 5788 user-defined magics wouldn't be found by @magic if they were
5784 5789 defined as class methods. Also cleaned up the namespace search
5785 5790 logic and the string building (to use %s instead of many repeated
5786 5791 string adds).
5787 5792
5788 5793 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5789 5794 of user-defined magics to operate with class methods (cleaner, in
5790 5795 line with the gnuplot code).
5791 5796
5792 5797 2002-04-22 Fernando Perez <fperez@colorado.edu>
5793 5798
5794 5799 * setup.py: updated dependency list so that manual is updated when
5795 5800 all included files change.
5796 5801
5797 5802 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5798 5803 the delimiter removal option (the fix is ugly right now).
5799 5804
5800 5805 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5801 5806 all of the math profile (quicker loading, no conflict between
5802 5807 g-9.8 and g-gnuplot).
5803 5808
5804 5809 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5805 5810 name of post-mortem files to IPython_crash_report.txt.
5806 5811
5807 5812 * Cleanup/update of the docs. Added all the new readline info and
5808 5813 formatted all lists as 'real lists'.
5809 5814
5810 5815 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5811 5816 tab-completion options, since the full readline parse_and_bind is
5812 5817 now accessible.
5813 5818
5814 5819 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5815 5820 handling of readline options. Now users can specify any string to
5816 5821 be passed to parse_and_bind(), as well as the delimiters to be
5817 5822 removed.
5818 5823 (InteractiveShell.__init__): Added __name__ to the global
5819 5824 namespace so that things like Itpl which rely on its existence
5820 5825 don't crash.
5821 5826 (InteractiveShell._prefilter): Defined the default with a _ so
5822 5827 that prefilter() is easier to override, while the default one
5823 5828 remains available.
5824 5829
5825 5830 2002-04-18 Fernando Perez <fperez@colorado.edu>
5826 5831
5827 5832 * Added information about pdb in the docs.
5828 5833
5829 5834 2002-04-17 Fernando Perez <fperez@colorado.edu>
5830 5835
5831 5836 * IPython/ipmaker.py (make_IPython): added rc_override option to
5832 5837 allow passing config options at creation time which may override
5833 5838 anything set in the config files or command line. This is
5834 5839 particularly useful for configuring embedded instances.
5835 5840
5836 5841 2002-04-15 Fernando Perez <fperez@colorado.edu>
5837 5842
5838 5843 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5839 5844 crash embedded instances because of the input cache falling out of
5840 5845 sync with the output counter.
5841 5846
5842 5847 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5843 5848 mode which calls pdb after an uncaught exception in IPython itself.
5844 5849
5845 5850 2002-04-14 Fernando Perez <fperez@colorado.edu>
5846 5851
5847 5852 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5848 5853 readline, fix it back after each call.
5849 5854
5850 5855 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5851 5856 method to force all access via __call__(), which guarantees that
5852 5857 traceback references are properly deleted.
5853 5858
5854 5859 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5855 5860 improve printing when pprint is in use.
5856 5861
5857 5862 2002-04-13 Fernando Perez <fperez@colorado.edu>
5858 5863
5859 5864 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5860 5865 exceptions aren't caught anymore. If the user triggers one, he
5861 5866 should know why he's doing it and it should go all the way up,
5862 5867 just like any other exception. So now @abort will fully kill the
5863 5868 embedded interpreter and the embedding code (unless that happens
5864 5869 to catch SystemExit).
5865 5870
5866 5871 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5867 5872 and a debugger() method to invoke the interactive pdb debugger
5868 5873 after printing exception information. Also added the corresponding
5869 5874 -pdb option and @pdb magic to control this feature, and updated
5870 5875 the docs. After a suggestion from Christopher Hart
5871 5876 (hart-AT-caltech.edu).
5872 5877
5873 5878 2002-04-12 Fernando Perez <fperez@colorado.edu>
5874 5879
5875 5880 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5876 5881 the exception handlers defined by the user (not the CrashHandler)
5877 5882 so that user exceptions don't trigger an ipython bug report.
5878 5883
5879 5884 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5880 5885 configurable (it should have always been so).
5881 5886
5882 5887 2002-03-26 Fernando Perez <fperez@colorado.edu>
5883 5888
5884 5889 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5885 5890 and there to fix embedding namespace issues. This should all be
5886 5891 done in a more elegant way.
5887 5892
5888 5893 2002-03-25 Fernando Perez <fperez@colorado.edu>
5889 5894
5890 5895 * IPython/genutils.py (get_home_dir): Try to make it work under
5891 5896 win9x also.
5892 5897
5893 5898 2002-03-20 Fernando Perez <fperez@colorado.edu>
5894 5899
5895 5900 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5896 5901 sys.displayhook untouched upon __init__.
5897 5902
5898 5903 2002-03-19 Fernando Perez <fperez@colorado.edu>
5899 5904
5900 5905 * Released 0.2.9 (for embedding bug, basically).
5901 5906
5902 5907 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5903 5908 exceptions so that enclosing shell's state can be restored.
5904 5909
5905 5910 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5906 5911 naming conventions in the .ipython/ dir.
5907 5912
5908 5913 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5909 5914 from delimiters list so filenames with - in them get expanded.
5910 5915
5911 5916 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5912 5917 sys.displayhook not being properly restored after an embedded call.
5913 5918
5914 5919 2002-03-18 Fernando Perez <fperez@colorado.edu>
5915 5920
5916 5921 * Released 0.2.8
5917 5922
5918 5923 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5919 5924 some files weren't being included in a -upgrade.
5920 5925 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5921 5926 on' so that the first tab completes.
5922 5927 (InteractiveShell.handle_magic): fixed bug with spaces around
5923 5928 quotes breaking many magic commands.
5924 5929
5925 5930 * setup.py: added note about ignoring the syntax error messages at
5926 5931 installation.
5927 5932
5928 5933 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5929 5934 streamlining the gnuplot interface, now there's only one magic @gp.
5930 5935
5931 5936 2002-03-17 Fernando Perez <fperez@colorado.edu>
5932 5937
5933 5938 * IPython/UserConfig/magic_gnuplot.py: new name for the
5934 5939 example-magic_pm.py file. Much enhanced system, now with a shell
5935 5940 for communicating directly with gnuplot, one command at a time.
5936 5941
5937 5942 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5938 5943 setting __name__=='__main__'.
5939 5944
5940 5945 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5941 5946 mini-shell for accessing gnuplot from inside ipython. Should
5942 5947 extend it later for grace access too. Inspired by Arnd's
5943 5948 suggestion.
5944 5949
5945 5950 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5946 5951 calling magic functions with () in their arguments. Thanks to Arnd
5947 5952 Baecker for pointing this to me.
5948 5953
5949 5954 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5950 5955 infinitely for integer or complex arrays (only worked with floats).
5951 5956
5952 5957 2002-03-16 Fernando Perez <fperez@colorado.edu>
5953 5958
5954 5959 * setup.py: Merged setup and setup_windows into a single script
5955 5960 which properly handles things for windows users.
5956 5961
5957 5962 2002-03-15 Fernando Perez <fperez@colorado.edu>
5958 5963
5959 5964 * Big change to the manual: now the magics are all automatically
5960 5965 documented. This information is generated from their docstrings
5961 5966 and put in a latex file included by the manual lyx file. This way
5962 5967 we get always up to date information for the magics. The manual
5963 5968 now also has proper version information, also auto-synced.
5964 5969
5965 5970 For this to work, an undocumented --magic_docstrings option was added.
5966 5971
5967 5972 2002-03-13 Fernando Perez <fperez@colorado.edu>
5968 5973
5969 5974 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5970 5975 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5971 5976
5972 5977 2002-03-12 Fernando Perez <fperez@colorado.edu>
5973 5978
5974 5979 * IPython/ultraTB.py (TermColors): changed color escapes again to
5975 5980 fix the (old, reintroduced) line-wrapping bug. Basically, if
5976 5981 \001..\002 aren't given in the color escapes, lines get wrapped
5977 5982 weirdly. But giving those screws up old xterms and emacs terms. So
5978 5983 I added some logic for emacs terms to be ok, but I can't identify old
5979 5984 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5980 5985
5981 5986 2002-03-10 Fernando Perez <fperez@colorado.edu>
5982 5987
5983 5988 * IPython/usage.py (__doc__): Various documentation cleanups and
5984 5989 updates, both in usage docstrings and in the manual.
5985 5990
5986 5991 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5987 5992 handling of caching. Set minimum acceptabe value for having a
5988 5993 cache at 20 values.
5989 5994
5990 5995 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5991 5996 install_first_time function to a method, renamed it and added an
5992 5997 'upgrade' mode. Now people can update their config directory with
5993 5998 a simple command line switch (-upgrade, also new).
5994 5999
5995 6000 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5996 6001 @file (convenient for automagic users under Python >= 2.2).
5997 6002 Removed @files (it seemed more like a plural than an abbrev. of
5998 6003 'file show').
5999 6004
6000 6005 * IPython/iplib.py (install_first_time): Fixed crash if there were
6001 6006 backup files ('~') in .ipython/ install directory.
6002 6007
6003 6008 * IPython/ipmaker.py (make_IPython): fixes for new prompt
6004 6009 system. Things look fine, but these changes are fairly
6005 6010 intrusive. Test them for a few days.
6006 6011
6007 6012 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
6008 6013 the prompts system. Now all in/out prompt strings are user
6009 6014 controllable. This is particularly useful for embedding, as one
6010 6015 can tag embedded instances with particular prompts.
6011 6016
6012 6017 Also removed global use of sys.ps1/2, which now allows nested
6013 6018 embeddings without any problems. Added command-line options for
6014 6019 the prompt strings.
6015 6020
6016 6021 2002-03-08 Fernando Perez <fperez@colorado.edu>
6017 6022
6018 6023 * IPython/UserConfig/example-embed-short.py (ipshell): added
6019 6024 example file with the bare minimum code for embedding.
6020 6025
6021 6026 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
6022 6027 functionality for the embeddable shell to be activated/deactivated
6023 6028 either globally or at each call.
6024 6029
6025 6030 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
6026 6031 rewriting the prompt with '--->' for auto-inputs with proper
6027 6032 coloring. Now the previous UGLY hack in handle_auto() is gone, and
6028 6033 this is handled by the prompts class itself, as it should.
6029 6034
6030 6035 2002-03-05 Fernando Perez <fperez@colorado.edu>
6031 6036
6032 6037 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
6033 6038 @logstart to avoid name clashes with the math log function.
6034 6039
6035 6040 * Big updates to X/Emacs section of the manual.
6036 6041
6037 6042 * Removed ipython_emacs. Milan explained to me how to pass
6038 6043 arguments to ipython through Emacs. Some day I'm going to end up
6039 6044 learning some lisp...
6040 6045
6041 6046 2002-03-04 Fernando Perez <fperez@colorado.edu>
6042 6047
6043 6048 * IPython/ipython_emacs: Created script to be used as the
6044 6049 py-python-command Emacs variable so we can pass IPython
6045 6050 parameters. I can't figure out how to tell Emacs directly to pass
6046 6051 parameters to IPython, so a dummy shell script will do it.
6047 6052
6048 6053 Other enhancements made for things to work better under Emacs'
6049 6054 various types of terminals. Many thanks to Milan Zamazal
6050 6055 <pdm-AT-zamazal.org> for all the suggestions and pointers.
6051 6056
6052 6057 2002-03-01 Fernando Perez <fperez@colorado.edu>
6053 6058
6054 6059 * IPython/ipmaker.py (make_IPython): added a --readline! option so
6055 6060 that loading of readline is now optional. This gives better
6056 6061 control to emacs users.
6057 6062
6058 6063 * IPython/ultraTB.py (__date__): Modified color escape sequences
6059 6064 and now things work fine under xterm and in Emacs' term buffers
6060 6065 (though not shell ones). Well, in emacs you get colors, but all
6061 6066 seem to be 'light' colors (no difference between dark and light
6062 6067 ones). But the garbage chars are gone, and also in xterms. It
6063 6068 seems that now I'm using 'cleaner' ansi sequences.
6064 6069
6065 6070 2002-02-21 Fernando Perez <fperez@colorado.edu>
6066 6071
6067 6072 * Released 0.2.7 (mainly to publish the scoping fix).
6068 6073
6069 6074 * IPython/Logger.py (Logger.logstate): added. A corresponding
6070 6075 @logstate magic was created.
6071 6076
6072 6077 * IPython/Magic.py: fixed nested scoping problem under Python
6073 6078 2.1.x (automagic wasn't working).
6074 6079
6075 6080 2002-02-20 Fernando Perez <fperez@colorado.edu>
6076 6081
6077 6082 * Released 0.2.6.
6078 6083
6079 6084 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6080 6085 option so that logs can come out without any headers at all.
6081 6086
6082 6087 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6083 6088 SciPy.
6084 6089
6085 6090 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6086 6091 that embedded IPython calls don't require vars() to be explicitly
6087 6092 passed. Now they are extracted from the caller's frame (code
6088 6093 snatched from Eric Jones' weave). Added better documentation to
6089 6094 the section on embedding and the example file.
6090 6095
6091 6096 * IPython/genutils.py (page): Changed so that under emacs, it just
6092 6097 prints the string. You can then page up and down in the emacs
6093 6098 buffer itself. This is how the builtin help() works.
6094 6099
6095 6100 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6096 6101 macro scoping: macros need to be executed in the user's namespace
6097 6102 to work as if they had been typed by the user.
6098 6103
6099 6104 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6100 6105 execute automatically (no need to type 'exec...'). They then
6101 6106 behave like 'true macros'. The printing system was also modified
6102 6107 for this to work.
6103 6108
6104 6109 2002-02-19 Fernando Perez <fperez@colorado.edu>
6105 6110
6106 6111 * IPython/genutils.py (page_file): new function for paging files
6107 6112 in an OS-independent way. Also necessary for file viewing to work
6108 6113 well inside Emacs buffers.
6109 6114 (page): Added checks for being in an emacs buffer.
6110 6115 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6111 6116 same bug in iplib.
6112 6117
6113 6118 2002-02-18 Fernando Perez <fperez@colorado.edu>
6114 6119
6115 6120 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6116 6121 of readline so that IPython can work inside an Emacs buffer.
6117 6122
6118 6123 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6119 6124 method signatures (they weren't really bugs, but it looks cleaner
6120 6125 and keeps PyChecker happy).
6121 6126
6122 6127 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6123 6128 for implementing various user-defined hooks. Currently only
6124 6129 display is done.
6125 6130
6126 6131 * IPython/Prompts.py (CachedOutput._display): changed display
6127 6132 functions so that they can be dynamically changed by users easily.
6128 6133
6129 6134 * IPython/Extensions/numeric_formats.py (num_display): added an
6130 6135 extension for printing NumPy arrays in flexible manners. It
6131 6136 doesn't do anything yet, but all the structure is in
6132 6137 place. Ultimately the plan is to implement output format control
6133 6138 like in Octave.
6134 6139
6135 6140 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6136 6141 methods are found at run-time by all the automatic machinery.
6137 6142
6138 6143 2002-02-17 Fernando Perez <fperez@colorado.edu>
6139 6144
6140 6145 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6141 6146 whole file a little.
6142 6147
6143 6148 * ToDo: closed this document. Now there's a new_design.lyx
6144 6149 document for all new ideas. Added making a pdf of it for the
6145 6150 end-user distro.
6146 6151
6147 6152 * IPython/Logger.py (Logger.switch_log): Created this to replace
6148 6153 logon() and logoff(). It also fixes a nasty crash reported by
6149 6154 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6150 6155
6151 6156 * IPython/iplib.py (complete): got auto-completion to work with
6152 6157 automagic (I had wanted this for a long time).
6153 6158
6154 6159 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6155 6160 to @file, since file() is now a builtin and clashes with automagic
6156 6161 for @file.
6157 6162
6158 6163 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6159 6164 of this was previously in iplib, which had grown to more than 2000
6160 6165 lines, way too long. No new functionality, but it makes managing
6161 6166 the code a bit easier.
6162 6167
6163 6168 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6164 6169 information to crash reports.
6165 6170
6166 6171 2002-02-12 Fernando Perez <fperez@colorado.edu>
6167 6172
6168 6173 * Released 0.2.5.
6169 6174
6170 6175 2002-02-11 Fernando Perez <fperez@colorado.edu>
6171 6176
6172 6177 * Wrote a relatively complete Windows installer. It puts
6173 6178 everything in place, creates Start Menu entries and fixes the
6174 6179 color issues. Nothing fancy, but it works.
6175 6180
6176 6181 2002-02-10 Fernando Perez <fperez@colorado.edu>
6177 6182
6178 6183 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6179 6184 os.path.expanduser() call so that we can type @run ~/myfile.py and
6180 6185 have thigs work as expected.
6181 6186
6182 6187 * IPython/genutils.py (page): fixed exception handling so things
6183 6188 work both in Unix and Windows correctly. Quitting a pager triggers
6184 6189 an IOError/broken pipe in Unix, and in windows not finding a pager
6185 6190 is also an IOError, so I had to actually look at the return value
6186 6191 of the exception, not just the exception itself. Should be ok now.
6187 6192
6188 6193 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6189 6194 modified to allow case-insensitive color scheme changes.
6190 6195
6191 6196 2002-02-09 Fernando Perez <fperez@colorado.edu>
6192 6197
6193 6198 * IPython/genutils.py (native_line_ends): new function to leave
6194 6199 user config files with os-native line-endings.
6195 6200
6196 6201 * README and manual updates.
6197 6202
6198 6203 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6199 6204 instead of StringType to catch Unicode strings.
6200 6205
6201 6206 * IPython/genutils.py (filefind): fixed bug for paths with
6202 6207 embedded spaces (very common in Windows).
6203 6208
6204 6209 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6205 6210 files under Windows, so that they get automatically associated
6206 6211 with a text editor. Windows makes it a pain to handle
6207 6212 extension-less files.
6208 6213
6209 6214 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6210 6215 warning about readline only occur for Posix. In Windows there's no
6211 6216 way to get readline, so why bother with the warning.
6212 6217
6213 6218 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6214 6219 for __str__ instead of dir(self), since dir() changed in 2.2.
6215 6220
6216 6221 * Ported to Windows! Tested on XP, I suspect it should work fine
6217 6222 on NT/2000, but I don't think it will work on 98 et al. That
6218 6223 series of Windows is such a piece of junk anyway that I won't try
6219 6224 porting it there. The XP port was straightforward, showed a few
6220 6225 bugs here and there (fixed all), in particular some string
6221 6226 handling stuff which required considering Unicode strings (which
6222 6227 Windows uses). This is good, but hasn't been too tested :) No
6223 6228 fancy installer yet, I'll put a note in the manual so people at
6224 6229 least make manually a shortcut.
6225 6230
6226 6231 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6227 6232 into a single one, "colors". This now controls both prompt and
6228 6233 exception color schemes, and can be changed both at startup
6229 6234 (either via command-line switches or via ipythonrc files) and at
6230 6235 runtime, with @colors.
6231 6236 (Magic.magic_run): renamed @prun to @run and removed the old
6232 6237 @run. The two were too similar to warrant keeping both.
6233 6238
6234 6239 2002-02-03 Fernando Perez <fperez@colorado.edu>
6235 6240
6236 6241 * IPython/iplib.py (install_first_time): Added comment on how to
6237 6242 configure the color options for first-time users. Put a <return>
6238 6243 request at the end so that small-terminal users get a chance to
6239 6244 read the startup info.
6240 6245
6241 6246 2002-01-23 Fernando Perez <fperez@colorado.edu>
6242 6247
6243 6248 * IPython/iplib.py (CachedOutput.update): Changed output memory
6244 6249 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6245 6250 input history we still use _i. Did this b/c these variable are
6246 6251 very commonly used in interactive work, so the less we need to
6247 6252 type the better off we are.
6248 6253 (Magic.magic_prun): updated @prun to better handle the namespaces
6249 6254 the file will run in, including a fix for __name__ not being set
6250 6255 before.
6251 6256
6252 6257 2002-01-20 Fernando Perez <fperez@colorado.edu>
6253 6258
6254 6259 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6255 6260 extra garbage for Python 2.2. Need to look more carefully into
6256 6261 this later.
6257 6262
6258 6263 2002-01-19 Fernando Perez <fperez@colorado.edu>
6259 6264
6260 6265 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6261 6266 display SyntaxError exceptions properly formatted when they occur
6262 6267 (they can be triggered by imported code).
6263 6268
6264 6269 2002-01-18 Fernando Perez <fperez@colorado.edu>
6265 6270
6266 6271 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6267 6272 SyntaxError exceptions are reported nicely formatted, instead of
6268 6273 spitting out only offset information as before.
6269 6274 (Magic.magic_prun): Added the @prun function for executing
6270 6275 programs with command line args inside IPython.
6271 6276
6272 6277 2002-01-16 Fernando Perez <fperez@colorado.edu>
6273 6278
6274 6279 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6275 6280 to *not* include the last item given in a range. This brings their
6276 6281 behavior in line with Python's slicing:
6277 6282 a[n1:n2] -> a[n1]...a[n2-1]
6278 6283 It may be a bit less convenient, but I prefer to stick to Python's
6279 6284 conventions *everywhere*, so users never have to wonder.
6280 6285 (Magic.magic_macro): Added @macro function to ease the creation of
6281 6286 macros.
6282 6287
6283 6288 2002-01-05 Fernando Perez <fperez@colorado.edu>
6284 6289
6285 6290 * Released 0.2.4.
6286 6291
6287 6292 * IPython/iplib.py (Magic.magic_pdef):
6288 6293 (InteractiveShell.safe_execfile): report magic lines and error
6289 6294 lines without line numbers so one can easily copy/paste them for
6290 6295 re-execution.
6291 6296
6292 6297 * Updated manual with recent changes.
6293 6298
6294 6299 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6295 6300 docstring printing when class? is called. Very handy for knowing
6296 6301 how to create class instances (as long as __init__ is well
6297 6302 documented, of course :)
6298 6303 (Magic.magic_doc): print both class and constructor docstrings.
6299 6304 (Magic.magic_pdef): give constructor info if passed a class and
6300 6305 __call__ info for callable object instances.
6301 6306
6302 6307 2002-01-04 Fernando Perez <fperez@colorado.edu>
6303 6308
6304 6309 * Made deep_reload() off by default. It doesn't always work
6305 6310 exactly as intended, so it's probably safer to have it off. It's
6306 6311 still available as dreload() anyway, so nothing is lost.
6307 6312
6308 6313 2002-01-02 Fernando Perez <fperez@colorado.edu>
6309 6314
6310 6315 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6311 6316 so I wanted an updated release).
6312 6317
6313 6318 2001-12-27 Fernando Perez <fperez@colorado.edu>
6314 6319
6315 6320 * IPython/iplib.py (InteractiveShell.interact): Added the original
6316 6321 code from 'code.py' for this module in order to change the
6317 6322 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6318 6323 the history cache would break when the user hit Ctrl-C, and
6319 6324 interact() offers no way to add any hooks to it.
6320 6325
6321 6326 2001-12-23 Fernando Perez <fperez@colorado.edu>
6322 6327
6323 6328 * setup.py: added check for 'MANIFEST' before trying to remove
6324 6329 it. Thanks to Sean Reifschneider.
6325 6330
6326 6331 2001-12-22 Fernando Perez <fperez@colorado.edu>
6327 6332
6328 6333 * Released 0.2.2.
6329 6334
6330 6335 * Finished (reasonably) writing the manual. Later will add the
6331 6336 python-standard navigation stylesheets, but for the time being
6332 6337 it's fairly complete. Distribution will include html and pdf
6333 6338 versions.
6334 6339
6335 6340 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6336 6341 (MayaVi author).
6337 6342
6338 6343 2001-12-21 Fernando Perez <fperez@colorado.edu>
6339 6344
6340 6345 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6341 6346 good public release, I think (with the manual and the distutils
6342 6347 installer). The manual can use some work, but that can go
6343 6348 slowly. Otherwise I think it's quite nice for end users. Next
6344 6349 summer, rewrite the guts of it...
6345 6350
6346 6351 * Changed format of ipythonrc files to use whitespace as the
6347 6352 separator instead of an explicit '='. Cleaner.
6348 6353
6349 6354 2001-12-20 Fernando Perez <fperez@colorado.edu>
6350 6355
6351 6356 * Started a manual in LyX. For now it's just a quick merge of the
6352 6357 various internal docstrings and READMEs. Later it may grow into a
6353 6358 nice, full-blown manual.
6354 6359
6355 6360 * Set up a distutils based installer. Installation should now be
6356 6361 trivially simple for end-users.
6357 6362
6358 6363 2001-12-11 Fernando Perez <fperez@colorado.edu>
6359 6364
6360 6365 * Released 0.2.0. First public release, announced it at
6361 6366 comp.lang.python. From now on, just bugfixes...
6362 6367
6363 6368 * Went through all the files, set copyright/license notices and
6364 6369 cleaned up things. Ready for release.
6365 6370
6366 6371 2001-12-10 Fernando Perez <fperez@colorado.edu>
6367 6372
6368 6373 * Changed the first-time installer not to use tarfiles. It's more
6369 6374 robust now and less unix-dependent. Also makes it easier for
6370 6375 people to later upgrade versions.
6371 6376
6372 6377 * Changed @exit to @abort to reflect the fact that it's pretty
6373 6378 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6374 6379 becomes significant only when IPyhton is embedded: in that case,
6375 6380 C-D closes IPython only, but @abort kills the enclosing program
6376 6381 too (unless it had called IPython inside a try catching
6377 6382 SystemExit).
6378 6383
6379 6384 * Created Shell module which exposes the actuall IPython Shell
6380 6385 classes, currently the normal and the embeddable one. This at
6381 6386 least offers a stable interface we won't need to change when
6382 6387 (later) the internals are rewritten. That rewrite will be confined
6383 6388 to iplib and ipmaker, but the Shell interface should remain as is.
6384 6389
6385 6390 * Added embed module which offers an embeddable IPShell object,
6386 6391 useful to fire up IPython *inside* a running program. Great for
6387 6392 debugging or dynamical data analysis.
6388 6393
6389 6394 2001-12-08 Fernando Perez <fperez@colorado.edu>
6390 6395
6391 6396 * Fixed small bug preventing seeing info from methods of defined
6392 6397 objects (incorrect namespace in _ofind()).
6393 6398
6394 6399 * Documentation cleanup. Moved the main usage docstrings to a
6395 6400 separate file, usage.py (cleaner to maintain, and hopefully in the
6396 6401 future some perlpod-like way of producing interactive, man and
6397 6402 html docs out of it will be found).
6398 6403
6399 6404 * Added @profile to see your profile at any time.
6400 6405
6401 6406 * Added @p as an alias for 'print'. It's especially convenient if
6402 6407 using automagic ('p x' prints x).
6403 6408
6404 6409 * Small cleanups and fixes after a pychecker run.
6405 6410
6406 6411 * Changed the @cd command to handle @cd - and @cd -<n> for
6407 6412 visiting any directory in _dh.
6408 6413
6409 6414 * Introduced _dh, a history of visited directories. @dhist prints
6410 6415 it out with numbers.
6411 6416
6412 6417 2001-12-07 Fernando Perez <fperez@colorado.edu>
6413 6418
6414 6419 * Released 0.1.22
6415 6420
6416 6421 * Made initialization a bit more robust against invalid color
6417 6422 options in user input (exit, not traceback-crash).
6418 6423
6419 6424 * Changed the bug crash reporter to write the report only in the
6420 6425 user's .ipython directory. That way IPython won't litter people's
6421 6426 hard disks with crash files all over the place. Also print on
6422 6427 screen the necessary mail command.
6423 6428
6424 6429 * With the new ultraTB, implemented LightBG color scheme for light
6425 6430 background terminals. A lot of people like white backgrounds, so I
6426 6431 guess we should at least give them something readable.
6427 6432
6428 6433 2001-12-06 Fernando Perez <fperez@colorado.edu>
6429 6434
6430 6435 * Modified the structure of ultraTB. Now there's a proper class
6431 6436 for tables of color schemes which allow adding schemes easily and
6432 6437 switching the active scheme without creating a new instance every
6433 6438 time (which was ridiculous). The syntax for creating new schemes
6434 6439 is also cleaner. I think ultraTB is finally done, with a clean
6435 6440 class structure. Names are also much cleaner (now there's proper
6436 6441 color tables, no need for every variable to also have 'color' in
6437 6442 its name).
6438 6443
6439 6444 * Broke down genutils into separate files. Now genutils only
6440 6445 contains utility functions, and classes have been moved to their
6441 6446 own files (they had enough independent functionality to warrant
6442 6447 it): ConfigLoader, OutputTrap, Struct.
6443 6448
6444 6449 2001-12-05 Fernando Perez <fperez@colorado.edu>
6445 6450
6446 6451 * IPython turns 21! Released version 0.1.21, as a candidate for
6447 6452 public consumption. If all goes well, release in a few days.
6448 6453
6449 6454 * Fixed path bug (files in Extensions/ directory wouldn't be found
6450 6455 unless IPython/ was explicitly in sys.path).
6451 6456
6452 6457 * Extended the FlexCompleter class as MagicCompleter to allow
6453 6458 completion of @-starting lines.
6454 6459
6455 6460 * Created __release__.py file as a central repository for release
6456 6461 info that other files can read from.
6457 6462
6458 6463 * Fixed small bug in logging: when logging was turned on in
6459 6464 mid-session, old lines with special meanings (!@?) were being
6460 6465 logged without the prepended comment, which is necessary since
6461 6466 they are not truly valid python syntax. This should make session
6462 6467 restores produce less errors.
6463 6468
6464 6469 * The namespace cleanup forced me to make a FlexCompleter class
6465 6470 which is nothing but a ripoff of rlcompleter, but with selectable
6466 6471 namespace (rlcompleter only works in __main__.__dict__). I'll try
6467 6472 to submit a note to the authors to see if this change can be
6468 6473 incorporated in future rlcompleter releases (Dec.6: done)
6469 6474
6470 6475 * More fixes to namespace handling. It was a mess! Now all
6471 6476 explicit references to __main__.__dict__ are gone (except when
6472 6477 really needed) and everything is handled through the namespace
6473 6478 dicts in the IPython instance. We seem to be getting somewhere
6474 6479 with this, finally...
6475 6480
6476 6481 * Small documentation updates.
6477 6482
6478 6483 * Created the Extensions directory under IPython (with an
6479 6484 __init__.py). Put the PhysicalQ stuff there. This directory should
6480 6485 be used for all special-purpose extensions.
6481 6486
6482 6487 * File renaming:
6483 6488 ipythonlib --> ipmaker
6484 6489 ipplib --> iplib
6485 6490 This makes a bit more sense in terms of what these files actually do.
6486 6491
6487 6492 * Moved all the classes and functions in ipythonlib to ipplib, so
6488 6493 now ipythonlib only has make_IPython(). This will ease up its
6489 6494 splitting in smaller functional chunks later.
6490 6495
6491 6496 * Cleaned up (done, I think) output of @whos. Better column
6492 6497 formatting, and now shows str(var) for as much as it can, which is
6493 6498 typically what one gets with a 'print var'.
6494 6499
6495 6500 2001-12-04 Fernando Perez <fperez@colorado.edu>
6496 6501
6497 6502 * Fixed namespace problems. Now builtin/IPyhton/user names get
6498 6503 properly reported in their namespace. Internal namespace handling
6499 6504 is finally getting decent (not perfect yet, but much better than
6500 6505 the ad-hoc mess we had).
6501 6506
6502 6507 * Removed -exit option. If people just want to run a python
6503 6508 script, that's what the normal interpreter is for. Less
6504 6509 unnecessary options, less chances for bugs.
6505 6510
6506 6511 * Added a crash handler which generates a complete post-mortem if
6507 6512 IPython crashes. This will help a lot in tracking bugs down the
6508 6513 road.
6509 6514
6510 6515 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6511 6516 which were boud to functions being reassigned would bypass the
6512 6517 logger, breaking the sync of _il with the prompt counter. This
6513 6518 would then crash IPython later when a new line was logged.
6514 6519
6515 6520 2001-12-02 Fernando Perez <fperez@colorado.edu>
6516 6521
6517 6522 * Made IPython a package. This means people don't have to clutter
6518 6523 their sys.path with yet another directory. Changed the INSTALL
6519 6524 file accordingly.
6520 6525
6521 6526 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6522 6527 sorts its output (so @who shows it sorted) and @whos formats the
6523 6528 table according to the width of the first column. Nicer, easier to
6524 6529 read. Todo: write a generic table_format() which takes a list of
6525 6530 lists and prints it nicely formatted, with optional row/column
6526 6531 separators and proper padding and justification.
6527 6532
6528 6533 * Released 0.1.20
6529 6534
6530 6535 * Fixed bug in @log which would reverse the inputcache list (a
6531 6536 copy operation was missing).
6532 6537
6533 6538 * Code cleanup. @config was changed to use page(). Better, since
6534 6539 its output is always quite long.
6535 6540
6536 6541 * Itpl is back as a dependency. I was having too many problems
6537 6542 getting the parametric aliases to work reliably, and it's just
6538 6543 easier to code weird string operations with it than playing %()s
6539 6544 games. It's only ~6k, so I don't think it's too big a deal.
6540 6545
6541 6546 * Found (and fixed) a very nasty bug with history. !lines weren't
6542 6547 getting cached, and the out of sync caches would crash
6543 6548 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6544 6549 division of labor a bit better. Bug fixed, cleaner structure.
6545 6550
6546 6551 2001-12-01 Fernando Perez <fperez@colorado.edu>
6547 6552
6548 6553 * Released 0.1.19
6549 6554
6550 6555 * Added option -n to @hist to prevent line number printing. Much
6551 6556 easier to copy/paste code this way.
6552 6557
6553 6558 * Created global _il to hold the input list. Allows easy
6554 6559 re-execution of blocks of code by slicing it (inspired by Janko's
6555 6560 comment on 'macros').
6556 6561
6557 6562 * Small fixes and doc updates.
6558 6563
6559 6564 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6560 6565 much too fragile with automagic. Handles properly multi-line
6561 6566 statements and takes parameters.
6562 6567
6563 6568 2001-11-30 Fernando Perez <fperez@colorado.edu>
6564 6569
6565 6570 * Version 0.1.18 released.
6566 6571
6567 6572 * Fixed nasty namespace bug in initial module imports.
6568 6573
6569 6574 * Added copyright/license notes to all code files (except
6570 6575 DPyGetOpt). For the time being, LGPL. That could change.
6571 6576
6572 6577 * Rewrote a much nicer README, updated INSTALL, cleaned up
6573 6578 ipythonrc-* samples.
6574 6579
6575 6580 * Overall code/documentation cleanup. Basically ready for
6576 6581 release. Only remaining thing: licence decision (LGPL?).
6577 6582
6578 6583 * Converted load_config to a class, ConfigLoader. Now recursion
6579 6584 control is better organized. Doesn't include the same file twice.
6580 6585
6581 6586 2001-11-29 Fernando Perez <fperez@colorado.edu>
6582 6587
6583 6588 * Got input history working. Changed output history variables from
6584 6589 _p to _o so that _i is for input and _o for output. Just cleaner
6585 6590 convention.
6586 6591
6587 6592 * Implemented parametric aliases. This pretty much allows the
6588 6593 alias system to offer full-blown shell convenience, I think.
6589 6594
6590 6595 * Version 0.1.17 released, 0.1.18 opened.
6591 6596
6592 6597 * dot_ipython/ipythonrc (alias): added documentation.
6593 6598 (xcolor): Fixed small bug (xcolors -> xcolor)
6594 6599
6595 6600 * Changed the alias system. Now alias is a magic command to define
6596 6601 aliases just like the shell. Rationale: the builtin magics should
6597 6602 be there for things deeply connected to IPython's
6598 6603 architecture. And this is a much lighter system for what I think
6599 6604 is the really important feature: allowing users to define quickly
6600 6605 magics that will do shell things for them, so they can customize
6601 6606 IPython easily to match their work habits. If someone is really
6602 6607 desperate to have another name for a builtin alias, they can
6603 6608 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6604 6609 works.
6605 6610
6606 6611 2001-11-28 Fernando Perez <fperez@colorado.edu>
6607 6612
6608 6613 * Changed @file so that it opens the source file at the proper
6609 6614 line. Since it uses less, if your EDITOR environment is
6610 6615 configured, typing v will immediately open your editor of choice
6611 6616 right at the line where the object is defined. Not as quick as
6612 6617 having a direct @edit command, but for all intents and purposes it
6613 6618 works. And I don't have to worry about writing @edit to deal with
6614 6619 all the editors, less does that.
6615 6620
6616 6621 * Version 0.1.16 released, 0.1.17 opened.
6617 6622
6618 6623 * Fixed some nasty bugs in the page/page_dumb combo that could
6619 6624 crash IPython.
6620 6625
6621 6626 2001-11-27 Fernando Perez <fperez@colorado.edu>
6622 6627
6623 6628 * Version 0.1.15 released, 0.1.16 opened.
6624 6629
6625 6630 * Finally got ? and ?? to work for undefined things: now it's
6626 6631 possible to type {}.get? and get information about the get method
6627 6632 of dicts, or os.path? even if only os is defined (so technically
6628 6633 os.path isn't). Works at any level. For example, after import os,
6629 6634 os?, os.path?, os.path.abspath? all work. This is great, took some
6630 6635 work in _ofind.
6631 6636
6632 6637 * Fixed more bugs with logging. The sanest way to do it was to add
6633 6638 to @log a 'mode' parameter. Killed two in one shot (this mode
6634 6639 option was a request of Janko's). I think it's finally clean
6635 6640 (famous last words).
6636 6641
6637 6642 * Added a page_dumb() pager which does a decent job of paging on
6638 6643 screen, if better things (like less) aren't available. One less
6639 6644 unix dependency (someday maybe somebody will port this to
6640 6645 windows).
6641 6646
6642 6647 * Fixed problem in magic_log: would lock of logging out if log
6643 6648 creation failed (because it would still think it had succeeded).
6644 6649
6645 6650 * Improved the page() function using curses to auto-detect screen
6646 6651 size. Now it can make a much better decision on whether to print
6647 6652 or page a string. Option screen_length was modified: a value 0
6648 6653 means auto-detect, and that's the default now.
6649 6654
6650 6655 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6651 6656 go out. I'll test it for a few days, then talk to Janko about
6652 6657 licences and announce it.
6653 6658
6654 6659 * Fixed the length of the auto-generated ---> prompt which appears
6655 6660 for auto-parens and auto-quotes. Getting this right isn't trivial,
6656 6661 with all the color escapes, different prompt types and optional
6657 6662 separators. But it seems to be working in all the combinations.
6658 6663
6659 6664 2001-11-26 Fernando Perez <fperez@colorado.edu>
6660 6665
6661 6666 * Wrote a regexp filter to get option types from the option names
6662 6667 string. This eliminates the need to manually keep two duplicate
6663 6668 lists.
6664 6669
6665 6670 * Removed the unneeded check_option_names. Now options are handled
6666 6671 in a much saner manner and it's easy to visually check that things
6667 6672 are ok.
6668 6673
6669 6674 * Updated version numbers on all files I modified to carry a
6670 6675 notice so Janko and Nathan have clear version markers.
6671 6676
6672 6677 * Updated docstring for ultraTB with my changes. I should send
6673 6678 this to Nathan.
6674 6679
6675 6680 * Lots of small fixes. Ran everything through pychecker again.
6676 6681
6677 6682 * Made loading of deep_reload an cmd line option. If it's not too
6678 6683 kosher, now people can just disable it. With -nodeep_reload it's
6679 6684 still available as dreload(), it just won't overwrite reload().
6680 6685
6681 6686 * Moved many options to the no| form (-opt and -noopt
6682 6687 accepted). Cleaner.
6683 6688
6684 6689 * Changed magic_log so that if called with no parameters, it uses
6685 6690 'rotate' mode. That way auto-generated logs aren't automatically
6686 6691 over-written. For normal logs, now a backup is made if it exists
6687 6692 (only 1 level of backups). A new 'backup' mode was added to the
6688 6693 Logger class to support this. This was a request by Janko.
6689 6694
6690 6695 * Added @logoff/@logon to stop/restart an active log.
6691 6696
6692 6697 * Fixed a lot of bugs in log saving/replay. It was pretty
6693 6698 broken. Now special lines (!@,/) appear properly in the command
6694 6699 history after a log replay.
6695 6700
6696 6701 * Tried and failed to implement full session saving via pickle. My
6697 6702 idea was to pickle __main__.__dict__, but modules can't be
6698 6703 pickled. This would be a better alternative to replaying logs, but
6699 6704 seems quite tricky to get to work. Changed -session to be called
6700 6705 -logplay, which more accurately reflects what it does. And if we
6701 6706 ever get real session saving working, -session is now available.
6702 6707
6703 6708 * Implemented color schemes for prompts also. As for tracebacks,
6704 6709 currently only NoColor and Linux are supported. But now the
6705 6710 infrastructure is in place, based on a generic ColorScheme
6706 6711 class. So writing and activating new schemes both for the prompts
6707 6712 and the tracebacks should be straightforward.
6708 6713
6709 6714 * Version 0.1.13 released, 0.1.14 opened.
6710 6715
6711 6716 * Changed handling of options for output cache. Now counter is
6712 6717 hardwired starting at 1 and one specifies the maximum number of
6713 6718 entries *in the outcache* (not the max prompt counter). This is
6714 6719 much better, since many statements won't increase the cache
6715 6720 count. It also eliminated some confusing options, now there's only
6716 6721 one: cache_size.
6717 6722
6718 6723 * Added 'alias' magic function and magic_alias option in the
6719 6724 ipythonrc file. Now the user can easily define whatever names he
6720 6725 wants for the magic functions without having to play weird
6721 6726 namespace games. This gives IPython a real shell-like feel.
6722 6727
6723 6728 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6724 6729 @ or not).
6725 6730
6726 6731 This was one of the last remaining 'visible' bugs (that I know
6727 6732 of). I think if I can clean up the session loading so it works
6728 6733 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6729 6734 about licensing).
6730 6735
6731 6736 2001-11-25 Fernando Perez <fperez@colorado.edu>
6732 6737
6733 6738 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6734 6739 there's a cleaner distinction between what ? and ?? show.
6735 6740
6736 6741 * Added screen_length option. Now the user can define his own
6737 6742 screen size for page() operations.
6738 6743
6739 6744 * Implemented magic shell-like functions with automatic code
6740 6745 generation. Now adding another function is just a matter of adding
6741 6746 an entry to a dict, and the function is dynamically generated at
6742 6747 run-time. Python has some really cool features!
6743 6748
6744 6749 * Renamed many options to cleanup conventions a little. Now all
6745 6750 are lowercase, and only underscores where needed. Also in the code
6746 6751 option name tables are clearer.
6747 6752
6748 6753 * Changed prompts a little. Now input is 'In [n]:' instead of
6749 6754 'In[n]:='. This allows it the numbers to be aligned with the
6750 6755 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6751 6756 Python (it was a Mathematica thing). The '...' continuation prompt
6752 6757 was also changed a little to align better.
6753 6758
6754 6759 * Fixed bug when flushing output cache. Not all _p<n> variables
6755 6760 exist, so their deletion needs to be wrapped in a try:
6756 6761
6757 6762 * Figured out how to properly use inspect.formatargspec() (it
6758 6763 requires the args preceded by *). So I removed all the code from
6759 6764 _get_pdef in Magic, which was just replicating that.
6760 6765
6761 6766 * Added test to prefilter to allow redefining magic function names
6762 6767 as variables. This is ok, since the @ form is always available,
6763 6768 but whe should allow the user to define a variable called 'ls' if
6764 6769 he needs it.
6765 6770
6766 6771 * Moved the ToDo information from README into a separate ToDo.
6767 6772
6768 6773 * General code cleanup and small bugfixes. I think it's close to a
6769 6774 state where it can be released, obviously with a big 'beta'
6770 6775 warning on it.
6771 6776
6772 6777 * Got the magic function split to work. Now all magics are defined
6773 6778 in a separate class. It just organizes things a bit, and now
6774 6779 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6775 6780 was too long).
6776 6781
6777 6782 * Changed @clear to @reset to avoid potential confusions with
6778 6783 the shell command clear. Also renamed @cl to @clear, which does
6779 6784 exactly what people expect it to from their shell experience.
6780 6785
6781 6786 Added a check to the @reset command (since it's so
6782 6787 destructive, it's probably a good idea to ask for confirmation).
6783 6788 But now reset only works for full namespace resetting. Since the
6784 6789 del keyword is already there for deleting a few specific
6785 6790 variables, I don't see the point of having a redundant magic
6786 6791 function for the same task.
6787 6792
6788 6793 2001-11-24 Fernando Perez <fperez@colorado.edu>
6789 6794
6790 6795 * Updated the builtin docs (esp. the ? ones).
6791 6796
6792 6797 * Ran all the code through pychecker. Not terribly impressed with
6793 6798 it: lots of spurious warnings and didn't really find anything of
6794 6799 substance (just a few modules being imported and not used).
6795 6800
6796 6801 * Implemented the new ultraTB functionality into IPython. New
6797 6802 option: xcolors. This chooses color scheme. xmode now only selects
6798 6803 between Plain and Verbose. Better orthogonality.
6799 6804
6800 6805 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6801 6806 mode and color scheme for the exception handlers. Now it's
6802 6807 possible to have the verbose traceback with no coloring.
6803 6808
6804 6809 2001-11-23 Fernando Perez <fperez@colorado.edu>
6805 6810
6806 6811 * Version 0.1.12 released, 0.1.13 opened.
6807 6812
6808 6813 * Removed option to set auto-quote and auto-paren escapes by
6809 6814 user. The chances of breaking valid syntax are just too high. If
6810 6815 someone *really* wants, they can always dig into the code.
6811 6816
6812 6817 * Made prompt separators configurable.
6813 6818
6814 6819 2001-11-22 Fernando Perez <fperez@colorado.edu>
6815 6820
6816 6821 * Small bugfixes in many places.
6817 6822
6818 6823 * Removed the MyCompleter class from ipplib. It seemed redundant
6819 6824 with the C-p,C-n history search functionality. Less code to
6820 6825 maintain.
6821 6826
6822 6827 * Moved all the original ipython.py code into ipythonlib.py. Right
6823 6828 now it's just one big dump into a function called make_IPython, so
6824 6829 no real modularity has been gained. But at least it makes the
6825 6830 wrapper script tiny, and since ipythonlib is a module, it gets
6826 6831 compiled and startup is much faster.
6827 6832
6828 6833 This is a reasobably 'deep' change, so we should test it for a
6829 6834 while without messing too much more with the code.
6830 6835
6831 6836 2001-11-21 Fernando Perez <fperez@colorado.edu>
6832 6837
6833 6838 * Version 0.1.11 released, 0.1.12 opened for further work.
6834 6839
6835 6840 * Removed dependency on Itpl. It was only needed in one place. It
6836 6841 would be nice if this became part of python, though. It makes life
6837 6842 *a lot* easier in some cases.
6838 6843
6839 6844 * Simplified the prefilter code a bit. Now all handlers are
6840 6845 expected to explicitly return a value (at least a blank string).
6841 6846
6842 6847 * Heavy edits in ipplib. Removed the help system altogether. Now
6843 6848 obj?/?? is used for inspecting objects, a magic @doc prints
6844 6849 docstrings, and full-blown Python help is accessed via the 'help'
6845 6850 keyword. This cleans up a lot of code (less to maintain) and does
6846 6851 the job. Since 'help' is now a standard Python component, might as
6847 6852 well use it and remove duplicate functionality.
6848 6853
6849 6854 Also removed the option to use ipplib as a standalone program. By
6850 6855 now it's too dependent on other parts of IPython to function alone.
6851 6856
6852 6857 * Fixed bug in genutils.pager. It would crash if the pager was
6853 6858 exited immediately after opening (broken pipe).
6854 6859
6855 6860 * Trimmed down the VerboseTB reporting a little. The header is
6856 6861 much shorter now and the repeated exception arguments at the end
6857 6862 have been removed. For interactive use the old header seemed a bit
6858 6863 excessive.
6859 6864
6860 6865 * Fixed small bug in output of @whos for variables with multi-word
6861 6866 types (only first word was displayed).
6862 6867
6863 6868 2001-11-17 Fernando Perez <fperez@colorado.edu>
6864 6869
6865 6870 * Version 0.1.10 released, 0.1.11 opened for further work.
6866 6871
6867 6872 * Modified dirs and friends. dirs now *returns* the stack (not
6868 6873 prints), so one can manipulate it as a variable. Convenient to
6869 6874 travel along many directories.
6870 6875
6871 6876 * Fixed bug in magic_pdef: would only work with functions with
6872 6877 arguments with default values.
6873 6878
6874 6879 2001-11-14 Fernando Perez <fperez@colorado.edu>
6875 6880
6876 6881 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6877 6882 example with IPython. Various other minor fixes and cleanups.
6878 6883
6879 6884 * Version 0.1.9 released, 0.1.10 opened for further work.
6880 6885
6881 6886 * Added sys.path to the list of directories searched in the
6882 6887 execfile= option. It used to be the current directory and the
6883 6888 user's IPYTHONDIR only.
6884 6889
6885 6890 2001-11-13 Fernando Perez <fperez@colorado.edu>
6886 6891
6887 6892 * Reinstated the raw_input/prefilter separation that Janko had
6888 6893 initially. This gives a more convenient setup for extending the
6889 6894 pre-processor from the outside: raw_input always gets a string,
6890 6895 and prefilter has to process it. We can then redefine prefilter
6891 6896 from the outside and implement extensions for special
6892 6897 purposes.
6893 6898
6894 6899 Today I got one for inputting PhysicalQuantity objects
6895 6900 (from Scientific) without needing any function calls at
6896 6901 all. Extremely convenient, and it's all done as a user-level
6897 6902 extension (no IPython code was touched). Now instead of:
6898 6903 a = PhysicalQuantity(4.2,'m/s**2')
6899 6904 one can simply say
6900 6905 a = 4.2 m/s**2
6901 6906 or even
6902 6907 a = 4.2 m/s^2
6903 6908
6904 6909 I use this, but it's also a proof of concept: IPython really is
6905 6910 fully user-extensible, even at the level of the parsing of the
6906 6911 command line. It's not trivial, but it's perfectly doable.
6907 6912
6908 6913 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6909 6914 the problem of modules being loaded in the inverse order in which
6910 6915 they were defined in
6911 6916
6912 6917 * Version 0.1.8 released, 0.1.9 opened for further work.
6913 6918
6914 6919 * Added magics pdef, source and file. They respectively show the
6915 6920 definition line ('prototype' in C), source code and full python
6916 6921 file for any callable object. The object inspector oinfo uses
6917 6922 these to show the same information.
6918 6923
6919 6924 * Version 0.1.7 released, 0.1.8 opened for further work.
6920 6925
6921 6926 * Separated all the magic functions into a class called Magic. The
6922 6927 InteractiveShell class was becoming too big for Xemacs to handle
6923 6928 (de-indenting a line would lock it up for 10 seconds while it
6924 6929 backtracked on the whole class!)
6925 6930
6926 6931 FIXME: didn't work. It can be done, but right now namespaces are
6927 6932 all messed up. Do it later (reverted it for now, so at least
6928 6933 everything works as before).
6929 6934
6930 6935 * Got the object introspection system (magic_oinfo) working! I
6931 6936 think this is pretty much ready for release to Janko, so he can
6932 6937 test it for a while and then announce it. Pretty much 100% of what
6933 6938 I wanted for the 'phase 1' release is ready. Happy, tired.
6934 6939
6935 6940 2001-11-12 Fernando Perez <fperez@colorado.edu>
6936 6941
6937 6942 * Version 0.1.6 released, 0.1.7 opened for further work.
6938 6943
6939 6944 * Fixed bug in printing: it used to test for truth before
6940 6945 printing, so 0 wouldn't print. Now checks for None.
6941 6946
6942 6947 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6943 6948 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6944 6949 reaches by hand into the outputcache. Think of a better way to do
6945 6950 this later.
6946 6951
6947 6952 * Various small fixes thanks to Nathan's comments.
6948 6953
6949 6954 * Changed magic_pprint to magic_Pprint. This way it doesn't
6950 6955 collide with pprint() and the name is consistent with the command
6951 6956 line option.
6952 6957
6953 6958 * Changed prompt counter behavior to be fully like
6954 6959 Mathematica's. That is, even input that doesn't return a result
6955 6960 raises the prompt counter. The old behavior was kind of confusing
6956 6961 (getting the same prompt number several times if the operation
6957 6962 didn't return a result).
6958 6963
6959 6964 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6960 6965
6961 6966 * Fixed -Classic mode (wasn't working anymore).
6962 6967
6963 6968 * Added colored prompts using Nathan's new code. Colors are
6964 6969 currently hardwired, they can be user-configurable. For
6965 6970 developers, they can be chosen in file ipythonlib.py, at the
6966 6971 beginning of the CachedOutput class def.
6967 6972
6968 6973 2001-11-11 Fernando Perez <fperez@colorado.edu>
6969 6974
6970 6975 * Version 0.1.5 released, 0.1.6 opened for further work.
6971 6976
6972 6977 * Changed magic_env to *return* the environment as a dict (not to
6973 6978 print it). This way it prints, but it can also be processed.
6974 6979
6975 6980 * Added Verbose exception reporting to interactive
6976 6981 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6977 6982 traceback. Had to make some changes to the ultraTB file. This is
6978 6983 probably the last 'big' thing in my mental todo list. This ties
6979 6984 in with the next entry:
6980 6985
6981 6986 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6982 6987 has to specify is Plain, Color or Verbose for all exception
6983 6988 handling.
6984 6989
6985 6990 * Removed ShellServices option. All this can really be done via
6986 6991 the magic system. It's easier to extend, cleaner and has automatic
6987 6992 namespace protection and documentation.
6988 6993
6989 6994 2001-11-09 Fernando Perez <fperez@colorado.edu>
6990 6995
6991 6996 * Fixed bug in output cache flushing (missing parameter to
6992 6997 __init__). Other small bugs fixed (found using pychecker).
6993 6998
6994 6999 * Version 0.1.4 opened for bugfixing.
6995 7000
6996 7001 2001-11-07 Fernando Perez <fperez@colorado.edu>
6997 7002
6998 7003 * Version 0.1.3 released, mainly because of the raw_input bug.
6999 7004
7000 7005 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
7001 7006 and when testing for whether things were callable, a call could
7002 7007 actually be made to certain functions. They would get called again
7003 7008 once 'really' executed, with a resulting double call. A disaster
7004 7009 in many cases (list.reverse() would never work!).
7005 7010
7006 7011 * Removed prefilter() function, moved its code to raw_input (which
7007 7012 after all was just a near-empty caller for prefilter). This saves
7008 7013 a function call on every prompt, and simplifies the class a tiny bit.
7009 7014
7010 7015 * Fix _ip to __ip name in magic example file.
7011 7016
7012 7017 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
7013 7018 work with non-gnu versions of tar.
7014 7019
7015 7020 2001-11-06 Fernando Perez <fperez@colorado.edu>
7016 7021
7017 7022 * Version 0.1.2. Just to keep track of the recent changes.
7018 7023
7019 7024 * Fixed nasty bug in output prompt routine. It used to check 'if
7020 7025 arg != None...'. Problem is, this fails if arg implements a
7021 7026 special comparison (__cmp__) which disallows comparing to
7022 7027 None. Found it when trying to use the PhysicalQuantity module from
7023 7028 ScientificPython.
7024 7029
7025 7030 2001-11-05 Fernando Perez <fperez@colorado.edu>
7026 7031
7027 7032 * Also added dirs. Now the pushd/popd/dirs family functions
7028 7033 basically like the shell, with the added convenience of going home
7029 7034 when called with no args.
7030 7035
7031 7036 * pushd/popd slightly modified to mimic shell behavior more
7032 7037 closely.
7033 7038
7034 7039 * Added env,pushd,popd from ShellServices as magic functions. I
7035 7040 think the cleanest will be to port all desired functions from
7036 7041 ShellServices as magics and remove ShellServices altogether. This
7037 7042 will provide a single, clean way of adding functionality
7038 7043 (shell-type or otherwise) to IP.
7039 7044
7040 7045 2001-11-04 Fernando Perez <fperez@colorado.edu>
7041 7046
7042 7047 * Added .ipython/ directory to sys.path. This way users can keep
7043 7048 customizations there and access them via import.
7044 7049
7045 7050 2001-11-03 Fernando Perez <fperez@colorado.edu>
7046 7051
7047 7052 * Opened version 0.1.1 for new changes.
7048 7053
7049 7054 * Changed version number to 0.1.0: first 'public' release, sent to
7050 7055 Nathan and Janko.
7051 7056
7052 7057 * Lots of small fixes and tweaks.
7053 7058
7054 7059 * Minor changes to whos format. Now strings are shown, snipped if
7055 7060 too long.
7056 7061
7057 7062 * Changed ShellServices to work on __main__ so they show up in @who
7058 7063
7059 7064 * Help also works with ? at the end of a line:
7060 7065 ?sin and sin?
7061 7066 both produce the same effect. This is nice, as often I use the
7062 7067 tab-complete to find the name of a method, but I used to then have
7063 7068 to go to the beginning of the line to put a ? if I wanted more
7064 7069 info. Now I can just add the ? and hit return. Convenient.
7065 7070
7066 7071 2001-11-02 Fernando Perez <fperez@colorado.edu>
7067 7072
7068 7073 * Python version check (>=2.1) added.
7069 7074
7070 7075 * Added LazyPython documentation. At this point the docs are quite
7071 7076 a mess. A cleanup is in order.
7072 7077
7073 7078 * Auto-installer created. For some bizarre reason, the zipfiles
7074 7079 module isn't working on my system. So I made a tar version
7075 7080 (hopefully the command line options in various systems won't kill
7076 7081 me).
7077 7082
7078 7083 * Fixes to Struct in genutils. Now all dictionary-like methods are
7079 7084 protected (reasonably).
7080 7085
7081 7086 * Added pager function to genutils and changed ? to print usage
7082 7087 note through it (it was too long).
7083 7088
7084 7089 * Added the LazyPython functionality. Works great! I changed the
7085 7090 auto-quote escape to ';', it's on home row and next to '. But
7086 7091 both auto-quote and auto-paren (still /) escapes are command-line
7087 7092 parameters.
7088 7093
7089 7094
7090 7095 2001-11-01 Fernando Perez <fperez@colorado.edu>
7091 7096
7092 7097 * Version changed to 0.0.7. Fairly large change: configuration now
7093 7098 is all stored in a directory, by default .ipython. There, all
7094 7099 config files have normal looking names (not .names)
7095 7100
7096 7101 * Version 0.0.6 Released first to Lucas and Archie as a test
7097 7102 run. Since it's the first 'semi-public' release, change version to
7098 7103 > 0.0.6 for any changes now.
7099 7104
7100 7105 * Stuff I had put in the ipplib.py changelog:
7101 7106
7102 7107 Changes to InteractiveShell:
7103 7108
7104 7109 - Made the usage message a parameter.
7105 7110
7106 7111 - Require the name of the shell variable to be given. It's a bit
7107 7112 of a hack, but allows the name 'shell' not to be hardwired in the
7108 7113 magic (@) handler, which is problematic b/c it requires
7109 7114 polluting the global namespace with 'shell'. This in turn is
7110 7115 fragile: if a user redefines a variable called shell, things
7111 7116 break.
7112 7117
7113 7118 - magic @: all functions available through @ need to be defined
7114 7119 as magic_<name>, even though they can be called simply as
7115 7120 @<name>. This allows the special command @magic to gather
7116 7121 information automatically about all existing magic functions,
7117 7122 even if they are run-time user extensions, by parsing the shell
7118 7123 instance __dict__ looking for special magic_ names.
7119 7124
7120 7125 - mainloop: added *two* local namespace parameters. This allows
7121 7126 the class to differentiate between parameters which were there
7122 7127 before and after command line initialization was processed. This
7123 7128 way, later @who can show things loaded at startup by the
7124 7129 user. This trick was necessary to make session saving/reloading
7125 7130 really work: ideally after saving/exiting/reloading a session,
7126 7131 *everything* should look the same, including the output of @who. I
7127 7132 was only able to make this work with this double namespace
7128 7133 trick.
7129 7134
7130 7135 - added a header to the logfile which allows (almost) full
7131 7136 session restoring.
7132 7137
7133 7138 - prepend lines beginning with @ or !, with a and log
7134 7139 them. Why? !lines: may be useful to know what you did @lines:
7135 7140 they may affect session state. So when restoring a session, at
7136 7141 least inform the user of their presence. I couldn't quite get
7137 7142 them to properly re-execute, but at least the user is warned.
7138 7143
7139 7144 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now