##// END OF EJS Templates
add sys.setdefaultencoding() call after a patch by 'pan'. ChangeLogs
vivainio -
Show More
@@ -1,2579 +1,2589 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 2885 2007-12-07 10:59:06Z vivainio $
9 $Id: iplib.py 2889 2007-12-12 19:32:33Z 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 exceptions
45 45 import glob
46 46 import inspect
47 47 import keyword
48 48 import new
49 49 import os
50 50 import pydoc
51 51 import re
52 52 import shutil
53 53 import string
54 54 import sys
55 55 import tempfile
56 56 import traceback
57 57 import types
58 58 from sets import Set
59 59 from pprint import pprint, pformat
60 60
61 61 # IPython's own modules
62 62 #import IPython
63 63 from IPython import Debugger,OInspect,PyColorize,ultraTB
64 64 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
65 65 from IPython.Extensions import pickleshare
66 66 from IPython.FakeModule import FakeModule
67 67 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
68 68 from IPython.Logger import Logger
69 69 from IPython.Magic import Magic
70 70 from IPython.Prompts import CachedOutput
71 71 from IPython.ipstruct import Struct
72 72 from IPython.background_jobs import BackgroundJobManager
73 73 from IPython.usage import cmd_line_usage,interactive_usage
74 74 from IPython.genutils import *
75 75 from IPython.strdispatch import StrDispatch
76 76 import IPython.ipapi
77 77 import IPython.history
78 78 import IPython.prefilter as prefilter
79 79 import IPython.shadowns
80 80 # Globals
81 81
82 # make converting between str and unicode easy, so str() will work most of the
83 # time
84
85 try:
86 sys.setappdefaultencoding(sys.stdin.encoding or 'ascii')
87 except:
88 # Many python versions don't have sys.setappdefaultencoding
89 reload(sys)
90 sys.setdefaultencoding(sys.stdin.encoding or 'ascii')
91
82 92 # store the builtin raw_input globally, and use this always, in case user code
83 93 # overwrites it (like wx.py.PyShell does)
84 94 raw_input_original = raw_input
85 95
86 96 # compiled regexps for autoindent management
87 97 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
88 98
89 99
90 100 #****************************************************************************
91 101 # Some utility function definitions
92 102
93 103 ini_spaces_re = re.compile(r'^(\s+)')
94 104
95 105 def num_ini_spaces(strng):
96 106 """Return the number of initial spaces in a string"""
97 107
98 108 ini_spaces = ini_spaces_re.match(strng)
99 109 if ini_spaces:
100 110 return ini_spaces.end()
101 111 else:
102 112 return 0
103 113
104 114 def softspace(file, newvalue):
105 115 """Copied from code.py, to remove the dependency"""
106 116
107 117 oldvalue = 0
108 118 try:
109 119 oldvalue = file.softspace
110 120 except AttributeError:
111 121 pass
112 122 try:
113 123 file.softspace = newvalue
114 124 except (AttributeError, TypeError):
115 125 # "attribute-less object" or "read-only attributes"
116 126 pass
117 127 return oldvalue
118 128
119 129
120 130 #****************************************************************************
121 131 # Local use exceptions
122 132 class SpaceInInput(exceptions.Exception): pass
123 133
124 134
125 135 #****************************************************************************
126 136 # Local use classes
127 137 class Bunch: pass
128 138
129 139 class Undefined: pass
130 140
131 141 class Quitter(object):
132 142 """Simple class to handle exit, similar to Python 2.5's.
133 143
134 144 It handles exiting in an ipython-safe manner, which the one in Python 2.5
135 145 doesn't do (obviously, since it doesn't know about ipython)."""
136 146
137 147 def __init__(self,shell,name):
138 148 self.shell = shell
139 149 self.name = name
140 150
141 151 def __repr__(self):
142 152 return 'Type %s() to exit.' % self.name
143 153 __str__ = __repr__
144 154
145 155 def __call__(self):
146 156 self.shell.exit()
147 157
148 158 class InputList(list):
149 159 """Class to store user input.
150 160
151 161 It's basically a list, but slices return a string instead of a list, thus
152 162 allowing things like (assuming 'In' is an instance):
153 163
154 164 exec In[4:7]
155 165
156 166 or
157 167
158 168 exec In[5:9] + In[14] + In[21:25]"""
159 169
160 170 def __getslice__(self,i,j):
161 171 return ''.join(list.__getslice__(self,i,j))
162 172
163 173 class SyntaxTB(ultraTB.ListTB):
164 174 """Extension which holds some state: the last exception value"""
165 175
166 176 def __init__(self,color_scheme = 'NoColor'):
167 177 ultraTB.ListTB.__init__(self,color_scheme)
168 178 self.last_syntax_error = None
169 179
170 180 def __call__(self, etype, value, elist):
171 181 self.last_syntax_error = value
172 182 ultraTB.ListTB.__call__(self,etype,value,elist)
173 183
174 184 def clear_err_state(self):
175 185 """Return the current error state and clear it"""
176 186 e = self.last_syntax_error
177 187 self.last_syntax_error = None
178 188 return e
179 189
180 190 #****************************************************************************
181 191 # Main IPython class
182 192
183 193 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
184 194 # until a full rewrite is made. I've cleaned all cross-class uses of
185 195 # attributes and methods, but too much user code out there relies on the
186 196 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
187 197 #
188 198 # But at least now, all the pieces have been separated and we could, in
189 199 # principle, stop using the mixin. This will ease the transition to the
190 200 # chainsaw branch.
191 201
192 202 # For reference, the following is the list of 'self.foo' uses in the Magic
193 203 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
194 204 # class, to prevent clashes.
195 205
196 206 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
197 207 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
198 208 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
199 209 # 'self.value']
200 210
201 211 class InteractiveShell(object,Magic):
202 212 """An enhanced console for Python."""
203 213
204 214 # class attribute to indicate whether the class supports threads or not.
205 215 # Subclasses with thread support should override this as needed.
206 216 isthreaded = False
207 217
208 218 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
209 219 user_ns = None,user_global_ns=None,banner2='',
210 220 custom_exceptions=((),None),embedded=False):
211 221
212 222 # log system
213 223 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
214 224
215 225 # some minimal strict typechecks. For some core data structures, I
216 226 # want actual basic python types, not just anything that looks like
217 227 # one. This is especially true for namespaces.
218 228 for ns in (user_ns,user_global_ns):
219 229 if ns is not None and type(ns) != types.DictType:
220 230 raise TypeError,'namespace must be a dictionary'
221 231
222 232 # Job manager (for jobs run as background threads)
223 233 self.jobs = BackgroundJobManager()
224 234
225 235 # Store the actual shell's name
226 236 self.name = name
227 237
228 238 # We need to know whether the instance is meant for embedding, since
229 239 # global/local namespaces need to be handled differently in that case
230 240 self.embedded = embedded
231 241 if embedded:
232 242 # Control variable so users can, from within the embedded instance,
233 243 # permanently deactivate it.
234 244 self.embedded_active = True
235 245
236 246 # command compiler
237 247 self.compile = codeop.CommandCompiler()
238 248
239 249 # User input buffer
240 250 self.buffer = []
241 251
242 252 # Default name given in compilation of code
243 253 self.filename = '<ipython console>'
244 254
245 255 # Install our own quitter instead of the builtins. For python2.3-2.4,
246 256 # this brings in behavior like 2.5, and for 2.5 it's identical.
247 257 __builtin__.exit = Quitter(self,'exit')
248 258 __builtin__.quit = Quitter(self,'quit')
249 259
250 260 # Make an empty namespace, which extension writers can rely on both
251 261 # existing and NEVER being used by ipython itself. This gives them a
252 262 # convenient location for storing additional information and state
253 263 # their extensions may require, without fear of collisions with other
254 264 # ipython names that may develop later.
255 265 self.meta = Struct()
256 266
257 267 # Create the namespace where the user will operate. user_ns is
258 268 # normally the only one used, and it is passed to the exec calls as
259 269 # the locals argument. But we do carry a user_global_ns namespace
260 270 # given as the exec 'globals' argument, This is useful in embedding
261 271 # situations where the ipython shell opens in a context where the
262 272 # distinction between locals and globals is meaningful.
263 273
264 274 # FIXME. For some strange reason, __builtins__ is showing up at user
265 275 # level as a dict instead of a module. This is a manual fix, but I
266 276 # should really track down where the problem is coming from. Alex
267 277 # Schmolck reported this problem first.
268 278
269 279 # A useful post by Alex Martelli on this topic:
270 280 # Re: inconsistent value from __builtins__
271 281 # Von: Alex Martelli <aleaxit@yahoo.com>
272 282 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
273 283 # Gruppen: comp.lang.python
274 284
275 285 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
276 286 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
277 287 # > <type 'dict'>
278 288 # > >>> print type(__builtins__)
279 289 # > <type 'module'>
280 290 # > Is this difference in return value intentional?
281 291
282 292 # Well, it's documented that '__builtins__' can be either a dictionary
283 293 # or a module, and it's been that way for a long time. Whether it's
284 294 # intentional (or sensible), I don't know. In any case, the idea is
285 295 # that if you need to access the built-in namespace directly, you
286 296 # should start with "import __builtin__" (note, no 's') which will
287 297 # definitely give you a module. Yeah, it's somewhat confusing:-(.
288 298
289 299 # These routines return properly built dicts as needed by the rest of
290 300 # the code, and can also be used by extension writers to generate
291 301 # properly initialized namespaces.
292 302 user_ns = IPython.ipapi.make_user_ns(user_ns)
293 303 user_global_ns = IPython.ipapi.make_user_global_ns(user_global_ns)
294 304
295 305 # Assign namespaces
296 306 # This is the namespace where all normal user variables live
297 307 self.user_ns = user_ns
298 308 # Embedded instances require a separate namespace for globals.
299 309 # Normally this one is unused by non-embedded instances.
300 310 self.user_global_ns = user_global_ns
301 311 # A namespace to keep track of internal data structures to prevent
302 312 # them from cluttering user-visible stuff. Will be updated later
303 313 self.internal_ns = {}
304 314
305 315 # Namespace of system aliases. Each entry in the alias
306 316 # table must be a 2-tuple of the form (N,name), where N is the number
307 317 # of positional arguments of the alias.
308 318 self.alias_table = {}
309 319
310 320 # A table holding all the namespaces IPython deals with, so that
311 321 # introspection facilities can search easily.
312 322 self.ns_table = {'user':user_ns,
313 323 'user_global':user_global_ns,
314 324 'alias':self.alias_table,
315 325 'internal':self.internal_ns,
316 326 'builtin':__builtin__.__dict__
317 327 }
318 328 # The user namespace MUST have a pointer to the shell itself.
319 329 self.user_ns[name] = self
320 330
321 331 # We need to insert into sys.modules something that looks like a
322 332 # module but which accesses the IPython namespace, for shelve and
323 333 # pickle to work interactively. Normally they rely on getting
324 334 # everything out of __main__, but for embedding purposes each IPython
325 335 # instance has its own private namespace, so we can't go shoving
326 336 # everything into __main__.
327 337
328 338 # note, however, that we should only do this for non-embedded
329 339 # ipythons, which really mimic the __main__.__dict__ with their own
330 340 # namespace. Embedded instances, on the other hand, should not do
331 341 # this because they need to manage the user local/global namespaces
332 342 # only, but they live within a 'normal' __main__ (meaning, they
333 343 # shouldn't overtake the execution environment of the script they're
334 344 # embedded in).
335 345
336 346 if not embedded:
337 347 try:
338 348 main_name = self.user_ns['__name__']
339 349 except KeyError:
340 350 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
341 351 else:
342 352 #print "pickle hack in place" # dbg
343 353 #print 'main_name:',main_name # dbg
344 354 sys.modules[main_name] = FakeModule(self.user_ns)
345 355
346 356 # Now that FakeModule produces a real module, we've run into a nasty
347 357 # problem: after script execution (via %run), the module where the user
348 358 # code ran is deleted. Now that this object is a true module (needed
349 359 # so docetst and other tools work correctly), the Python module
350 360 # teardown mechanism runs over it, and sets to None every variable
351 361 # present in that module. This means that later calls to functions
352 362 # defined in the script (which have become interactively visible after
353 363 # script exit) fail, because they hold references to objects that have
354 364 # become overwritten into None. The only solution I see right now is
355 365 # to protect every FakeModule used by %run by holding an internal
356 366 # reference to it. This private list will be used for that. The
357 367 # %reset command will flush it as well.
358 368 self._user_main_modules = []
359 369
360 370 # List of input with multi-line handling.
361 371 # Fill its zero entry, user counter starts at 1
362 372 self.input_hist = InputList(['\n'])
363 373 # This one will hold the 'raw' input history, without any
364 374 # pre-processing. This will allow users to retrieve the input just as
365 375 # it was exactly typed in by the user, with %hist -r.
366 376 self.input_hist_raw = InputList(['\n'])
367 377
368 378 # list of visited directories
369 379 try:
370 380 self.dir_hist = [os.getcwd()]
371 381 except OSError:
372 382 self.dir_hist = []
373 383
374 384 # dict of output history
375 385 self.output_hist = {}
376 386
377 387 # Get system encoding at startup time. Certain terminals (like Emacs
378 388 # under Win32 have it set to None, and we need to have a known valid
379 389 # encoding to use in the raw_input() method
380 390 self.stdin_encoding = sys.stdin.encoding or 'ascii'
381 391
382 392 # dict of things NOT to alias (keywords, builtins and some magics)
383 393 no_alias = {}
384 394 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
385 395 for key in keyword.kwlist + no_alias_magics:
386 396 no_alias[key] = 1
387 397 no_alias.update(__builtin__.__dict__)
388 398 self.no_alias = no_alias
389 399
390 400 # make global variables for user access to these
391 401 self.user_ns['_ih'] = self.input_hist
392 402 self.user_ns['_oh'] = self.output_hist
393 403 self.user_ns['_dh'] = self.dir_hist
394 404
395 405 # user aliases to input and output histories
396 406 self.user_ns['In'] = self.input_hist
397 407 self.user_ns['Out'] = self.output_hist
398 408
399 409 self.user_ns['_sh'] = IPython.shadowns
400 410 # Object variable to store code object waiting execution. This is
401 411 # used mainly by the multithreaded shells, but it can come in handy in
402 412 # other situations. No need to use a Queue here, since it's a single
403 413 # item which gets cleared once run.
404 414 self.code_to_run = None
405 415
406 416 # escapes for automatic behavior on the command line
407 417 self.ESC_SHELL = '!'
408 418 self.ESC_SH_CAP = '!!'
409 419 self.ESC_HELP = '?'
410 420 self.ESC_MAGIC = '%'
411 421 self.ESC_QUOTE = ','
412 422 self.ESC_QUOTE2 = ';'
413 423 self.ESC_PAREN = '/'
414 424
415 425 # And their associated handlers
416 426 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
417 427 self.ESC_QUOTE : self.handle_auto,
418 428 self.ESC_QUOTE2 : self.handle_auto,
419 429 self.ESC_MAGIC : self.handle_magic,
420 430 self.ESC_HELP : self.handle_help,
421 431 self.ESC_SHELL : self.handle_shell_escape,
422 432 self.ESC_SH_CAP : self.handle_shell_escape,
423 433 }
424 434
425 435 # class initializations
426 436 Magic.__init__(self,self)
427 437
428 438 # Python source parser/formatter for syntax highlighting
429 439 pyformat = PyColorize.Parser().format
430 440 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
431 441
432 442 # hooks holds pointers used for user-side customizations
433 443 self.hooks = Struct()
434 444
435 445 self.strdispatchers = {}
436 446
437 447 # Set all default hooks, defined in the IPython.hooks module.
438 448 hooks = IPython.hooks
439 449 for hook_name in hooks.__all__:
440 450 # default hooks have priority 100, i.e. low; user hooks should have
441 451 # 0-100 priority
442 452 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
443 453 #print "bound hook",hook_name
444 454
445 455 # Flag to mark unconditional exit
446 456 self.exit_now = False
447 457
448 458 self.usage_min = """\
449 459 An enhanced console for Python.
450 460 Some of its features are:
451 461 - Readline support if the readline library is present.
452 462 - Tab completion in the local namespace.
453 463 - Logging of input, see command-line options.
454 464 - System shell escape via ! , eg !ls.
455 465 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
456 466 - Keeps track of locally defined variables via %who, %whos.
457 467 - Show object information with a ? eg ?x or x? (use ?? for more info).
458 468 """
459 469 if usage: self.usage = usage
460 470 else: self.usage = self.usage_min
461 471
462 472 # Storage
463 473 self.rc = rc # This will hold all configuration information
464 474 self.pager = 'less'
465 475 # temporary files used for various purposes. Deleted at exit.
466 476 self.tempfiles = []
467 477
468 478 # Keep track of readline usage (later set by init_readline)
469 479 self.has_readline = False
470 480
471 481 # template for logfile headers. It gets resolved at runtime by the
472 482 # logstart method.
473 483 self.loghead_tpl = \
474 484 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
475 485 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
476 486 #log# opts = %s
477 487 #log# args = %s
478 488 #log# It is safe to make manual edits below here.
479 489 #log#-----------------------------------------------------------------------
480 490 """
481 491 # for pushd/popd management
482 492 try:
483 493 self.home_dir = get_home_dir()
484 494 except HomeDirError,msg:
485 495 fatal(msg)
486 496
487 497 self.dir_stack = []
488 498
489 499 # Functions to call the underlying shell.
490 500
491 501 # The first is similar to os.system, but it doesn't return a value,
492 502 # and it allows interpolation of variables in the user's namespace.
493 503 self.system = lambda cmd: \
494 504 shell(self.var_expand(cmd,depth=2),
495 505 header=self.rc.system_header,
496 506 verbose=self.rc.system_verbose)
497 507
498 508 # These are for getoutput and getoutputerror:
499 509 self.getoutput = lambda cmd: \
500 510 getoutput(self.var_expand(cmd,depth=2),
501 511 header=self.rc.system_header,
502 512 verbose=self.rc.system_verbose)
503 513
504 514 self.getoutputerror = lambda cmd: \
505 515 getoutputerror(self.var_expand(cmd,depth=2),
506 516 header=self.rc.system_header,
507 517 verbose=self.rc.system_verbose)
508 518
509 519
510 520 # keep track of where we started running (mainly for crash post-mortem)
511 521 self.starting_dir = os.getcwd()
512 522
513 523 # Various switches which can be set
514 524 self.CACHELENGTH = 5000 # this is cheap, it's just text
515 525 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
516 526 self.banner2 = banner2
517 527
518 528 # TraceBack handlers:
519 529
520 530 # Syntax error handler.
521 531 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
522 532
523 533 # The interactive one is initialized with an offset, meaning we always
524 534 # want to remove the topmost item in the traceback, which is our own
525 535 # internal code. Valid modes: ['Plain','Context','Verbose']
526 536 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
527 537 color_scheme='NoColor',
528 538 tb_offset = 1)
529 539
530 540 # IPython itself shouldn't crash. This will produce a detailed
531 541 # post-mortem if it does. But we only install the crash handler for
532 542 # non-threaded shells, the threaded ones use a normal verbose reporter
533 543 # and lose the crash handler. This is because exceptions in the main
534 544 # thread (such as in GUI code) propagate directly to sys.excepthook,
535 545 # and there's no point in printing crash dumps for every user exception.
536 546 if self.isthreaded:
537 547 ipCrashHandler = ultraTB.FormattedTB()
538 548 else:
539 549 from IPython import CrashHandler
540 550 ipCrashHandler = CrashHandler.IPythonCrashHandler(self)
541 551 self.set_crash_handler(ipCrashHandler)
542 552
543 553 # and add any custom exception handlers the user may have specified
544 554 self.set_custom_exc(*custom_exceptions)
545 555
546 556 # indentation management
547 557 self.autoindent = False
548 558 self.indent_current_nsp = 0
549 559
550 560 # Make some aliases automatically
551 561 # Prepare list of shell aliases to auto-define
552 562 if os.name == 'posix':
553 563 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
554 564 'mv mv -i','rm rm -i','cp cp -i',
555 565 'cat cat','less less','clear clear',
556 566 # a better ls
557 567 'ls ls -F',
558 568 # long ls
559 569 'll ls -lF')
560 570 # Extra ls aliases with color, which need special treatment on BSD
561 571 # variants
562 572 ls_extra = ( # color ls
563 573 'lc ls -F -o --color',
564 574 # ls normal files only
565 575 'lf ls -F -o --color %l | grep ^-',
566 576 # ls symbolic links
567 577 'lk ls -F -o --color %l | grep ^l',
568 578 # directories or links to directories,
569 579 'ldir ls -F -o --color %l | grep /$',
570 580 # things which are executable
571 581 'lx ls -F -o --color %l | grep ^-..x',
572 582 )
573 583 # The BSDs don't ship GNU ls, so they don't understand the
574 584 # --color switch out of the box
575 585 if 'bsd' in sys.platform:
576 586 ls_extra = ( # ls normal files only
577 587 'lf ls -lF | grep ^-',
578 588 # ls symbolic links
579 589 'lk ls -lF | grep ^l',
580 590 # directories or links to directories,
581 591 'ldir ls -lF | grep /$',
582 592 # things which are executable
583 593 'lx ls -lF | grep ^-..x',
584 594 )
585 595 auto_alias = auto_alias + ls_extra
586 596 elif os.name in ['nt','dos']:
587 597 auto_alias = ('ls dir /on',
588 598 'ddir dir /ad /on', 'ldir dir /ad /on',
589 599 'mkdir mkdir','rmdir rmdir','echo echo',
590 600 'ren ren','cls cls','copy copy')
591 601 else:
592 602 auto_alias = ()
593 603 self.auto_alias = [s.split(None,1) for s in auto_alias]
594 604
595 605 # Produce a public API instance
596 606 self.api = IPython.ipapi.IPApi(self)
597 607
598 608 # Call the actual (public) initializer
599 609 self.init_auto_alias()
600 610
601 611 # track which builtins we add, so we can clean up later
602 612 self.builtins_added = {}
603 613 # This method will add the necessary builtins for operation, but
604 614 # tracking what it did via the builtins_added dict.
605 615 self.add_builtins()
606 616
607 617
608 618
609 619 # end __init__
610 620
611 621 def var_expand(self,cmd,depth=0):
612 622 """Expand python variables in a string.
613 623
614 624 The depth argument indicates how many frames above the caller should
615 625 be walked to look for the local namespace where to expand variables.
616 626
617 627 The global namespace for expansion is always the user's interactive
618 628 namespace.
619 629 """
620 630
621 631 return str(ItplNS(cmd,
622 632 self.user_ns, # globals
623 633 # Skip our own frame in searching for locals:
624 634 sys._getframe(depth+1).f_locals # locals
625 635 ))
626 636
627 637 def pre_config_initialization(self):
628 638 """Pre-configuration init method
629 639
630 640 This is called before the configuration files are processed to
631 641 prepare the services the config files might need.
632 642
633 643 self.rc already has reasonable default values at this point.
634 644 """
635 645 rc = self.rc
636 646 try:
637 647 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
638 648 except exceptions.UnicodeDecodeError:
639 649 print "Your ipythondir can't be decoded to unicode!"
640 650 print "Please set HOME environment variable to something that"
641 651 print r"only has ASCII characters, e.g. c:\home"
642 652 print "Now it is",rc.ipythondir
643 653 sys.exit()
644 654 self.shadowhist = IPython.history.ShadowHist(self.db)
645 655
646 656
647 657 def post_config_initialization(self):
648 658 """Post configuration init method
649 659
650 660 This is called after the configuration files have been processed to
651 661 'finalize' the initialization."""
652 662
653 663 rc = self.rc
654 664
655 665 # Object inspector
656 666 self.inspector = OInspect.Inspector(OInspect.InspectColors,
657 667 PyColorize.ANSICodeColors,
658 668 'NoColor',
659 669 rc.object_info_string_level)
660 670
661 671 self.rl_next_input = None
662 672 self.rl_do_indent = False
663 673 # Load readline proper
664 674 if rc.readline:
665 675 self.init_readline()
666 676
667 677
668 678 # local shortcut, this is used a LOT
669 679 self.log = self.logger.log
670 680
671 681 # Initialize cache, set in/out prompts and printing system
672 682 self.outputcache = CachedOutput(self,
673 683 rc.cache_size,
674 684 rc.pprint,
675 685 input_sep = rc.separate_in,
676 686 output_sep = rc.separate_out,
677 687 output_sep2 = rc.separate_out2,
678 688 ps1 = rc.prompt_in1,
679 689 ps2 = rc.prompt_in2,
680 690 ps_out = rc.prompt_out,
681 691 pad_left = rc.prompts_pad_left)
682 692
683 693 # user may have over-ridden the default print hook:
684 694 try:
685 695 self.outputcache.__class__.display = self.hooks.display
686 696 except AttributeError:
687 697 pass
688 698
689 699 # I don't like assigning globally to sys, because it means when
690 700 # embedding instances, each embedded instance overrides the previous
691 701 # choice. But sys.displayhook seems to be called internally by exec,
692 702 # so I don't see a way around it. We first save the original and then
693 703 # overwrite it.
694 704 self.sys_displayhook = sys.displayhook
695 705 sys.displayhook = self.outputcache
696 706
697 707 # Do a proper resetting of doctest, including the necessary displayhook
698 708 # monkeypatching
699 709 doctest_reload()
700 710
701 711 # Set user colors (don't do it in the constructor above so that it
702 712 # doesn't crash if colors option is invalid)
703 713 self.magic_colors(rc.colors)
704 714
705 715 # Set calling of pdb on exceptions
706 716 self.call_pdb = rc.pdb
707 717
708 718 # Load user aliases
709 719 for alias in rc.alias:
710 720 self.magic_alias(alias)
711 721
712 722 self.hooks.late_startup_hook()
713 723
714 724 batchrun = False
715 725 for batchfile in [path(arg) for arg in self.rc.args
716 726 if arg.lower().endswith('.ipy')]:
717 727 if not batchfile.isfile():
718 728 print "No such batch file:", batchfile
719 729 continue
720 730 self.api.runlines(batchfile.text())
721 731 batchrun = True
722 732 # without -i option, exit after running the batch file
723 733 if batchrun and not self.rc.interact:
724 734 self.exit_now = True
725 735
726 736 def add_builtins(self):
727 737 """Store ipython references into the builtin namespace.
728 738
729 739 Some parts of ipython operate via builtins injected here, which hold a
730 740 reference to IPython itself."""
731 741
732 742 # TODO: deprecate all except _ip; 'jobs' should be installed
733 743 # by an extension and the rest are under _ip, ipalias is redundant
734 744 builtins_new = dict(__IPYTHON__ = self,
735 745 ip_set_hook = self.set_hook,
736 746 jobs = self.jobs,
737 747 ipmagic = wrap_deprecated(self.ipmagic,'_ip.magic()'),
738 748 ipalias = wrap_deprecated(self.ipalias),
739 749 ipsystem = wrap_deprecated(self.ipsystem,'_ip.system()'),
740 750 _ip = self.api
741 751 )
742 752 for biname,bival in builtins_new.items():
743 753 try:
744 754 # store the orignal value so we can restore it
745 755 self.builtins_added[biname] = __builtin__.__dict__[biname]
746 756 except KeyError:
747 757 # or mark that it wasn't defined, and we'll just delete it at
748 758 # cleanup
749 759 self.builtins_added[biname] = Undefined
750 760 __builtin__.__dict__[biname] = bival
751 761
752 762 # Keep in the builtins a flag for when IPython is active. We set it
753 763 # with setdefault so that multiple nested IPythons don't clobber one
754 764 # another. Each will increase its value by one upon being activated,
755 765 # which also gives us a way to determine the nesting level.
756 766 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
757 767
758 768 def clean_builtins(self):
759 769 """Remove any builtins which might have been added by add_builtins, or
760 770 restore overwritten ones to their previous values."""
761 771 for biname,bival in self.builtins_added.items():
762 772 if bival is Undefined:
763 773 del __builtin__.__dict__[biname]
764 774 else:
765 775 __builtin__.__dict__[biname] = bival
766 776 self.builtins_added.clear()
767 777
768 778 def set_hook(self,name,hook, priority = 50, str_key = None, re_key = None):
769 779 """set_hook(name,hook) -> sets an internal IPython hook.
770 780
771 781 IPython exposes some of its internal API as user-modifiable hooks. By
772 782 adding your function to one of these hooks, you can modify IPython's
773 783 behavior to call at runtime your own routines."""
774 784
775 785 # At some point in the future, this should validate the hook before it
776 786 # accepts it. Probably at least check that the hook takes the number
777 787 # of args it's supposed to.
778 788
779 789 f = new.instancemethod(hook,self,self.__class__)
780 790
781 791 # check if the hook is for strdispatcher first
782 792 if str_key is not None:
783 793 sdp = self.strdispatchers.get(name, StrDispatch())
784 794 sdp.add_s(str_key, f, priority )
785 795 self.strdispatchers[name] = sdp
786 796 return
787 797 if re_key is not None:
788 798 sdp = self.strdispatchers.get(name, StrDispatch())
789 799 sdp.add_re(re.compile(re_key), f, priority )
790 800 self.strdispatchers[name] = sdp
791 801 return
792 802
793 803 dp = getattr(self.hooks, name, None)
794 804 if name not in IPython.hooks.__all__:
795 805 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
796 806 if not dp:
797 807 dp = IPython.hooks.CommandChainDispatcher()
798 808
799 809 try:
800 810 dp.add(f,priority)
801 811 except AttributeError:
802 812 # it was not commandchain, plain old func - replace
803 813 dp = f
804 814
805 815 setattr(self.hooks,name, dp)
806 816
807 817
808 818 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
809 819
810 820 def set_crash_handler(self,crashHandler):
811 821 """Set the IPython crash handler.
812 822
813 823 This must be a callable with a signature suitable for use as
814 824 sys.excepthook."""
815 825
816 826 # Install the given crash handler as the Python exception hook
817 827 sys.excepthook = crashHandler
818 828
819 829 # The instance will store a pointer to this, so that runtime code
820 830 # (such as magics) can access it. This is because during the
821 831 # read-eval loop, it gets temporarily overwritten (to deal with GUI
822 832 # frameworks).
823 833 self.sys_excepthook = sys.excepthook
824 834
825 835
826 836 def set_custom_exc(self,exc_tuple,handler):
827 837 """set_custom_exc(exc_tuple,handler)
828 838
829 839 Set a custom exception handler, which will be called if any of the
830 840 exceptions in exc_tuple occur in the mainloop (specifically, in the
831 841 runcode() method.
832 842
833 843 Inputs:
834 844
835 845 - exc_tuple: a *tuple* of valid exceptions to call the defined
836 846 handler for. It is very important that you use a tuple, and NOT A
837 847 LIST here, because of the way Python's except statement works. If
838 848 you only want to trap a single exception, use a singleton tuple:
839 849
840 850 exc_tuple == (MyCustomException,)
841 851
842 852 - handler: this must be defined as a function with the following
843 853 basic interface: def my_handler(self,etype,value,tb).
844 854
845 855 This will be made into an instance method (via new.instancemethod)
846 856 of IPython itself, and it will be called if any of the exceptions
847 857 listed in the exc_tuple are caught. If the handler is None, an
848 858 internal basic one is used, which just prints basic info.
849 859
850 860 WARNING: by putting in your own exception handler into IPython's main
851 861 execution loop, you run a very good chance of nasty crashes. This
852 862 facility should only be used if you really know what you are doing."""
853 863
854 864 assert type(exc_tuple)==type(()) , \
855 865 "The custom exceptions must be given AS A TUPLE."
856 866
857 867 def dummy_handler(self,etype,value,tb):
858 868 print '*** Simple custom exception handler ***'
859 869 print 'Exception type :',etype
860 870 print 'Exception value:',value
861 871 print 'Traceback :',tb
862 872 print 'Source code :','\n'.join(self.buffer)
863 873
864 874 if handler is None: handler = dummy_handler
865 875
866 876 self.CustomTB = new.instancemethod(handler,self,self.__class__)
867 877 self.custom_exceptions = exc_tuple
868 878
869 879 def set_custom_completer(self,completer,pos=0):
870 880 """set_custom_completer(completer,pos=0)
871 881
872 882 Adds a new custom completer function.
873 883
874 884 The position argument (defaults to 0) is the index in the completers
875 885 list where you want the completer to be inserted."""
876 886
877 887 newcomp = new.instancemethod(completer,self.Completer,
878 888 self.Completer.__class__)
879 889 self.Completer.matchers.insert(pos,newcomp)
880 890
881 891 def set_completer(self):
882 892 """reset readline's completer to be our own."""
883 893 self.readline.set_completer(self.Completer.complete)
884 894
885 895 def _get_call_pdb(self):
886 896 return self._call_pdb
887 897
888 898 def _set_call_pdb(self,val):
889 899
890 900 if val not in (0,1,False,True):
891 901 raise ValueError,'new call_pdb value must be boolean'
892 902
893 903 # store value in instance
894 904 self._call_pdb = val
895 905
896 906 # notify the actual exception handlers
897 907 self.InteractiveTB.call_pdb = val
898 908 if self.isthreaded:
899 909 try:
900 910 self.sys_excepthook.call_pdb = val
901 911 except:
902 912 warn('Failed to activate pdb for threaded exception handler')
903 913
904 914 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
905 915 'Control auto-activation of pdb at exceptions')
906 916
907 917
908 918 # These special functions get installed in the builtin namespace, to
909 919 # provide programmatic (pure python) access to magics, aliases and system
910 920 # calls. This is important for logging, user scripting, and more.
911 921
912 922 # We are basically exposing, via normal python functions, the three
913 923 # mechanisms in which ipython offers special call modes (magics for
914 924 # internal control, aliases for direct system access via pre-selected
915 925 # names, and !cmd for calling arbitrary system commands).
916 926
917 927 def ipmagic(self,arg_s):
918 928 """Call a magic function by name.
919 929
920 930 Input: a string containing the name of the magic function to call and any
921 931 additional arguments to be passed to the magic.
922 932
923 933 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
924 934 prompt:
925 935
926 936 In[1]: %name -opt foo bar
927 937
928 938 To call a magic without arguments, simply use ipmagic('name').
929 939
930 940 This provides a proper Python function to call IPython's magics in any
931 941 valid Python code you can type at the interpreter, including loops and
932 942 compound statements. It is added by IPython to the Python builtin
933 943 namespace upon initialization."""
934 944
935 945 args = arg_s.split(' ',1)
936 946 magic_name = args[0]
937 947 magic_name = magic_name.lstrip(self.ESC_MAGIC)
938 948
939 949 try:
940 950 magic_args = args[1]
941 951 except IndexError:
942 952 magic_args = ''
943 953 fn = getattr(self,'magic_'+magic_name,None)
944 954 if fn is None:
945 955 error("Magic function `%s` not found." % magic_name)
946 956 else:
947 957 magic_args = self.var_expand(magic_args,1)
948 958 return fn(magic_args)
949 959
950 960 def ipalias(self,arg_s):
951 961 """Call an alias by name.
952 962
953 963 Input: a string containing the name of the alias to call and any
954 964 additional arguments to be passed to the magic.
955 965
956 966 ipalias('name -opt foo bar') is equivalent to typing at the ipython
957 967 prompt:
958 968
959 969 In[1]: name -opt foo bar
960 970
961 971 To call an alias without arguments, simply use ipalias('name').
962 972
963 973 This provides a proper Python function to call IPython's aliases in any
964 974 valid Python code you can type at the interpreter, including loops and
965 975 compound statements. It is added by IPython to the Python builtin
966 976 namespace upon initialization."""
967 977
968 978 args = arg_s.split(' ',1)
969 979 alias_name = args[0]
970 980 try:
971 981 alias_args = args[1]
972 982 except IndexError:
973 983 alias_args = ''
974 984 if alias_name in self.alias_table:
975 985 self.call_alias(alias_name,alias_args)
976 986 else:
977 987 error("Alias `%s` not found." % alias_name)
978 988
979 989 def ipsystem(self,arg_s):
980 990 """Make a system call, using IPython."""
981 991
982 992 self.system(arg_s)
983 993
984 994 def complete(self,text):
985 995 """Return a sorted list of all possible completions on text.
986 996
987 997 Inputs:
988 998
989 999 - text: a string of text to be completed on.
990 1000
991 1001 This is a wrapper around the completion mechanism, similar to what
992 1002 readline does at the command line when the TAB key is hit. By
993 1003 exposing it as a method, it can be used by other non-readline
994 1004 environments (such as GUIs) for text completion.
995 1005
996 1006 Simple usage example:
997 1007
998 1008 In [1]: x = 'hello'
999 1009
1000 1010 In [2]: __IP.complete('x.l')
1001 1011 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
1002 1012
1003 1013 complete = self.Completer.complete
1004 1014 state = 0
1005 1015 # use a dict so we get unique keys, since ipyhton's multiple
1006 1016 # completers can return duplicates. When we make 2.4 a requirement,
1007 1017 # start using sets instead, which are faster.
1008 1018 comps = {}
1009 1019 while True:
1010 1020 newcomp = complete(text,state,line_buffer=text)
1011 1021 if newcomp is None:
1012 1022 break
1013 1023 comps[newcomp] = 1
1014 1024 state += 1
1015 1025 outcomps = comps.keys()
1016 1026 outcomps.sort()
1017 1027 return outcomps
1018 1028
1019 1029 def set_completer_frame(self, frame=None):
1020 1030 if frame:
1021 1031 self.Completer.namespace = frame.f_locals
1022 1032 self.Completer.global_namespace = frame.f_globals
1023 1033 else:
1024 1034 self.Completer.namespace = self.user_ns
1025 1035 self.Completer.global_namespace = self.user_global_ns
1026 1036
1027 1037 def init_auto_alias(self):
1028 1038 """Define some aliases automatically.
1029 1039
1030 1040 These are ALL parameter-less aliases"""
1031 1041
1032 1042 for alias,cmd in self.auto_alias:
1033 1043 self.getapi().defalias(alias,cmd)
1034 1044
1035 1045
1036 1046 def alias_table_validate(self,verbose=0):
1037 1047 """Update information about the alias table.
1038 1048
1039 1049 In particular, make sure no Python keywords/builtins are in it."""
1040 1050
1041 1051 no_alias = self.no_alias
1042 1052 for k in self.alias_table.keys():
1043 1053 if k in no_alias:
1044 1054 del self.alias_table[k]
1045 1055 if verbose:
1046 1056 print ("Deleting alias <%s>, it's a Python "
1047 1057 "keyword or builtin." % k)
1048 1058
1049 1059 def set_autoindent(self,value=None):
1050 1060 """Set the autoindent flag, checking for readline support.
1051 1061
1052 1062 If called with no arguments, it acts as a toggle."""
1053 1063
1054 1064 if not self.has_readline:
1055 1065 if os.name == 'posix':
1056 1066 warn("The auto-indent feature requires the readline library")
1057 1067 self.autoindent = 0
1058 1068 return
1059 1069 if value is None:
1060 1070 self.autoindent = not self.autoindent
1061 1071 else:
1062 1072 self.autoindent = value
1063 1073
1064 1074 def rc_set_toggle(self,rc_field,value=None):
1065 1075 """Set or toggle a field in IPython's rc config. structure.
1066 1076
1067 1077 If called with no arguments, it acts as a toggle.
1068 1078
1069 1079 If called with a non-existent field, the resulting AttributeError
1070 1080 exception will propagate out."""
1071 1081
1072 1082 rc_val = getattr(self.rc,rc_field)
1073 1083 if value is None:
1074 1084 value = not rc_val
1075 1085 setattr(self.rc,rc_field,value)
1076 1086
1077 1087 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1078 1088 """Install the user configuration directory.
1079 1089
1080 1090 Can be called when running for the first time or to upgrade the user's
1081 1091 .ipython/ directory with the mode parameter. Valid modes are 'install'
1082 1092 and 'upgrade'."""
1083 1093
1084 1094 def wait():
1085 1095 try:
1086 1096 raw_input("Please press <RETURN> to start IPython.")
1087 1097 except EOFError:
1088 1098 print >> Term.cout
1089 1099 print '*'*70
1090 1100
1091 1101 cwd = os.getcwd() # remember where we started
1092 1102 glb = glob.glob
1093 1103 print '*'*70
1094 1104 if mode == 'install':
1095 1105 print \
1096 1106 """Welcome to IPython. I will try to create a personal configuration directory
1097 1107 where you can customize many aspects of IPython's functionality in:\n"""
1098 1108 else:
1099 1109 print 'I am going to upgrade your configuration in:'
1100 1110
1101 1111 print ipythondir
1102 1112
1103 1113 rcdirend = os.path.join('IPython','UserConfig')
1104 1114 cfg = lambda d: os.path.join(d,rcdirend)
1105 1115 try:
1106 1116 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1107 1117 print "Initializing from configuration",rcdir
1108 1118 except IndexError:
1109 1119 warning = """
1110 1120 Installation error. IPython's directory was not found.
1111 1121
1112 1122 Check the following:
1113 1123
1114 1124 The ipython/IPython directory should be in a directory belonging to your
1115 1125 PYTHONPATH environment variable (that is, it should be in a directory
1116 1126 belonging to sys.path). You can copy it explicitly there or just link to it.
1117 1127
1118 1128 IPython will create a minimal default configuration for you.
1119 1129
1120 1130 """
1121 1131 warn(warning)
1122 1132 wait()
1123 1133
1124 1134 if sys.platform =='win32':
1125 1135 inif = 'ipythonrc.ini'
1126 1136 else:
1127 1137 inif = 'ipythonrc'
1128 1138 minimal_setup = {'ipy_user_conf.py' : 'import ipy_defaults', inif : '# intentionally left blank' }
1129 1139 os.makedirs(ipythondir)
1130 1140 for f, cont in minimal_setup.items():
1131 1141 open(ipythondir + '/' + f,'w').write(cont)
1132 1142
1133 1143 return
1134 1144
1135 1145 if mode == 'install':
1136 1146 try:
1137 1147 shutil.copytree(rcdir,ipythondir)
1138 1148 os.chdir(ipythondir)
1139 1149 rc_files = glb("ipythonrc*")
1140 1150 for rc_file in rc_files:
1141 1151 os.rename(rc_file,rc_file+rc_suffix)
1142 1152 except:
1143 1153 warning = """
1144 1154
1145 1155 There was a problem with the installation:
1146 1156 %s
1147 1157 Try to correct it or contact the developers if you think it's a bug.
1148 1158 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1149 1159 warn(warning)
1150 1160 wait()
1151 1161 return
1152 1162
1153 1163 elif mode == 'upgrade':
1154 1164 try:
1155 1165 os.chdir(ipythondir)
1156 1166 except:
1157 1167 print """
1158 1168 Can not upgrade: changing to directory %s failed. Details:
1159 1169 %s
1160 1170 """ % (ipythondir,sys.exc_info()[1])
1161 1171 wait()
1162 1172 return
1163 1173 else:
1164 1174 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1165 1175 for new_full_path in sources:
1166 1176 new_filename = os.path.basename(new_full_path)
1167 1177 if new_filename.startswith('ipythonrc'):
1168 1178 new_filename = new_filename + rc_suffix
1169 1179 # The config directory should only contain files, skip any
1170 1180 # directories which may be there (like CVS)
1171 1181 if os.path.isdir(new_full_path):
1172 1182 continue
1173 1183 if os.path.exists(new_filename):
1174 1184 old_file = new_filename+'.old'
1175 1185 if os.path.exists(old_file):
1176 1186 os.remove(old_file)
1177 1187 os.rename(new_filename,old_file)
1178 1188 shutil.copy(new_full_path,new_filename)
1179 1189 else:
1180 1190 raise ValueError,'unrecognized mode for install:',`mode`
1181 1191
1182 1192 # Fix line-endings to those native to each platform in the config
1183 1193 # directory.
1184 1194 try:
1185 1195 os.chdir(ipythondir)
1186 1196 except:
1187 1197 print """
1188 1198 Problem: changing to directory %s failed.
1189 1199 Details:
1190 1200 %s
1191 1201
1192 1202 Some configuration files may have incorrect line endings. This should not
1193 1203 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1194 1204 wait()
1195 1205 else:
1196 1206 for fname in glb('ipythonrc*'):
1197 1207 try:
1198 1208 native_line_ends(fname,backup=0)
1199 1209 except IOError:
1200 1210 pass
1201 1211
1202 1212 if mode == 'install':
1203 1213 print """
1204 1214 Successful installation!
1205 1215
1206 1216 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1207 1217 IPython manual (there are both HTML and PDF versions supplied with the
1208 1218 distribution) to make sure that your system environment is properly configured
1209 1219 to take advantage of IPython's features.
1210 1220
1211 1221 Important note: the configuration system has changed! The old system is
1212 1222 still in place, but its setting may be partly overridden by the settings in
1213 1223 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1214 1224 if some of the new settings bother you.
1215 1225
1216 1226 """
1217 1227 else:
1218 1228 print """
1219 1229 Successful upgrade!
1220 1230
1221 1231 All files in your directory:
1222 1232 %(ipythondir)s
1223 1233 which would have been overwritten by the upgrade were backed up with a .old
1224 1234 extension. If you had made particular customizations in those files you may
1225 1235 want to merge them back into the new files.""" % locals()
1226 1236 wait()
1227 1237 os.chdir(cwd)
1228 1238 # end user_setup()
1229 1239
1230 1240 def atexit_operations(self):
1231 1241 """This will be executed at the time of exit.
1232 1242
1233 1243 Saving of persistent data should be performed here. """
1234 1244
1235 1245 #print '*** IPython exit cleanup ***' # dbg
1236 1246 # input history
1237 1247 self.savehist()
1238 1248
1239 1249 # Cleanup all tempfiles left around
1240 1250 for tfile in self.tempfiles:
1241 1251 try:
1242 1252 os.unlink(tfile)
1243 1253 except OSError:
1244 1254 pass
1245 1255
1246 1256 self.hooks.shutdown_hook()
1247 1257
1248 1258 def savehist(self):
1249 1259 """Save input history to a file (via readline library)."""
1250 1260 try:
1251 1261 self.readline.write_history_file(self.histfile)
1252 1262 except:
1253 1263 print 'Unable to save IPython command history to file: ' + \
1254 1264 `self.histfile`
1255 1265
1256 1266 def reloadhist(self):
1257 1267 """Reload the input history from disk file."""
1258 1268
1259 1269 if self.has_readline:
1260 1270 self.readline.clear_history()
1261 1271 self.readline.read_history_file(self.shell.histfile)
1262 1272
1263 1273 def history_saving_wrapper(self, func):
1264 1274 """ Wrap func for readline history saving
1265 1275
1266 1276 Convert func into callable that saves & restores
1267 1277 history around the call """
1268 1278
1269 1279 if not self.has_readline:
1270 1280 return func
1271 1281
1272 1282 def wrapper():
1273 1283 self.savehist()
1274 1284 try:
1275 1285 func()
1276 1286 finally:
1277 1287 readline.read_history_file(self.histfile)
1278 1288 return wrapper
1279 1289
1280 1290
1281 1291 def pre_readline(self):
1282 1292 """readline hook to be used at the start of each line.
1283 1293
1284 1294 Currently it handles auto-indent only."""
1285 1295
1286 1296 #debugx('self.indent_current_nsp','pre_readline:')
1287 1297
1288 1298 if self.rl_do_indent:
1289 1299 self.readline.insert_text(self.indent_current_str())
1290 1300 if self.rl_next_input is not None:
1291 1301 self.readline.insert_text(self.rl_next_input)
1292 1302 self.rl_next_input = None
1293 1303
1294 1304 def init_readline(self):
1295 1305 """Command history completion/saving/reloading."""
1296 1306
1297 1307
1298 1308 import IPython.rlineimpl as readline
1299 1309
1300 1310 if not readline.have_readline:
1301 1311 self.has_readline = 0
1302 1312 self.readline = None
1303 1313 # no point in bugging windows users with this every time:
1304 1314 warn('Readline services not available on this platform.')
1305 1315 else:
1306 1316 sys.modules['readline'] = readline
1307 1317 import atexit
1308 1318 from IPython.completer import IPCompleter
1309 1319 self.Completer = IPCompleter(self,
1310 1320 self.user_ns,
1311 1321 self.user_global_ns,
1312 1322 self.rc.readline_omit__names,
1313 1323 self.alias_table)
1314 1324 sdisp = self.strdispatchers.get('complete_command', StrDispatch())
1315 1325 self.strdispatchers['complete_command'] = sdisp
1316 1326 self.Completer.custom_completers = sdisp
1317 1327 # Platform-specific configuration
1318 1328 if os.name == 'nt':
1319 1329 self.readline_startup_hook = readline.set_pre_input_hook
1320 1330 else:
1321 1331 self.readline_startup_hook = readline.set_startup_hook
1322 1332
1323 1333 # Load user's initrc file (readline config)
1324 1334 # Or if libedit is used, load editrc.
1325 1335 inputrc_name = os.environ.get('INPUTRC')
1326 1336 if inputrc_name is None:
1327 1337 home_dir = get_home_dir()
1328 1338 if home_dir is not None:
1329 1339 inputrc_name = '.inputrc'
1330 1340 if readline.uses_libedit:
1331 1341 inputrc_name = '.editrc'
1332 1342 inputrc_name = os.path.join(home_dir, inputrc_name)
1333 1343 if os.path.isfile(inputrc_name):
1334 1344 try:
1335 1345 readline.read_init_file(inputrc_name)
1336 1346 except:
1337 1347 warn('Problems reading readline initialization file <%s>'
1338 1348 % inputrc_name)
1339 1349
1340 1350 self.has_readline = 1
1341 1351 self.readline = readline
1342 1352 # save this in sys so embedded copies can restore it properly
1343 1353 sys.ipcompleter = self.Completer.complete
1344 1354 self.set_completer()
1345 1355
1346 1356 # Configure readline according to user's prefs
1347 1357 # This is only done if GNU readline is being used. If libedit
1348 1358 # is being used (as on Leopard) the readline config is
1349 1359 # not run as the syntax for libedit is different.
1350 1360 if not readline.uses_libedit:
1351 1361 for rlcommand in self.rc.readline_parse_and_bind:
1352 1362 readline.parse_and_bind(rlcommand)
1353 1363
1354 1364 # remove some chars from the delimiters list
1355 1365 delims = readline.get_completer_delims()
1356 1366 delims = delims.translate(string._idmap,
1357 1367 self.rc.readline_remove_delims)
1358 1368 readline.set_completer_delims(delims)
1359 1369 # otherwise we end up with a monster history after a while:
1360 1370 readline.set_history_length(1000)
1361 1371 try:
1362 1372 #print '*** Reading readline history' # dbg
1363 1373 readline.read_history_file(self.histfile)
1364 1374 except IOError:
1365 1375 pass # It doesn't exist yet.
1366 1376
1367 1377 atexit.register(self.atexit_operations)
1368 1378 del atexit
1369 1379
1370 1380 # Configure auto-indent for all platforms
1371 1381 self.set_autoindent(self.rc.autoindent)
1372 1382
1373 1383 def ask_yes_no(self,prompt,default=True):
1374 1384 if self.rc.quiet:
1375 1385 return True
1376 1386 return ask_yes_no(prompt,default)
1377 1387
1378 1388 def _should_recompile(self,e):
1379 1389 """Utility routine for edit_syntax_error"""
1380 1390
1381 1391 if e.filename in ('<ipython console>','<input>','<string>',
1382 1392 '<console>','<BackgroundJob compilation>',
1383 1393 None):
1384 1394
1385 1395 return False
1386 1396 try:
1387 1397 if (self.rc.autoedit_syntax and
1388 1398 not self.ask_yes_no('Return to editor to correct syntax error? '
1389 1399 '[Y/n] ','y')):
1390 1400 return False
1391 1401 except EOFError:
1392 1402 return False
1393 1403
1394 1404 def int0(x):
1395 1405 try:
1396 1406 return int(x)
1397 1407 except TypeError:
1398 1408 return 0
1399 1409 # always pass integer line and offset values to editor hook
1400 1410 self.hooks.fix_error_editor(e.filename,
1401 1411 int0(e.lineno),int0(e.offset),e.msg)
1402 1412 return True
1403 1413
1404 1414 def edit_syntax_error(self):
1405 1415 """The bottom half of the syntax error handler called in the main loop.
1406 1416
1407 1417 Loop until syntax error is fixed or user cancels.
1408 1418 """
1409 1419
1410 1420 while self.SyntaxTB.last_syntax_error:
1411 1421 # copy and clear last_syntax_error
1412 1422 err = self.SyntaxTB.clear_err_state()
1413 1423 if not self._should_recompile(err):
1414 1424 return
1415 1425 try:
1416 1426 # may set last_syntax_error again if a SyntaxError is raised
1417 1427 self.safe_execfile(err.filename,self.user_ns)
1418 1428 except:
1419 1429 self.showtraceback()
1420 1430 else:
1421 1431 try:
1422 1432 f = file(err.filename)
1423 1433 try:
1424 1434 sys.displayhook(f.read())
1425 1435 finally:
1426 1436 f.close()
1427 1437 except:
1428 1438 self.showtraceback()
1429 1439
1430 1440 def showsyntaxerror(self, filename=None):
1431 1441 """Display the syntax error that just occurred.
1432 1442
1433 1443 This doesn't display a stack trace because there isn't one.
1434 1444
1435 1445 If a filename is given, it is stuffed in the exception instead
1436 1446 of what was there before (because Python's parser always uses
1437 1447 "<string>" when reading from a string).
1438 1448 """
1439 1449 etype, value, last_traceback = sys.exc_info()
1440 1450
1441 1451 # See note about these variables in showtraceback() below
1442 1452 sys.last_type = etype
1443 1453 sys.last_value = value
1444 1454 sys.last_traceback = last_traceback
1445 1455
1446 1456 if filename and etype is SyntaxError:
1447 1457 # Work hard to stuff the correct filename in the exception
1448 1458 try:
1449 1459 msg, (dummy_filename, lineno, offset, line) = value
1450 1460 except:
1451 1461 # Not the format we expect; leave it alone
1452 1462 pass
1453 1463 else:
1454 1464 # Stuff in the right filename
1455 1465 try:
1456 1466 # Assume SyntaxError is a class exception
1457 1467 value = SyntaxError(msg, (filename, lineno, offset, line))
1458 1468 except:
1459 1469 # If that failed, assume SyntaxError is a string
1460 1470 value = msg, (filename, lineno, offset, line)
1461 1471 self.SyntaxTB(etype,value,[])
1462 1472
1463 1473 def debugger(self,force=False):
1464 1474 """Call the pydb/pdb debugger.
1465 1475
1466 1476 Keywords:
1467 1477
1468 1478 - force(False): by default, this routine checks the instance call_pdb
1469 1479 flag and does not actually invoke the debugger if the flag is false.
1470 1480 The 'force' option forces the debugger to activate even if the flag
1471 1481 is false.
1472 1482 """
1473 1483
1474 1484 if not (force or self.call_pdb):
1475 1485 return
1476 1486
1477 1487 if not hasattr(sys,'last_traceback'):
1478 1488 error('No traceback has been produced, nothing to debug.')
1479 1489 return
1480 1490
1481 1491 # use pydb if available
1482 1492 if Debugger.has_pydb:
1483 1493 from pydb import pm
1484 1494 else:
1485 1495 # fallback to our internal debugger
1486 1496 pm = lambda : self.InteractiveTB.debugger(force=True)
1487 1497 self.history_saving_wrapper(pm)()
1488 1498
1489 1499 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1490 1500 """Display the exception that just occurred.
1491 1501
1492 1502 If nothing is known about the exception, this is the method which
1493 1503 should be used throughout the code for presenting user tracebacks,
1494 1504 rather than directly invoking the InteractiveTB object.
1495 1505
1496 1506 A specific showsyntaxerror() also exists, but this method can take
1497 1507 care of calling it if needed, so unless you are explicitly catching a
1498 1508 SyntaxError exception, don't try to analyze the stack manually and
1499 1509 simply call this method."""
1500 1510
1501 1511
1502 1512 # Though this won't be called by syntax errors in the input line,
1503 1513 # there may be SyntaxError cases whith imported code.
1504 1514
1505 1515
1506 1516 if exc_tuple is None:
1507 1517 etype, value, tb = sys.exc_info()
1508 1518 else:
1509 1519 etype, value, tb = exc_tuple
1510 1520
1511 1521 if etype is SyntaxError:
1512 1522 self.showsyntaxerror(filename)
1513 1523 elif etype is IPython.ipapi.UsageError:
1514 1524 print "UsageError:", value
1515 1525 else:
1516 1526 # WARNING: these variables are somewhat deprecated and not
1517 1527 # necessarily safe to use in a threaded environment, but tools
1518 1528 # like pdb depend on their existence, so let's set them. If we
1519 1529 # find problems in the field, we'll need to revisit their use.
1520 1530 sys.last_type = etype
1521 1531 sys.last_value = value
1522 1532 sys.last_traceback = tb
1523 1533
1524 1534 if etype in self.custom_exceptions:
1525 1535 self.CustomTB(etype,value,tb)
1526 1536 else:
1527 1537 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1528 1538 if self.InteractiveTB.call_pdb and self.has_readline:
1529 1539 # pdb mucks up readline, fix it back
1530 1540 self.set_completer()
1531 1541
1532 1542
1533 1543 def mainloop(self,banner=None):
1534 1544 """Creates the local namespace and starts the mainloop.
1535 1545
1536 1546 If an optional banner argument is given, it will override the
1537 1547 internally created default banner."""
1538 1548
1539 1549 if self.rc.c: # Emulate Python's -c option
1540 1550 self.exec_init_cmd()
1541 1551 if banner is None:
1542 1552 if not self.rc.banner:
1543 1553 banner = ''
1544 1554 # banner is string? Use it directly!
1545 1555 elif isinstance(self.rc.banner,basestring):
1546 1556 banner = self.rc.banner
1547 1557 else:
1548 1558 banner = self.BANNER+self.banner2
1549 1559
1550 1560 self.interact(banner)
1551 1561
1552 1562 def exec_init_cmd(self):
1553 1563 """Execute a command given at the command line.
1554 1564
1555 1565 This emulates Python's -c option."""
1556 1566
1557 1567 #sys.argv = ['-c']
1558 1568 self.push(self.prefilter(self.rc.c, False))
1559 1569 if not self.rc.interact:
1560 1570 self.exit_now = True
1561 1571
1562 1572 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1563 1573 """Embeds IPython into a running python program.
1564 1574
1565 1575 Input:
1566 1576
1567 1577 - header: An optional header message can be specified.
1568 1578
1569 1579 - local_ns, global_ns: working namespaces. If given as None, the
1570 1580 IPython-initialized one is updated with __main__.__dict__, so that
1571 1581 program variables become visible but user-specific configuration
1572 1582 remains possible.
1573 1583
1574 1584 - stack_depth: specifies how many levels in the stack to go to
1575 1585 looking for namespaces (when local_ns and global_ns are None). This
1576 1586 allows an intermediate caller to make sure that this function gets
1577 1587 the namespace from the intended level in the stack. By default (0)
1578 1588 it will get its locals and globals from the immediate caller.
1579 1589
1580 1590 Warning: it's possible to use this in a program which is being run by
1581 1591 IPython itself (via %run), but some funny things will happen (a few
1582 1592 globals get overwritten). In the future this will be cleaned up, as
1583 1593 there is no fundamental reason why it can't work perfectly."""
1584 1594
1585 1595 # Get locals and globals from caller
1586 1596 if local_ns is None or global_ns is None:
1587 1597 call_frame = sys._getframe(stack_depth).f_back
1588 1598
1589 1599 if local_ns is None:
1590 1600 local_ns = call_frame.f_locals
1591 1601 if global_ns is None:
1592 1602 global_ns = call_frame.f_globals
1593 1603
1594 1604 # Update namespaces and fire up interpreter
1595 1605
1596 1606 # The global one is easy, we can just throw it in
1597 1607 self.user_global_ns = global_ns
1598 1608
1599 1609 # but the user/local one is tricky: ipython needs it to store internal
1600 1610 # data, but we also need the locals. We'll copy locals in the user
1601 1611 # one, but will track what got copied so we can delete them at exit.
1602 1612 # This is so that a later embedded call doesn't see locals from a
1603 1613 # previous call (which most likely existed in a separate scope).
1604 1614 local_varnames = local_ns.keys()
1605 1615 self.user_ns.update(local_ns)
1606 1616
1607 1617 # Patch for global embedding to make sure that things don't overwrite
1608 1618 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1609 1619 # FIXME. Test this a bit more carefully (the if.. is new)
1610 1620 if local_ns is None and global_ns is None:
1611 1621 self.user_global_ns.update(__main__.__dict__)
1612 1622
1613 1623 # make sure the tab-completer has the correct frame information, so it
1614 1624 # actually completes using the frame's locals/globals
1615 1625 self.set_completer_frame()
1616 1626
1617 1627 # before activating the interactive mode, we need to make sure that
1618 1628 # all names in the builtin namespace needed by ipython point to
1619 1629 # ourselves, and not to other instances.
1620 1630 self.add_builtins()
1621 1631
1622 1632 self.interact(header)
1623 1633
1624 1634 # now, purge out the user namespace from anything we might have added
1625 1635 # from the caller's local namespace
1626 1636 delvar = self.user_ns.pop
1627 1637 for var in local_varnames:
1628 1638 delvar(var,None)
1629 1639 # and clean builtins we may have overridden
1630 1640 self.clean_builtins()
1631 1641
1632 1642 def interact(self, banner=None):
1633 1643 """Closely emulate the interactive Python console.
1634 1644
1635 1645 The optional banner argument specify the banner to print
1636 1646 before the first interaction; by default it prints a banner
1637 1647 similar to the one printed by the real Python interpreter,
1638 1648 followed by the current class name in parentheses (so as not
1639 1649 to confuse this with the real interpreter -- since it's so
1640 1650 close!).
1641 1651
1642 1652 """
1643 1653
1644 1654 if self.exit_now:
1645 1655 # batch run -> do not interact
1646 1656 return
1647 1657 cprt = 'Type "copyright", "credits" or "license" for more information.'
1648 1658 if banner is None:
1649 1659 self.write("Python %s on %s\n%s\n(%s)\n" %
1650 1660 (sys.version, sys.platform, cprt,
1651 1661 self.__class__.__name__))
1652 1662 else:
1653 1663 self.write(banner)
1654 1664
1655 1665 more = 0
1656 1666
1657 1667 # Mark activity in the builtins
1658 1668 __builtin__.__dict__['__IPYTHON__active'] += 1
1659 1669
1660 1670 if self.has_readline:
1661 1671 self.readline_startup_hook(self.pre_readline)
1662 1672 # exit_now is set by a call to %Exit or %Quit
1663 1673
1664 1674 while not self.exit_now:
1665 1675 if more:
1666 1676 prompt = self.hooks.generate_prompt(True)
1667 1677 if self.autoindent:
1668 1678 self.rl_do_indent = True
1669 1679
1670 1680 else:
1671 1681 prompt = self.hooks.generate_prompt(False)
1672 1682 try:
1673 1683 line = self.raw_input(prompt,more)
1674 1684 if self.exit_now:
1675 1685 # quick exit on sys.std[in|out] close
1676 1686 break
1677 1687 if self.autoindent:
1678 1688 self.rl_do_indent = False
1679 1689
1680 1690 except KeyboardInterrupt:
1681 1691 self.write('\nKeyboardInterrupt\n')
1682 1692 self.resetbuffer()
1683 1693 # keep cache in sync with the prompt counter:
1684 1694 self.outputcache.prompt_count -= 1
1685 1695
1686 1696 if self.autoindent:
1687 1697 self.indent_current_nsp = 0
1688 1698 more = 0
1689 1699 except EOFError:
1690 1700 if self.autoindent:
1691 1701 self.rl_do_indent = False
1692 1702 self.readline_startup_hook(None)
1693 1703 self.write('\n')
1694 1704 self.exit()
1695 1705 except bdb.BdbQuit:
1696 1706 warn('The Python debugger has exited with a BdbQuit exception.\n'
1697 1707 'Because of how pdb handles the stack, it is impossible\n'
1698 1708 'for IPython to properly format this particular exception.\n'
1699 1709 'IPython will resume normal operation.')
1700 1710 except:
1701 1711 # exceptions here are VERY RARE, but they can be triggered
1702 1712 # asynchronously by signal handlers, for example.
1703 1713 self.showtraceback()
1704 1714 else:
1705 1715 more = self.push(line)
1706 1716 if (self.SyntaxTB.last_syntax_error and
1707 1717 self.rc.autoedit_syntax):
1708 1718 self.edit_syntax_error()
1709 1719
1710 1720 # We are off again...
1711 1721 __builtin__.__dict__['__IPYTHON__active'] -= 1
1712 1722
1713 1723 def excepthook(self, etype, value, tb):
1714 1724 """One more defense for GUI apps that call sys.excepthook.
1715 1725
1716 1726 GUI frameworks like wxPython trap exceptions and call
1717 1727 sys.excepthook themselves. I guess this is a feature that
1718 1728 enables them to keep running after exceptions that would
1719 1729 otherwise kill their mainloop. This is a bother for IPython
1720 1730 which excepts to catch all of the program exceptions with a try:
1721 1731 except: statement.
1722 1732
1723 1733 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1724 1734 any app directly invokes sys.excepthook, it will look to the user like
1725 1735 IPython crashed. In order to work around this, we can disable the
1726 1736 CrashHandler and replace it with this excepthook instead, which prints a
1727 1737 regular traceback using our InteractiveTB. In this fashion, apps which
1728 1738 call sys.excepthook will generate a regular-looking exception from
1729 1739 IPython, and the CrashHandler will only be triggered by real IPython
1730 1740 crashes.
1731 1741
1732 1742 This hook should be used sparingly, only in places which are not likely
1733 1743 to be true IPython errors.
1734 1744 """
1735 1745 self.showtraceback((etype,value,tb),tb_offset=0)
1736 1746
1737 1747 def expand_aliases(self,fn,rest):
1738 1748 """ Expand multiple levels of aliases:
1739 1749
1740 1750 if:
1741 1751
1742 1752 alias foo bar /tmp
1743 1753 alias baz foo
1744 1754
1745 1755 then:
1746 1756
1747 1757 baz huhhahhei -> bar /tmp huhhahhei
1748 1758
1749 1759 """
1750 1760 line = fn + " " + rest
1751 1761
1752 1762 done = Set()
1753 1763 while 1:
1754 1764 pre,fn,rest = prefilter.splitUserInput(line,
1755 1765 prefilter.shell_line_split)
1756 1766 if fn in self.alias_table:
1757 1767 if fn in done:
1758 1768 warn("Cyclic alias definition, repeated '%s'" % fn)
1759 1769 return ""
1760 1770 done.add(fn)
1761 1771
1762 1772 l2 = self.transform_alias(fn,rest)
1763 1773 # dir -> dir
1764 1774 # print "alias",line, "->",l2 #dbg
1765 1775 if l2 == line:
1766 1776 break
1767 1777 # ls -> ls -F should not recurse forever
1768 1778 if l2.split(None,1)[0] == line.split(None,1)[0]:
1769 1779 line = l2
1770 1780 break
1771 1781
1772 1782 line=l2
1773 1783
1774 1784
1775 1785 # print "al expand to",line #dbg
1776 1786 else:
1777 1787 break
1778 1788
1779 1789 return line
1780 1790
1781 1791 def transform_alias(self, alias,rest=''):
1782 1792 """ Transform alias to system command string.
1783 1793 """
1784 1794 trg = self.alias_table[alias]
1785 1795
1786 1796 nargs,cmd = trg
1787 1797 # print trg #dbg
1788 1798 if ' ' in cmd and os.path.isfile(cmd):
1789 1799 cmd = '"%s"' % cmd
1790 1800
1791 1801 # Expand the %l special to be the user's input line
1792 1802 if cmd.find('%l') >= 0:
1793 1803 cmd = cmd.replace('%l',rest)
1794 1804 rest = ''
1795 1805 if nargs==0:
1796 1806 # Simple, argument-less aliases
1797 1807 cmd = '%s %s' % (cmd,rest)
1798 1808 else:
1799 1809 # Handle aliases with positional arguments
1800 1810 args = rest.split(None,nargs)
1801 1811 if len(args)< nargs:
1802 1812 error('Alias <%s> requires %s arguments, %s given.' %
1803 1813 (alias,nargs,len(args)))
1804 1814 return None
1805 1815 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1806 1816 # Now call the macro, evaluating in the user's namespace
1807 1817 #print 'new command: <%r>' % cmd # dbg
1808 1818 return cmd
1809 1819
1810 1820 def call_alias(self,alias,rest=''):
1811 1821 """Call an alias given its name and the rest of the line.
1812 1822
1813 1823 This is only used to provide backwards compatibility for users of
1814 1824 ipalias(), use of which is not recommended for anymore."""
1815 1825
1816 1826 # Now call the macro, evaluating in the user's namespace
1817 1827 cmd = self.transform_alias(alias, rest)
1818 1828 try:
1819 1829 self.system(cmd)
1820 1830 except:
1821 1831 self.showtraceback()
1822 1832
1823 1833 def indent_current_str(self):
1824 1834 """return the current level of indentation as a string"""
1825 1835 return self.indent_current_nsp * ' '
1826 1836
1827 1837 def autoindent_update(self,line):
1828 1838 """Keep track of the indent level."""
1829 1839
1830 1840 #debugx('line')
1831 1841 #debugx('self.indent_current_nsp')
1832 1842 if self.autoindent:
1833 1843 if line:
1834 1844 inisp = num_ini_spaces(line)
1835 1845 if inisp < self.indent_current_nsp:
1836 1846 self.indent_current_nsp = inisp
1837 1847
1838 1848 if line[-1] == ':':
1839 1849 self.indent_current_nsp += 4
1840 1850 elif dedent_re.match(line):
1841 1851 self.indent_current_nsp -= 4
1842 1852 else:
1843 1853 self.indent_current_nsp = 0
1844 1854
1845 1855 def runlines(self,lines):
1846 1856 """Run a string of one or more lines of source.
1847 1857
1848 1858 This method is capable of running a string containing multiple source
1849 1859 lines, as if they had been entered at the IPython prompt. Since it
1850 1860 exposes IPython's processing machinery, the given strings can contain
1851 1861 magic calls (%magic), special shell access (!cmd), etc."""
1852 1862
1853 1863 # We must start with a clean buffer, in case this is run from an
1854 1864 # interactive IPython session (via a magic, for example).
1855 1865 self.resetbuffer()
1856 1866 lines = lines.split('\n')
1857 1867 more = 0
1858 1868
1859 1869 for line in lines:
1860 1870 # skip blank lines so we don't mess up the prompt counter, but do
1861 1871 # NOT skip even a blank line if we are in a code block (more is
1862 1872 # true)
1863 1873
1864 1874
1865 1875 if line or more:
1866 1876 # push to raw history, so hist line numbers stay in sync
1867 1877 self.input_hist_raw.append("# " + line + "\n")
1868 1878 more = self.push(self.prefilter(line,more))
1869 1879 # IPython's runsource returns None if there was an error
1870 1880 # compiling the code. This allows us to stop processing right
1871 1881 # away, so the user gets the error message at the right place.
1872 1882 if more is None:
1873 1883 break
1874 1884 else:
1875 1885 self.input_hist_raw.append("\n")
1876 1886 # final newline in case the input didn't have it, so that the code
1877 1887 # actually does get executed
1878 1888 if more:
1879 1889 self.push('\n')
1880 1890
1881 1891 def runsource(self, source, filename='<input>', symbol='single'):
1882 1892 """Compile and run some source in the interpreter.
1883 1893
1884 1894 Arguments are as for compile_command().
1885 1895
1886 1896 One several things can happen:
1887 1897
1888 1898 1) The input is incorrect; compile_command() raised an
1889 1899 exception (SyntaxError or OverflowError). A syntax traceback
1890 1900 will be printed by calling the showsyntaxerror() method.
1891 1901
1892 1902 2) The input is incomplete, and more input is required;
1893 1903 compile_command() returned None. Nothing happens.
1894 1904
1895 1905 3) The input is complete; compile_command() returned a code
1896 1906 object. The code is executed by calling self.runcode() (which
1897 1907 also handles run-time exceptions, except for SystemExit).
1898 1908
1899 1909 The return value is:
1900 1910
1901 1911 - True in case 2
1902 1912
1903 1913 - False in the other cases, unless an exception is raised, where
1904 1914 None is returned instead. This can be used by external callers to
1905 1915 know whether to continue feeding input or not.
1906 1916
1907 1917 The return value can be used to decide whether to use sys.ps1 or
1908 1918 sys.ps2 to prompt the next line."""
1909 1919
1910 1920 # if the source code has leading blanks, add 'if 1:\n' to it
1911 1921 # this allows execution of indented pasted code. It is tempting
1912 1922 # to add '\n' at the end of source to run commands like ' a=1'
1913 1923 # directly, but this fails for more complicated scenarios
1914 source=source.encode(self.stdin_encoding)
1924 source = str(source)
1915 1925 if source[:1] in [' ', '\t']:
1916 1926 source = 'if 1:\n%s' % source
1917 1927
1918 1928 try:
1919 1929 code = self.compile(source,filename,symbol)
1920 1930 except (OverflowError, SyntaxError, ValueError):
1921 1931 # Case 1
1922 1932 self.showsyntaxerror(filename)
1923 1933 return None
1924 1934
1925 1935 if code is None:
1926 1936 # Case 2
1927 1937 return True
1928 1938
1929 1939 # Case 3
1930 1940 # We store the code object so that threaded shells and
1931 1941 # custom exception handlers can access all this info if needed.
1932 1942 # The source corresponding to this can be obtained from the
1933 1943 # buffer attribute as '\n'.join(self.buffer).
1934 1944 self.code_to_run = code
1935 1945 # now actually execute the code object
1936 1946 if self.runcode(code) == 0:
1937 1947 return False
1938 1948 else:
1939 1949 return None
1940 1950
1941 1951 def runcode(self,code_obj):
1942 1952 """Execute a code object.
1943 1953
1944 1954 When an exception occurs, self.showtraceback() is called to display a
1945 1955 traceback.
1946 1956
1947 1957 Return value: a flag indicating whether the code to be run completed
1948 1958 successfully:
1949 1959
1950 1960 - 0: successful execution.
1951 1961 - 1: an error occurred.
1952 1962 """
1953 1963
1954 1964 # Set our own excepthook in case the user code tries to call it
1955 1965 # directly, so that the IPython crash handler doesn't get triggered
1956 1966 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1957 1967
1958 1968 # we save the original sys.excepthook in the instance, in case config
1959 1969 # code (such as magics) needs access to it.
1960 1970 self.sys_excepthook = old_excepthook
1961 1971 outflag = 1 # happens in more places, so it's easier as default
1962 1972 try:
1963 1973 try:
1964 1974 # Embedded instances require separate global/local namespaces
1965 1975 # so they can see both the surrounding (local) namespace and
1966 1976 # the module-level globals when called inside another function.
1967 1977 if self.embedded:
1968 1978 exec code_obj in self.user_global_ns, self.user_ns
1969 1979 # Normal (non-embedded) instances should only have a single
1970 1980 # namespace for user code execution, otherwise functions won't
1971 1981 # see interactive top-level globals.
1972 1982 else:
1973 1983 exec code_obj in self.user_ns
1974 1984 finally:
1975 1985 # Reset our crash handler in place
1976 1986 sys.excepthook = old_excepthook
1977 1987 except SystemExit:
1978 1988 self.resetbuffer()
1979 1989 self.showtraceback()
1980 1990 warn("Type %exit or %quit to exit IPython "
1981 1991 "(%Exit or %Quit do so unconditionally).",level=1)
1982 1992 except self.custom_exceptions:
1983 1993 etype,value,tb = sys.exc_info()
1984 1994 self.CustomTB(etype,value,tb)
1985 1995 except:
1986 1996 self.showtraceback()
1987 1997 else:
1988 1998 outflag = 0
1989 1999 if softspace(sys.stdout, 0):
1990 2000 print
1991 2001 # Flush out code object which has been run (and source)
1992 2002 self.code_to_run = None
1993 2003 return outflag
1994 2004
1995 2005 def push(self, line):
1996 2006 """Push a line to the interpreter.
1997 2007
1998 2008 The line should not have a trailing newline; it may have
1999 2009 internal newlines. The line is appended to a buffer and the
2000 2010 interpreter's runsource() method is called with the
2001 2011 concatenated contents of the buffer as source. If this
2002 2012 indicates that the command was executed or invalid, the buffer
2003 2013 is reset; otherwise, the command is incomplete, and the buffer
2004 2014 is left as it was after the line was appended. The return
2005 2015 value is 1 if more input is required, 0 if the line was dealt
2006 2016 with in some way (this is the same as runsource()).
2007 2017 """
2008 2018
2009 2019 # autoindent management should be done here, and not in the
2010 2020 # interactive loop, since that one is only seen by keyboard input. We
2011 2021 # need this done correctly even for code run via runlines (which uses
2012 2022 # push).
2013 2023
2014 2024 #print 'push line: <%s>' % line # dbg
2015 2025 for subline in line.splitlines():
2016 2026 self.autoindent_update(subline)
2017 2027 self.buffer.append(line)
2018 2028 more = self.runsource('\n'.join(self.buffer), self.filename)
2019 2029 if not more:
2020 2030 self.resetbuffer()
2021 2031 return more
2022 2032
2023 2033 def split_user_input(self, line):
2024 2034 # This is really a hold-over to support ipapi and some extensions
2025 2035 return prefilter.splitUserInput(line)
2026 2036
2027 2037 def resetbuffer(self):
2028 2038 """Reset the input buffer."""
2029 2039 self.buffer[:] = []
2030 2040
2031 2041 def raw_input(self,prompt='',continue_prompt=False):
2032 2042 """Write a prompt and read a line.
2033 2043
2034 2044 The returned line does not include the trailing newline.
2035 2045 When the user enters the EOF key sequence, EOFError is raised.
2036 2046
2037 2047 Optional inputs:
2038 2048
2039 2049 - prompt(''): a string to be printed to prompt the user.
2040 2050
2041 2051 - continue_prompt(False): whether this line is the first one or a
2042 2052 continuation in a sequence of inputs.
2043 2053 """
2044 2054
2045 2055 # Code run by the user may have modified the readline completer state.
2046 2056 # We must ensure that our completer is back in place.
2047 2057 if self.has_readline:
2048 2058 self.set_completer()
2049 2059
2050 2060 try:
2051 2061 line = raw_input_original(prompt).decode(self.stdin_encoding)
2052 2062 except ValueError:
2053 2063 warn("\n********\nYou or a %run:ed script called sys.stdin.close()"
2054 2064 " or sys.stdout.close()!\nExiting IPython!")
2055 2065 self.exit_now = True
2056 2066 return ""
2057 2067
2058 2068 # Try to be reasonably smart about not re-indenting pasted input more
2059 2069 # than necessary. We do this by trimming out the auto-indent initial
2060 2070 # spaces, if the user's actual input started itself with whitespace.
2061 2071 #debugx('self.buffer[-1]')
2062 2072
2063 2073 if self.autoindent:
2064 2074 if num_ini_spaces(line) > self.indent_current_nsp:
2065 2075 line = line[self.indent_current_nsp:]
2066 2076 self.indent_current_nsp = 0
2067 2077
2068 2078 # store the unfiltered input before the user has any chance to modify
2069 2079 # it.
2070 2080 if line.strip():
2071 2081 if continue_prompt:
2072 2082 self.input_hist_raw[-1] += '%s\n' % line
2073 2083 if self.has_readline: # and some config option is set?
2074 2084 try:
2075 2085 histlen = self.readline.get_current_history_length()
2076 2086 newhist = self.input_hist_raw[-1].rstrip()
2077 2087 self.readline.remove_history_item(histlen-1)
2078 2088 self.readline.replace_history_item(histlen-2,newhist)
2079 2089 except AttributeError:
2080 2090 pass # re{move,place}_history_item are new in 2.4.
2081 2091 else:
2082 2092 self.input_hist_raw.append('%s\n' % line)
2083 2093 # only entries starting at first column go to shadow history
2084 2094 if line.lstrip() == line:
2085 2095 self.shadowhist.add(line.strip())
2086 2096 elif not continue_prompt:
2087 2097 self.input_hist_raw.append('\n')
2088 2098 try:
2089 2099 lineout = self.prefilter(line,continue_prompt)
2090 2100 except:
2091 2101 # blanket except, in case a user-defined prefilter crashes, so it
2092 2102 # can't take all of ipython with it.
2093 2103 self.showtraceback()
2094 2104 return ''
2095 2105 else:
2096 2106 return lineout
2097 2107
2098 2108 def _prefilter(self, line, continue_prompt):
2099 2109 """Calls different preprocessors, depending on the form of line."""
2100 2110
2101 2111 # All handlers *must* return a value, even if it's blank ('').
2102 2112
2103 2113 # Lines are NOT logged here. Handlers should process the line as
2104 2114 # needed, update the cache AND log it (so that the input cache array
2105 2115 # stays synced).
2106 2116
2107 2117 #.....................................................................
2108 2118 # Code begins
2109 2119
2110 2120 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
2111 2121
2112 2122 # save the line away in case we crash, so the post-mortem handler can
2113 2123 # record it
2114 2124 self._last_input_line = line
2115 2125
2116 2126 #print '***line: <%s>' % line # dbg
2117 2127
2118 2128 if not line:
2119 2129 # Return immediately on purely empty lines, so that if the user
2120 2130 # previously typed some whitespace that started a continuation
2121 2131 # prompt, he can break out of that loop with just an empty line.
2122 2132 # This is how the default python prompt works.
2123 2133
2124 2134 # Only return if the accumulated input buffer was just whitespace!
2125 2135 if ''.join(self.buffer).isspace():
2126 2136 self.buffer[:] = []
2127 2137 return ''
2128 2138
2129 2139 line_info = prefilter.LineInfo(line, continue_prompt)
2130 2140
2131 2141 # the input history needs to track even empty lines
2132 2142 stripped = line.strip()
2133 2143
2134 2144 if not stripped:
2135 2145 if not continue_prompt:
2136 2146 self.outputcache.prompt_count -= 1
2137 2147 return self.handle_normal(line_info)
2138 2148
2139 2149 # print '***cont',continue_prompt # dbg
2140 2150 # special handlers are only allowed for single line statements
2141 2151 if continue_prompt and not self.rc.multi_line_specials:
2142 2152 return self.handle_normal(line_info)
2143 2153
2144 2154
2145 2155 # See whether any pre-existing handler can take care of it
2146 2156 rewritten = self.hooks.input_prefilter(stripped)
2147 2157 if rewritten != stripped: # ok, some prefilter did something
2148 2158 rewritten = line_info.pre + rewritten # add indentation
2149 2159 return self.handle_normal(prefilter.LineInfo(rewritten,
2150 2160 continue_prompt))
2151 2161
2152 2162 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2153 2163
2154 2164 return prefilter.prefilter(line_info, self)
2155 2165
2156 2166
2157 2167 def _prefilter_dumb(self, line, continue_prompt):
2158 2168 """simple prefilter function, for debugging"""
2159 2169 return self.handle_normal(line,continue_prompt)
2160 2170
2161 2171
2162 2172 def multiline_prefilter(self, line, continue_prompt):
2163 2173 """ Run _prefilter for each line of input
2164 2174
2165 2175 Covers cases where there are multiple lines in the user entry,
2166 2176 which is the case when the user goes back to a multiline history
2167 2177 entry and presses enter.
2168 2178
2169 2179 """
2170 2180 out = []
2171 2181 for l in line.rstrip('\n').split('\n'):
2172 2182 out.append(self._prefilter(l, continue_prompt))
2173 2183 return '\n'.join(out)
2174 2184
2175 2185 # Set the default prefilter() function (this can be user-overridden)
2176 2186 prefilter = multiline_prefilter
2177 2187
2178 2188 def handle_normal(self,line_info):
2179 2189 """Handle normal input lines. Use as a template for handlers."""
2180 2190
2181 2191 # With autoindent on, we need some way to exit the input loop, and I
2182 2192 # don't want to force the user to have to backspace all the way to
2183 2193 # clear the line. The rule will be in this case, that either two
2184 2194 # lines of pure whitespace in a row, or a line of pure whitespace but
2185 2195 # of a size different to the indent level, will exit the input loop.
2186 2196 line = line_info.line
2187 2197 continue_prompt = line_info.continue_prompt
2188 2198
2189 2199 if (continue_prompt and self.autoindent and line.isspace() and
2190 2200 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2191 2201 (self.buffer[-1]).isspace() )):
2192 2202 line = ''
2193 2203
2194 2204 self.log(line,line,continue_prompt)
2195 2205 return line
2196 2206
2197 2207 def handle_alias(self,line_info):
2198 2208 """Handle alias input lines. """
2199 2209 tgt = self.alias_table[line_info.iFun]
2200 2210 # print "=>",tgt #dbg
2201 2211 if callable(tgt):
2202 2212 if '$' in line_info.line:
2203 2213 call_meth = '(_ip, _ip.itpl(%s))'
2204 2214 else:
2205 2215 call_meth = '(_ip,%s)'
2206 2216 line_out = ("%s_sh.%s" + call_meth) % (line_info.preWhitespace,
2207 2217 line_info.iFun,
2208 2218 make_quoted_expr(line_info.line))
2209 2219 else:
2210 2220 transformed = self.expand_aliases(line_info.iFun,line_info.theRest)
2211 2221
2212 2222 # pre is needed, because it carries the leading whitespace. Otherwise
2213 2223 # aliases won't work in indented sections.
2214 2224 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2215 2225 make_quoted_expr( transformed ))
2216 2226
2217 2227 self.log(line_info.line,line_out,line_info.continue_prompt)
2218 2228 #print 'line out:',line_out # dbg
2219 2229 return line_out
2220 2230
2221 2231 def handle_shell_escape(self, line_info):
2222 2232 """Execute the line in a shell, empty return value"""
2223 2233 #print 'line in :', `line` # dbg
2224 2234 line = line_info.line
2225 2235 if line.lstrip().startswith('!!'):
2226 2236 # rewrite LineInfo's line, iFun and theRest to properly hold the
2227 2237 # call to %sx and the actual command to be executed, so
2228 2238 # handle_magic can work correctly. Note that this works even if
2229 2239 # the line is indented, so it handles multi_line_specials
2230 2240 # properly.
2231 2241 new_rest = line.lstrip()[2:]
2232 2242 line_info.line = '%ssx %s' % (self.ESC_MAGIC,new_rest)
2233 2243 line_info.iFun = 'sx'
2234 2244 line_info.theRest = new_rest
2235 2245 return self.handle_magic(line_info)
2236 2246 else:
2237 2247 cmd = line.lstrip().lstrip('!')
2238 2248 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2239 2249 make_quoted_expr(cmd))
2240 2250 # update cache/log and return
2241 2251 self.log(line,line_out,line_info.continue_prompt)
2242 2252 return line_out
2243 2253
2244 2254 def handle_magic(self, line_info):
2245 2255 """Execute magic functions."""
2246 2256 iFun = line_info.iFun
2247 2257 theRest = line_info.theRest
2248 2258 cmd = '%s_ip.magic(%s)' % (line_info.preWhitespace,
2249 2259 make_quoted_expr(iFun + " " + theRest))
2250 2260 self.log(line_info.line,cmd,line_info.continue_prompt)
2251 2261 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2252 2262 return cmd
2253 2263
2254 2264 def handle_auto(self, line_info):
2255 2265 """Hande lines which can be auto-executed, quoting if requested."""
2256 2266
2257 2267 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2258 2268 line = line_info.line
2259 2269 iFun = line_info.iFun
2260 2270 theRest = line_info.theRest
2261 2271 pre = line_info.pre
2262 2272 continue_prompt = line_info.continue_prompt
2263 2273 obj = line_info.ofind(self)['obj']
2264 2274
2265 2275 # This should only be active for single-line input!
2266 2276 if continue_prompt:
2267 2277 self.log(line,line,continue_prompt)
2268 2278 return line
2269 2279
2270 2280 force_auto = isinstance(obj, IPython.ipapi.IPyAutocall)
2271 2281 auto_rewrite = True
2272 2282
2273 2283 if pre == self.ESC_QUOTE:
2274 2284 # Auto-quote splitting on whitespace
2275 2285 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2276 2286 elif pre == self.ESC_QUOTE2:
2277 2287 # Auto-quote whole string
2278 2288 newcmd = '%s("%s")' % (iFun,theRest)
2279 2289 elif pre == self.ESC_PAREN:
2280 2290 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2281 2291 else:
2282 2292 # Auto-paren.
2283 2293 # We only apply it to argument-less calls if the autocall
2284 2294 # parameter is set to 2. We only need to check that autocall is <
2285 2295 # 2, since this function isn't called unless it's at least 1.
2286 2296 if not theRest and (self.rc.autocall < 2) and not force_auto:
2287 2297 newcmd = '%s %s' % (iFun,theRest)
2288 2298 auto_rewrite = False
2289 2299 else:
2290 2300 if not force_auto and theRest.startswith('['):
2291 2301 if hasattr(obj,'__getitem__'):
2292 2302 # Don't autocall in this case: item access for an object
2293 2303 # which is BOTH callable and implements __getitem__.
2294 2304 newcmd = '%s %s' % (iFun,theRest)
2295 2305 auto_rewrite = False
2296 2306 else:
2297 2307 # if the object doesn't support [] access, go ahead and
2298 2308 # autocall
2299 2309 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2300 2310 elif theRest.endswith(';'):
2301 2311 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2302 2312 else:
2303 2313 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2304 2314
2305 2315 if auto_rewrite:
2306 2316 rw = self.outputcache.prompt1.auto_rewrite() + newcmd
2307 2317
2308 2318 try:
2309 2319 # plain ascii works better w/ pyreadline, on some machines, so
2310 2320 # we use it and only print uncolored rewrite if we have unicode
2311 2321 rw = str(rw)
2312 2322 print >>Term.cout, rw
2313 2323 except UnicodeEncodeError:
2314 2324 print "-------------->" + newcmd
2315 2325
2316 2326 # log what is now valid Python, not the actual user input (without the
2317 2327 # final newline)
2318 2328 self.log(line,newcmd,continue_prompt)
2319 2329 return newcmd
2320 2330
2321 2331 def handle_help(self, line_info):
2322 2332 """Try to get some help for the object.
2323 2333
2324 2334 obj? or ?obj -> basic information.
2325 2335 obj?? or ??obj -> more details.
2326 2336 """
2327 2337
2328 2338 line = line_info.line
2329 2339 # We need to make sure that we don't process lines which would be
2330 2340 # otherwise valid python, such as "x=1 # what?"
2331 2341 try:
2332 2342 codeop.compile_command(line)
2333 2343 except SyntaxError:
2334 2344 # We should only handle as help stuff which is NOT valid syntax
2335 2345 if line[0]==self.ESC_HELP:
2336 2346 line = line[1:]
2337 2347 elif line[-1]==self.ESC_HELP:
2338 2348 line = line[:-1]
2339 2349 self.log(line,'#?'+line,line_info.continue_prompt)
2340 2350 if line:
2341 2351 #print 'line:<%r>' % line # dbg
2342 2352 self.magic_pinfo(line)
2343 2353 else:
2344 2354 page(self.usage,screen_lines=self.rc.screen_length)
2345 2355 return '' # Empty string is needed here!
2346 2356 except:
2347 2357 # Pass any other exceptions through to the normal handler
2348 2358 return self.handle_normal(line_info)
2349 2359 else:
2350 2360 # If the code compiles ok, we should handle it normally
2351 2361 return self.handle_normal(line_info)
2352 2362
2353 2363 def getapi(self):
2354 2364 """ Get an IPApi object for this shell instance
2355 2365
2356 2366 Getting an IPApi object is always preferable to accessing the shell
2357 2367 directly, but this holds true especially for extensions.
2358 2368
2359 2369 It should always be possible to implement an extension with IPApi
2360 2370 alone. If not, contact maintainer to request an addition.
2361 2371
2362 2372 """
2363 2373 return self.api
2364 2374
2365 2375 def handle_emacs(self, line_info):
2366 2376 """Handle input lines marked by python-mode."""
2367 2377
2368 2378 # Currently, nothing is done. Later more functionality can be added
2369 2379 # here if needed.
2370 2380
2371 2381 # The input cache shouldn't be updated
2372 2382 return line_info.line
2373 2383
2374 2384
2375 2385 def mktempfile(self,data=None):
2376 2386 """Make a new tempfile and return its filename.
2377 2387
2378 2388 This makes a call to tempfile.mktemp, but it registers the created
2379 2389 filename internally so ipython cleans it up at exit time.
2380 2390
2381 2391 Optional inputs:
2382 2392
2383 2393 - data(None): if data is given, it gets written out to the temp file
2384 2394 immediately, and the file is closed again."""
2385 2395
2386 2396 filename = tempfile.mktemp('.py','ipython_edit_')
2387 2397 self.tempfiles.append(filename)
2388 2398
2389 2399 if data:
2390 2400 tmp_file = open(filename,'w')
2391 2401 tmp_file.write(data)
2392 2402 tmp_file.close()
2393 2403 return filename
2394 2404
2395 2405 def write(self,data):
2396 2406 """Write a string to the default output"""
2397 2407 Term.cout.write(data)
2398 2408
2399 2409 def write_err(self,data):
2400 2410 """Write a string to the default error output"""
2401 2411 Term.cerr.write(data)
2402 2412
2403 2413 def exit(self):
2404 2414 """Handle interactive exit.
2405 2415
2406 2416 This method sets the exit_now attribute."""
2407 2417
2408 2418 if self.rc.confirm_exit:
2409 2419 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2410 2420 self.exit_now = True
2411 2421 else:
2412 2422 self.exit_now = True
2413 2423
2414 2424 def safe_execfile(self,fname,*where,**kw):
2415 2425 """A safe version of the builtin execfile().
2416 2426
2417 2427 This version will never throw an exception, and knows how to handle
2418 2428 ipython logs as well.
2419 2429
2420 2430 :Parameters:
2421 2431 fname : string
2422 2432 Name of the file to be executed.
2423 2433
2424 2434 where : tuple
2425 2435 One or two namespaces, passed to execfile() as (globals,locals).
2426 2436 If only one is given, it is passed as both.
2427 2437
2428 2438 :Keywords:
2429 2439 islog : boolean (False)
2430 2440
2431 2441 quiet : boolean (True)
2432 2442
2433 2443 exit_ignore : boolean (False)
2434 2444 """
2435 2445
2436 2446 def syspath_cleanup():
2437 2447 """Internal cleanup routine for sys.path."""
2438 2448 if add_dname:
2439 2449 try:
2440 2450 sys.path.remove(dname)
2441 2451 except ValueError:
2442 2452 # For some reason the user has already removed it, ignore.
2443 2453 pass
2444 2454
2445 2455 fname = os.path.expanduser(fname)
2446 2456
2447 2457 # Find things also in current directory. This is needed to mimic the
2448 2458 # behavior of running a script from the system command line, where
2449 2459 # Python inserts the script's directory into sys.path
2450 2460 dname = os.path.dirname(os.path.abspath(fname))
2451 2461 add_dname = False
2452 2462 if dname not in sys.path:
2453 2463 sys.path.insert(0,dname)
2454 2464 add_dname = True
2455 2465
2456 2466 try:
2457 2467 xfile = open(fname)
2458 2468 except:
2459 2469 print >> Term.cerr, \
2460 2470 'Could not open file <%s> for safe execution.' % fname
2461 2471 syspath_cleanup()
2462 2472 return None
2463 2473
2464 2474 kw.setdefault('islog',0)
2465 2475 kw.setdefault('quiet',1)
2466 2476 kw.setdefault('exit_ignore',0)
2467 2477
2468 2478 first = xfile.readline()
2469 2479 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2470 2480 xfile.close()
2471 2481 # line by line execution
2472 2482 if first.startswith(loghead) or kw['islog']:
2473 2483 print 'Loading log file <%s> one line at a time...' % fname
2474 2484 if kw['quiet']:
2475 2485 stdout_save = sys.stdout
2476 2486 sys.stdout = StringIO.StringIO()
2477 2487 try:
2478 2488 globs,locs = where[0:2]
2479 2489 except:
2480 2490 try:
2481 2491 globs = locs = where[0]
2482 2492 except:
2483 2493 globs = locs = globals()
2484 2494 badblocks = []
2485 2495
2486 2496 # we also need to identify indented blocks of code when replaying
2487 2497 # logs and put them together before passing them to an exec
2488 2498 # statement. This takes a bit of regexp and look-ahead work in the
2489 2499 # file. It's easiest if we swallow the whole thing in memory
2490 2500 # first, and manually walk through the lines list moving the
2491 2501 # counter ourselves.
2492 2502 indent_re = re.compile('\s+\S')
2493 2503 xfile = open(fname)
2494 2504 filelines = xfile.readlines()
2495 2505 xfile.close()
2496 2506 nlines = len(filelines)
2497 2507 lnum = 0
2498 2508 while lnum < nlines:
2499 2509 line = filelines[lnum]
2500 2510 lnum += 1
2501 2511 # don't re-insert logger status info into cache
2502 2512 if line.startswith('#log#'):
2503 2513 continue
2504 2514 else:
2505 2515 # build a block of code (maybe a single line) for execution
2506 2516 block = line
2507 2517 try:
2508 2518 next = filelines[lnum] # lnum has already incremented
2509 2519 except:
2510 2520 next = None
2511 2521 while next and indent_re.match(next):
2512 2522 block += next
2513 2523 lnum += 1
2514 2524 try:
2515 2525 next = filelines[lnum]
2516 2526 except:
2517 2527 next = None
2518 2528 # now execute the block of one or more lines
2519 2529 try:
2520 2530 exec block in globs,locs
2521 2531 except SystemExit:
2522 2532 pass
2523 2533 except:
2524 2534 badblocks.append(block.rstrip())
2525 2535 if kw['quiet']: # restore stdout
2526 2536 sys.stdout.close()
2527 2537 sys.stdout = stdout_save
2528 2538 print 'Finished replaying log file <%s>' % fname
2529 2539 if badblocks:
2530 2540 print >> sys.stderr, ('\nThe following lines/blocks in file '
2531 2541 '<%s> reported errors:' % fname)
2532 2542
2533 2543 for badline in badblocks:
2534 2544 print >> sys.stderr, badline
2535 2545 else: # regular file execution
2536 2546 try:
2537 2547 if sys.platform == 'win32' and sys.version_info < (2,5,1):
2538 2548 # Work around a bug in Python for Windows. The bug was
2539 2549 # fixed in in Python 2.5 r54159 and 54158, but that's still
2540 2550 # SVN Python as of March/07. For details, see:
2541 2551 # http://projects.scipy.org/ipython/ipython/ticket/123
2542 2552 try:
2543 2553 globs,locs = where[0:2]
2544 2554 except:
2545 2555 try:
2546 2556 globs = locs = where[0]
2547 2557 except:
2548 2558 globs = locs = globals()
2549 2559 exec file(fname) in globs,locs
2550 2560 else:
2551 2561 execfile(fname,*where)
2552 2562 except SyntaxError:
2553 2563 self.showsyntaxerror()
2554 2564 warn('Failure executing file: <%s>' % fname)
2555 2565 except SystemExit,status:
2556 2566 # Code that correctly sets the exit status flag to success (0)
2557 2567 # shouldn't be bothered with a traceback. Note that a plain
2558 2568 # sys.exit() does NOT set the message to 0 (it's empty) so that
2559 2569 # will still get a traceback. Note that the structure of the
2560 2570 # SystemExit exception changed between Python 2.4 and 2.5, so
2561 2571 # the checks must be done in a version-dependent way.
2562 2572 show = False
2563 2573
2564 2574 if sys.version_info[:2] > (2,5):
2565 2575 if status.message!=0 and not kw['exit_ignore']:
2566 2576 show = True
2567 2577 else:
2568 2578 if status.code and not kw['exit_ignore']:
2569 2579 show = True
2570 2580 if show:
2571 2581 self.showtraceback()
2572 2582 warn('Failure executing file: <%s>' % fname)
2573 2583 except:
2574 2584 self.showtraceback()
2575 2585 warn('Failure executing file: <%s>' % fname)
2576 2586
2577 2587 syspath_cleanup()
2578 2588
2579 2589 #************************* end of file <iplib.py> *****************************
@@ -1,7270 +1,7294 b''
1 2007-12-12 Ville Vainio <vivainio@gmail.com>
2
3 * genutils.py (abbrev_cwd): Terminal title now shows 2 levels of current
4 directory.
5
6 * iplib.py: We now set system default encoding to sys.stdin.encoding with
7 sys.setdefaultencoding, after a patch by 'pan'. This makes str() calls that
8 IPython still has implicitly work. This should be removed when such calls
9 are cleaned.
10
1 11 2007-12-12 Fernando Perez <Fernando.Perez@colorado.edu>
2 12
3 13 * IPython/Shell.py (_select_shell): add support for controlling
4 14 the pylab threading mode directly at the command line, without
5 15 having to modify MPL config files. Added unit tests for this
6 16 feature, though manual/docs update is still pending, will do later.
7 17
18 2007-12-11 Ville Vainio <vivainio@gmail.com>
19
20 * ext_rescapture.py: var = !cmd is no longer verbose (to facilitate
21 use in scripts)
22
23 2007-12-07 Ville Vainio <vivainio@gmail.com>
24
25 * iplib.py, ipy_profile_sh.py: Do not escape # on command lines
26 anymore (to \#) - even if it is a comment char that is implicitly
27 escaped in some unix shells in interactive mode, it is ok to leave
28 it in IPython as such.
29
30
8 31 2007-12-01 Robert Kern <robert.kern@gmail.com>
9 32
10 33 * IPython/ultraTB.py (findsource): Improve the monkeypatch to
11 34 inspect.findsource(). It can now find source lines inside zipped
12 35 packages.
13 36
14 37 * IPython/ultraTB.py: When constructing tracebacks, try to use __file__
15 38 in the frame's namespace before trusting the filename in the code object
16 39 which created the frame.
17 40
18 41 2007-11-29 *** Released version 0.8.2
19 42
20 43 2007-11-25 Fernando Perez <Fernando.Perez@colorado.edu>
21 44
22 45 * IPython/Logger.py (Logger.logstop): add a proper logstop()
23 46 method to fully stop the logger, along with a corresponding
24 47 %logstop magic for interactive use.
25 48
26 49 * IPython/Extensions/ipy_host_completers.py: added new host
27 50 completers functionality, contributed by Gael Pasgrimaud
28 51 <gawel-AT-afpy.org>.
29 52
30 53 2007-11-24 Fernando Perez <Fernando.Perez@colorado.edu>
31 54
32 55 * IPython/DPyGetOpt.py (ArgumentError): Apply patch by Paul Mueller
33 56 <gakusei-AT-dakotacom.net>, to fix deprecated string exceptions in
34 57 options handling. Unicode fix in %whos (committed a while ago)
35 58 was also contributed by Paul.
36 59
37 60 2007-11-23 Darren Dale <darren.dale@cornell.edu>
38 61 * ipy_traits_completer.py: let traits_completer respect the user's
39 62 readline_omit__names setting.
40 63
41 64 2007-11-08 Ville Vainio <vivainio@gmail.com>
65
42 66 * ipy_completers.py (import completer): assume 'xml' module exists.
43 67 Do not add every module twice anymore. Closes #196.
44 68
45 69 * ipy_completers.py, ipy_app_completers.py: Add proper apt-get
46 70 completer that uses apt-cache to search for existing packages.
47 71
48 72 2007-11-06 Ville Vainio <vivainio@gmail.com>
49 73
50 74 * Prompts.py: Do not update _oh and _123 when do_full_cache is not
51 75 true. Closes #194.
52 76
53 77 2007-11-01 Brian Granger <ellisonbg@gmail.com>
54 78
55 79 * iplib.py, rlineimpl.py: Applied Body Water's patches to get IPython
56 80 working with OS X 10.5 libedit implementation of readline.
57 81
58 82 2007-10-24 Ville Vainio <vivainio@gmail.com>
59 83
60 84 * iplib.py(user_setup): To route around buggy installations where
61 85 UserConfig is not available, create a minimal _ipython.
62 86
63 87 * iplib.py: Unicode fixes from Jorgen.
64 88
65 89 * genutils.py: Slist now has new method 'fields()' for extraction of
66 90 whitespace-separated fields from line-oriented data.
67 91
68 92 2007-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
69 93
70 94 * IPython/OInspect.py (Inspector.pinfo): fix bug that could arise
71 95 when querying objects with no __class__ attribute (such as
72 96 f2py-generated modules).
73 97
74 98 2007-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
75 99
76 100 * IPython/Magic.py (magic_time): track compilation time and report
77 101 it if longer than 0.1s (fix done to %time and %timeit). After a
78 102 SAGE bug report: http://trac.sagemath.org/sage_trac/ticket/632.
79 103
80 104 2007-09-18 Ville Vainio <vivainio@gmail.com>
81 105
82 106 * genutils.py(make_quoted_expr): Do not use Itpl, it does
83 107 not support unicode at the moment. Fixes (many) magic calls with
84 108 special characters.
85 109
86 110 2007-09-14 Fernando Perez <Fernando.Perez@colorado.edu>
87 111
88 112 * IPython/genutils.py (doctest_reload): expose the doctest
89 113 reloader to the user so that people can easily reset doctest while
90 114 using it interactively. Fixes a problem reported by Jorgen.
91 115
92 116 * IPython/iplib.py (InteractiveShell.__init__): protect the
93 117 FakeModule instances used for __main__ in %run calls from
94 118 deletion, so that user code defined in them isn't left with
95 119 dangling references due to the Python module deletion machinery.
96 120 This should fix the problems reported by Darren.
97 121
98 122 2007-09-10 Darren Dale <dd55@cornell.edu>
99 123
100 124 * Cleanup of IPShellQt and IPShellQt4
101 125
102 126 2007-09-09 Fernando Perez <Fernando.Perez@colorado.edu>
103 127
104 128 * IPython/FakeModule.py (FakeModule.__init__): further fixes for
105 129 doctest support.
106 130
107 131 * IPython/iplib.py (safe_execfile): minor docstring improvements.
108 132
109 133 2007-09-08 Ville Vainio <vivainio@gmail.com>
110 134
111 135 * Magic.py (%pushd, %popd, %dirs): Fix dir stack - push *current*
112 136 directory, not the target directory.
113 137
114 138 * ipapi.py, Magic.py, iplib.py: Add ipapi.UsageError, a lighter weight
115 139 exception that won't print the tracebacks. Switched many magics to
116 140 raise them on error situations, also GetoptError is not printed
117 141 anymore.
118 142
119 143 2007-09-07 Ville Vainio <vivainio@gmail.com>
120 144
121 145 * iplib.py: do not auto-alias "dir", it screws up other dir auto
122 146 aliases.
123 147
124 148 * genutils.py: SList.grep() implemented.
125 149
126 150 * ipy_editors.py, UserConfig/ipy_user_conf.py: Add some editors
127 151 for easy "out of the box" setup of several common editors, so that
128 152 e.g. '%edit os.path.isfile' will jump to the correct line
129 153 automatically. Contributions for command lines of your favourite
130 154 editors welcome.
131 155
132 156 2007-09-07 Fernando Perez <Fernando.Perez@colorado.edu>
133 157
134 158 * IPython/OInspect.py (Inspector.pinfo): fixed bug that was
135 159 preventing source display in certain cases. In reality I think
136 160 the problem is with Ubuntu's Python build, but this change works
137 161 around the issue in some cases (not in all, unfortunately). I'd
138 162 filed a Python bug on this with more details, but in the change of
139 163 bug trackers it seems to have been lost.
140 164
141 165 * IPython/Magic.py (magic_dhist): restore %dhist. No, cd -TAB is
142 166 not the same, it's not self-documenting, doesn't allow range
143 167 selection, and sorts alphabetically instead of numerically.
144 168 (magic_r): restore %r. No, "up + enter. One char magic" is not
145 169 the same thing, since %r takes parameters to allow fast retrieval
146 170 of old commands. I've received emails from users who use this a
147 171 LOT, so it stays.
148 172 (magic_automagic): restore %automagic. "use _ip.option.automagic"
149 173 is not a valid replacement b/c it doesn't provide an complete
150 174 explanation (which the automagic docstring does).
151 175 (magic_autocall): restore %autocall, with improved docstring.
152 176 Same argument as for others, "use _ip.options.autocall" is not a
153 177 valid replacement.
154 178 (magic_pdef): restore %pdef & friends. Used widely, mentioned in
155 179 tutorials and online docs.
156 180
157 181 2007-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
158 182
159 183 * IPython/usage.py (quick_reference): mention magics in quickref,
160 184 modified main banner to mention %quickref.
161 185
162 186 * IPython/FakeModule.py (FakeModule): fixes for doctest compatibility.
163 187
164 188 2007-09-06 Ville Vainio <vivainio@gmail.com>
165 189
166 190 * ipy_rehashdir.py, ipy_workdir.py, ipy_fsops.py, iplib.py:
167 191 Callable aliases now pass the _ip as first arg. This breaks
168 192 compatibility with earlier 0.8.2.svn series! (though they should
169 193 not have been in use yet outside these few extensions)
170 194
171 195 2007-09-05 Ville Vainio <vivainio@gmail.com>
172 196
173 197 * external/mglob.py: expand('dirname') => ['dirname'], instead
174 198 of ['dirname/foo','dirname/bar', ...].
175 199
176 200 * Extensions/ipy_fsops.py: added, has usefull shell utils for plain
177 201 win32 installations: icp, imv, imkdir, igrep, irm, collect (collect
178 202 is useful for others as well).
179 203
180 204 * iplib.py: on callable aliases (as opposed to old style aliases),
181 205 do var_expand() immediately, and use make_quoted_expr instead
182 206 of hardcoded r"""
183 207
184 208 * Extensions/ipy_profile_sh.py: Try to detect cygwin on win32,
185 209 if not available load ipy_fsops.py for cp, mv, etc. replacements
186 210
187 211 * OInspect.py, ipy_which.py: improve %which and obj? for callable
188 212 aliases
189 213
190 214 2007-09-04 Ville Vainio <vivainio@gmail.com>
191 215
192 216 * ipy_profile_zope.py: add zope profile, by Stefan Eletzhofer.
193 217 Relicensed under BSD with the authors approval.
194 218
195 219 * ipmaker.py, usage.py: Remove %magic from default banner, improve
196 220 %quickref
197 221
198 222 2007-09-03 Ville Vainio <vivainio@gmail.com>
199 223
200 224 * Magic.py: %time now passes expression through prefilter,
201 225 allowing IPython syntax.
202 226
203 227 2007-09-01 Ville Vainio <vivainio@gmail.com>
204 228
205 229 * ipmaker.py: Always show full traceback when newstyle config fails
206 230
207 231 2007-08-27 Ville Vainio <vivainio@gmail.com>
208 232
209 233 * Magic.py: fix %cd for nonexistent dir when dhist is empty, close #180
210 234
211 235 2007-08-26 Ville Vainio <vivainio@gmail.com>
212 236
213 237 * ipmaker.py: Command line args have the highest priority again
214 238
215 239 * iplib.py, ipmaker.py: -i command line argument now behaves as in
216 240 normal python, i.e. leaves the IPython session running after -c
217 241 command or running a batch file from command line.
218 242
219 243 2007-08-22 Ville Vainio <vivainio@gmail.com>
220 244
221 245 * iplib.py: no extra empty (last) line in raw hist w/ multiline
222 246 statements
223 247
224 248 * logger.py: Fix bug where blank lines in history were not
225 249 added until AFTER adding the current line; translated and raw
226 250 history should finally be in sync with prompt now.
227 251
228 252 * ipy_completers.py: quick_completer now makes it easy to create
229 253 trivial custom completers
230 254
231 255 * clearcmd.py: shadow history compression & erasing, fixed input hist
232 256 clearing.
233 257
234 258 * envpersist.py, history.py: %env (sh profile only), %hist completers
235 259
236 260 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
237 261 term title now include the drive letter, and always use / instead of
238 262 os.sep (as per recommended approach for win32 ipython in general).
239 263
240 264 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
241 265 plain python scripts from ipykit command line by running
242 266 "py myscript.py", even w/o installed python.
243 267
244 268 2007-08-21 Ville Vainio <vivainio@gmail.com>
245 269
246 270 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
247 271 (for backwards compatibility)
248 272
249 273 * history.py: switch back to %hist -t from %hist -r as default.
250 274 At least until raw history is fixed for good.
251 275
252 276 2007-08-20 Ville Vainio <vivainio@gmail.com>
253 277
254 278 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
255 279 locate alias redeclarations etc. Also, avoid handling
256 280 _ip.IP.alias_table directly, prefer using _ip.defalias.
257 281
258 282
259 283 2007-08-15 Ville Vainio <vivainio@gmail.com>
260 284
261 285 * prefilter.py: ! is now always served first
262 286
263 287 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
264 288
265 289 * IPython/iplib.py (safe_execfile): fix the SystemExit
266 290 auto-suppression code to work in Python2.4 (the internal structure
267 291 of that exception changed and I'd only tested the code with 2.5).
268 292 Bug reported by a SciPy attendee.
269 293
270 294 2007-08-13 Ville Vainio <vivainio@gmail.com>
271 295
272 296 * prefilter.py: reverted !c:/bin/foo fix, made % in
273 297 multiline specials work again
274 298
275 299 2007-08-13 Ville Vainio <vivainio@gmail.com>
276 300
277 301 * prefilter.py: Take more care to special-case !, so that
278 302 !c:/bin/foo.exe works.
279 303
280 304 * setup.py: if we are building eggs, strip all docs and
281 305 examples (it doesn't make sense to bytecompile examples,
282 306 and docs would be in an awkward place anyway).
283 307
284 308 * Ryan Krauss' patch fixes start menu shortcuts when IPython
285 309 is installed into a directory that has spaces in the name.
286 310
287 311 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
288 312
289 313 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
290 314 doctest profile and %doctest_mode, so they actually generate the
291 315 blank lines needed by doctest to separate individual tests.
292 316
293 317 * IPython/iplib.py (safe_execfile): modify so that running code
294 318 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
295 319 doesn't get a printed traceback. Any other value in sys.exit(),
296 320 including the empty call, still generates a traceback. This
297 321 enables use of %run without having to pass '-e' for codes that
298 322 correctly set the exit status flag.
299 323
300 324 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
301 325
302 326 * IPython/iplib.py (InteractiveShell.post_config_initialization):
303 327 fix problems with doctests failing when run inside IPython due to
304 328 IPython's modifications of sys.displayhook.
305 329
306 330 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
307 331
308 332 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
309 333 a string with names.
310 334
311 335 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
312 336
313 337 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
314 338 magic to toggle on/off the doctest pasting support without having
315 339 to leave a session to switch to a separate profile.
316 340
317 341 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
318 342
319 343 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
320 344 introduce a blank line between inputs, to conform to doctest
321 345 requirements.
322 346
323 347 * IPython/OInspect.py (Inspector.pinfo): fix another part where
324 348 auto-generated docstrings for new-style classes were showing up.
325 349
326 350 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
327 351
328 352 * api_changes: Add new file to track backward-incompatible
329 353 user-visible changes.
330 354
331 355 2007-08-06 Ville Vainio <vivainio@gmail.com>
332 356
333 357 * ipmaker.py: fix bug where user_config_ns didn't exist at all
334 358 before all the config files were handled.
335 359
336 360 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
337 361
338 362 * IPython/irunner.py (RunnerFactory): Add new factory class for
339 363 creating reusable runners based on filenames.
340 364
341 365 * IPython/Extensions/ipy_profile_doctest.py: New profile for
342 366 doctest support. It sets prompts/exceptions as similar to
343 367 standard Python as possible, so that ipython sessions in this
344 368 profile can be easily pasted as doctests with minimal
345 369 modifications. It also enables pasting of doctests from external
346 370 sources (even if they have leading whitespace), so that you can
347 371 rerun doctests from existing sources.
348 372
349 373 * IPython/iplib.py (_prefilter): fix a buglet where after entering
350 374 some whitespace, the prompt would become a continuation prompt
351 375 with no way of exiting it other than Ctrl-C. This fix brings us
352 376 into conformity with how the default python prompt works.
353 377
354 378 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
355 379 Add support for pasting not only lines that start with '>>>', but
356 380 also with ' >>>'. That is, arbitrary whitespace can now precede
357 381 the prompts. This makes the system useful for pasting doctests
358 382 from docstrings back into a normal session.
359 383
360 384 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
361 385
362 386 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
363 387 r1357, which had killed multiple invocations of an embedded
364 388 ipython (this means that example-embed has been broken for over 1
365 389 year!!!). Rather than possibly breaking the batch stuff for which
366 390 the code in iplib.py/interact was introduced, I worked around the
367 391 problem in the embedding class in Shell.py. We really need a
368 392 bloody test suite for this code, I'm sick of finding stuff that
369 393 used to work breaking left and right every time I use an old
370 394 feature I hadn't touched in a few months.
371 395 (kill_embedded): Add a new magic that only shows up in embedded
372 396 mode, to allow users to permanently deactivate an embedded instance.
373 397
374 398 2007-08-01 Ville Vainio <vivainio@gmail.com>
375 399
376 400 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
377 401 history gets out of sync on runlines (e.g. when running macros).
378 402
379 403 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
380 404
381 405 * IPython/Magic.py (magic_colors): fix win32-related error message
382 406 that could appear under *nix when readline was missing. Patch by
383 407 Scott Jackson, closes #175.
384 408
385 409 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
386 410
387 411 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
388 412 completer that it traits-aware, so that traits objects don't show
389 413 all of their internal attributes all the time.
390 414
391 415 * IPython/genutils.py (dir2): moved this code from inside
392 416 completer.py to expose it publicly, so I could use it in the
393 417 wildcards bugfix.
394 418
395 419 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
396 420 Stefan with Traits.
397 421
398 422 * IPython/completer.py (Completer.attr_matches): change internal
399 423 var name from 'object' to 'obj', since 'object' is now a builtin
400 424 and this can lead to weird bugs if reusing this code elsewhere.
401 425
402 426 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
403 427
404 428 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
405 429 'foo?' and update the code to prevent printing of default
406 430 docstrings that started appearing after I added support for
407 431 new-style classes. The approach I'm using isn't ideal (I just
408 432 special-case those strings) but I'm not sure how to more robustly
409 433 differentiate between truly user-written strings and Python's
410 434 automatic ones.
411 435
412 436 2007-07-09 Ville Vainio <vivainio@gmail.com>
413 437
414 438 * completer.py: Applied Matthew Neeley's patch:
415 439 Dynamic attributes from trait_names and _getAttributeNames are added
416 440 to the list of tab completions, but when this happens, the attribute
417 441 list is turned into a set, so the attributes are unordered when
418 442 printed, which makes it hard to find the right completion. This patch
419 443 turns this set back into a list and sort it.
420 444
421 445 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
422 446
423 447 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
424 448 classes in various inspector functions.
425 449
426 450 2007-06-28 Ville Vainio <vivainio@gmail.com>
427 451
428 452 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
429 453 Implement "shadow" namespace, and callable aliases that reside there.
430 454 Use them by:
431 455
432 456 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
433 457
434 458 foo hello world
435 459 (gets translated to:)
436 460 _sh.foo(r"""hello world""")
437 461
438 462 In practice, this kind of alias can take the role of a magic function
439 463
440 464 * New generic inspect_object, called on obj? and obj??
441 465
442 466 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
443 467
444 468 * IPython/ultraTB.py (findsource): fix a problem with
445 469 inspect.getfile that can cause crashes during traceback construction.
446 470
447 471 2007-06-14 Ville Vainio <vivainio@gmail.com>
448 472
449 473 * iplib.py (handle_auto): Try to use ascii for printing "--->"
450 474 autocall rewrite indication, becausesometimes unicode fails to print
451 475 properly (and you get ' - - - '). Use plain uncoloured ---> for
452 476 unicode.
453 477
454 478 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
455 479
456 480 . pickleshare 'hash' commands (hget, hset, hcompress,
457 481 hdict) for efficient shadow history storage.
458 482
459 483 2007-06-13 Ville Vainio <vivainio@gmail.com>
460 484
461 485 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
462 486 Added kw arg 'interactive', tell whether vars should be visible
463 487 with %whos.
464 488
465 489 2007-06-11 Ville Vainio <vivainio@gmail.com>
466 490
467 491 * pspersistence.py, Magic.py, iplib.py: directory history now saved
468 492 to db
469 493
470 494 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
471 495 Also, it exits IPython immediately after evaluating the command (just like
472 496 std python)
473 497
474 498 2007-06-05 Walter Doerwald <walter@livinglogic.de>
475 499
476 500 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
477 501 Python string and captures the output. (Idea and original patch by
478 502 Stefan van der Walt)
479 503
480 504 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
481 505
482 506 * IPython/ultraTB.py (VerboseTB.text): update printing of
483 507 exception types for Python 2.5 (now all exceptions in the stdlib
484 508 are new-style classes).
485 509
486 510 2007-05-31 Walter Doerwald <walter@livinglogic.de>
487 511
488 512 * IPython/Extensions/igrid.py: Add new commands refresh and
489 513 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
490 514 the iterator once (refresh) or after every x seconds (refresh_timer).
491 515 Add a working implementation of "searchexpression", where the text
492 516 entered is not the text to search for, but an expression that must
493 517 be true. Added display of shortcuts to the menu. Added commands "pickinput"
494 518 and "pickinputattr" that put the object or attribute under the cursor
495 519 in the input line. Split the statusbar to be able to display the currently
496 520 active refresh interval. (Patch by Nik Tautenhahn)
497 521
498 522 2007-05-29 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
499 523
500 524 * fixing set_term_title to use ctypes as default
501 525
502 526 * fixing set_term_title fallback to work when curent dir
503 527 is on a windows network share
504 528
505 529 2007-05-28 Ville Vainio <vivainio@gmail.com>
506 530
507 531 * %cpaste: strip + with > from left (diffs).
508 532
509 533 * iplib.py: Fix crash when readline not installed
510 534
511 535 2007-05-26 Ville Vainio <vivainio@gmail.com>
512 536
513 537 * generics.py: intruduce easy to extend result_display generic
514 538 function (using simplegeneric.py).
515 539
516 540 * Fixed the append functionality of %set.
517 541
518 542 2007-05-25 Ville Vainio <vivainio@gmail.com>
519 543
520 544 * New magic: %rep (fetch / run old commands from history)
521 545
522 546 * New extension: mglob (%mglob magic), for powerful glob / find /filter
523 547 like functionality
524 548
525 549 % maghistory.py: %hist -g PATTERM greps the history for pattern
526 550
527 551 2007-05-24 Walter Doerwald <walter@livinglogic.de>
528 552
529 553 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
530 554 browse the IPython input history
531 555
532 556 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
533 557 (mapped to "i") can be used to put the object under the curser in the input
534 558 line. pickinputattr (mapped to "I") does the same for the attribute under
535 559 the cursor.
536 560
537 561 2007-05-24 Ville Vainio <vivainio@gmail.com>
538 562
539 563 * Grand magic cleansing (changeset [2380]):
540 564
541 565 * Introduce ipy_legacy.py where the following magics were
542 566 moved:
543 567
544 568 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
545 569
546 570 If you need them, either use default profile or "import ipy_legacy"
547 571 in your ipy_user_conf.py
548 572
549 573 * Move sh and scipy profile to Extensions from UserConfig. this implies
550 574 you should not edit them, but you don't need to run %upgrade when
551 575 upgrading IPython anymore.
552 576
553 577 * %hist/%history now operates in "raw" mode by default. To get the old
554 578 behaviour, run '%hist -n' (native mode).
555 579
556 580 * split ipy_stock_completers.py to ipy_stock_completers.py and
557 581 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
558 582 installed as default.
559 583
560 584 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
561 585 handling.
562 586
563 587 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
564 588 input if readline is available.
565 589
566 590 2007-05-23 Ville Vainio <vivainio@gmail.com>
567 591
568 592 * macro.py: %store uses __getstate__ properly
569 593
570 594 * exesetup.py: added new setup script for creating
571 595 standalone IPython executables with py2exe (i.e.
572 596 no python installation required).
573 597
574 598 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
575 599 its place.
576 600
577 601 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
578 602
579 603 2007-05-21 Ville Vainio <vivainio@gmail.com>
580 604
581 605 * platutil_win32.py (set_term_title): handle
582 606 failure of 'title' system call properly.
583 607
584 608 2007-05-17 Walter Doerwald <walter@livinglogic.de>
585 609
586 610 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
587 611 (Bug detected by Paul Mueller).
588 612
589 613 2007-05-16 Ville Vainio <vivainio@gmail.com>
590 614
591 615 * ipy_profile_sci.py, ipython_win_post_install.py: Create
592 616 new "sci" profile, effectively a modern version of the old
593 617 "scipy" profile (which is now slated for deprecation).
594 618
595 619 2007-05-15 Ville Vainio <vivainio@gmail.com>
596 620
597 621 * pycolorize.py, pycolor.1: Paul Mueller's patches that
598 622 make pycolorize read input from stdin when run without arguments.
599 623
600 624 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
601 625
602 626 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
603 627 it in sh profile (instead of ipy_system_conf.py).
604 628
605 629 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
606 630 aliases are now lower case on windows (MyCommand.exe => mycommand).
607 631
608 632 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
609 633 Macros are now callable objects that inherit from ipapi.IPyAutocall,
610 634 i.e. get autocalled regardless of system autocall setting.
611 635
612 636 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
613 637
614 638 * IPython/rlineimpl.py: check for clear_history in readline and
615 639 make it a dummy no-op if not available. This function isn't
616 640 guaranteed to be in the API and appeared in Python 2.4, so we need
617 641 to check it ourselves. Also, clean up this file quite a bit.
618 642
619 643 * ipython.1: update man page and full manual with information
620 644 about threads (remove outdated warning). Closes #151.
621 645
622 646 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
623 647
624 648 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
625 649 in trunk (note that this made it into the 0.8.1 release already,
626 650 but the changelogs didn't get coordinated). Many thanks to Gael
627 651 Varoquaux <gael.varoquaux-AT-normalesup.org>
628 652
629 653 2007-05-09 *** Released version 0.8.1
630 654
631 655 2007-05-10 Walter Doerwald <walter@livinglogic.de>
632 656
633 657 * IPython/Extensions/igrid.py: Incorporate html help into
634 658 the module, so we don't have to search for the file.
635 659
636 660 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
637 661
638 662 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
639 663
640 664 2007-04-30 Ville Vainio <vivainio@gmail.com>
641 665
642 666 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
643 667 user has illegal (non-ascii) home directory name
644 668
645 669 2007-04-27 Ville Vainio <vivainio@gmail.com>
646 670
647 671 * platutils_win32.py: implement set_term_title for windows
648 672
649 673 * Update version number
650 674
651 675 * ipy_profile_sh.py: more informative prompt (2 dir levels)
652 676
653 677 2007-04-26 Walter Doerwald <walter@livinglogic.de>
654 678
655 679 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
656 680 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
657 681 bug discovered by Ville).
658 682
659 683 2007-04-26 Ville Vainio <vivainio@gmail.com>
660 684
661 685 * Extensions/ipy_completers.py: Olivier's module completer now
662 686 saves the list of root modules if it takes > 4 secs on the first run.
663 687
664 688 * Magic.py (%rehashx): %rehashx now clears the completer cache
665 689
666 690
667 691 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
668 692
669 693 * ipython.el: fix incorrect color scheme, reported by Stefan.
670 694 Closes #149.
671 695
672 696 * IPython/PyColorize.py (Parser.format2): fix state-handling
673 697 logic. I still don't like how that code handles state, but at
674 698 least now it should be correct, if inelegant. Closes #146.
675 699
676 700 2007-04-25 Ville Vainio <vivainio@gmail.com>
677 701
678 702 * Extensions/ipy_which.py: added extension for %which magic, works
679 703 a lot like unix 'which' but also finds and expands aliases, and
680 704 allows wildcards.
681 705
682 706 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
683 707 as opposed to returning nothing.
684 708
685 709 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
686 710 ipy_stock_completers on default profile, do import on sh profile.
687 711
688 712 2007-04-22 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
689 713
690 714 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
691 715 like ipython.py foo.py which raised a IndexError.
692 716
693 717 2007-04-21 Ville Vainio <vivainio@gmail.com>
694 718
695 719 * Extensions/ipy_extutil.py: added extension to manage other ipython
696 720 extensions. Now only supports 'ls' == list extensions.
697 721
698 722 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
699 723
700 724 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
701 725 would prevent use of the exception system outside of a running
702 726 IPython instance.
703 727
704 728 2007-04-20 Ville Vainio <vivainio@gmail.com>
705 729
706 730 * Extensions/ipy_render.py: added extension for easy
707 731 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
708 732 'Iptl' template notation,
709 733
710 734 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
711 735 safer & faster 'import' completer.
712 736
713 737 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
714 738 and _ip.defalias(name, command).
715 739
716 740 * Extensions/ipy_exportdb.py: New extension for exporting all the
717 741 %store'd data in a portable format (normal ipapi calls like
718 742 defmacro() etc.)
719 743
720 744 2007-04-19 Ville Vainio <vivainio@gmail.com>
721 745
722 746 * upgrade_dir.py: skip junk files like *.pyc
723 747
724 748 * Release.py: version number to 0.8.1
725 749
726 750 2007-04-18 Ville Vainio <vivainio@gmail.com>
727 751
728 752 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
729 753 and later on win32.
730 754
731 755 2007-04-16 Ville Vainio <vivainio@gmail.com>
732 756
733 757 * iplib.py (showtraceback): Do not crash when running w/o readline.
734 758
735 759 2007-04-12 Walter Doerwald <walter@livinglogic.de>
736 760
737 761 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
738 762 sorted (case sensitive with files and dirs mixed).
739 763
740 764 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
741 765
742 766 * IPython/Release.py (version): Open trunk for 0.8.1 development.
743 767
744 768 2007-04-10 *** Released version 0.8.0
745 769
746 770 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
747 771
748 772 * Tag 0.8.0 for release.
749 773
750 774 * IPython/iplib.py (reloadhist): add API function to cleanly
751 775 reload the readline history, which was growing inappropriately on
752 776 every %run call.
753 777
754 778 * win32_manual_post_install.py (run): apply last part of Nicolas
755 779 Pernetty's patch (I'd accidentally applied it in a different
756 780 directory and this particular file didn't get patched).
757 781
758 782 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
759 783
760 784 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
761 785 find the main thread id and use the proper API call. Thanks to
762 786 Stefan for the fix.
763 787
764 788 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
765 789 unit tests to reflect fixed ticket #52, and add more tests sent by
766 790 him.
767 791
768 792 * IPython/iplib.py (raw_input): restore the readline completer
769 793 state on every input, in case third-party code messed it up.
770 794 (_prefilter): revert recent addition of early-escape checks which
771 795 prevent many valid alias calls from working.
772 796
773 797 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
774 798 flag for sigint handler so we don't run a full signal() call on
775 799 each runcode access.
776 800
777 801 * IPython/Magic.py (magic_whos): small improvement to diagnostic
778 802 message.
779 803
780 804 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
781 805
782 806 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
783 807 asynchronous exceptions working, i.e., Ctrl-C can actually
784 808 interrupt long-running code in the multithreaded shells.
785 809
786 810 This is using Tomer Filiba's great ctypes-based trick:
787 811 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
788 812 this in the past, but hadn't been able to make it work before. So
789 813 far it looks like it's actually running, but this needs more
790 814 testing. If it really works, I'll be *very* happy, and we'll owe
791 815 a huge thank you to Tomer. My current implementation is ugly,
792 816 hackish and uses nasty globals, but I don't want to try and clean
793 817 anything up until we know if it actually works.
794 818
795 819 NOTE: this feature needs ctypes to work. ctypes is included in
796 820 Python2.5, but 2.4 users will need to manually install it. This
797 821 feature makes multi-threaded shells so much more usable that it's
798 822 a minor price to pay (ctypes is very easy to install, already a
799 823 requirement for win32 and available in major linux distros).
800 824
801 825 2007-04-04 Ville Vainio <vivainio@gmail.com>
802 826
803 827 * Extensions/ipy_completers.py, ipy_stock_completers.py:
804 828 Moved implementations of 'bundled' completers to ipy_completers.py,
805 829 they are only enabled in ipy_stock_completers.py.
806 830
807 831 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
808 832
809 833 * IPython/PyColorize.py (Parser.format2): Fix identation of
810 834 colorzied output and return early if color scheme is NoColor, to
811 835 avoid unnecessary and expensive tokenization. Closes #131.
812 836
813 837 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
814 838
815 839 * IPython/Debugger.py: disable the use of pydb version 1.17. It
816 840 has a critical bug (a missing import that makes post-mortem not
817 841 work at all). Unfortunately as of this time, this is the version
818 842 shipped with Ubuntu Edgy, so quite a few people have this one. I
819 843 hope Edgy will update to a more recent package.
820 844
821 845 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
822 846
823 847 * IPython/iplib.py (_prefilter): close #52, second part of a patch
824 848 set by Stefan (only the first part had been applied before).
825 849
826 850 * IPython/Extensions/ipy_stock_completers.py (module_completer):
827 851 remove usage of the dangerous pkgutil.walk_packages(). See
828 852 details in comments left in the code.
829 853
830 854 * IPython/Magic.py (magic_whos): add support for numpy arrays
831 855 similar to what we had for Numeric.
832 856
833 857 * IPython/completer.py (IPCompleter.complete): extend the
834 858 complete() call API to support completions by other mechanisms
835 859 than readline. Closes #109.
836 860
837 861 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
838 862 protect against a bug in Python's execfile(). Closes #123.
839 863
840 864 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
841 865
842 866 * IPython/iplib.py (split_user_input): ensure that when splitting
843 867 user input, the part that can be treated as a python name is pure
844 868 ascii (Python identifiers MUST be pure ascii). Part of the
845 869 ongoing Unicode support work.
846 870
847 871 * IPython/Prompts.py (prompt_specials_color): Add \N for the
848 872 actual prompt number, without any coloring. This allows users to
849 873 produce numbered prompts with their own colors. Added after a
850 874 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
851 875
852 876 2007-03-31 Walter Doerwald <walter@livinglogic.de>
853 877
854 878 * IPython/Extensions/igrid.py: Map the return key
855 879 to enter() and shift-return to enterattr().
856 880
857 881 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
858 882
859 883 * IPython/Magic.py (magic_psearch): add unicode support by
860 884 encoding to ascii the input, since this routine also only deals
861 885 with valid Python names. Fixes a bug reported by Stefan.
862 886
863 887 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
864 888
865 889 * IPython/Magic.py (_inspect): convert unicode input into ascii
866 890 before trying to evaluate it as a Python identifier. This fixes a
867 891 problem that the new unicode support had introduced when analyzing
868 892 long definition lines for functions.
869 893
870 894 2007-03-24 Walter Doerwald <walter@livinglogic.de>
871 895
872 896 * IPython/Extensions/igrid.py: Fix picking. Using
873 897 igrid with wxPython 2.6 and -wthread should work now.
874 898 igrid.display() simply tries to create a frame without
875 899 an application. Only if this fails an application is created.
876 900
877 901 2007-03-23 Walter Doerwald <walter@livinglogic.de>
878 902
879 903 * IPython/Extensions/path.py: Updated to version 2.2.
880 904
881 905 2007-03-23 Ville Vainio <vivainio@gmail.com>
882 906
883 907 * iplib.py: recursive alias expansion now works better, so that
884 908 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
885 909 doesn't trip up the process, if 'd' has been aliased to 'ls'.
886 910
887 911 * Extensions/ipy_gnuglobal.py added, provides %global magic
888 912 for users of http://www.gnu.org/software/global
889 913
890 914 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
891 915 Closes #52. Patch by Stefan van der Walt.
892 916
893 917 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
894 918
895 919 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
896 920 respect the __file__ attribute when using %run. Thanks to a bug
897 921 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
898 922
899 923 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
900 924
901 925 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
902 926 input. Patch sent by Stefan.
903 927
904 928 2007-03-20 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
905 929 * IPython/Extensions/ipy_stock_completer.py
906 930 shlex_split, fix bug in shlex_split. len function
907 931 call was missing an if statement. Caused shlex_split to
908 932 sometimes return "" as last element.
909 933
910 934 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
911 935
912 936 * IPython/completer.py
913 937 (IPCompleter.file_matches.single_dir_expand): fix a problem
914 938 reported by Stefan, where directories containign a single subdir
915 939 would be completed too early.
916 940
917 941 * IPython/Shell.py (_load_pylab): Make the execution of 'from
918 942 pylab import *' when -pylab is given be optional. A new flag,
919 943 pylab_import_all controls this behavior, the default is True for
920 944 backwards compatibility.
921 945
922 946 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
923 947 modified) R. Bernstein's patch for fully syntax highlighted
924 948 tracebacks. The functionality is also available under ultraTB for
925 949 non-ipython users (someone using ultraTB but outside an ipython
926 950 session). They can select the color scheme by setting the
927 951 module-level global DEFAULT_SCHEME. The highlight functionality
928 952 also works when debugging.
929 953
930 954 * IPython/genutils.py (IOStream.close): small patch by
931 955 R. Bernstein for improved pydb support.
932 956
933 957 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
934 958 DaveS <davls@telus.net> to improve support of debugging under
935 959 NTEmacs, including improved pydb behavior.
936 960
937 961 * IPython/Magic.py (magic_prun): Fix saving of profile info for
938 962 Python 2.5, where the stats object API changed a little. Thanks
939 963 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
940 964
941 965 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
942 966 Pernetty's patch to improve support for (X)Emacs under Win32.
943 967
944 968 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
945 969
946 970 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
947 971 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
948 972 a report by Nik Tautenhahn.
949 973
950 974 2007-03-16 Walter Doerwald <walter@livinglogic.de>
951 975
952 976 * setup.py: Add the igrid help files to the list of data files
953 977 to be installed alongside igrid.
954 978 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
955 979 Show the input object of the igrid browser as the window tile.
956 980 Show the object the cursor is on in the statusbar.
957 981
958 982 2007-03-15 Ville Vainio <vivainio@gmail.com>
959 983
960 984 * Extensions/ipy_stock_completers.py: Fixed exception
961 985 on mismatching quotes in %run completer. Patch by
962 986 Jorgen Stenarson. Closes #127.
963 987
964 988 2007-03-14 Ville Vainio <vivainio@gmail.com>
965 989
966 990 * Extensions/ext_rehashdir.py: Do not do auto_alias
967 991 in %rehashdir, it clobbers %store'd aliases.
968 992
969 993 * UserConfig/ipy_profile_sh.py: envpersist.py extension
970 994 (beefed up %env) imported for sh profile.
971 995
972 996 2007-03-10 Walter Doerwald <walter@livinglogic.de>
973 997
974 998 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
975 999 as the default browser.
976 1000 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
977 1001 As igrid displays all attributes it ever encounters, fetch() (which has
978 1002 been renamed to _fetch()) doesn't have to recalculate the display attributes
979 1003 every time a new item is fetched. This should speed up scrolling.
980 1004
981 1005 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
982 1006
983 1007 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
984 1008 Schmolck's recently reported tab-completion bug (my previous one
985 1009 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
986 1010
987 1011 2007-03-09 Walter Doerwald <walter@livinglogic.de>
988 1012
989 1013 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
990 1014 Close help window if exiting igrid.
991 1015
992 1016 2007-03-02 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
993 1017
994 1018 * IPython/Extensions/ipy_defaults.py: Check if readline is available
995 1019 before calling functions from readline.
996 1020
997 1021 2007-03-02 Walter Doerwald <walter@livinglogic.de>
998 1022
999 1023 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
1000 1024 igrid is a wxPython-based display object for ipipe. If your system has
1001 1025 wx installed igrid will be the default display. Without wx ipipe falls
1002 1026 back to ibrowse (which needs curses). If no curses is installed ipipe
1003 1027 falls back to idump.
1004 1028
1005 1029 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
1006 1030
1007 1031 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
1008 1032 my changes from yesterday, they introduced bugs. Will reactivate
1009 1033 once I get a correct solution, which will be much easier thanks to
1010 1034 Dan Milstein's new prefilter test suite.
1011 1035
1012 1036 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
1013 1037
1014 1038 * IPython/iplib.py (split_user_input): fix input splitting so we
1015 1039 don't attempt attribute accesses on things that can't possibly be
1016 1040 valid Python attributes. After a bug report by Alex Schmolck.
1017 1041 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
1018 1042 %magic with explicit % prefix.
1019 1043
1020 1044 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
1021 1045
1022 1046 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
1023 1047 avoid a DeprecationWarning from GTK.
1024 1048
1025 1049 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
1026 1050
1027 1051 * IPython/genutils.py (clock): I modified clock() to return total
1028 1052 time, user+system. This is a more commonly needed metric. I also
1029 1053 introduced the new clocku/clocks to get only user/system time if
1030 1054 one wants those instead.
1031 1055
1032 1056 ***WARNING: API CHANGE*** clock() used to return only user time,
1033 1057 so if you want exactly the same results as before, use clocku
1034 1058 instead.
1035 1059
1036 1060 2007-02-22 Ville Vainio <vivainio@gmail.com>
1037 1061
1038 1062 * IPython/Extensions/ipy_p4.py: Extension for improved
1039 1063 p4 (perforce version control system) experience.
1040 1064 Adds %p4 magic with p4 command completion and
1041 1065 automatic -G argument (marshall output as python dict)
1042 1066
1043 1067 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
1044 1068
1045 1069 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
1046 1070 stop marks.
1047 1071 (ClearingMixin): a simple mixin to easily make a Demo class clear
1048 1072 the screen in between blocks and have empty marquees. The
1049 1073 ClearDemo and ClearIPDemo classes that use it are included.
1050 1074
1051 1075 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
1052 1076
1053 1077 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
1054 1078 protect against exceptions at Python shutdown time. Patch
1055 1079 sumbmitted to upstream.
1056 1080
1057 1081 2007-02-14 Walter Doerwald <walter@livinglogic.de>
1058 1082
1059 1083 * IPython/Extensions/ibrowse.py: If entering the first object level
1060 1084 (i.e. the object for which the browser has been started) fails,
1061 1085 now the error is raised directly (aborting the browser) instead of
1062 1086 running into an empty levels list later.
1063 1087
1064 1088 2007-02-03 Walter Doerwald <walter@livinglogic.de>
1065 1089
1066 1090 * IPython/Extensions/ipipe.py: Add an xrepr implementation
1067 1091 for the noitem object.
1068 1092
1069 1093 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
1070 1094
1071 1095 * IPython/completer.py (Completer.attr_matches): Fix small
1072 1096 tab-completion bug with Enthought Traits objects with units.
1073 1097 Thanks to a bug report by Tom Denniston
1074 1098 <tom.denniston-AT-alum.dartmouth.org>.
1075 1099
1076 1100 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
1077 1101
1078 1102 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
1079 1103 bug where only .ipy or .py would be completed. Once the first
1080 1104 argument to %run has been given, all completions are valid because
1081 1105 they are the arguments to the script, which may well be non-python
1082 1106 filenames.
1083 1107
1084 1108 * IPython/irunner.py (InteractiveRunner.run_source): major updates
1085 1109 to irunner to allow it to correctly support real doctesting of
1086 1110 out-of-process ipython code.
1087 1111
1088 1112 * IPython/Magic.py (magic_cd): Make the setting of the terminal
1089 1113 title an option (-noterm_title) because it completely breaks
1090 1114 doctesting.
1091 1115
1092 1116 * IPython/demo.py: fix IPythonDemo class that was not actually working.
1093 1117
1094 1118 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
1095 1119
1096 1120 * IPython/irunner.py (main): fix small bug where extensions were
1097 1121 not being correctly recognized.
1098 1122
1099 1123 2007-01-23 Walter Doerwald <walter@livinglogic.de>
1100 1124
1101 1125 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
1102 1126 a string containing a single line yields the string itself as the
1103 1127 only item.
1104 1128
1105 1129 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
1106 1130 object if it's the same as the one on the last level (This avoids
1107 1131 infinite recursion for one line strings).
1108 1132
1109 1133 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1110 1134
1111 1135 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
1112 1136 all output streams before printing tracebacks. This ensures that
1113 1137 user output doesn't end up interleaved with traceback output.
1114 1138
1115 1139 2007-01-10 Ville Vainio <vivainio@gmail.com>
1116 1140
1117 1141 * Extensions/envpersist.py: Turbocharged %env that remembers
1118 1142 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
1119 1143 "%env VISUAL=jed".
1120 1144
1121 1145 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
1122 1146
1123 1147 * IPython/iplib.py (showtraceback): ensure that we correctly call
1124 1148 custom handlers in all cases (some with pdb were slipping through,
1125 1149 but I'm not exactly sure why).
1126 1150
1127 1151 * IPython/Debugger.py (Tracer.__init__): added new class to
1128 1152 support set_trace-like usage of IPython's enhanced debugger.
1129 1153
1130 1154 2006-12-24 Ville Vainio <vivainio@gmail.com>
1131 1155
1132 1156 * ipmaker.py: more informative message when ipy_user_conf
1133 1157 import fails (suggest running %upgrade).
1134 1158
1135 1159 * tools/run_ipy_in_profiler.py: Utility to see where
1136 1160 the time during IPython startup is spent.
1137 1161
1138 1162 2006-12-20 Ville Vainio <vivainio@gmail.com>
1139 1163
1140 1164 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
1141 1165
1142 1166 * ipapi.py: Add new ipapi method, expand_alias.
1143 1167
1144 1168 * Release.py: Bump up version to 0.7.4.svn
1145 1169
1146 1170 2006-12-17 Ville Vainio <vivainio@gmail.com>
1147 1171
1148 1172 * Extensions/jobctrl.py: Fixed &cmd arg arg...
1149 1173 to work properly on posix too
1150 1174
1151 1175 * Release.py: Update revnum (version is still just 0.7.3).
1152 1176
1153 1177 2006-12-15 Ville Vainio <vivainio@gmail.com>
1154 1178
1155 1179 * scripts/ipython_win_post_install: create ipython.py in
1156 1180 prefix + "/scripts".
1157 1181
1158 1182 * Release.py: Update version to 0.7.3.
1159 1183
1160 1184 2006-12-14 Ville Vainio <vivainio@gmail.com>
1161 1185
1162 1186 * scripts/ipython_win_post_install: Overwrite old shortcuts
1163 1187 if they already exist
1164 1188
1165 1189 * Release.py: release 0.7.3rc2
1166 1190
1167 1191 2006-12-13 Ville Vainio <vivainio@gmail.com>
1168 1192
1169 1193 * Branch and update Release.py for 0.7.3rc1
1170 1194
1171 1195 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
1172 1196
1173 1197 * IPython/Shell.py (IPShellWX): update for current WX naming
1174 1198 conventions, to avoid a deprecation warning with current WX
1175 1199 versions. Thanks to a report by Danny Shevitz.
1176 1200
1177 1201 2006-12-12 Ville Vainio <vivainio@gmail.com>
1178 1202
1179 1203 * ipmaker.py: apply david cournapeau's patch to make
1180 1204 import_some work properly even when ipythonrc does
1181 1205 import_some on empty list (it was an old bug!).
1182 1206
1183 1207 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
1184 1208 Add deprecation note to ipythonrc and a url to wiki
1185 1209 in ipy_user_conf.py
1186 1210
1187 1211
1188 1212 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
1189 1213 as if it was typed on IPython command prompt, i.e.
1190 1214 as IPython script.
1191 1215
1192 1216 * example-magic.py, magic_grepl.py: remove outdated examples
1193 1217
1194 1218 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
1195 1219
1196 1220 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
1197 1221 is called before any exception has occurred.
1198 1222
1199 1223 2006-12-08 Ville Vainio <vivainio@gmail.com>
1200 1224
1201 1225 * Extensions/ipy_stock_completers.py: fix cd completer
1202 1226 to translate /'s to \'s again.
1203 1227
1204 1228 * completer.py: prevent traceback on file completions w/
1205 1229 backslash.
1206 1230
1207 1231 * Release.py: Update release number to 0.7.3b3 for release
1208 1232
1209 1233 2006-12-07 Ville Vainio <vivainio@gmail.com>
1210 1234
1211 1235 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1212 1236 while executing external code. Provides more shell-like behaviour
1213 1237 and overall better response to ctrl + C / ctrl + break.
1214 1238
1215 1239 * tools/make_tarball.py: new script to create tarball straight from svn
1216 1240 (setup.py sdist doesn't work on win32).
1217 1241
1218 1242 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1219 1243 on dirnames with spaces and use the default completer instead.
1220 1244
1221 1245 * Revision.py: Change version to 0.7.3b2 for release.
1222 1246
1223 1247 2006-12-05 Ville Vainio <vivainio@gmail.com>
1224 1248
1225 1249 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1226 1250 pydb patch 4 (rm debug printing, py 2.5 checking)
1227 1251
1228 1252 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1229 1253 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1230 1254 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1231 1255 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1232 1256 object the cursor was on before the refresh. The command "markrange" is
1233 1257 mapped to "%" now.
1234 1258 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1235 1259
1236 1260 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1237 1261
1238 1262 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1239 1263 interactive debugger on the last traceback, without having to call
1240 1264 %pdb and rerun your code. Made minor changes in various modules,
1241 1265 should automatically recognize pydb if available.
1242 1266
1243 1267 2006-11-28 Ville Vainio <vivainio@gmail.com>
1244 1268
1245 1269 * completer.py: If the text start with !, show file completions
1246 1270 properly. This helps when trying to complete command name
1247 1271 for shell escapes.
1248 1272
1249 1273 2006-11-27 Ville Vainio <vivainio@gmail.com>
1250 1274
1251 1275 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1252 1276 der Walt. Clean up svn and hg completers by using a common
1253 1277 vcs_completer.
1254 1278
1255 1279 2006-11-26 Ville Vainio <vivainio@gmail.com>
1256 1280
1257 1281 * Remove ipconfig and %config; you should use _ip.options structure
1258 1282 directly instead!
1259 1283
1260 1284 * genutils.py: add wrap_deprecated function for deprecating callables
1261 1285
1262 1286 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1263 1287 _ip.system instead. ipalias is redundant.
1264 1288
1265 1289 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1266 1290 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1267 1291 explicit.
1268 1292
1269 1293 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1270 1294 completer. Try it by entering 'hg ' and pressing tab.
1271 1295
1272 1296 * macro.py: Give Macro a useful __repr__ method
1273 1297
1274 1298 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1275 1299
1276 1300 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1277 1301 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1278 1302 we don't get a duplicate ipipe module, where registration of the xrepr
1279 1303 implementation for Text is useless.
1280 1304
1281 1305 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1282 1306
1283 1307 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1284 1308
1285 1309 2006-11-24 Ville Vainio <vivainio@gmail.com>
1286 1310
1287 1311 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1288 1312 try to use "cProfile" instead of the slower pure python
1289 1313 "profile"
1290 1314
1291 1315 2006-11-23 Ville Vainio <vivainio@gmail.com>
1292 1316
1293 1317 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1294 1318 Qt+IPython+Designer link in documentation.
1295 1319
1296 1320 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1297 1321 correct Pdb object to %pydb.
1298 1322
1299 1323
1300 1324 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1301 1325 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1302 1326 generic xrepr(), otherwise the list implementation would kick in.
1303 1327
1304 1328 2006-11-21 Ville Vainio <vivainio@gmail.com>
1305 1329
1306 1330 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1307 1331 with one from UserConfig.
1308 1332
1309 1333 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1310 1334 it was missing which broke the sh profile.
1311 1335
1312 1336 * completer.py: file completer now uses explicit '/' instead
1313 1337 of os.path.join, expansion of 'foo' was broken on win32
1314 1338 if there was one directory with name 'foobar'.
1315 1339
1316 1340 * A bunch of patches from Kirill Smelkov:
1317 1341
1318 1342 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1319 1343
1320 1344 * [patch 7/9] Implement %page -r (page in raw mode) -
1321 1345
1322 1346 * [patch 5/9] ScientificPython webpage has moved
1323 1347
1324 1348 * [patch 4/9] The manual mentions %ds, should be %dhist
1325 1349
1326 1350 * [patch 3/9] Kill old bits from %prun doc.
1327 1351
1328 1352 * [patch 1/9] Fix typos here and there.
1329 1353
1330 1354 2006-11-08 Ville Vainio <vivainio@gmail.com>
1331 1355
1332 1356 * completer.py (attr_matches): catch all exceptions raised
1333 1357 by eval of expr with dots.
1334 1358
1335 1359 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1336 1360
1337 1361 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1338 1362 input if it starts with whitespace. This allows you to paste
1339 1363 indented input from any editor without manually having to type in
1340 1364 the 'if 1:', which is convenient when working interactively.
1341 1365 Slightly modifed version of a patch by Bo Peng
1342 1366 <bpeng-AT-rice.edu>.
1343 1367
1344 1368 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1345 1369
1346 1370 * IPython/irunner.py (main): modified irunner so it automatically
1347 1371 recognizes the right runner to use based on the extension (.py for
1348 1372 python, .ipy for ipython and .sage for sage).
1349 1373
1350 1374 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1351 1375 visible in ipapi as ip.config(), to programatically control the
1352 1376 internal rc object. There's an accompanying %config magic for
1353 1377 interactive use, which has been enhanced to match the
1354 1378 funtionality in ipconfig.
1355 1379
1356 1380 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1357 1381 so it's not just a toggle, it now takes an argument. Add support
1358 1382 for a customizable header when making system calls, as the new
1359 1383 system_header variable in the ipythonrc file.
1360 1384
1361 1385 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1362 1386
1363 1387 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1364 1388 generic functions (using Philip J. Eby's simplegeneric package).
1365 1389 This makes it possible to customize the display of third-party classes
1366 1390 without having to monkeypatch them. xiter() no longer supports a mode
1367 1391 argument and the XMode class has been removed. The same functionality can
1368 1392 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1369 1393 One consequence of the switch to generic functions is that xrepr() and
1370 1394 xattrs() implementation must define the default value for the mode
1371 1395 argument themselves and xattrs() implementations must return real
1372 1396 descriptors.
1373 1397
1374 1398 * IPython/external: This new subpackage will contain all third-party
1375 1399 packages that are bundled with IPython. (The first one is simplegeneric).
1376 1400
1377 1401 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1378 1402 directory which as been dropped in r1703.
1379 1403
1380 1404 * IPython/Extensions/ipipe.py (iless): Fixed.
1381 1405
1382 1406 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1383 1407
1384 1408 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1385 1409
1386 1410 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1387 1411 handling in variable expansion so that shells and magics recognize
1388 1412 function local scopes correctly. Bug reported by Brian.
1389 1413
1390 1414 * scripts/ipython: remove the very first entry in sys.path which
1391 1415 Python auto-inserts for scripts, so that sys.path under IPython is
1392 1416 as similar as possible to that under plain Python.
1393 1417
1394 1418 * IPython/completer.py (IPCompleter.file_matches): Fix
1395 1419 tab-completion so that quotes are not closed unless the completion
1396 1420 is unambiguous. After a request by Stefan. Minor cleanups in
1397 1421 ipy_stock_completers.
1398 1422
1399 1423 2006-11-02 Ville Vainio <vivainio@gmail.com>
1400 1424
1401 1425 * ipy_stock_completers.py: Add %run and %cd completers.
1402 1426
1403 1427 * completer.py: Try running custom completer for both
1404 1428 "foo" and "%foo" if the command is just "foo". Ignore case
1405 1429 when filtering possible completions.
1406 1430
1407 1431 * UserConfig/ipy_user_conf.py: install stock completers as default
1408 1432
1409 1433 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1410 1434 simplified readline history save / restore through a wrapper
1411 1435 function
1412 1436
1413 1437
1414 1438 2006-10-31 Ville Vainio <vivainio@gmail.com>
1415 1439
1416 1440 * strdispatch.py, completer.py, ipy_stock_completers.py:
1417 1441 Allow str_key ("command") in completer hooks. Implement
1418 1442 trivial completer for 'import' (stdlib modules only). Rename
1419 1443 ipy_linux_package_managers.py to ipy_stock_completers.py.
1420 1444 SVN completer.
1421 1445
1422 1446 * Extensions/ledit.py: %magic line editor for easily and
1423 1447 incrementally manipulating lists of strings. The magic command
1424 1448 name is %led.
1425 1449
1426 1450 2006-10-30 Ville Vainio <vivainio@gmail.com>
1427 1451
1428 1452 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1429 1453 Bernsteins's patches for pydb integration.
1430 1454 http://bashdb.sourceforge.net/pydb/
1431 1455
1432 1456 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1433 1457 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1434 1458 custom completer hook to allow the users to implement their own
1435 1459 completers. See ipy_linux_package_managers.py for example. The
1436 1460 hook name is 'complete_command'.
1437 1461
1438 1462 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1439 1463
1440 1464 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1441 1465 Numeric leftovers.
1442 1466
1443 1467 * ipython.el (py-execute-region): apply Stefan's patch to fix
1444 1468 garbled results if the python shell hasn't been previously started.
1445 1469
1446 1470 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1447 1471 pretty generic function and useful for other things.
1448 1472
1449 1473 * IPython/OInspect.py (getsource): Add customizable source
1450 1474 extractor. After a request/patch form W. Stein (SAGE).
1451 1475
1452 1476 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1453 1477 window size to a more reasonable value from what pexpect does,
1454 1478 since their choice causes wrapping bugs with long input lines.
1455 1479
1456 1480 2006-10-28 Ville Vainio <vivainio@gmail.com>
1457 1481
1458 1482 * Magic.py (%run): Save and restore the readline history from
1459 1483 file around %run commands to prevent side effects from
1460 1484 %runned programs that might use readline (e.g. pydb).
1461 1485
1462 1486 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1463 1487 invoking the pydb enhanced debugger.
1464 1488
1465 1489 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1466 1490
1467 1491 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1468 1492 call the base class method and propagate the return value to
1469 1493 ifile. This is now done by path itself.
1470 1494
1471 1495 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1472 1496
1473 1497 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1474 1498 api: set_crash_handler(), to expose the ability to change the
1475 1499 internal crash handler.
1476 1500
1477 1501 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1478 1502 the various parameters of the crash handler so that apps using
1479 1503 IPython as their engine can customize crash handling. Ipmlemented
1480 1504 at the request of SAGE.
1481 1505
1482 1506 2006-10-14 Ville Vainio <vivainio@gmail.com>
1483 1507
1484 1508 * Magic.py, ipython.el: applied first "safe" part of Rocky
1485 1509 Bernstein's patch set for pydb integration.
1486 1510
1487 1511 * Magic.py (%unalias, %alias): %store'd aliases can now be
1488 1512 removed with '%unalias'. %alias w/o args now shows most
1489 1513 interesting (stored / manually defined) aliases last
1490 1514 where they catch the eye w/o scrolling.
1491 1515
1492 1516 * Magic.py (%rehashx), ext_rehashdir.py: files with
1493 1517 'py' extension are always considered executable, even
1494 1518 when not in PATHEXT environment variable.
1495 1519
1496 1520 2006-10-12 Ville Vainio <vivainio@gmail.com>
1497 1521
1498 1522 * jobctrl.py: Add new "jobctrl" extension for spawning background
1499 1523 processes with "&find /". 'import jobctrl' to try it out. Requires
1500 1524 'subprocess' module, standard in python 2.4+.
1501 1525
1502 1526 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1503 1527 so if foo -> bar and bar -> baz, then foo -> baz.
1504 1528
1505 1529 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1506 1530
1507 1531 * IPython/Magic.py (Magic.parse_options): add a new posix option
1508 1532 to allow parsing of input args in magics that doesn't strip quotes
1509 1533 (if posix=False). This also closes %timeit bug reported by
1510 1534 Stefan.
1511 1535
1512 1536 2006-10-03 Ville Vainio <vivainio@gmail.com>
1513 1537
1514 1538 * iplib.py (raw_input, interact): Return ValueError catching for
1515 1539 raw_input. Fixes infinite loop for sys.stdin.close() or
1516 1540 sys.stdout.close().
1517 1541
1518 1542 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1519 1543
1520 1544 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1521 1545 to help in handling doctests. irunner is now pretty useful for
1522 1546 running standalone scripts and simulate a full interactive session
1523 1547 in a format that can be then pasted as a doctest.
1524 1548
1525 1549 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1526 1550 on top of the default (useless) ones. This also fixes the nasty
1527 1551 way in which 2.5's Quitter() exits (reverted [1785]).
1528 1552
1529 1553 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1530 1554 2.5.
1531 1555
1532 1556 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1533 1557 color scheme is updated as well when color scheme is changed
1534 1558 interactively.
1535 1559
1536 1560 2006-09-27 Ville Vainio <vivainio@gmail.com>
1537 1561
1538 1562 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1539 1563 infinite loop and just exit. It's a hack, but will do for a while.
1540 1564
1541 1565 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1542 1566
1543 1567 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1544 1568 the constructor, this makes it possible to get a list of only directories
1545 1569 or only files.
1546 1570
1547 1571 2006-08-12 Ville Vainio <vivainio@gmail.com>
1548 1572
1549 1573 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1550 1574 they broke unittest
1551 1575
1552 1576 2006-08-11 Ville Vainio <vivainio@gmail.com>
1553 1577
1554 1578 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1555 1579 by resolving issue properly, i.e. by inheriting FakeModule
1556 1580 from types.ModuleType. Pickling ipython interactive data
1557 1581 should still work as usual (testing appreciated).
1558 1582
1559 1583 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1560 1584
1561 1585 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1562 1586 running under python 2.3 with code from 2.4 to fix a bug with
1563 1587 help(). Reported by the Debian maintainers, Norbert Tretkowski
1564 1588 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1565 1589 <afayolle-AT-debian.org>.
1566 1590
1567 1591 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1568 1592
1569 1593 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1570 1594 (which was displaying "quit" twice).
1571 1595
1572 1596 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1573 1597
1574 1598 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1575 1599 the mode argument).
1576 1600
1577 1601 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1578 1602
1579 1603 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1580 1604 not running under IPython.
1581 1605
1582 1606 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1583 1607 and make it iterable (iterating over the attribute itself). Add two new
1584 1608 magic strings for __xattrs__(): If the string starts with "-", the attribute
1585 1609 will not be displayed in ibrowse's detail view (but it can still be
1586 1610 iterated over). This makes it possible to add attributes that are large
1587 1611 lists or generator methods to the detail view. Replace magic attribute names
1588 1612 and _attrname() and _getattr() with "descriptors": For each type of magic
1589 1613 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1590 1614 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1591 1615 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1592 1616 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1593 1617 are still supported.
1594 1618
1595 1619 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1596 1620 fails in ibrowse.fetch(), the exception object is added as the last item
1597 1621 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1598 1622 a generator throws an exception midway through execution.
1599 1623
1600 1624 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1601 1625 encoding into methods.
1602 1626
1603 1627 2006-07-26 Ville Vainio <vivainio@gmail.com>
1604 1628
1605 1629 * iplib.py: history now stores multiline input as single
1606 1630 history entries. Patch by Jorgen Cederlof.
1607 1631
1608 1632 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1609 1633
1610 1634 * IPython/Extensions/ibrowse.py: Make cursor visible over
1611 1635 non existing attributes.
1612 1636
1613 1637 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1614 1638
1615 1639 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1616 1640 error output of the running command doesn't mess up the screen.
1617 1641
1618 1642 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1619 1643
1620 1644 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1621 1645 argument. This sorts the items themselves.
1622 1646
1623 1647 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1624 1648
1625 1649 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1626 1650 Compile expression strings into code objects. This should speed
1627 1651 up ifilter and friends somewhat.
1628 1652
1629 1653 2006-07-08 Ville Vainio <vivainio@gmail.com>
1630 1654
1631 1655 * Magic.py: %cpaste now strips > from the beginning of lines
1632 1656 to ease pasting quoted code from emails. Contributed by
1633 1657 Stefan van der Walt.
1634 1658
1635 1659 2006-06-29 Ville Vainio <vivainio@gmail.com>
1636 1660
1637 1661 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1638 1662 mode, patch contributed by Darren Dale. NEEDS TESTING!
1639 1663
1640 1664 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1641 1665
1642 1666 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1643 1667 a blue background. Fix fetching new display rows when the browser
1644 1668 scrolls more than a screenful (e.g. by using the goto command).
1645 1669
1646 1670 2006-06-27 Ville Vainio <vivainio@gmail.com>
1647 1671
1648 1672 * Magic.py (_inspect, _ofind) Apply David Huard's
1649 1673 patch for displaying the correct docstring for 'property'
1650 1674 attributes.
1651 1675
1652 1676 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1653 1677
1654 1678 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1655 1679 commands into the methods implementing them.
1656 1680
1657 1681 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1658 1682
1659 1683 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1660 1684 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1661 1685 autoindent support was authored by Jin Liu.
1662 1686
1663 1687 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1664 1688
1665 1689 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1666 1690 for keymaps with a custom class that simplifies handling.
1667 1691
1668 1692 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1669 1693
1670 1694 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1671 1695 resizing. This requires Python 2.5 to work.
1672 1696
1673 1697 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1674 1698
1675 1699 * IPython/Extensions/ibrowse.py: Add two new commands to
1676 1700 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1677 1701 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1678 1702 attributes again. Remapped the help command to "?". Display
1679 1703 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1680 1704 as keys for the "home" and "end" commands. Add three new commands
1681 1705 to the input mode for "find" and friends: "delend" (CTRL-K)
1682 1706 deletes to the end of line. "incsearchup" searches upwards in the
1683 1707 command history for an input that starts with the text before the cursor.
1684 1708 "incsearchdown" does the same downwards. Removed a bogus mapping of
1685 1709 the x key to "delete".
1686 1710
1687 1711 2006-06-15 Ville Vainio <vivainio@gmail.com>
1688 1712
1689 1713 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1690 1714 used to create prompts dynamically, instead of the "old" way of
1691 1715 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1692 1716 way still works (it's invoked by the default hook), of course.
1693 1717
1694 1718 * Prompts.py: added generate_output_prompt hook for altering output
1695 1719 prompt
1696 1720
1697 1721 * Release.py: Changed version string to 0.7.3.svn.
1698 1722
1699 1723 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1700 1724
1701 1725 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1702 1726 the call to fetch() always tries to fetch enough data for at least one
1703 1727 full screen. This makes it possible to simply call moveto(0,0,True) in
1704 1728 the constructor. Fix typos and removed the obsolete goto attribute.
1705 1729
1706 1730 2006-06-12 Ville Vainio <vivainio@gmail.com>
1707 1731
1708 1732 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1709 1733 allowing $variable interpolation within multiline statements,
1710 1734 though so far only with "sh" profile for a testing period.
1711 1735 The patch also enables splitting long commands with \ but it
1712 1736 doesn't work properly yet.
1713 1737
1714 1738 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1715 1739
1716 1740 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1717 1741 input history and the position of the cursor in the input history for
1718 1742 the find, findbackwards and goto command.
1719 1743
1720 1744 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1721 1745
1722 1746 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1723 1747 implements the basic functionality of browser commands that require
1724 1748 input. Reimplement the goto, find and findbackwards commands as
1725 1749 subclasses of _CommandInput. Add an input history and keymaps to those
1726 1750 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1727 1751 execute commands.
1728 1752
1729 1753 2006-06-07 Ville Vainio <vivainio@gmail.com>
1730 1754
1731 1755 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1732 1756 running the batch files instead of leaving the session open.
1733 1757
1734 1758 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1735 1759
1736 1760 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1737 1761 the original fix was incomplete. Patch submitted by W. Maier.
1738 1762
1739 1763 2006-06-07 Ville Vainio <vivainio@gmail.com>
1740 1764
1741 1765 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1742 1766 Confirmation prompts can be supressed by 'quiet' option.
1743 1767 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1744 1768
1745 1769 2006-06-06 *** Released version 0.7.2
1746 1770
1747 1771 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1748 1772
1749 1773 * IPython/Release.py (version): Made 0.7.2 final for release.
1750 1774 Repo tagged and release cut.
1751 1775
1752 1776 2006-06-05 Ville Vainio <vivainio@gmail.com>
1753 1777
1754 1778 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1755 1779 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1756 1780
1757 1781 * upgrade_dir.py: try import 'path' module a bit harder
1758 1782 (for %upgrade)
1759 1783
1760 1784 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1761 1785
1762 1786 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1763 1787 instead of looping 20 times.
1764 1788
1765 1789 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1766 1790 correctly at initialization time. Bug reported by Krishna Mohan
1767 1791 Gundu <gkmohan-AT-gmail.com> on the user list.
1768 1792
1769 1793 * IPython/Release.py (version): Mark 0.7.2 version to start
1770 1794 testing for release on 06/06.
1771 1795
1772 1796 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1773 1797
1774 1798 * scripts/irunner: thin script interface so users don't have to
1775 1799 find the module and call it as an executable, since modules rarely
1776 1800 live in people's PATH.
1777 1801
1778 1802 * IPython/irunner.py (InteractiveRunner.__init__): added
1779 1803 delaybeforesend attribute to control delays with newer versions of
1780 1804 pexpect. Thanks to detailed help from pexpect's author, Noah
1781 1805 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1782 1806 correctly (it works in NoColor mode).
1783 1807
1784 1808 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1785 1809 SAGE list, from improper log() calls.
1786 1810
1787 1811 2006-05-31 Ville Vainio <vivainio@gmail.com>
1788 1812
1789 1813 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1790 1814 with args in parens to work correctly with dirs that have spaces.
1791 1815
1792 1816 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1793 1817
1794 1818 * IPython/Logger.py (Logger.logstart): add option to log raw input
1795 1819 instead of the processed one. A -r flag was added to the
1796 1820 %logstart magic used for controlling logging.
1797 1821
1798 1822 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1799 1823
1800 1824 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1801 1825 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1802 1826 recognize the option. After a bug report by Will Maier. This
1803 1827 closes #64 (will do it after confirmation from W. Maier).
1804 1828
1805 1829 * IPython/irunner.py: New module to run scripts as if manually
1806 1830 typed into an interactive environment, based on pexpect. After a
1807 1831 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1808 1832 ipython-user list. Simple unittests in the tests/ directory.
1809 1833
1810 1834 * tools/release: add Will Maier, OpenBSD port maintainer, to
1811 1835 recepients list. We are now officially part of the OpenBSD ports:
1812 1836 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1813 1837 work.
1814 1838
1815 1839 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1816 1840
1817 1841 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1818 1842 so that it doesn't break tkinter apps.
1819 1843
1820 1844 * IPython/iplib.py (_prefilter): fix bug where aliases would
1821 1845 shadow variables when autocall was fully off. Reported by SAGE
1822 1846 author William Stein.
1823 1847
1824 1848 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1825 1849 at what detail level strings are computed when foo? is requested.
1826 1850 This allows users to ask for example that the string form of an
1827 1851 object is only computed when foo?? is called, or even never, by
1828 1852 setting the object_info_string_level >= 2 in the configuration
1829 1853 file. This new option has been added and documented. After a
1830 1854 request by SAGE to be able to control the printing of very large
1831 1855 objects more easily.
1832 1856
1833 1857 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1834 1858
1835 1859 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1836 1860 from sys.argv, to be 100% consistent with how Python itself works
1837 1861 (as seen for example with python -i file.py). After a bug report
1838 1862 by Jeffrey Collins.
1839 1863
1840 1864 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1841 1865 nasty bug which was preventing custom namespaces with -pylab,
1842 1866 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1843 1867 compatibility (long gone from mpl).
1844 1868
1845 1869 * IPython/ipapi.py (make_session): name change: create->make. We
1846 1870 use make in other places (ipmaker,...), it's shorter and easier to
1847 1871 type and say, etc. I'm trying to clean things before 0.7.2 so
1848 1872 that I can keep things stable wrt to ipapi in the chainsaw branch.
1849 1873
1850 1874 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1851 1875 python-mode recognizes our debugger mode. Add support for
1852 1876 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1853 1877 <m.liu.jin-AT-gmail.com> originally written by
1854 1878 doxgen-AT-newsmth.net (with minor modifications for xemacs
1855 1879 compatibility)
1856 1880
1857 1881 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1858 1882 tracebacks when walking the stack so that the stack tracking system
1859 1883 in emacs' python-mode can identify the frames correctly.
1860 1884
1861 1885 * IPython/ipmaker.py (make_IPython): make the internal (and
1862 1886 default config) autoedit_syntax value false by default. Too many
1863 1887 users have complained to me (both on and off-list) about problems
1864 1888 with this option being on by default, so I'm making it default to
1865 1889 off. It can still be enabled by anyone via the usual mechanisms.
1866 1890
1867 1891 * IPython/completer.py (Completer.attr_matches): add support for
1868 1892 PyCrust-style _getAttributeNames magic method. Patch contributed
1869 1893 by <mscott-AT-goldenspud.com>. Closes #50.
1870 1894
1871 1895 * IPython/iplib.py (InteractiveShell.__init__): remove the
1872 1896 deletion of exit/quit from __builtin__, which can break
1873 1897 third-party tools like the Zope debugging console. The
1874 1898 %exit/%quit magics remain. In general, it's probably a good idea
1875 1899 not to delete anything from __builtin__, since we never know what
1876 1900 that will break. In any case, python now (for 2.5) will support
1877 1901 'real' exit/quit, so this issue is moot. Closes #55.
1878 1902
1879 1903 * IPython/genutils.py (with_obj): rename the 'with' function to
1880 1904 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1881 1905 becomes a language keyword. Closes #53.
1882 1906
1883 1907 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1884 1908 __file__ attribute to this so it fools more things into thinking
1885 1909 it is a real module. Closes #59.
1886 1910
1887 1911 * IPython/Magic.py (magic_edit): add -n option to open the editor
1888 1912 at a specific line number. After a patch by Stefan van der Walt.
1889 1913
1890 1914 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1891 1915
1892 1916 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1893 1917 reason the file could not be opened. After automatic crash
1894 1918 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1895 1919 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1896 1920 (_should_recompile): Don't fire editor if using %bg, since there
1897 1921 is no file in the first place. From the same report as above.
1898 1922 (raw_input): protect against faulty third-party prefilters. After
1899 1923 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1900 1924 while running under SAGE.
1901 1925
1902 1926 2006-05-23 Ville Vainio <vivainio@gmail.com>
1903 1927
1904 1928 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1905 1929 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1906 1930 now returns None (again), unless dummy is specifically allowed by
1907 1931 ipapi.get(allow_dummy=True).
1908 1932
1909 1933 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1910 1934
1911 1935 * IPython: remove all 2.2-compatibility objects and hacks from
1912 1936 everywhere, since we only support 2.3 at this point. Docs
1913 1937 updated.
1914 1938
1915 1939 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1916 1940 Anything requiring extra validation can be turned into a Python
1917 1941 property in the future. I used a property for the db one b/c
1918 1942 there was a nasty circularity problem with the initialization
1919 1943 order, which right now I don't have time to clean up.
1920 1944
1921 1945 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1922 1946 another locking bug reported by Jorgen. I'm not 100% sure though,
1923 1947 so more testing is needed...
1924 1948
1925 1949 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1926 1950
1927 1951 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1928 1952 local variables from any routine in user code (typically executed
1929 1953 with %run) directly into the interactive namespace. Very useful
1930 1954 when doing complex debugging.
1931 1955 (IPythonNotRunning): Changed the default None object to a dummy
1932 1956 whose attributes can be queried as well as called without
1933 1957 exploding, to ease writing code which works transparently both in
1934 1958 and out of ipython and uses some of this API.
1935 1959
1936 1960 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1937 1961
1938 1962 * IPython/hooks.py (result_display): Fix the fact that our display
1939 1963 hook was using str() instead of repr(), as the default python
1940 1964 console does. This had gone unnoticed b/c it only happened if
1941 1965 %Pprint was off, but the inconsistency was there.
1942 1966
1943 1967 2006-05-15 Ville Vainio <vivainio@gmail.com>
1944 1968
1945 1969 * Oinspect.py: Only show docstring for nonexisting/binary files
1946 1970 when doing object??, closing ticket #62
1947 1971
1948 1972 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1949 1973
1950 1974 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1951 1975 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1952 1976 was being released in a routine which hadn't checked if it had
1953 1977 been the one to acquire it.
1954 1978
1955 1979 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1956 1980
1957 1981 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1958 1982
1959 1983 2006-04-11 Ville Vainio <vivainio@gmail.com>
1960 1984
1961 1985 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1962 1986 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1963 1987 prefilters, allowing stuff like magics and aliases in the file.
1964 1988
1965 1989 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1966 1990 added. Supported now are "%clear in" and "%clear out" (clear input and
1967 1991 output history, respectively). Also fixed CachedOutput.flush to
1968 1992 properly flush the output cache.
1969 1993
1970 1994 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1971 1995 half-success (and fail explicitly).
1972 1996
1973 1997 2006-03-28 Ville Vainio <vivainio@gmail.com>
1974 1998
1975 1999 * iplib.py: Fix quoting of aliases so that only argless ones
1976 2000 are quoted
1977 2001
1978 2002 2006-03-28 Ville Vainio <vivainio@gmail.com>
1979 2003
1980 2004 * iplib.py: Quote aliases with spaces in the name.
1981 2005 "c:\program files\blah\bin" is now legal alias target.
1982 2006
1983 2007 * ext_rehashdir.py: Space no longer allowed as arg
1984 2008 separator, since space is legal in path names.
1985 2009
1986 2010 2006-03-16 Ville Vainio <vivainio@gmail.com>
1987 2011
1988 2012 * upgrade_dir.py: Take path.py from Extensions, correcting
1989 2013 %upgrade magic
1990 2014
1991 2015 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1992 2016
1993 2017 * hooks.py: Only enclose editor binary in quotes if legal and
1994 2018 necessary (space in the name, and is an existing file). Fixes a bug
1995 2019 reported by Zachary Pincus.
1996 2020
1997 2021 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1998 2022
1999 2023 * Manual: thanks to a tip on proper color handling for Emacs, by
2000 2024 Eric J Haywiser <ejh1-AT-MIT.EDU>.
2001 2025
2002 2026 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
2003 2027 by applying the provided patch. Thanks to Liu Jin
2004 2028 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
2005 2029 XEmacs/Linux, I'm trusting the submitter that it actually helps
2006 2030 under win32/GNU Emacs. Will revisit if any problems are reported.
2007 2031
2008 2032 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
2009 2033
2010 2034 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
2011 2035 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
2012 2036
2013 2037 2006-03-12 Ville Vainio <vivainio@gmail.com>
2014 2038
2015 2039 * Magic.py (magic_timeit): Added %timeit magic, contributed by
2016 2040 Torsten Marek.
2017 2041
2018 2042 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
2019 2043
2020 2044 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
2021 2045 line ranges works again.
2022 2046
2023 2047 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
2024 2048
2025 2049 * IPython/iplib.py (showtraceback): add back sys.last_traceback
2026 2050 and friends, after a discussion with Zach Pincus on ipython-user.
2027 2051 I'm not 100% sure, but after thinking about it quite a bit, it may
2028 2052 be OK. Testing with the multithreaded shells didn't reveal any
2029 2053 problems, but let's keep an eye out.
2030 2054
2031 2055 In the process, I fixed a few things which were calling
2032 2056 self.InteractiveTB() directly (like safe_execfile), which is a
2033 2057 mistake: ALL exception reporting should be done by calling
2034 2058 self.showtraceback(), which handles state and tab-completion and
2035 2059 more.
2036 2060
2037 2061 2006-03-01 Ville Vainio <vivainio@gmail.com>
2038 2062
2039 2063 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
2040 2064 To use, do "from ipipe import *".
2041 2065
2042 2066 2006-02-24 Ville Vainio <vivainio@gmail.com>
2043 2067
2044 2068 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
2045 2069 "cleanly" and safely than the older upgrade mechanism.
2046 2070
2047 2071 2006-02-21 Ville Vainio <vivainio@gmail.com>
2048 2072
2049 2073 * Magic.py: %save works again.
2050 2074
2051 2075 2006-02-15 Ville Vainio <vivainio@gmail.com>
2052 2076
2053 2077 * Magic.py: %Pprint works again
2054 2078
2055 2079 * Extensions/ipy_sane_defaults.py: Provide everything provided
2056 2080 in default ipythonrc, to make it possible to have a completely empty
2057 2081 ipythonrc (and thus completely rc-file free configuration)
2058 2082
2059 2083 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
2060 2084
2061 2085 * IPython/hooks.py (editor): quote the call to the editor command,
2062 2086 to allow commands with spaces in them. Problem noted by watching
2063 2087 Ian Oswald's video about textpad under win32 at
2064 2088 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
2065 2089
2066 2090 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
2067 2091 describing magics (we haven't used @ for a loong time).
2068 2092
2069 2093 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
2070 2094 contributed by marienz to close
2071 2095 http://www.scipy.net/roundup/ipython/issue53.
2072 2096
2073 2097 2006-02-10 Ville Vainio <vivainio@gmail.com>
2074 2098
2075 2099 * genutils.py: getoutput now works in win32 too
2076 2100
2077 2101 * completer.py: alias and magic completion only invoked
2078 2102 at the first "item" in the line, to avoid "cd %store"
2079 2103 nonsense.
2080 2104
2081 2105 2006-02-09 Ville Vainio <vivainio@gmail.com>
2082 2106
2083 2107 * test/*: Added a unit testing framework (finally).
2084 2108 '%run runtests.py' to run test_*.
2085 2109
2086 2110 * ipapi.py: Exposed runlines and set_custom_exc
2087 2111
2088 2112 2006-02-07 Ville Vainio <vivainio@gmail.com>
2089 2113
2090 2114 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
2091 2115 instead use "f(1 2)" as before.
2092 2116
2093 2117 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
2094 2118
2095 2119 * IPython/demo.py (IPythonDemo): Add new classes to the demo
2096 2120 facilities, for demos processed by the IPython input filter
2097 2121 (IPythonDemo), and for running a script one-line-at-a-time as a
2098 2122 demo, both for pure Python (LineDemo) and for IPython-processed
2099 2123 input (IPythonLineDemo). After a request by Dave Kohel, from the
2100 2124 SAGE team.
2101 2125 (Demo.edit): added an edit() method to the demo objects, to edit
2102 2126 the in-memory copy of the last executed block.
2103 2127
2104 2128 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
2105 2129 processing to %edit, %macro and %save. These commands can now be
2106 2130 invoked on the unprocessed input as it was typed by the user
2107 2131 (without any prefilters applied). After requests by the SAGE team
2108 2132 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
2109 2133
2110 2134 2006-02-01 Ville Vainio <vivainio@gmail.com>
2111 2135
2112 2136 * setup.py, eggsetup.py: easy_install ipython==dev works
2113 2137 correctly now (on Linux)
2114 2138
2115 2139 * ipy_user_conf,ipmaker: user config changes, removed spurious
2116 2140 warnings
2117 2141
2118 2142 * iplib: if rc.banner is string, use it as is.
2119 2143
2120 2144 * Magic: %pycat accepts a string argument and pages it's contents.
2121 2145
2122 2146
2123 2147 2006-01-30 Ville Vainio <vivainio@gmail.com>
2124 2148
2125 2149 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
2126 2150 Now %store and bookmarks work through PickleShare, meaning that
2127 2151 concurrent access is possible and all ipython sessions see the
2128 2152 same database situation all the time, instead of snapshot of
2129 2153 the situation when the session was started. Hence, %bookmark
2130 2154 results are immediately accessible from othes sessions. The database
2131 2155 is also available for use by user extensions. See:
2132 2156 http://www.python.org/pypi/pickleshare
2133 2157
2134 2158 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
2135 2159
2136 2160 * aliases can now be %store'd
2137 2161
2138 2162 * path.py moved to Extensions so that pickleshare does not need
2139 2163 IPython-specific import. Extensions added to pythonpath right
2140 2164 at __init__.
2141 2165
2142 2166 * iplib.py: ipalias deprecated/redundant; aliases are converted and
2143 2167 called with _ip.system and the pre-transformed command string.
2144 2168
2145 2169 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
2146 2170
2147 2171 * IPython/iplib.py (interact): Fix that we were not catching
2148 2172 KeyboardInterrupt exceptions properly. I'm not quite sure why the
2149 2173 logic here had to change, but it's fixed now.
2150 2174
2151 2175 2006-01-29 Ville Vainio <vivainio@gmail.com>
2152 2176
2153 2177 * iplib.py: Try to import pyreadline on Windows.
2154 2178
2155 2179 2006-01-27 Ville Vainio <vivainio@gmail.com>
2156 2180
2157 2181 * iplib.py: Expose ipapi as _ip in builtin namespace.
2158 2182 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
2159 2183 and ip_set_hook (-> _ip.set_hook) redundant. % and !
2160 2184 syntax now produce _ip.* variant of the commands.
2161 2185
2162 2186 * "_ip.options().autoedit_syntax = 2" automatically throws
2163 2187 user to editor for syntax error correction without prompting.
2164 2188
2165 2189 2006-01-27 Ville Vainio <vivainio@gmail.com>
2166 2190
2167 2191 * ipmaker.py: Give "realistic" sys.argv for scripts (without
2168 2192 'ipython' at argv[0]) executed through command line.
2169 2193 NOTE: this DEPRECATES calling ipython with multiple scripts
2170 2194 ("ipython a.py b.py c.py")
2171 2195
2172 2196 * iplib.py, hooks.py: Added configurable input prefilter,
2173 2197 named 'input_prefilter'. See ext_rescapture.py for example
2174 2198 usage.
2175 2199
2176 2200 * ext_rescapture.py, Magic.py: Better system command output capture
2177 2201 through 'var = !ls' (deprecates user-visible %sc). Same notation
2178 2202 applies for magics, 'var = %alias' assigns alias list to var.
2179 2203
2180 2204 * ipapi.py: added meta() for accessing extension-usable data store.
2181 2205
2182 2206 * iplib.py: added InteractiveShell.getapi(). New magics should be
2183 2207 written doing self.getapi() instead of using the shell directly.
2184 2208
2185 2209 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
2186 2210 %store foo >> ~/myfoo.txt to store variables to files (in clean
2187 2211 textual form, not a restorable pickle).
2188 2212
2189 2213 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
2190 2214
2191 2215 * usage.py, Magic.py: added %quickref
2192 2216
2193 2217 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
2194 2218
2195 2219 * GetoptErrors when invoking magics etc. with wrong args
2196 2220 are now more helpful:
2197 2221 GetoptError: option -l not recognized (allowed: "qb" )
2198 2222
2199 2223 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
2200 2224
2201 2225 * IPython/demo.py (Demo.show): Flush stdout after each block, so
2202 2226 computationally intensive blocks don't appear to stall the demo.
2203 2227
2204 2228 2006-01-24 Ville Vainio <vivainio@gmail.com>
2205 2229
2206 2230 * iplib.py, hooks.py: 'result_display' hook can return a non-None
2207 2231 value to manipulate resulting history entry.
2208 2232
2209 2233 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2210 2234 to instance methods of IPApi class, to make extending an embedded
2211 2235 IPython feasible. See ext_rehashdir.py for example usage.
2212 2236
2213 2237 * Merged 1071-1076 from branches/0.7.1
2214 2238
2215 2239
2216 2240 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2217 2241
2218 2242 * tools/release (daystamp): Fix build tools to use the new
2219 2243 eggsetup.py script to build lightweight eggs.
2220 2244
2221 2245 * Applied changesets 1062 and 1064 before 0.7.1 release.
2222 2246
2223 2247 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2224 2248 see the raw input history (without conversions like %ls ->
2225 2249 ipmagic("ls")). After a request from W. Stein, SAGE
2226 2250 (http://modular.ucsd.edu/sage) developer. This information is
2227 2251 stored in the input_hist_raw attribute of the IPython instance, so
2228 2252 developers can access it if needed (it's an InputList instance).
2229 2253
2230 2254 * Versionstring = 0.7.2.svn
2231 2255
2232 2256 * eggsetup.py: A separate script for constructing eggs, creates
2233 2257 proper launch scripts even on Windows (an .exe file in
2234 2258 \python24\scripts).
2235 2259
2236 2260 * ipapi.py: launch_new_instance, launch entry point needed for the
2237 2261 egg.
2238 2262
2239 2263 2006-01-23 Ville Vainio <vivainio@gmail.com>
2240 2264
2241 2265 * Added %cpaste magic for pasting python code
2242 2266
2243 2267 2006-01-22 Ville Vainio <vivainio@gmail.com>
2244 2268
2245 2269 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2246 2270
2247 2271 * Versionstring = 0.7.2.svn
2248 2272
2249 2273 * eggsetup.py: A separate script for constructing eggs, creates
2250 2274 proper launch scripts even on Windows (an .exe file in
2251 2275 \python24\scripts).
2252 2276
2253 2277 * ipapi.py: launch_new_instance, launch entry point needed for the
2254 2278 egg.
2255 2279
2256 2280 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2257 2281
2258 2282 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2259 2283 %pfile foo would print the file for foo even if it was a binary.
2260 2284 Now, extensions '.so' and '.dll' are skipped.
2261 2285
2262 2286 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2263 2287 bug, where macros would fail in all threaded modes. I'm not 100%
2264 2288 sure, so I'm going to put out an rc instead of making a release
2265 2289 today, and wait for feedback for at least a few days.
2266 2290
2267 2291 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2268 2292 it...) the handling of pasting external code with autoindent on.
2269 2293 To get out of a multiline input, the rule will appear for most
2270 2294 users unchanged: two blank lines or change the indent level
2271 2295 proposed by IPython. But there is a twist now: you can
2272 2296 add/subtract only *one or two spaces*. If you add/subtract three
2273 2297 or more (unless you completely delete the line), IPython will
2274 2298 accept that line, and you'll need to enter a second one of pure
2275 2299 whitespace. I know it sounds complicated, but I can't find a
2276 2300 different solution that covers all the cases, with the right
2277 2301 heuristics. Hopefully in actual use, nobody will really notice
2278 2302 all these strange rules and things will 'just work'.
2279 2303
2280 2304 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2281 2305
2282 2306 * IPython/iplib.py (interact): catch exceptions which can be
2283 2307 triggered asynchronously by signal handlers. Thanks to an
2284 2308 automatic crash report, submitted by Colin Kingsley
2285 2309 <tercel-AT-gentoo.org>.
2286 2310
2287 2311 2006-01-20 Ville Vainio <vivainio@gmail.com>
2288 2312
2289 2313 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2290 2314 (%rehashdir, very useful, try it out) of how to extend ipython
2291 2315 with new magics. Also added Extensions dir to pythonpath to make
2292 2316 importing extensions easy.
2293 2317
2294 2318 * %store now complains when trying to store interactively declared
2295 2319 classes / instances of those classes.
2296 2320
2297 2321 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2298 2322 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2299 2323 if they exist, and ipy_user_conf.py with some defaults is created for
2300 2324 the user.
2301 2325
2302 2326 * Startup rehashing done by the config file, not InterpreterExec.
2303 2327 This means system commands are available even without selecting the
2304 2328 pysh profile. It's the sensible default after all.
2305 2329
2306 2330 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2307 2331
2308 2332 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2309 2333 multiline code with autoindent on working. But I am really not
2310 2334 sure, so this needs more testing. Will commit a debug-enabled
2311 2335 version for now, while I test it some more, so that Ville and
2312 2336 others may also catch any problems. Also made
2313 2337 self.indent_current_str() a method, to ensure that there's no
2314 2338 chance of the indent space count and the corresponding string
2315 2339 falling out of sync. All code needing the string should just call
2316 2340 the method.
2317 2341
2318 2342 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2319 2343
2320 2344 * IPython/Magic.py (magic_edit): fix check for when users don't
2321 2345 save their output files, the try/except was in the wrong section.
2322 2346
2323 2347 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2324 2348
2325 2349 * IPython/Magic.py (magic_run): fix __file__ global missing from
2326 2350 script's namespace when executed via %run. After a report by
2327 2351 Vivian.
2328 2352
2329 2353 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2330 2354 when using python 2.4. The parent constructor changed in 2.4, and
2331 2355 we need to track it directly (we can't call it, as it messes up
2332 2356 readline and tab-completion inside our pdb would stop working).
2333 2357 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2334 2358
2335 2359 2006-01-16 Ville Vainio <vivainio@gmail.com>
2336 2360
2337 2361 * Ipython/magic.py: Reverted back to old %edit functionality
2338 2362 that returns file contents on exit.
2339 2363
2340 2364 * IPython/path.py: Added Jason Orendorff's "path" module to
2341 2365 IPython tree, http://www.jorendorff.com/articles/python/path/.
2342 2366 You can get path objects conveniently through %sc, and !!, e.g.:
2343 2367 sc files=ls
2344 2368 for p in files.paths: # or files.p
2345 2369 print p,p.mtime
2346 2370
2347 2371 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2348 2372 now work again without considering the exclusion regexp -
2349 2373 hence, things like ',foo my/path' turn to 'foo("my/path")'
2350 2374 instead of syntax error.
2351 2375
2352 2376
2353 2377 2006-01-14 Ville Vainio <vivainio@gmail.com>
2354 2378
2355 2379 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2356 2380 ipapi decorators for python 2.4 users, options() provides access to rc
2357 2381 data.
2358 2382
2359 2383 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2360 2384 as path separators (even on Linux ;-). Space character after
2361 2385 backslash (as yielded by tab completer) is still space;
2362 2386 "%cd long\ name" works as expected.
2363 2387
2364 2388 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2365 2389 as "chain of command", with priority. API stays the same,
2366 2390 TryNext exception raised by a hook function signals that
2367 2391 current hook failed and next hook should try handling it, as
2368 2392 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2369 2393 requested configurable display hook, which is now implemented.
2370 2394
2371 2395 2006-01-13 Ville Vainio <vivainio@gmail.com>
2372 2396
2373 2397 * IPython/platutils*.py: platform specific utility functions,
2374 2398 so far only set_term_title is implemented (change terminal
2375 2399 label in windowing systems). %cd now changes the title to
2376 2400 current dir.
2377 2401
2378 2402 * IPython/Release.py: Added myself to "authors" list,
2379 2403 had to create new files.
2380 2404
2381 2405 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2382 2406 shell escape; not a known bug but had potential to be one in the
2383 2407 future.
2384 2408
2385 2409 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2386 2410 extension API for IPython! See the module for usage example. Fix
2387 2411 OInspect for docstring-less magic functions.
2388 2412
2389 2413
2390 2414 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2391 2415
2392 2416 * IPython/iplib.py (raw_input): temporarily deactivate all
2393 2417 attempts at allowing pasting of code with autoindent on. It
2394 2418 introduced bugs (reported by Prabhu) and I can't seem to find a
2395 2419 robust combination which works in all cases. Will have to revisit
2396 2420 later.
2397 2421
2398 2422 * IPython/genutils.py: remove isspace() function. We've dropped
2399 2423 2.2 compatibility, so it's OK to use the string method.
2400 2424
2401 2425 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2402 2426
2403 2427 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2404 2428 matching what NOT to autocall on, to include all python binary
2405 2429 operators (including things like 'and', 'or', 'is' and 'in').
2406 2430 Prompted by a bug report on 'foo & bar', but I realized we had
2407 2431 many more potential bug cases with other operators. The regexp is
2408 2432 self.re_exclude_auto, it's fairly commented.
2409 2433
2410 2434 2006-01-12 Ville Vainio <vivainio@gmail.com>
2411 2435
2412 2436 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2413 2437 Prettified and hardened string/backslash quoting with ipsystem(),
2414 2438 ipalias() and ipmagic(). Now even \ characters are passed to
2415 2439 %magics, !shell escapes and aliases exactly as they are in the
2416 2440 ipython command line. Should improve backslash experience,
2417 2441 particularly in Windows (path delimiter for some commands that
2418 2442 won't understand '/'), but Unix benefits as well (regexps). %cd
2419 2443 magic still doesn't support backslash path delimiters, though. Also
2420 2444 deleted all pretense of supporting multiline command strings in
2421 2445 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2422 2446
2423 2447 * doc/build_doc_instructions.txt added. Documentation on how to
2424 2448 use doc/update_manual.py, added yesterday. Both files contributed
2425 2449 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2426 2450 doc/*.sh for deprecation at a later date.
2427 2451
2428 2452 * /ipython.py Added ipython.py to root directory for
2429 2453 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2430 2454 ipython.py) and development convenience (no need to keep doing
2431 2455 "setup.py install" between changes).
2432 2456
2433 2457 * Made ! and !! shell escapes work (again) in multiline expressions:
2434 2458 if 1:
2435 2459 !ls
2436 2460 !!ls
2437 2461
2438 2462 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2439 2463
2440 2464 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2441 2465 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2442 2466 module in case-insensitive installation. Was causing crashes
2443 2467 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2444 2468
2445 2469 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2446 2470 <marienz-AT-gentoo.org>, closes
2447 2471 http://www.scipy.net/roundup/ipython/issue51.
2448 2472
2449 2473 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2450 2474
2451 2475 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2452 2476 problem of excessive CPU usage under *nix and keyboard lag under
2453 2477 win32.
2454 2478
2455 2479 2006-01-10 *** Released version 0.7.0
2456 2480
2457 2481 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2458 2482
2459 2483 * IPython/Release.py (revision): tag version number to 0.7.0,
2460 2484 ready for release.
2461 2485
2462 2486 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2463 2487 it informs the user of the name of the temp. file used. This can
2464 2488 help if you decide later to reuse that same file, so you know
2465 2489 where to copy the info from.
2466 2490
2467 2491 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2468 2492
2469 2493 * setup_bdist_egg.py: little script to build an egg. Added
2470 2494 support in the release tools as well.
2471 2495
2472 2496 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2473 2497
2474 2498 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2475 2499 version selection (new -wxversion command line and ipythonrc
2476 2500 parameter). Patch contributed by Arnd Baecker
2477 2501 <arnd.baecker-AT-web.de>.
2478 2502
2479 2503 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2480 2504 embedded instances, for variables defined at the interactive
2481 2505 prompt of the embedded ipython. Reported by Arnd.
2482 2506
2483 2507 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2484 2508 it can be used as a (stateful) toggle, or with a direct parameter.
2485 2509
2486 2510 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2487 2511 could be triggered in certain cases and cause the traceback
2488 2512 printer not to work.
2489 2513
2490 2514 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2491 2515
2492 2516 * IPython/iplib.py (_should_recompile): Small fix, closes
2493 2517 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2494 2518
2495 2519 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2496 2520
2497 2521 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2498 2522 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2499 2523 Moad for help with tracking it down.
2500 2524
2501 2525 * IPython/iplib.py (handle_auto): fix autocall handling for
2502 2526 objects which support BOTH __getitem__ and __call__ (so that f [x]
2503 2527 is left alone, instead of becoming f([x]) automatically).
2504 2528
2505 2529 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2506 2530 Ville's patch.
2507 2531
2508 2532 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2509 2533
2510 2534 * IPython/iplib.py (handle_auto): changed autocall semantics to
2511 2535 include 'smart' mode, where the autocall transformation is NOT
2512 2536 applied if there are no arguments on the line. This allows you to
2513 2537 just type 'foo' if foo is a callable to see its internal form,
2514 2538 instead of having it called with no arguments (typically a
2515 2539 mistake). The old 'full' autocall still exists: for that, you
2516 2540 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2517 2541
2518 2542 * IPython/completer.py (Completer.attr_matches): add
2519 2543 tab-completion support for Enthoughts' traits. After a report by
2520 2544 Arnd and a patch by Prabhu.
2521 2545
2522 2546 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2523 2547
2524 2548 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2525 2549 Schmolck's patch to fix inspect.getinnerframes().
2526 2550
2527 2551 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2528 2552 for embedded instances, regarding handling of namespaces and items
2529 2553 added to the __builtin__ one. Multiple embedded instances and
2530 2554 recursive embeddings should work better now (though I'm not sure
2531 2555 I've got all the corner cases fixed, that code is a bit of a brain
2532 2556 twister).
2533 2557
2534 2558 * IPython/Magic.py (magic_edit): added support to edit in-memory
2535 2559 macros (automatically creates the necessary temp files). %edit
2536 2560 also doesn't return the file contents anymore, it's just noise.
2537 2561
2538 2562 * IPython/completer.py (Completer.attr_matches): revert change to
2539 2563 complete only on attributes listed in __all__. I realized it
2540 2564 cripples the tab-completion system as a tool for exploring the
2541 2565 internals of unknown libraries (it renders any non-__all__
2542 2566 attribute off-limits). I got bit by this when trying to see
2543 2567 something inside the dis module.
2544 2568
2545 2569 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2546 2570
2547 2571 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2548 2572 namespace for users and extension writers to hold data in. This
2549 2573 follows the discussion in
2550 2574 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2551 2575
2552 2576 * IPython/completer.py (IPCompleter.complete): small patch to help
2553 2577 tab-completion under Emacs, after a suggestion by John Barnard
2554 2578 <barnarj-AT-ccf.org>.
2555 2579
2556 2580 * IPython/Magic.py (Magic.extract_input_slices): added support for
2557 2581 the slice notation in magics to use N-M to represent numbers N...M
2558 2582 (closed endpoints). This is used by %macro and %save.
2559 2583
2560 2584 * IPython/completer.py (Completer.attr_matches): for modules which
2561 2585 define __all__, complete only on those. After a patch by Jeffrey
2562 2586 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2563 2587 speed up this routine.
2564 2588
2565 2589 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2566 2590 don't know if this is the end of it, but the behavior now is
2567 2591 certainly much more correct. Note that coupled with macros,
2568 2592 slightly surprising (at first) behavior may occur: a macro will in
2569 2593 general expand to multiple lines of input, so upon exiting, the
2570 2594 in/out counters will both be bumped by the corresponding amount
2571 2595 (as if the macro's contents had been typed interactively). Typing
2572 2596 %hist will reveal the intermediate (silently processed) lines.
2573 2597
2574 2598 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2575 2599 pickle to fail (%run was overwriting __main__ and not restoring
2576 2600 it, but pickle relies on __main__ to operate).
2577 2601
2578 2602 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2579 2603 using properties, but forgot to make the main InteractiveShell
2580 2604 class a new-style class. Properties fail silently, and
2581 2605 mysteriously, with old-style class (getters work, but
2582 2606 setters don't do anything).
2583 2607
2584 2608 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2585 2609
2586 2610 * IPython/Magic.py (magic_history): fix history reporting bug (I
2587 2611 know some nasties are still there, I just can't seem to find a
2588 2612 reproducible test case to track them down; the input history is
2589 2613 falling out of sync...)
2590 2614
2591 2615 * IPython/iplib.py (handle_shell_escape): fix bug where both
2592 2616 aliases and system accesses where broken for indented code (such
2593 2617 as loops).
2594 2618
2595 2619 * IPython/genutils.py (shell): fix small but critical bug for
2596 2620 win32 system access.
2597 2621
2598 2622 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2599 2623
2600 2624 * IPython/iplib.py (showtraceback): remove use of the
2601 2625 sys.last_{type/value/traceback} structures, which are non
2602 2626 thread-safe.
2603 2627 (_prefilter): change control flow to ensure that we NEVER
2604 2628 introspect objects when autocall is off. This will guarantee that
2605 2629 having an input line of the form 'x.y', where access to attribute
2606 2630 'y' has side effects, doesn't trigger the side effect TWICE. It
2607 2631 is important to note that, with autocall on, these side effects
2608 2632 can still happen.
2609 2633 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2610 2634 trio. IPython offers these three kinds of special calls which are
2611 2635 not python code, and it's a good thing to have their call method
2612 2636 be accessible as pure python functions (not just special syntax at
2613 2637 the command line). It gives us a better internal implementation
2614 2638 structure, as well as exposing these for user scripting more
2615 2639 cleanly.
2616 2640
2617 2641 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2618 2642 file. Now that they'll be more likely to be used with the
2619 2643 persistance system (%store), I want to make sure their module path
2620 2644 doesn't change in the future, so that we don't break things for
2621 2645 users' persisted data.
2622 2646
2623 2647 * IPython/iplib.py (autoindent_update): move indentation
2624 2648 management into the _text_ processing loop, not the keyboard
2625 2649 interactive one. This is necessary to correctly process non-typed
2626 2650 multiline input (such as macros).
2627 2651
2628 2652 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2629 2653 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2630 2654 which was producing problems in the resulting manual.
2631 2655 (magic_whos): improve reporting of instances (show their class,
2632 2656 instead of simply printing 'instance' which isn't terribly
2633 2657 informative).
2634 2658
2635 2659 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2636 2660 (minor mods) to support network shares under win32.
2637 2661
2638 2662 * IPython/winconsole.py (get_console_size): add new winconsole
2639 2663 module and fixes to page_dumb() to improve its behavior under
2640 2664 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2641 2665
2642 2666 * IPython/Magic.py (Macro): simplified Macro class to just
2643 2667 subclass list. We've had only 2.2 compatibility for a very long
2644 2668 time, yet I was still avoiding subclassing the builtin types. No
2645 2669 more (I'm also starting to use properties, though I won't shift to
2646 2670 2.3-specific features quite yet).
2647 2671 (magic_store): added Ville's patch for lightweight variable
2648 2672 persistence, after a request on the user list by Matt Wilkie
2649 2673 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2650 2674 details.
2651 2675
2652 2676 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2653 2677 changed the default logfile name from 'ipython.log' to
2654 2678 'ipython_log.py'. These logs are real python files, and now that
2655 2679 we have much better multiline support, people are more likely to
2656 2680 want to use them as such. Might as well name them correctly.
2657 2681
2658 2682 * IPython/Magic.py: substantial cleanup. While we can't stop
2659 2683 using magics as mixins, due to the existing customizations 'out
2660 2684 there' which rely on the mixin naming conventions, at least I
2661 2685 cleaned out all cross-class name usage. So once we are OK with
2662 2686 breaking compatibility, the two systems can be separated.
2663 2687
2664 2688 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2665 2689 anymore, and the class is a fair bit less hideous as well. New
2666 2690 features were also introduced: timestamping of input, and logging
2667 2691 of output results. These are user-visible with the -t and -o
2668 2692 options to %logstart. Closes
2669 2693 http://www.scipy.net/roundup/ipython/issue11 and a request by
2670 2694 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2671 2695
2672 2696 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2673 2697
2674 2698 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2675 2699 better handle backslashes in paths. See the thread 'More Windows
2676 2700 questions part 2 - \/ characters revisited' on the iypthon user
2677 2701 list:
2678 2702 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2679 2703
2680 2704 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2681 2705
2682 2706 (InteractiveShell.__init__): change threaded shells to not use the
2683 2707 ipython crash handler. This was causing more problems than not,
2684 2708 as exceptions in the main thread (GUI code, typically) would
2685 2709 always show up as a 'crash', when they really weren't.
2686 2710
2687 2711 The colors and exception mode commands (%colors/%xmode) have been
2688 2712 synchronized to also take this into account, so users can get
2689 2713 verbose exceptions for their threaded code as well. I also added
2690 2714 support for activating pdb inside this exception handler as well,
2691 2715 so now GUI authors can use IPython's enhanced pdb at runtime.
2692 2716
2693 2717 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2694 2718 true by default, and add it to the shipped ipythonrc file. Since
2695 2719 this asks the user before proceeding, I think it's OK to make it
2696 2720 true by default.
2697 2721
2698 2722 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2699 2723 of the previous special-casing of input in the eval loop. I think
2700 2724 this is cleaner, as they really are commands and shouldn't have
2701 2725 a special role in the middle of the core code.
2702 2726
2703 2727 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2704 2728
2705 2729 * IPython/iplib.py (edit_syntax_error): added support for
2706 2730 automatically reopening the editor if the file had a syntax error
2707 2731 in it. Thanks to scottt who provided the patch at:
2708 2732 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2709 2733 version committed).
2710 2734
2711 2735 * IPython/iplib.py (handle_normal): add suport for multi-line
2712 2736 input with emtpy lines. This fixes
2713 2737 http://www.scipy.net/roundup/ipython/issue43 and a similar
2714 2738 discussion on the user list.
2715 2739
2716 2740 WARNING: a behavior change is necessarily introduced to support
2717 2741 blank lines: now a single blank line with whitespace does NOT
2718 2742 break the input loop, which means that when autoindent is on, by
2719 2743 default hitting return on the next (indented) line does NOT exit.
2720 2744
2721 2745 Instead, to exit a multiline input you can either have:
2722 2746
2723 2747 - TWO whitespace lines (just hit return again), or
2724 2748 - a single whitespace line of a different length than provided
2725 2749 by the autoindent (add or remove a space).
2726 2750
2727 2751 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2728 2752 module to better organize all readline-related functionality.
2729 2753 I've deleted FlexCompleter and put all completion clases here.
2730 2754
2731 2755 * IPython/iplib.py (raw_input): improve indentation management.
2732 2756 It is now possible to paste indented code with autoindent on, and
2733 2757 the code is interpreted correctly (though it still looks bad on
2734 2758 screen, due to the line-oriented nature of ipython).
2735 2759 (MagicCompleter.complete): change behavior so that a TAB key on an
2736 2760 otherwise empty line actually inserts a tab, instead of completing
2737 2761 on the entire global namespace. This makes it easier to use the
2738 2762 TAB key for indentation. After a request by Hans Meine
2739 2763 <hans_meine-AT-gmx.net>
2740 2764 (_prefilter): add support so that typing plain 'exit' or 'quit'
2741 2765 does a sensible thing. Originally I tried to deviate as little as
2742 2766 possible from the default python behavior, but even that one may
2743 2767 change in this direction (thread on python-dev to that effect).
2744 2768 Regardless, ipython should do the right thing even if CPython's
2745 2769 '>>>' prompt doesn't.
2746 2770 (InteractiveShell): removed subclassing code.InteractiveConsole
2747 2771 class. By now we'd overridden just about all of its methods: I've
2748 2772 copied the remaining two over, and now ipython is a standalone
2749 2773 class. This will provide a clearer picture for the chainsaw
2750 2774 branch refactoring.
2751 2775
2752 2776 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2753 2777
2754 2778 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2755 2779 failures for objects which break when dir() is called on them.
2756 2780
2757 2781 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2758 2782 distinct local and global namespaces in the completer API. This
2759 2783 change allows us to properly handle completion with distinct
2760 2784 scopes, including in embedded instances (this had never really
2761 2785 worked correctly).
2762 2786
2763 2787 Note: this introduces a change in the constructor for
2764 2788 MagicCompleter, as a new global_namespace parameter is now the
2765 2789 second argument (the others were bumped one position).
2766 2790
2767 2791 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2768 2792
2769 2793 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2770 2794 embedded instances (which can be done now thanks to Vivian's
2771 2795 frame-handling fixes for pdb).
2772 2796 (InteractiveShell.__init__): Fix namespace handling problem in
2773 2797 embedded instances. We were overwriting __main__ unconditionally,
2774 2798 and this should only be done for 'full' (non-embedded) IPython;
2775 2799 embedded instances must respect the caller's __main__. Thanks to
2776 2800 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2777 2801
2778 2802 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2779 2803
2780 2804 * setup.py: added download_url to setup(). This registers the
2781 2805 download address at PyPI, which is not only useful to humans
2782 2806 browsing the site, but is also picked up by setuptools (the Eggs
2783 2807 machinery). Thanks to Ville and R. Kern for the info/discussion
2784 2808 on this.
2785 2809
2786 2810 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2787 2811
2788 2812 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2789 2813 This brings a lot of nice functionality to the pdb mode, which now
2790 2814 has tab-completion, syntax highlighting, and better stack handling
2791 2815 than before. Many thanks to Vivian De Smedt
2792 2816 <vivian-AT-vdesmedt.com> for the original patches.
2793 2817
2794 2818 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2795 2819
2796 2820 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2797 2821 sequence to consistently accept the banner argument. The
2798 2822 inconsistency was tripping SAGE, thanks to Gary Zablackis
2799 2823 <gzabl-AT-yahoo.com> for the report.
2800 2824
2801 2825 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2802 2826
2803 2827 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2804 2828 Fix bug where a naked 'alias' call in the ipythonrc file would
2805 2829 cause a crash. Bug reported by Jorgen Stenarson.
2806 2830
2807 2831 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2808 2832
2809 2833 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2810 2834 startup time.
2811 2835
2812 2836 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2813 2837 instances had introduced a bug with globals in normal code. Now
2814 2838 it's working in all cases.
2815 2839
2816 2840 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2817 2841 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2818 2842 has been introduced to set the default case sensitivity of the
2819 2843 searches. Users can still select either mode at runtime on a
2820 2844 per-search basis.
2821 2845
2822 2846 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2823 2847
2824 2848 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2825 2849 attributes in wildcard searches for subclasses. Modified version
2826 2850 of a patch by Jorgen.
2827 2851
2828 2852 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2829 2853
2830 2854 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2831 2855 embedded instances. I added a user_global_ns attribute to the
2832 2856 InteractiveShell class to handle this.
2833 2857
2834 2858 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2835 2859
2836 2860 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2837 2861 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2838 2862 (reported under win32, but may happen also in other platforms).
2839 2863 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2840 2864
2841 2865 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2842 2866
2843 2867 * IPython/Magic.py (magic_psearch): new support for wildcard
2844 2868 patterns. Now, typing ?a*b will list all names which begin with a
2845 2869 and end in b, for example. The %psearch magic has full
2846 2870 docstrings. Many thanks to JΓΆrgen Stenarson
2847 2871 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2848 2872 implementing this functionality.
2849 2873
2850 2874 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2851 2875
2852 2876 * Manual: fixed long-standing annoyance of double-dashes (as in
2853 2877 --prefix=~, for example) being stripped in the HTML version. This
2854 2878 is a latex2html bug, but a workaround was provided. Many thanks
2855 2879 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2856 2880 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2857 2881 rolling. This seemingly small issue had tripped a number of users
2858 2882 when first installing, so I'm glad to see it gone.
2859 2883
2860 2884 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2861 2885
2862 2886 * IPython/Extensions/numeric_formats.py: fix missing import,
2863 2887 reported by Stephen Walton.
2864 2888
2865 2889 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2866 2890
2867 2891 * IPython/demo.py: finish demo module, fully documented now.
2868 2892
2869 2893 * IPython/genutils.py (file_read): simple little utility to read a
2870 2894 file and ensure it's closed afterwards.
2871 2895
2872 2896 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2873 2897
2874 2898 * IPython/demo.py (Demo.__init__): added support for individually
2875 2899 tagging blocks for automatic execution.
2876 2900
2877 2901 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2878 2902 syntax-highlighted python sources, requested by John.
2879 2903
2880 2904 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2881 2905
2882 2906 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2883 2907 finishing.
2884 2908
2885 2909 * IPython/genutils.py (shlex_split): moved from Magic to here,
2886 2910 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2887 2911
2888 2912 * IPython/demo.py (Demo.__init__): added support for silent
2889 2913 blocks, improved marks as regexps, docstrings written.
2890 2914 (Demo.__init__): better docstring, added support for sys.argv.
2891 2915
2892 2916 * IPython/genutils.py (marquee): little utility used by the demo
2893 2917 code, handy in general.
2894 2918
2895 2919 * IPython/demo.py (Demo.__init__): new class for interactive
2896 2920 demos. Not documented yet, I just wrote it in a hurry for
2897 2921 scipy'05. Will docstring later.
2898 2922
2899 2923 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2900 2924
2901 2925 * IPython/Shell.py (sigint_handler): Drastic simplification which
2902 2926 also seems to make Ctrl-C work correctly across threads! This is
2903 2927 so simple, that I can't beleive I'd missed it before. Needs more
2904 2928 testing, though.
2905 2929 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2906 2930 like this before...
2907 2931
2908 2932 * IPython/genutils.py (get_home_dir): add protection against
2909 2933 non-dirs in win32 registry.
2910 2934
2911 2935 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2912 2936 bug where dict was mutated while iterating (pysh crash).
2913 2937
2914 2938 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2915 2939
2916 2940 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2917 2941 spurious newlines added by this routine. After a report by
2918 2942 F. Mantegazza.
2919 2943
2920 2944 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2921 2945
2922 2946 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2923 2947 calls. These were a leftover from the GTK 1.x days, and can cause
2924 2948 problems in certain cases (after a report by John Hunter).
2925 2949
2926 2950 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2927 2951 os.getcwd() fails at init time. Thanks to patch from David Remahl
2928 2952 <chmod007-AT-mac.com>.
2929 2953 (InteractiveShell.__init__): prevent certain special magics from
2930 2954 being shadowed by aliases. Closes
2931 2955 http://www.scipy.net/roundup/ipython/issue41.
2932 2956
2933 2957 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2934 2958
2935 2959 * IPython/iplib.py (InteractiveShell.complete): Added new
2936 2960 top-level completion method to expose the completion mechanism
2937 2961 beyond readline-based environments.
2938 2962
2939 2963 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2940 2964
2941 2965 * tools/ipsvnc (svnversion): fix svnversion capture.
2942 2966
2943 2967 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2944 2968 attribute to self, which was missing. Before, it was set by a
2945 2969 routine which in certain cases wasn't being called, so the
2946 2970 instance could end up missing the attribute. This caused a crash.
2947 2971 Closes http://www.scipy.net/roundup/ipython/issue40.
2948 2972
2949 2973 2005-08-16 Fernando Perez <fperez@colorado.edu>
2950 2974
2951 2975 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2952 2976 contains non-string attribute. Closes
2953 2977 http://www.scipy.net/roundup/ipython/issue38.
2954 2978
2955 2979 2005-08-14 Fernando Perez <fperez@colorado.edu>
2956 2980
2957 2981 * tools/ipsvnc: Minor improvements, to add changeset info.
2958 2982
2959 2983 2005-08-12 Fernando Perez <fperez@colorado.edu>
2960 2984
2961 2985 * IPython/iplib.py (runsource): remove self.code_to_run_src
2962 2986 attribute. I realized this is nothing more than
2963 2987 '\n'.join(self.buffer), and having the same data in two different
2964 2988 places is just asking for synchronization bugs. This may impact
2965 2989 people who have custom exception handlers, so I need to warn
2966 2990 ipython-dev about it (F. Mantegazza may use them).
2967 2991
2968 2992 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2969 2993
2970 2994 * IPython/genutils.py: fix 2.2 compatibility (generators)
2971 2995
2972 2996 2005-07-18 Fernando Perez <fperez@colorado.edu>
2973 2997
2974 2998 * IPython/genutils.py (get_home_dir): fix to help users with
2975 2999 invalid $HOME under win32.
2976 3000
2977 3001 2005-07-17 Fernando Perez <fperez@colorado.edu>
2978 3002
2979 3003 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2980 3004 some old hacks and clean up a bit other routines; code should be
2981 3005 simpler and a bit faster.
2982 3006
2983 3007 * IPython/iplib.py (interact): removed some last-resort attempts
2984 3008 to survive broken stdout/stderr. That code was only making it
2985 3009 harder to abstract out the i/o (necessary for gui integration),
2986 3010 and the crashes it could prevent were extremely rare in practice
2987 3011 (besides being fully user-induced in a pretty violent manner).
2988 3012
2989 3013 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2990 3014 Nothing major yet, but the code is simpler to read; this should
2991 3015 make it easier to do more serious modifications in the future.
2992 3016
2993 3017 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2994 3018 which broke in .15 (thanks to a report by Ville).
2995 3019
2996 3020 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2997 3021 be quite correct, I know next to nothing about unicode). This
2998 3022 will allow unicode strings to be used in prompts, amongst other
2999 3023 cases. It also will prevent ipython from crashing when unicode
3000 3024 shows up unexpectedly in many places. If ascii encoding fails, we
3001 3025 assume utf_8. Currently the encoding is not a user-visible
3002 3026 setting, though it could be made so if there is demand for it.
3003 3027
3004 3028 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
3005 3029
3006 3030 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
3007 3031
3008 3032 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
3009 3033
3010 3034 * IPython/genutils.py: Add 2.2 compatibility here, so all other
3011 3035 code can work transparently for 2.2/2.3.
3012 3036
3013 3037 2005-07-16 Fernando Perez <fperez@colorado.edu>
3014 3038
3015 3039 * IPython/ultraTB.py (ExceptionColors): Make a global variable
3016 3040 out of the color scheme table used for coloring exception
3017 3041 tracebacks. This allows user code to add new schemes at runtime.
3018 3042 This is a minimally modified version of the patch at
3019 3043 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
3020 3044 for the contribution.
3021 3045
3022 3046 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
3023 3047 slightly modified version of the patch in
3024 3048 http://www.scipy.net/roundup/ipython/issue34, which also allows me
3025 3049 to remove the previous try/except solution (which was costlier).
3026 3050 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
3027 3051
3028 3052 2005-06-08 Fernando Perez <fperez@colorado.edu>
3029 3053
3030 3054 * IPython/iplib.py (write/write_err): Add methods to abstract all
3031 3055 I/O a bit more.
3032 3056
3033 3057 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
3034 3058 warning, reported by Aric Hagberg, fix by JD Hunter.
3035 3059
3036 3060 2005-06-02 *** Released version 0.6.15
3037 3061
3038 3062 2005-06-01 Fernando Perez <fperez@colorado.edu>
3039 3063
3040 3064 * IPython/iplib.py (MagicCompleter.file_matches): Fix
3041 3065 tab-completion of filenames within open-quoted strings. Note that
3042 3066 this requires that in ~/.ipython/ipythonrc, users change the
3043 3067 readline delimiters configuration to read:
3044 3068
3045 3069 readline_remove_delims -/~
3046 3070
3047 3071
3048 3072 2005-05-31 *** Released version 0.6.14
3049 3073
3050 3074 2005-05-29 Fernando Perez <fperez@colorado.edu>
3051 3075
3052 3076 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
3053 3077 with files not on the filesystem. Reported by Eliyahu Sandler
3054 3078 <eli@gondolin.net>
3055 3079
3056 3080 2005-05-22 Fernando Perez <fperez@colorado.edu>
3057 3081
3058 3082 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
3059 3083 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
3060 3084
3061 3085 2005-05-19 Fernando Perez <fperez@colorado.edu>
3062 3086
3063 3087 * IPython/iplib.py (safe_execfile): close a file which could be
3064 3088 left open (causing problems in win32, which locks open files).
3065 3089 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
3066 3090
3067 3091 2005-05-18 Fernando Perez <fperez@colorado.edu>
3068 3092
3069 3093 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
3070 3094 keyword arguments correctly to safe_execfile().
3071 3095
3072 3096 2005-05-13 Fernando Perez <fperez@colorado.edu>
3073 3097
3074 3098 * ipython.1: Added info about Qt to manpage, and threads warning
3075 3099 to usage page (invoked with --help).
3076 3100
3077 3101 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
3078 3102 new matcher (it goes at the end of the priority list) to do
3079 3103 tab-completion on named function arguments. Submitted by George
3080 3104 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
3081 3105 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
3082 3106 for more details.
3083 3107
3084 3108 * IPython/Magic.py (magic_run): Added new -e flag to ignore
3085 3109 SystemExit exceptions in the script being run. Thanks to a report
3086 3110 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
3087 3111 producing very annoying behavior when running unit tests.
3088 3112
3089 3113 2005-05-12 Fernando Perez <fperez@colorado.edu>
3090 3114
3091 3115 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
3092 3116 which I'd broken (again) due to a changed regexp. In the process,
3093 3117 added ';' as an escape to auto-quote the whole line without
3094 3118 splitting its arguments. Thanks to a report by Jerry McRae
3095 3119 <qrs0xyc02-AT-sneakemail.com>.
3096 3120
3097 3121 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
3098 3122 possible crashes caused by a TokenError. Reported by Ed Schofield
3099 3123 <schofield-AT-ftw.at>.
3100 3124
3101 3125 2005-05-06 Fernando Perez <fperez@colorado.edu>
3102 3126
3103 3127 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
3104 3128
3105 3129 2005-04-29 Fernando Perez <fperez@colorado.edu>
3106 3130
3107 3131 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
3108 3132 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
3109 3133 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
3110 3134 which provides support for Qt interactive usage (similar to the
3111 3135 existing one for WX and GTK). This had been often requested.
3112 3136
3113 3137 2005-04-14 *** Released version 0.6.13
3114 3138
3115 3139 2005-04-08 Fernando Perez <fperez@colorado.edu>
3116 3140
3117 3141 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
3118 3142 from _ofind, which gets called on almost every input line. Now,
3119 3143 we only try to get docstrings if they are actually going to be
3120 3144 used (the overhead of fetching unnecessary docstrings can be
3121 3145 noticeable for certain objects, such as Pyro proxies).
3122 3146
3123 3147 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
3124 3148 for completers. For some reason I had been passing them the state
3125 3149 variable, which completers never actually need, and was in
3126 3150 conflict with the rlcompleter API. Custom completers ONLY need to
3127 3151 take the text parameter.
3128 3152
3129 3153 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
3130 3154 work correctly in pysh. I've also moved all the logic which used
3131 3155 to be in pysh.py here, which will prevent problems with future
3132 3156 upgrades. However, this time I must warn users to update their
3133 3157 pysh profile to include the line
3134 3158
3135 3159 import_all IPython.Extensions.InterpreterExec
3136 3160
3137 3161 because otherwise things won't work for them. They MUST also
3138 3162 delete pysh.py and the line
3139 3163
3140 3164 execfile pysh.py
3141 3165
3142 3166 from their ipythonrc-pysh.
3143 3167
3144 3168 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
3145 3169 robust in the face of objects whose dir() returns non-strings
3146 3170 (which it shouldn't, but some broken libs like ITK do). Thanks to
3147 3171 a patch by John Hunter (implemented differently, though). Also
3148 3172 minor improvements by using .extend instead of + on lists.
3149 3173
3150 3174 * pysh.py:
3151 3175
3152 3176 2005-04-06 Fernando Perez <fperez@colorado.edu>
3153 3177
3154 3178 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
3155 3179 by default, so that all users benefit from it. Those who don't
3156 3180 want it can still turn it off.
3157 3181
3158 3182 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
3159 3183 config file, I'd forgotten about this, so users were getting it
3160 3184 off by default.
3161 3185
3162 3186 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
3163 3187 consistency. Now magics can be called in multiline statements,
3164 3188 and python variables can be expanded in magic calls via $var.
3165 3189 This makes the magic system behave just like aliases or !system
3166 3190 calls.
3167 3191
3168 3192 2005-03-28 Fernando Perez <fperez@colorado.edu>
3169 3193
3170 3194 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
3171 3195 expensive string additions for building command. Add support for
3172 3196 trailing ';' when autocall is used.
3173 3197
3174 3198 2005-03-26 Fernando Perez <fperez@colorado.edu>
3175 3199
3176 3200 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
3177 3201 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
3178 3202 ipython.el robust against prompts with any number of spaces
3179 3203 (including 0) after the ':' character.
3180 3204
3181 3205 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
3182 3206 continuation prompt, which misled users to think the line was
3183 3207 already indented. Closes debian Bug#300847, reported to me by
3184 3208 Norbert Tretkowski <tretkowski-AT-inittab.de>.
3185 3209
3186 3210 2005-03-23 Fernando Perez <fperez@colorado.edu>
3187 3211
3188 3212 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
3189 3213 properly aligned if they have embedded newlines.
3190 3214
3191 3215 * IPython/iplib.py (runlines): Add a public method to expose
3192 3216 IPython's code execution machinery, so that users can run strings
3193 3217 as if they had been typed at the prompt interactively.
3194 3218 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
3195 3219 methods which can call the system shell, but with python variable
3196 3220 expansion. The three such methods are: __IPYTHON__.system,
3197 3221 .getoutput and .getoutputerror. These need to be documented in a
3198 3222 'public API' section (to be written) of the manual.
3199 3223
3200 3224 2005-03-20 Fernando Perez <fperez@colorado.edu>
3201 3225
3202 3226 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
3203 3227 for custom exception handling. This is quite powerful, and it
3204 3228 allows for user-installable exception handlers which can trap
3205 3229 custom exceptions at runtime and treat them separately from
3206 3230 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
3207 3231 Mantegazza <mantegazza-AT-ill.fr>.
3208 3232 (InteractiveShell.set_custom_completer): public API function to
3209 3233 add new completers at runtime.
3210 3234
3211 3235 2005-03-19 Fernando Perez <fperez@colorado.edu>
3212 3236
3213 3237 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3214 3238 allow objects which provide their docstrings via non-standard
3215 3239 mechanisms (like Pyro proxies) to still be inspected by ipython's
3216 3240 ? system.
3217 3241
3218 3242 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3219 3243 automatic capture system. I tried quite hard to make it work
3220 3244 reliably, and simply failed. I tried many combinations with the
3221 3245 subprocess module, but eventually nothing worked in all needed
3222 3246 cases (not blocking stdin for the child, duplicating stdout
3223 3247 without blocking, etc). The new %sc/%sx still do capture to these
3224 3248 magical list/string objects which make shell use much more
3225 3249 conveninent, so not all is lost.
3226 3250
3227 3251 XXX - FIX MANUAL for the change above!
3228 3252
3229 3253 (runsource): I copied code.py's runsource() into ipython to modify
3230 3254 it a bit. Now the code object and source to be executed are
3231 3255 stored in ipython. This makes this info accessible to third-party
3232 3256 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
3233 3257 Mantegazza <mantegazza-AT-ill.fr>.
3234 3258
3235 3259 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3236 3260 history-search via readline (like C-p/C-n). I'd wanted this for a
3237 3261 long time, but only recently found out how to do it. For users
3238 3262 who already have their ipythonrc files made and want this, just
3239 3263 add:
3240 3264
3241 3265 readline_parse_and_bind "\e[A": history-search-backward
3242 3266 readline_parse_and_bind "\e[B": history-search-forward
3243 3267
3244 3268 2005-03-18 Fernando Perez <fperez@colorado.edu>
3245 3269
3246 3270 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3247 3271 LSString and SList classes which allow transparent conversions
3248 3272 between list mode and whitespace-separated string.
3249 3273 (magic_r): Fix recursion problem in %r.
3250 3274
3251 3275 * IPython/genutils.py (LSString): New class to be used for
3252 3276 automatic storage of the results of all alias/system calls in _o
3253 3277 and _e (stdout/err). These provide a .l/.list attribute which
3254 3278 does automatic splitting on newlines. This means that for most
3255 3279 uses, you'll never need to do capturing of output with %sc/%sx
3256 3280 anymore, since ipython keeps this always done for you. Note that
3257 3281 only the LAST results are stored, the _o/e variables are
3258 3282 overwritten on each call. If you need to save their contents
3259 3283 further, simply bind them to any other name.
3260 3284
3261 3285 2005-03-17 Fernando Perez <fperez@colorado.edu>
3262 3286
3263 3287 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3264 3288 prompt namespace handling.
3265 3289
3266 3290 2005-03-16 Fernando Perez <fperez@colorado.edu>
3267 3291
3268 3292 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3269 3293 classic prompts to be '>>> ' (final space was missing, and it
3270 3294 trips the emacs python mode).
3271 3295 (BasePrompt.__str__): Added safe support for dynamic prompt
3272 3296 strings. Now you can set your prompt string to be '$x', and the
3273 3297 value of x will be printed from your interactive namespace. The
3274 3298 interpolation syntax includes the full Itpl support, so
3275 3299 ${foo()+x+bar()} is a valid prompt string now, and the function
3276 3300 calls will be made at runtime.
3277 3301
3278 3302 2005-03-15 Fernando Perez <fperez@colorado.edu>
3279 3303
3280 3304 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3281 3305 avoid name clashes in pylab. %hist still works, it just forwards
3282 3306 the call to %history.
3283 3307
3284 3308 2005-03-02 *** Released version 0.6.12
3285 3309
3286 3310 2005-03-02 Fernando Perez <fperez@colorado.edu>
3287 3311
3288 3312 * IPython/iplib.py (handle_magic): log magic calls properly as
3289 3313 ipmagic() function calls.
3290 3314
3291 3315 * IPython/Magic.py (magic_time): Improved %time to support
3292 3316 statements and provide wall-clock as well as CPU time.
3293 3317
3294 3318 2005-02-27 Fernando Perez <fperez@colorado.edu>
3295 3319
3296 3320 * IPython/hooks.py: New hooks module, to expose user-modifiable
3297 3321 IPython functionality in a clean manner. For now only the editor
3298 3322 hook is actually written, and other thigns which I intend to turn
3299 3323 into proper hooks aren't yet there. The display and prefilter
3300 3324 stuff, for example, should be hooks. But at least now the
3301 3325 framework is in place, and the rest can be moved here with more
3302 3326 time later. IPython had had a .hooks variable for a long time for
3303 3327 this purpose, but I'd never actually used it for anything.
3304 3328
3305 3329 2005-02-26 Fernando Perez <fperez@colorado.edu>
3306 3330
3307 3331 * IPython/ipmaker.py (make_IPython): make the default ipython
3308 3332 directory be called _ipython under win32, to follow more the
3309 3333 naming peculiarities of that platform (where buggy software like
3310 3334 Visual Sourcesafe breaks with .named directories). Reported by
3311 3335 Ville Vainio.
3312 3336
3313 3337 2005-02-23 Fernando Perez <fperez@colorado.edu>
3314 3338
3315 3339 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3316 3340 auto_aliases for win32 which were causing problems. Users can
3317 3341 define the ones they personally like.
3318 3342
3319 3343 2005-02-21 Fernando Perez <fperez@colorado.edu>
3320 3344
3321 3345 * IPython/Magic.py (magic_time): new magic to time execution of
3322 3346 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3323 3347
3324 3348 2005-02-19 Fernando Perez <fperez@colorado.edu>
3325 3349
3326 3350 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3327 3351 into keys (for prompts, for example).
3328 3352
3329 3353 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3330 3354 prompts in case users want them. This introduces a small behavior
3331 3355 change: ipython does not automatically add a space to all prompts
3332 3356 anymore. To get the old prompts with a space, users should add it
3333 3357 manually to their ipythonrc file, so for example prompt_in1 should
3334 3358 now read 'In [\#]: ' instead of 'In [\#]:'.
3335 3359 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3336 3360 file) to control left-padding of secondary prompts.
3337 3361
3338 3362 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3339 3363 the profiler can't be imported. Fix for Debian, which removed
3340 3364 profile.py because of License issues. I applied a slightly
3341 3365 modified version of the original Debian patch at
3342 3366 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3343 3367
3344 3368 2005-02-17 Fernando Perez <fperez@colorado.edu>
3345 3369
3346 3370 * IPython/genutils.py (native_line_ends): Fix bug which would
3347 3371 cause improper line-ends under win32 b/c I was not opening files
3348 3372 in binary mode. Bug report and fix thanks to Ville.
3349 3373
3350 3374 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3351 3375 trying to catch spurious foo[1] autocalls. My fix actually broke
3352 3376 ',/' autoquote/call with explicit escape (bad regexp).
3353 3377
3354 3378 2005-02-15 *** Released version 0.6.11
3355 3379
3356 3380 2005-02-14 Fernando Perez <fperez@colorado.edu>
3357 3381
3358 3382 * IPython/background_jobs.py: New background job management
3359 3383 subsystem. This is implemented via a new set of classes, and
3360 3384 IPython now provides a builtin 'jobs' object for background job
3361 3385 execution. A convenience %bg magic serves as a lightweight
3362 3386 frontend for starting the more common type of calls. This was
3363 3387 inspired by discussions with B. Granger and the BackgroundCommand
3364 3388 class described in the book Python Scripting for Computational
3365 3389 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3366 3390 (although ultimately no code from this text was used, as IPython's
3367 3391 system is a separate implementation).
3368 3392
3369 3393 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3370 3394 to control the completion of single/double underscore names
3371 3395 separately. As documented in the example ipytonrc file, the
3372 3396 readline_omit__names variable can now be set to 2, to omit even
3373 3397 single underscore names. Thanks to a patch by Brian Wong
3374 3398 <BrianWong-AT-AirgoNetworks.Com>.
3375 3399 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3376 3400 be autocalled as foo([1]) if foo were callable. A problem for
3377 3401 things which are both callable and implement __getitem__.
3378 3402 (init_readline): Fix autoindentation for win32. Thanks to a patch
3379 3403 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3380 3404
3381 3405 2005-02-12 Fernando Perez <fperez@colorado.edu>
3382 3406
3383 3407 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3384 3408 which I had written long ago to sort out user error messages which
3385 3409 may occur during startup. This seemed like a good idea initially,
3386 3410 but it has proven a disaster in retrospect. I don't want to
3387 3411 change much code for now, so my fix is to set the internal 'debug'
3388 3412 flag to true everywhere, whose only job was precisely to control
3389 3413 this subsystem. This closes issue 28 (as well as avoiding all
3390 3414 sorts of strange hangups which occur from time to time).
3391 3415
3392 3416 2005-02-07 Fernando Perez <fperez@colorado.edu>
3393 3417
3394 3418 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3395 3419 previous call produced a syntax error.
3396 3420
3397 3421 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3398 3422 classes without constructor.
3399 3423
3400 3424 2005-02-06 Fernando Perez <fperez@colorado.edu>
3401 3425
3402 3426 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3403 3427 completions with the results of each matcher, so we return results
3404 3428 to the user from all namespaces. This breaks with ipython
3405 3429 tradition, but I think it's a nicer behavior. Now you get all
3406 3430 possible completions listed, from all possible namespaces (python,
3407 3431 filesystem, magics...) After a request by John Hunter
3408 3432 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3409 3433
3410 3434 2005-02-05 Fernando Perez <fperez@colorado.edu>
3411 3435
3412 3436 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3413 3437 the call had quote characters in it (the quotes were stripped).
3414 3438
3415 3439 2005-01-31 Fernando Perez <fperez@colorado.edu>
3416 3440
3417 3441 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3418 3442 Itpl.itpl() to make the code more robust against psyco
3419 3443 optimizations.
3420 3444
3421 3445 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3422 3446 of causing an exception. Quicker, cleaner.
3423 3447
3424 3448 2005-01-28 Fernando Perez <fperez@colorado.edu>
3425 3449
3426 3450 * scripts/ipython_win_post_install.py (install): hardcode
3427 3451 sys.prefix+'python.exe' as the executable path. It turns out that
3428 3452 during the post-installation run, sys.executable resolves to the
3429 3453 name of the binary installer! I should report this as a distutils
3430 3454 bug, I think. I updated the .10 release with this tiny fix, to
3431 3455 avoid annoying the lists further.
3432 3456
3433 3457 2005-01-27 *** Released version 0.6.10
3434 3458
3435 3459 2005-01-27 Fernando Perez <fperez@colorado.edu>
3436 3460
3437 3461 * IPython/numutils.py (norm): Added 'inf' as optional name for
3438 3462 L-infinity norm, included references to mathworld.com for vector
3439 3463 norm definitions.
3440 3464 (amin/amax): added amin/amax for array min/max. Similar to what
3441 3465 pylab ships with after the recent reorganization of names.
3442 3466 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3443 3467
3444 3468 * ipython.el: committed Alex's recent fixes and improvements.
3445 3469 Tested with python-mode from CVS, and it looks excellent. Since
3446 3470 python-mode hasn't released anything in a while, I'm temporarily
3447 3471 putting a copy of today's CVS (v 4.70) of python-mode in:
3448 3472 http://ipython.scipy.org/tmp/python-mode.el
3449 3473
3450 3474 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3451 3475 sys.executable for the executable name, instead of assuming it's
3452 3476 called 'python.exe' (the post-installer would have produced broken
3453 3477 setups on systems with a differently named python binary).
3454 3478
3455 3479 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3456 3480 references to os.linesep, to make the code more
3457 3481 platform-independent. This is also part of the win32 coloring
3458 3482 fixes.
3459 3483
3460 3484 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3461 3485 lines, which actually cause coloring bugs because the length of
3462 3486 the line is very difficult to correctly compute with embedded
3463 3487 escapes. This was the source of all the coloring problems under
3464 3488 Win32. I think that _finally_, Win32 users have a properly
3465 3489 working ipython in all respects. This would never have happened
3466 3490 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3467 3491
3468 3492 2005-01-26 *** Released version 0.6.9
3469 3493
3470 3494 2005-01-25 Fernando Perez <fperez@colorado.edu>
3471 3495
3472 3496 * setup.py: finally, we have a true Windows installer, thanks to
3473 3497 the excellent work of Viktor Ransmayr
3474 3498 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3475 3499 Windows users. The setup routine is quite a bit cleaner thanks to
3476 3500 this, and the post-install script uses the proper functions to
3477 3501 allow a clean de-installation using the standard Windows Control
3478 3502 Panel.
3479 3503
3480 3504 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3481 3505 environment variable under all OSes (including win32) if
3482 3506 available. This will give consistency to win32 users who have set
3483 3507 this variable for any reason. If os.environ['HOME'] fails, the
3484 3508 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3485 3509
3486 3510 2005-01-24 Fernando Perez <fperez@colorado.edu>
3487 3511
3488 3512 * IPython/numutils.py (empty_like): add empty_like(), similar to
3489 3513 zeros_like() but taking advantage of the new empty() Numeric routine.
3490 3514
3491 3515 2005-01-23 *** Released version 0.6.8
3492 3516
3493 3517 2005-01-22 Fernando Perez <fperez@colorado.edu>
3494 3518
3495 3519 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3496 3520 automatic show() calls. After discussing things with JDH, it
3497 3521 turns out there are too many corner cases where this can go wrong.
3498 3522 It's best not to try to be 'too smart', and simply have ipython
3499 3523 reproduce as much as possible the default behavior of a normal
3500 3524 python shell.
3501 3525
3502 3526 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3503 3527 line-splitting regexp and _prefilter() to avoid calling getattr()
3504 3528 on assignments. This closes
3505 3529 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3506 3530 readline uses getattr(), so a simple <TAB> keypress is still
3507 3531 enough to trigger getattr() calls on an object.
3508 3532
3509 3533 2005-01-21 Fernando Perez <fperez@colorado.edu>
3510 3534
3511 3535 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3512 3536 docstring under pylab so it doesn't mask the original.
3513 3537
3514 3538 2005-01-21 *** Released version 0.6.7
3515 3539
3516 3540 2005-01-21 Fernando Perez <fperez@colorado.edu>
3517 3541
3518 3542 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3519 3543 signal handling for win32 users in multithreaded mode.
3520 3544
3521 3545 2005-01-17 Fernando Perez <fperez@colorado.edu>
3522 3546
3523 3547 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3524 3548 instances with no __init__. After a crash report by Norbert Nemec
3525 3549 <Norbert-AT-nemec-online.de>.
3526 3550
3527 3551 2005-01-14 Fernando Perez <fperez@colorado.edu>
3528 3552
3529 3553 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3530 3554 names for verbose exceptions, when multiple dotted names and the
3531 3555 'parent' object were present on the same line.
3532 3556
3533 3557 2005-01-11 Fernando Perez <fperez@colorado.edu>
3534 3558
3535 3559 * IPython/genutils.py (flag_calls): new utility to trap and flag
3536 3560 calls in functions. I need it to clean up matplotlib support.
3537 3561 Also removed some deprecated code in genutils.
3538 3562
3539 3563 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3540 3564 that matplotlib scripts called with %run, which don't call show()
3541 3565 themselves, still have their plotting windows open.
3542 3566
3543 3567 2005-01-05 Fernando Perez <fperez@colorado.edu>
3544 3568
3545 3569 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3546 3570 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3547 3571
3548 3572 2004-12-19 Fernando Perez <fperez@colorado.edu>
3549 3573
3550 3574 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3551 3575 parent_runcode, which was an eyesore. The same result can be
3552 3576 obtained with Python's regular superclass mechanisms.
3553 3577
3554 3578 2004-12-17 Fernando Perez <fperez@colorado.edu>
3555 3579
3556 3580 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3557 3581 reported by Prabhu.
3558 3582 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3559 3583 sys.stderr) instead of explicitly calling sys.stderr. This helps
3560 3584 maintain our I/O abstractions clean, for future GUI embeddings.
3561 3585
3562 3586 * IPython/genutils.py (info): added new utility for sys.stderr
3563 3587 unified info message handling (thin wrapper around warn()).
3564 3588
3565 3589 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3566 3590 composite (dotted) names on verbose exceptions.
3567 3591 (VerboseTB.nullrepr): harden against another kind of errors which
3568 3592 Python's inspect module can trigger, and which were crashing
3569 3593 IPython. Thanks to a report by Marco Lombardi
3570 3594 <mlombard-AT-ma010192.hq.eso.org>.
3571 3595
3572 3596 2004-12-13 *** Released version 0.6.6
3573 3597
3574 3598 2004-12-12 Fernando Perez <fperez@colorado.edu>
3575 3599
3576 3600 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3577 3601 generated by pygtk upon initialization if it was built without
3578 3602 threads (for matplotlib users). After a crash reported by
3579 3603 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3580 3604
3581 3605 * IPython/ipmaker.py (make_IPython): fix small bug in the
3582 3606 import_some parameter for multiple imports.
3583 3607
3584 3608 * IPython/iplib.py (ipmagic): simplified the interface of
3585 3609 ipmagic() to take a single string argument, just as it would be
3586 3610 typed at the IPython cmd line.
3587 3611 (ipalias): Added new ipalias() with an interface identical to
3588 3612 ipmagic(). This completes exposing a pure python interface to the
3589 3613 alias and magic system, which can be used in loops or more complex
3590 3614 code where IPython's automatic line mangling is not active.
3591 3615
3592 3616 * IPython/genutils.py (timing): changed interface of timing to
3593 3617 simply run code once, which is the most common case. timings()
3594 3618 remains unchanged, for the cases where you want multiple runs.
3595 3619
3596 3620 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3597 3621 bug where Python2.2 crashes with exec'ing code which does not end
3598 3622 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3599 3623 before.
3600 3624
3601 3625 2004-12-10 Fernando Perez <fperez@colorado.edu>
3602 3626
3603 3627 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3604 3628 -t to -T, to accomodate the new -t flag in %run (the %run and
3605 3629 %prun options are kind of intermixed, and it's not easy to change
3606 3630 this with the limitations of python's getopt).
3607 3631
3608 3632 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3609 3633 the execution of scripts. It's not as fine-tuned as timeit.py,
3610 3634 but it works from inside ipython (and under 2.2, which lacks
3611 3635 timeit.py). Optionally a number of runs > 1 can be given for
3612 3636 timing very short-running code.
3613 3637
3614 3638 * IPython/genutils.py (uniq_stable): new routine which returns a
3615 3639 list of unique elements in any iterable, but in stable order of
3616 3640 appearance. I needed this for the ultraTB fixes, and it's a handy
3617 3641 utility.
3618 3642
3619 3643 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3620 3644 dotted names in Verbose exceptions. This had been broken since
3621 3645 the very start, now x.y will properly be printed in a Verbose
3622 3646 traceback, instead of x being shown and y appearing always as an
3623 3647 'undefined global'. Getting this to work was a bit tricky,
3624 3648 because by default python tokenizers are stateless. Saved by
3625 3649 python's ability to easily add a bit of state to an arbitrary
3626 3650 function (without needing to build a full-blown callable object).
3627 3651
3628 3652 Also big cleanup of this code, which had horrendous runtime
3629 3653 lookups of zillions of attributes for colorization. Moved all
3630 3654 this code into a few templates, which make it cleaner and quicker.
3631 3655
3632 3656 Printout quality was also improved for Verbose exceptions: one
3633 3657 variable per line, and memory addresses are printed (this can be
3634 3658 quite handy in nasty debugging situations, which is what Verbose
3635 3659 is for).
3636 3660
3637 3661 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3638 3662 the command line as scripts to be loaded by embedded instances.
3639 3663 Doing so has the potential for an infinite recursion if there are
3640 3664 exceptions thrown in the process. This fixes a strange crash
3641 3665 reported by Philippe MULLER <muller-AT-irit.fr>.
3642 3666
3643 3667 2004-12-09 Fernando Perez <fperez@colorado.edu>
3644 3668
3645 3669 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3646 3670 to reflect new names in matplotlib, which now expose the
3647 3671 matlab-compatible interface via a pylab module instead of the
3648 3672 'matlab' name. The new code is backwards compatible, so users of
3649 3673 all matplotlib versions are OK. Patch by J. Hunter.
3650 3674
3651 3675 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3652 3676 of __init__ docstrings for instances (class docstrings are already
3653 3677 automatically printed). Instances with customized docstrings
3654 3678 (indep. of the class) are also recognized and all 3 separate
3655 3679 docstrings are printed (instance, class, constructor). After some
3656 3680 comments/suggestions by J. Hunter.
3657 3681
3658 3682 2004-12-05 Fernando Perez <fperez@colorado.edu>
3659 3683
3660 3684 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3661 3685 warnings when tab-completion fails and triggers an exception.
3662 3686
3663 3687 2004-12-03 Fernando Perez <fperez@colorado.edu>
3664 3688
3665 3689 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3666 3690 be triggered when using 'run -p'. An incorrect option flag was
3667 3691 being set ('d' instead of 'D').
3668 3692 (manpage): fix missing escaped \- sign.
3669 3693
3670 3694 2004-11-30 *** Released version 0.6.5
3671 3695
3672 3696 2004-11-30 Fernando Perez <fperez@colorado.edu>
3673 3697
3674 3698 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3675 3699 setting with -d option.
3676 3700
3677 3701 * setup.py (docfiles): Fix problem where the doc glob I was using
3678 3702 was COMPLETELY BROKEN. It was giving the right files by pure
3679 3703 accident, but failed once I tried to include ipython.el. Note:
3680 3704 glob() does NOT allow you to do exclusion on multiple endings!
3681 3705
3682 3706 2004-11-29 Fernando Perez <fperez@colorado.edu>
3683 3707
3684 3708 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3685 3709 the manpage as the source. Better formatting & consistency.
3686 3710
3687 3711 * IPython/Magic.py (magic_run): Added new -d option, to run
3688 3712 scripts under the control of the python pdb debugger. Note that
3689 3713 this required changing the %prun option -d to -D, to avoid a clash
3690 3714 (since %run must pass options to %prun, and getopt is too dumb to
3691 3715 handle options with string values with embedded spaces). Thanks
3692 3716 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3693 3717 (magic_who_ls): added type matching to %who and %whos, so that one
3694 3718 can filter their output to only include variables of certain
3695 3719 types. Another suggestion by Matthew.
3696 3720 (magic_whos): Added memory summaries in kb and Mb for arrays.
3697 3721 (magic_who): Improve formatting (break lines every 9 vars).
3698 3722
3699 3723 2004-11-28 Fernando Perez <fperez@colorado.edu>
3700 3724
3701 3725 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3702 3726 cache when empty lines were present.
3703 3727
3704 3728 2004-11-24 Fernando Perez <fperez@colorado.edu>
3705 3729
3706 3730 * IPython/usage.py (__doc__): document the re-activated threading
3707 3731 options for WX and GTK.
3708 3732
3709 3733 2004-11-23 Fernando Perez <fperez@colorado.edu>
3710 3734
3711 3735 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3712 3736 the -wthread and -gthread options, along with a new -tk one to try
3713 3737 and coordinate Tk threading with wx/gtk. The tk support is very
3714 3738 platform dependent, since it seems to require Tcl and Tk to be
3715 3739 built with threads (Fedora1/2 appears NOT to have it, but in
3716 3740 Prabhu's Debian boxes it works OK). But even with some Tk
3717 3741 limitations, this is a great improvement.
3718 3742
3719 3743 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3720 3744 info in user prompts. Patch by Prabhu.
3721 3745
3722 3746 2004-11-18 Fernando Perez <fperez@colorado.edu>
3723 3747
3724 3748 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3725 3749 EOFErrors and bail, to avoid infinite loops if a non-terminating
3726 3750 file is fed into ipython. Patch submitted in issue 19 by user,
3727 3751 many thanks.
3728 3752
3729 3753 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3730 3754 autoquote/parens in continuation prompts, which can cause lots of
3731 3755 problems. Closes roundup issue 20.
3732 3756
3733 3757 2004-11-17 Fernando Perez <fperez@colorado.edu>
3734 3758
3735 3759 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3736 3760 reported as debian bug #280505. I'm not sure my local changelog
3737 3761 entry has the proper debian format (Jack?).
3738 3762
3739 3763 2004-11-08 *** Released version 0.6.4
3740 3764
3741 3765 2004-11-08 Fernando Perez <fperez@colorado.edu>
3742 3766
3743 3767 * IPython/iplib.py (init_readline): Fix exit message for Windows
3744 3768 when readline is active. Thanks to a report by Eric Jones
3745 3769 <eric-AT-enthought.com>.
3746 3770
3747 3771 2004-11-07 Fernando Perez <fperez@colorado.edu>
3748 3772
3749 3773 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3750 3774 sometimes seen by win2k/cygwin users.
3751 3775
3752 3776 2004-11-06 Fernando Perez <fperez@colorado.edu>
3753 3777
3754 3778 * IPython/iplib.py (interact): Change the handling of %Exit from
3755 3779 trying to propagate a SystemExit to an internal ipython flag.
3756 3780 This is less elegant than using Python's exception mechanism, but
3757 3781 I can't get that to work reliably with threads, so under -pylab
3758 3782 %Exit was hanging IPython. Cross-thread exception handling is
3759 3783 really a bitch. Thaks to a bug report by Stephen Walton
3760 3784 <stephen.walton-AT-csun.edu>.
3761 3785
3762 3786 2004-11-04 Fernando Perez <fperez@colorado.edu>
3763 3787
3764 3788 * IPython/iplib.py (raw_input_original): store a pointer to the
3765 3789 true raw_input to harden against code which can modify it
3766 3790 (wx.py.PyShell does this and would otherwise crash ipython).
3767 3791 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3768 3792
3769 3793 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3770 3794 Ctrl-C problem, which does not mess up the input line.
3771 3795
3772 3796 2004-11-03 Fernando Perez <fperez@colorado.edu>
3773 3797
3774 3798 * IPython/Release.py: Changed licensing to BSD, in all files.
3775 3799 (name): lowercase name for tarball/RPM release.
3776 3800
3777 3801 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3778 3802 use throughout ipython.
3779 3803
3780 3804 * IPython/Magic.py (Magic._ofind): Switch to using the new
3781 3805 OInspect.getdoc() function.
3782 3806
3783 3807 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3784 3808 of the line currently being canceled via Ctrl-C. It's extremely
3785 3809 ugly, but I don't know how to do it better (the problem is one of
3786 3810 handling cross-thread exceptions).
3787 3811
3788 3812 2004-10-28 Fernando Perez <fperez@colorado.edu>
3789 3813
3790 3814 * IPython/Shell.py (signal_handler): add signal handlers to trap
3791 3815 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3792 3816 report by Francesc Alted.
3793 3817
3794 3818 2004-10-21 Fernando Perez <fperez@colorado.edu>
3795 3819
3796 3820 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3797 3821 to % for pysh syntax extensions.
3798 3822
3799 3823 2004-10-09 Fernando Perez <fperez@colorado.edu>
3800 3824
3801 3825 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3802 3826 arrays to print a more useful summary, without calling str(arr).
3803 3827 This avoids the problem of extremely lengthy computations which
3804 3828 occur if arr is large, and appear to the user as a system lockup
3805 3829 with 100% cpu activity. After a suggestion by Kristian Sandberg
3806 3830 <Kristian.Sandberg@colorado.edu>.
3807 3831 (Magic.__init__): fix bug in global magic escapes not being
3808 3832 correctly set.
3809 3833
3810 3834 2004-10-08 Fernando Perez <fperez@colorado.edu>
3811 3835
3812 3836 * IPython/Magic.py (__license__): change to absolute imports of
3813 3837 ipython's own internal packages, to start adapting to the absolute
3814 3838 import requirement of PEP-328.
3815 3839
3816 3840 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3817 3841 files, and standardize author/license marks through the Release
3818 3842 module instead of having per/file stuff (except for files with
3819 3843 particular licenses, like the MIT/PSF-licensed codes).
3820 3844
3821 3845 * IPython/Debugger.py: remove dead code for python 2.1
3822 3846
3823 3847 2004-10-04 Fernando Perez <fperez@colorado.edu>
3824 3848
3825 3849 * IPython/iplib.py (ipmagic): New function for accessing magics
3826 3850 via a normal python function call.
3827 3851
3828 3852 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3829 3853 from '@' to '%', to accomodate the new @decorator syntax of python
3830 3854 2.4.
3831 3855
3832 3856 2004-09-29 Fernando Perez <fperez@colorado.edu>
3833 3857
3834 3858 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3835 3859 matplotlib.use to prevent running scripts which try to switch
3836 3860 interactive backends from within ipython. This will just crash
3837 3861 the python interpreter, so we can't allow it (but a detailed error
3838 3862 is given to the user).
3839 3863
3840 3864 2004-09-28 Fernando Perez <fperez@colorado.edu>
3841 3865
3842 3866 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3843 3867 matplotlib-related fixes so that using @run with non-matplotlib
3844 3868 scripts doesn't pop up spurious plot windows. This requires
3845 3869 matplotlib >= 0.63, where I had to make some changes as well.
3846 3870
3847 3871 * IPython/ipmaker.py (make_IPython): update version requirement to
3848 3872 python 2.2.
3849 3873
3850 3874 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3851 3875 banner arg for embedded customization.
3852 3876
3853 3877 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3854 3878 explicit uses of __IP as the IPython's instance name. Now things
3855 3879 are properly handled via the shell.name value. The actual code
3856 3880 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3857 3881 is much better than before. I'll clean things completely when the
3858 3882 magic stuff gets a real overhaul.
3859 3883
3860 3884 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3861 3885 minor changes to debian dir.
3862 3886
3863 3887 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3864 3888 pointer to the shell itself in the interactive namespace even when
3865 3889 a user-supplied dict is provided. This is needed for embedding
3866 3890 purposes (found by tests with Michel Sanner).
3867 3891
3868 3892 2004-09-27 Fernando Perez <fperez@colorado.edu>
3869 3893
3870 3894 * IPython/UserConfig/ipythonrc: remove []{} from
3871 3895 readline_remove_delims, so that things like [modname.<TAB> do
3872 3896 proper completion. This disables [].TAB, but that's a less common
3873 3897 case than module names in list comprehensions, for example.
3874 3898 Thanks to a report by Andrea Riciputi.
3875 3899
3876 3900 2004-09-09 Fernando Perez <fperez@colorado.edu>
3877 3901
3878 3902 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3879 3903 blocking problems in win32 and osx. Fix by John.
3880 3904
3881 3905 2004-09-08 Fernando Perez <fperez@colorado.edu>
3882 3906
3883 3907 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3884 3908 for Win32 and OSX. Fix by John Hunter.
3885 3909
3886 3910 2004-08-30 *** Released version 0.6.3
3887 3911
3888 3912 2004-08-30 Fernando Perez <fperez@colorado.edu>
3889 3913
3890 3914 * setup.py (isfile): Add manpages to list of dependent files to be
3891 3915 updated.
3892 3916
3893 3917 2004-08-27 Fernando Perez <fperez@colorado.edu>
3894 3918
3895 3919 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3896 3920 for now. They don't really work with standalone WX/GTK code
3897 3921 (though matplotlib IS working fine with both of those backends).
3898 3922 This will neeed much more testing. I disabled most things with
3899 3923 comments, so turning it back on later should be pretty easy.
3900 3924
3901 3925 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3902 3926 autocalling of expressions like r'foo', by modifying the line
3903 3927 split regexp. Closes
3904 3928 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3905 3929 Riley <ipythonbugs-AT-sabi.net>.
3906 3930 (InteractiveShell.mainloop): honor --nobanner with banner
3907 3931 extensions.
3908 3932
3909 3933 * IPython/Shell.py: Significant refactoring of all classes, so
3910 3934 that we can really support ALL matplotlib backends and threading
3911 3935 models (John spotted a bug with Tk which required this). Now we
3912 3936 should support single-threaded, WX-threads and GTK-threads, both
3913 3937 for generic code and for matplotlib.
3914 3938
3915 3939 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3916 3940 -pylab, to simplify things for users. Will also remove the pylab
3917 3941 profile, since now all of matplotlib configuration is directly
3918 3942 handled here. This also reduces startup time.
3919 3943
3920 3944 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3921 3945 shell wasn't being correctly called. Also in IPShellWX.
3922 3946
3923 3947 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3924 3948 fine-tune banner.
3925 3949
3926 3950 * IPython/numutils.py (spike): Deprecate these spike functions,
3927 3951 delete (long deprecated) gnuplot_exec handler.
3928 3952
3929 3953 2004-08-26 Fernando Perez <fperez@colorado.edu>
3930 3954
3931 3955 * ipython.1: Update for threading options, plus some others which
3932 3956 were missing.
3933 3957
3934 3958 * IPython/ipmaker.py (__call__): Added -wthread option for
3935 3959 wxpython thread handling. Make sure threading options are only
3936 3960 valid at the command line.
3937 3961
3938 3962 * scripts/ipython: moved shell selection into a factory function
3939 3963 in Shell.py, to keep the starter script to a minimum.
3940 3964
3941 3965 2004-08-25 Fernando Perez <fperez@colorado.edu>
3942 3966
3943 3967 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3944 3968 John. Along with some recent changes he made to matplotlib, the
3945 3969 next versions of both systems should work very well together.
3946 3970
3947 3971 2004-08-24 Fernando Perez <fperez@colorado.edu>
3948 3972
3949 3973 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3950 3974 tried to switch the profiling to using hotshot, but I'm getting
3951 3975 strange errors from prof.runctx() there. I may be misreading the
3952 3976 docs, but it looks weird. For now the profiling code will
3953 3977 continue to use the standard profiler.
3954 3978
3955 3979 2004-08-23 Fernando Perez <fperez@colorado.edu>
3956 3980
3957 3981 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3958 3982 threaded shell, by John Hunter. It's not quite ready yet, but
3959 3983 close.
3960 3984
3961 3985 2004-08-22 Fernando Perez <fperez@colorado.edu>
3962 3986
3963 3987 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3964 3988 in Magic and ultraTB.
3965 3989
3966 3990 * ipython.1: document threading options in manpage.
3967 3991
3968 3992 * scripts/ipython: Changed name of -thread option to -gthread,
3969 3993 since this is GTK specific. I want to leave the door open for a
3970 3994 -wthread option for WX, which will most likely be necessary. This
3971 3995 change affects usage and ipmaker as well.
3972 3996
3973 3997 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3974 3998 handle the matplotlib shell issues. Code by John Hunter
3975 3999 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3976 4000 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3977 4001 broken (and disabled for end users) for now, but it puts the
3978 4002 infrastructure in place.
3979 4003
3980 4004 2004-08-21 Fernando Perez <fperez@colorado.edu>
3981 4005
3982 4006 * ipythonrc-pylab: Add matplotlib support.
3983 4007
3984 4008 * matplotlib_config.py: new files for matplotlib support, part of
3985 4009 the pylab profile.
3986 4010
3987 4011 * IPython/usage.py (__doc__): documented the threading options.
3988 4012
3989 4013 2004-08-20 Fernando Perez <fperez@colorado.edu>
3990 4014
3991 4015 * ipython: Modified the main calling routine to handle the -thread
3992 4016 and -mpthread options. This needs to be done as a top-level hack,
3993 4017 because it determines which class to instantiate for IPython
3994 4018 itself.
3995 4019
3996 4020 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3997 4021 classes to support multithreaded GTK operation without blocking,
3998 4022 and matplotlib with all backends. This is a lot of still very
3999 4023 experimental code, and threads are tricky. So it may still have a
4000 4024 few rough edges... This code owes a lot to
4001 4025 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
4002 4026 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
4003 4027 to John Hunter for all the matplotlib work.
4004 4028
4005 4029 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
4006 4030 options for gtk thread and matplotlib support.
4007 4031
4008 4032 2004-08-16 Fernando Perez <fperez@colorado.edu>
4009 4033
4010 4034 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
4011 4035 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
4012 4036 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
4013 4037
4014 4038 2004-08-11 Fernando Perez <fperez@colorado.edu>
4015 4039
4016 4040 * setup.py (isfile): Fix build so documentation gets updated for
4017 4041 rpms (it was only done for .tgz builds).
4018 4042
4019 4043 2004-08-10 Fernando Perez <fperez@colorado.edu>
4020 4044
4021 4045 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
4022 4046
4023 4047 * iplib.py : Silence syntax error exceptions in tab-completion.
4024 4048
4025 4049 2004-08-05 Fernando Perez <fperez@colorado.edu>
4026 4050
4027 4051 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
4028 4052 'color off' mark for continuation prompts. This was causing long
4029 4053 continuation lines to mis-wrap.
4030 4054
4031 4055 2004-08-01 Fernando Perez <fperez@colorado.edu>
4032 4056
4033 4057 * IPython/ipmaker.py (make_IPython): Allow the shell class used
4034 4058 for building ipython to be a parameter. All this is necessary
4035 4059 right now to have a multithreaded version, but this insane
4036 4060 non-design will be cleaned up soon. For now, it's a hack that
4037 4061 works.
4038 4062
4039 4063 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
4040 4064 args in various places. No bugs so far, but it's a dangerous
4041 4065 practice.
4042 4066
4043 4067 2004-07-31 Fernando Perez <fperez@colorado.edu>
4044 4068
4045 4069 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
4046 4070 fix completion of files with dots in their names under most
4047 4071 profiles (pysh was OK because the completion order is different).
4048 4072
4049 4073 2004-07-27 Fernando Perez <fperez@colorado.edu>
4050 4074
4051 4075 * IPython/iplib.py (InteractiveShell.__init__): build dict of
4052 4076 keywords manually, b/c the one in keyword.py was removed in python
4053 4077 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
4054 4078 This is NOT a bug under python 2.3 and earlier.
4055 4079
4056 4080 2004-07-26 Fernando Perez <fperez@colorado.edu>
4057 4081
4058 4082 * IPython/ultraTB.py (VerboseTB.text): Add another
4059 4083 linecache.checkcache() call to try to prevent inspect.py from
4060 4084 crashing under python 2.3. I think this fixes
4061 4085 http://www.scipy.net/roundup/ipython/issue17.
4062 4086
4063 4087 2004-07-26 *** Released version 0.6.2
4064 4088
4065 4089 2004-07-26 Fernando Perez <fperez@colorado.edu>
4066 4090
4067 4091 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
4068 4092 fail for any number.
4069 4093 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
4070 4094 empty bookmarks.
4071 4095
4072 4096 2004-07-26 *** Released version 0.6.1
4073 4097
4074 4098 2004-07-26 Fernando Perez <fperez@colorado.edu>
4075 4099
4076 4100 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
4077 4101
4078 4102 * IPython/iplib.py (protect_filename): Applied Ville's patch for
4079 4103 escaping '()[]{}' in filenames.
4080 4104
4081 4105 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
4082 4106 Python 2.2 users who lack a proper shlex.split.
4083 4107
4084 4108 2004-07-19 Fernando Perez <fperez@colorado.edu>
4085 4109
4086 4110 * IPython/iplib.py (InteractiveShell.init_readline): Add support
4087 4111 for reading readline's init file. I follow the normal chain:
4088 4112 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
4089 4113 report by Mike Heeter. This closes
4090 4114 http://www.scipy.net/roundup/ipython/issue16.
4091 4115
4092 4116 2004-07-18 Fernando Perez <fperez@colorado.edu>
4093 4117
4094 4118 * IPython/iplib.py (__init__): Add better handling of '\' under
4095 4119 Win32 for filenames. After a patch by Ville.
4096 4120
4097 4121 2004-07-17 Fernando Perez <fperez@colorado.edu>
4098 4122
4099 4123 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4100 4124 autocalling would be triggered for 'foo is bar' if foo is
4101 4125 callable. I also cleaned up the autocall detection code to use a
4102 4126 regexp, which is faster. Bug reported by Alexander Schmolck.
4103 4127
4104 4128 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
4105 4129 '?' in them would confuse the help system. Reported by Alex
4106 4130 Schmolck.
4107 4131
4108 4132 2004-07-16 Fernando Perez <fperez@colorado.edu>
4109 4133
4110 4134 * IPython/GnuplotInteractive.py (__all__): added plot2.
4111 4135
4112 4136 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
4113 4137 plotting dictionaries, lists or tuples of 1d arrays.
4114 4138
4115 4139 * IPython/Magic.py (Magic.magic_hist): small clenaups and
4116 4140 optimizations.
4117 4141
4118 4142 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
4119 4143 the information which was there from Janko's original IPP code:
4120 4144
4121 4145 03.05.99 20:53 porto.ifm.uni-kiel.de
4122 4146 --Started changelog.
4123 4147 --make clear do what it say it does
4124 4148 --added pretty output of lines from inputcache
4125 4149 --Made Logger a mixin class, simplifies handling of switches
4126 4150 --Added own completer class. .string<TAB> expands to last history
4127 4151 line which starts with string. The new expansion is also present
4128 4152 with Ctrl-r from the readline library. But this shows, who this
4129 4153 can be done for other cases.
4130 4154 --Added convention that all shell functions should accept a
4131 4155 parameter_string This opens the door for different behaviour for
4132 4156 each function. @cd is a good example of this.
4133 4157
4134 4158 04.05.99 12:12 porto.ifm.uni-kiel.de
4135 4159 --added logfile rotation
4136 4160 --added new mainloop method which freezes first the namespace
4137 4161
4138 4162 07.05.99 21:24 porto.ifm.uni-kiel.de
4139 4163 --added the docreader classes. Now there is a help system.
4140 4164 -This is only a first try. Currently it's not easy to put new
4141 4165 stuff in the indices. But this is the way to go. Info would be
4142 4166 better, but HTML is every where and not everybody has an info
4143 4167 system installed and it's not so easy to change html-docs to info.
4144 4168 --added global logfile option
4145 4169 --there is now a hook for object inspection method pinfo needs to
4146 4170 be provided for this. Can be reached by two '??'.
4147 4171
4148 4172 08.05.99 20:51 porto.ifm.uni-kiel.de
4149 4173 --added a README
4150 4174 --bug in rc file. Something has changed so functions in the rc
4151 4175 file need to reference the shell and not self. Not clear if it's a
4152 4176 bug or feature.
4153 4177 --changed rc file for new behavior
4154 4178
4155 4179 2004-07-15 Fernando Perez <fperez@colorado.edu>
4156 4180
4157 4181 * IPython/Logger.py (Logger.log): fixed recent bug where the input
4158 4182 cache was falling out of sync in bizarre manners when multi-line
4159 4183 input was present. Minor optimizations and cleanup.
4160 4184
4161 4185 (Logger): Remove old Changelog info for cleanup. This is the
4162 4186 information which was there from Janko's original code:
4163 4187
4164 4188 Changes to Logger: - made the default log filename a parameter
4165 4189
4166 4190 - put a check for lines beginning with !@? in log(). Needed
4167 4191 (even if the handlers properly log their lines) for mid-session
4168 4192 logging activation to work properly. Without this, lines logged
4169 4193 in mid session, which get read from the cache, would end up
4170 4194 'bare' (with !@? in the open) in the log. Now they are caught
4171 4195 and prepended with a #.
4172 4196
4173 4197 * IPython/iplib.py (InteractiveShell.init_readline): added check
4174 4198 in case MagicCompleter fails to be defined, so we don't crash.
4175 4199
4176 4200 2004-07-13 Fernando Perez <fperez@colorado.edu>
4177 4201
4178 4202 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
4179 4203 of EPS if the requested filename ends in '.eps'.
4180 4204
4181 4205 2004-07-04 Fernando Perez <fperez@colorado.edu>
4182 4206
4183 4207 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
4184 4208 escaping of quotes when calling the shell.
4185 4209
4186 4210 2004-07-02 Fernando Perez <fperez@colorado.edu>
4187 4211
4188 4212 * IPython/Prompts.py (CachedOutput.update): Fix problem with
4189 4213 gettext not working because we were clobbering '_'. Fixes
4190 4214 http://www.scipy.net/roundup/ipython/issue6.
4191 4215
4192 4216 2004-07-01 Fernando Perez <fperez@colorado.edu>
4193 4217
4194 4218 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
4195 4219 into @cd. Patch by Ville.
4196 4220
4197 4221 * IPython/iplib.py (InteractiveShell.post_config_initialization):
4198 4222 new function to store things after ipmaker runs. Patch by Ville.
4199 4223 Eventually this will go away once ipmaker is removed and the class
4200 4224 gets cleaned up, but for now it's ok. Key functionality here is
4201 4225 the addition of the persistent storage mechanism, a dict for
4202 4226 keeping data across sessions (for now just bookmarks, but more can
4203 4227 be implemented later).
4204 4228
4205 4229 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
4206 4230 persistent across sections. Patch by Ville, I modified it
4207 4231 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
4208 4232 added a '-l' option to list all bookmarks.
4209 4233
4210 4234 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4211 4235 center for cleanup. Registered with atexit.register(). I moved
4212 4236 here the old exit_cleanup(). After a patch by Ville.
4213 4237
4214 4238 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4215 4239 characters in the hacked shlex_split for python 2.2.
4216 4240
4217 4241 * IPython/iplib.py (file_matches): more fixes to filenames with
4218 4242 whitespace in them. It's not perfect, but limitations in python's
4219 4243 readline make it impossible to go further.
4220 4244
4221 4245 2004-06-29 Fernando Perez <fperez@colorado.edu>
4222 4246
4223 4247 * IPython/iplib.py (file_matches): escape whitespace correctly in
4224 4248 filename completions. Bug reported by Ville.
4225 4249
4226 4250 2004-06-28 Fernando Perez <fperez@colorado.edu>
4227 4251
4228 4252 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4229 4253 the history file will be called 'history-PROFNAME' (or just
4230 4254 'history' if no profile is loaded). I was getting annoyed at
4231 4255 getting my Numerical work history clobbered by pysh sessions.
4232 4256
4233 4257 * IPython/iplib.py (InteractiveShell.__init__): Internal
4234 4258 getoutputerror() function so that we can honor the system_verbose
4235 4259 flag for _all_ system calls. I also added escaping of #
4236 4260 characters here to avoid confusing Itpl.
4237 4261
4238 4262 * IPython/Magic.py (shlex_split): removed call to shell in
4239 4263 parse_options and replaced it with shlex.split(). The annoying
4240 4264 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4241 4265 to backport it from 2.3, with several frail hacks (the shlex
4242 4266 module is rather limited in 2.2). Thanks to a suggestion by Ville
4243 4267 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4244 4268 problem.
4245 4269
4246 4270 (Magic.magic_system_verbose): new toggle to print the actual
4247 4271 system calls made by ipython. Mainly for debugging purposes.
4248 4272
4249 4273 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4250 4274 doesn't support persistence. Reported (and fix suggested) by
4251 4275 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4252 4276
4253 4277 2004-06-26 Fernando Perez <fperez@colorado.edu>
4254 4278
4255 4279 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4256 4280 continue prompts.
4257 4281
4258 4282 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4259 4283 function (basically a big docstring) and a few more things here to
4260 4284 speedup startup. pysh.py is now very lightweight. We want because
4261 4285 it gets execfile'd, while InterpreterExec gets imported, so
4262 4286 byte-compilation saves time.
4263 4287
4264 4288 2004-06-25 Fernando Perez <fperez@colorado.edu>
4265 4289
4266 4290 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4267 4291 -NUM', which was recently broken.
4268 4292
4269 4293 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4270 4294 in multi-line input (but not !!, which doesn't make sense there).
4271 4295
4272 4296 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4273 4297 It's just too useful, and people can turn it off in the less
4274 4298 common cases where it's a problem.
4275 4299
4276 4300 2004-06-24 Fernando Perez <fperez@colorado.edu>
4277 4301
4278 4302 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4279 4303 special syntaxes (like alias calling) is now allied in multi-line
4280 4304 input. This is still _very_ experimental, but it's necessary for
4281 4305 efficient shell usage combining python looping syntax with system
4282 4306 calls. For now it's restricted to aliases, I don't think it
4283 4307 really even makes sense to have this for magics.
4284 4308
4285 4309 2004-06-23 Fernando Perez <fperez@colorado.edu>
4286 4310
4287 4311 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4288 4312 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4289 4313
4290 4314 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4291 4315 extensions under Windows (after code sent by Gary Bishop). The
4292 4316 extensions considered 'executable' are stored in IPython's rc
4293 4317 structure as win_exec_ext.
4294 4318
4295 4319 * IPython/genutils.py (shell): new function, like system() but
4296 4320 without return value. Very useful for interactive shell work.
4297 4321
4298 4322 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4299 4323 delete aliases.
4300 4324
4301 4325 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4302 4326 sure that the alias table doesn't contain python keywords.
4303 4327
4304 4328 2004-06-21 Fernando Perez <fperez@colorado.edu>
4305 4329
4306 4330 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4307 4331 non-existent items are found in $PATH. Reported by Thorsten.
4308 4332
4309 4333 2004-06-20 Fernando Perez <fperez@colorado.edu>
4310 4334
4311 4335 * IPython/iplib.py (complete): modified the completer so that the
4312 4336 order of priorities can be easily changed at runtime.
4313 4337
4314 4338 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4315 4339 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4316 4340
4317 4341 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4318 4342 expand Python variables prepended with $ in all system calls. The
4319 4343 same was done to InteractiveShell.handle_shell_escape. Now all
4320 4344 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4321 4345 expansion of python variables and expressions according to the
4322 4346 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4323 4347
4324 4348 Though PEP-215 has been rejected, a similar (but simpler) one
4325 4349 seems like it will go into Python 2.4, PEP-292 -
4326 4350 http://www.python.org/peps/pep-0292.html.
4327 4351
4328 4352 I'll keep the full syntax of PEP-215, since IPython has since the
4329 4353 start used Ka-Ping Yee's reference implementation discussed there
4330 4354 (Itpl), and I actually like the powerful semantics it offers.
4331 4355
4332 4356 In order to access normal shell variables, the $ has to be escaped
4333 4357 via an extra $. For example:
4334 4358
4335 4359 In [7]: PATH='a python variable'
4336 4360
4337 4361 In [8]: !echo $PATH
4338 4362 a python variable
4339 4363
4340 4364 In [9]: !echo $$PATH
4341 4365 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4342 4366
4343 4367 (Magic.parse_options): escape $ so the shell doesn't evaluate
4344 4368 things prematurely.
4345 4369
4346 4370 * IPython/iplib.py (InteractiveShell.call_alias): added the
4347 4371 ability for aliases to expand python variables via $.
4348 4372
4349 4373 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4350 4374 system, now there's a @rehash/@rehashx pair of magics. These work
4351 4375 like the csh rehash command, and can be invoked at any time. They
4352 4376 build a table of aliases to everything in the user's $PATH
4353 4377 (@rehash uses everything, @rehashx is slower but only adds
4354 4378 executable files). With this, the pysh.py-based shell profile can
4355 4379 now simply call rehash upon startup, and full access to all
4356 4380 programs in the user's path is obtained.
4357 4381
4358 4382 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4359 4383 functionality is now fully in place. I removed the old dynamic
4360 4384 code generation based approach, in favor of a much lighter one
4361 4385 based on a simple dict. The advantage is that this allows me to
4362 4386 now have thousands of aliases with negligible cost (unthinkable
4363 4387 with the old system).
4364 4388
4365 4389 2004-06-19 Fernando Perez <fperez@colorado.edu>
4366 4390
4367 4391 * IPython/iplib.py (__init__): extended MagicCompleter class to
4368 4392 also complete (last in priority) on user aliases.
4369 4393
4370 4394 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4371 4395 call to eval.
4372 4396 (ItplNS.__init__): Added a new class which functions like Itpl,
4373 4397 but allows configuring the namespace for the evaluation to occur
4374 4398 in.
4375 4399
4376 4400 2004-06-18 Fernando Perez <fperez@colorado.edu>
4377 4401
4378 4402 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4379 4403 better message when 'exit' or 'quit' are typed (a common newbie
4380 4404 confusion).
4381 4405
4382 4406 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4383 4407 check for Windows users.
4384 4408
4385 4409 * IPython/iplib.py (InteractiveShell.user_setup): removed
4386 4410 disabling of colors for Windows. I'll test at runtime and issue a
4387 4411 warning if Gary's readline isn't found, as to nudge users to
4388 4412 download it.
4389 4413
4390 4414 2004-06-16 Fernando Perez <fperez@colorado.edu>
4391 4415
4392 4416 * IPython/genutils.py (Stream.__init__): changed to print errors
4393 4417 to sys.stderr. I had a circular dependency here. Now it's
4394 4418 possible to run ipython as IDLE's shell (consider this pre-alpha,
4395 4419 since true stdout things end up in the starting terminal instead
4396 4420 of IDLE's out).
4397 4421
4398 4422 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4399 4423 users who haven't # updated their prompt_in2 definitions. Remove
4400 4424 eventually.
4401 4425 (multiple_replace): added credit to original ASPN recipe.
4402 4426
4403 4427 2004-06-15 Fernando Perez <fperez@colorado.edu>
4404 4428
4405 4429 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4406 4430 list of auto-defined aliases.
4407 4431
4408 4432 2004-06-13 Fernando Perez <fperez@colorado.edu>
4409 4433
4410 4434 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4411 4435 install was really requested (so setup.py can be used for other
4412 4436 things under Windows).
4413 4437
4414 4438 2004-06-10 Fernando Perez <fperez@colorado.edu>
4415 4439
4416 4440 * IPython/Logger.py (Logger.create_log): Manually remove any old
4417 4441 backup, since os.remove may fail under Windows. Fixes bug
4418 4442 reported by Thorsten.
4419 4443
4420 4444 2004-06-09 Fernando Perez <fperez@colorado.edu>
4421 4445
4422 4446 * examples/example-embed.py: fixed all references to %n (replaced
4423 4447 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4424 4448 for all examples and the manual as well.
4425 4449
4426 4450 2004-06-08 Fernando Perez <fperez@colorado.edu>
4427 4451
4428 4452 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4429 4453 alignment and color management. All 3 prompt subsystems now
4430 4454 inherit from BasePrompt.
4431 4455
4432 4456 * tools/release: updates for windows installer build and tag rpms
4433 4457 with python version (since paths are fixed).
4434 4458
4435 4459 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4436 4460 which will become eventually obsolete. Also fixed the default
4437 4461 prompt_in2 to use \D, so at least new users start with the correct
4438 4462 defaults.
4439 4463 WARNING: Users with existing ipythonrc files will need to apply
4440 4464 this fix manually!
4441 4465
4442 4466 * setup.py: make windows installer (.exe). This is finally the
4443 4467 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4444 4468 which I hadn't included because it required Python 2.3 (or recent
4445 4469 distutils).
4446 4470
4447 4471 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4448 4472 usage of new '\D' escape.
4449 4473
4450 4474 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4451 4475 lacks os.getuid())
4452 4476 (CachedOutput.set_colors): Added the ability to turn coloring
4453 4477 on/off with @colors even for manually defined prompt colors. It
4454 4478 uses a nasty global, but it works safely and via the generic color
4455 4479 handling mechanism.
4456 4480 (Prompt2.__init__): Introduced new escape '\D' for continuation
4457 4481 prompts. It represents the counter ('\#') as dots.
4458 4482 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4459 4483 need to update their ipythonrc files and replace '%n' with '\D' in
4460 4484 their prompt_in2 settings everywhere. Sorry, but there's
4461 4485 otherwise no clean way to get all prompts to properly align. The
4462 4486 ipythonrc shipped with IPython has been updated.
4463 4487
4464 4488 2004-06-07 Fernando Perez <fperez@colorado.edu>
4465 4489
4466 4490 * setup.py (isfile): Pass local_icons option to latex2html, so the
4467 4491 resulting HTML file is self-contained. Thanks to
4468 4492 dryice-AT-liu.com.cn for the tip.
4469 4493
4470 4494 * pysh.py: I created a new profile 'shell', which implements a
4471 4495 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4472 4496 system shell, nor will it become one anytime soon. It's mainly
4473 4497 meant to illustrate the use of the new flexible bash-like prompts.
4474 4498 I guess it could be used by hardy souls for true shell management,
4475 4499 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4476 4500 profile. This uses the InterpreterExec extension provided by
4477 4501 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4478 4502
4479 4503 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4480 4504 auto-align itself with the length of the previous input prompt
4481 4505 (taking into account the invisible color escapes).
4482 4506 (CachedOutput.__init__): Large restructuring of this class. Now
4483 4507 all three prompts (primary1, primary2, output) are proper objects,
4484 4508 managed by the 'parent' CachedOutput class. The code is still a
4485 4509 bit hackish (all prompts share state via a pointer to the cache),
4486 4510 but it's overall far cleaner than before.
4487 4511
4488 4512 * IPython/genutils.py (getoutputerror): modified to add verbose,
4489 4513 debug and header options. This makes the interface of all getout*
4490 4514 functions uniform.
4491 4515 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4492 4516
4493 4517 * IPython/Magic.py (Magic.default_option): added a function to
4494 4518 allow registering default options for any magic command. This
4495 4519 makes it easy to have profiles which customize the magics globally
4496 4520 for a certain use. The values set through this function are
4497 4521 picked up by the parse_options() method, which all magics should
4498 4522 use to parse their options.
4499 4523
4500 4524 * IPython/genutils.py (warn): modified the warnings framework to
4501 4525 use the Term I/O class. I'm trying to slowly unify all of
4502 4526 IPython's I/O operations to pass through Term.
4503 4527
4504 4528 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4505 4529 the secondary prompt to correctly match the length of the primary
4506 4530 one for any prompt. Now multi-line code will properly line up
4507 4531 even for path dependent prompts, such as the new ones available
4508 4532 via the prompt_specials.
4509 4533
4510 4534 2004-06-06 Fernando Perez <fperez@colorado.edu>
4511 4535
4512 4536 * IPython/Prompts.py (prompt_specials): Added the ability to have
4513 4537 bash-like special sequences in the prompts, which get
4514 4538 automatically expanded. Things like hostname, current working
4515 4539 directory and username are implemented already, but it's easy to
4516 4540 add more in the future. Thanks to a patch by W.J. van der Laan
4517 4541 <gnufnork-AT-hetdigitalegat.nl>
4518 4542 (prompt_specials): Added color support for prompt strings, so
4519 4543 users can define arbitrary color setups for their prompts.
4520 4544
4521 4545 2004-06-05 Fernando Perez <fperez@colorado.edu>
4522 4546
4523 4547 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4524 4548 code to load Gary Bishop's readline and configure it
4525 4549 automatically. Thanks to Gary for help on this.
4526 4550
4527 4551 2004-06-01 Fernando Perez <fperez@colorado.edu>
4528 4552
4529 4553 * IPython/Logger.py (Logger.create_log): fix bug for logging
4530 4554 with no filename (previous fix was incomplete).
4531 4555
4532 4556 2004-05-25 Fernando Perez <fperez@colorado.edu>
4533 4557
4534 4558 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4535 4559 parens would get passed to the shell.
4536 4560
4537 4561 2004-05-20 Fernando Perez <fperez@colorado.edu>
4538 4562
4539 4563 * IPython/Magic.py (Magic.magic_prun): changed default profile
4540 4564 sort order to 'time' (the more common profiling need).
4541 4565
4542 4566 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4543 4567 so that source code shown is guaranteed in sync with the file on
4544 4568 disk (also changed in psource). Similar fix to the one for
4545 4569 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4546 4570 <yann.ledu-AT-noos.fr>.
4547 4571
4548 4572 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4549 4573 with a single option would not be correctly parsed. Closes
4550 4574 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4551 4575 introduced in 0.6.0 (on 2004-05-06).
4552 4576
4553 4577 2004-05-13 *** Released version 0.6.0
4554 4578
4555 4579 2004-05-13 Fernando Perez <fperez@colorado.edu>
4556 4580
4557 4581 * debian/: Added debian/ directory to CVS, so that debian support
4558 4582 is publicly accessible. The debian package is maintained by Jack
4559 4583 Moffit <jack-AT-xiph.org>.
4560 4584
4561 4585 * Documentation: included the notes about an ipython-based system
4562 4586 shell (the hypothetical 'pysh') into the new_design.pdf document,
4563 4587 so that these ideas get distributed to users along with the
4564 4588 official documentation.
4565 4589
4566 4590 2004-05-10 Fernando Perez <fperez@colorado.edu>
4567 4591
4568 4592 * IPython/Logger.py (Logger.create_log): fix recently introduced
4569 4593 bug (misindented line) where logstart would fail when not given an
4570 4594 explicit filename.
4571 4595
4572 4596 2004-05-09 Fernando Perez <fperez@colorado.edu>
4573 4597
4574 4598 * IPython/Magic.py (Magic.parse_options): skip system call when
4575 4599 there are no options to look for. Faster, cleaner for the common
4576 4600 case.
4577 4601
4578 4602 * Documentation: many updates to the manual: describing Windows
4579 4603 support better, Gnuplot updates, credits, misc small stuff. Also
4580 4604 updated the new_design doc a bit.
4581 4605
4582 4606 2004-05-06 *** Released version 0.6.0.rc1
4583 4607
4584 4608 2004-05-06 Fernando Perez <fperez@colorado.edu>
4585 4609
4586 4610 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4587 4611 operations to use the vastly more efficient list/''.join() method.
4588 4612 (FormattedTB.text): Fix
4589 4613 http://www.scipy.net/roundup/ipython/issue12 - exception source
4590 4614 extract not updated after reload. Thanks to Mike Salib
4591 4615 <msalib-AT-mit.edu> for pinning the source of the problem.
4592 4616 Fortunately, the solution works inside ipython and doesn't require
4593 4617 any changes to python proper.
4594 4618
4595 4619 * IPython/Magic.py (Magic.parse_options): Improved to process the
4596 4620 argument list as a true shell would (by actually using the
4597 4621 underlying system shell). This way, all @magics automatically get
4598 4622 shell expansion for variables. Thanks to a comment by Alex
4599 4623 Schmolck.
4600 4624
4601 4625 2004-04-04 Fernando Perez <fperez@colorado.edu>
4602 4626
4603 4627 * IPython/iplib.py (InteractiveShell.interact): Added a special
4604 4628 trap for a debugger quit exception, which is basically impossible
4605 4629 to handle by normal mechanisms, given what pdb does to the stack.
4606 4630 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4607 4631
4608 4632 2004-04-03 Fernando Perez <fperez@colorado.edu>
4609 4633
4610 4634 * IPython/genutils.py (Term): Standardized the names of the Term
4611 4635 class streams to cin/cout/cerr, following C++ naming conventions
4612 4636 (I can't use in/out/err because 'in' is not a valid attribute
4613 4637 name).
4614 4638
4615 4639 * IPython/iplib.py (InteractiveShell.interact): don't increment
4616 4640 the prompt if there's no user input. By Daniel 'Dang' Griffith
4617 4641 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4618 4642 Francois Pinard.
4619 4643
4620 4644 2004-04-02 Fernando Perez <fperez@colorado.edu>
4621 4645
4622 4646 * IPython/genutils.py (Stream.__init__): Modified to survive at
4623 4647 least importing in contexts where stdin/out/err aren't true file
4624 4648 objects, such as PyCrust (they lack fileno() and mode). However,
4625 4649 the recovery facilities which rely on these things existing will
4626 4650 not work.
4627 4651
4628 4652 2004-04-01 Fernando Perez <fperez@colorado.edu>
4629 4653
4630 4654 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4631 4655 use the new getoutputerror() function, so it properly
4632 4656 distinguishes stdout/err.
4633 4657
4634 4658 * IPython/genutils.py (getoutputerror): added a function to
4635 4659 capture separately the standard output and error of a command.
4636 4660 After a comment from dang on the mailing lists. This code is
4637 4661 basically a modified version of commands.getstatusoutput(), from
4638 4662 the standard library.
4639 4663
4640 4664 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4641 4665 '!!' as a special syntax (shorthand) to access @sx.
4642 4666
4643 4667 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4644 4668 command and return its output as a list split on '\n'.
4645 4669
4646 4670 2004-03-31 Fernando Perez <fperez@colorado.edu>
4647 4671
4648 4672 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4649 4673 method to dictionaries used as FakeModule instances if they lack
4650 4674 it. At least pydoc in python2.3 breaks for runtime-defined
4651 4675 functions without this hack. At some point I need to _really_
4652 4676 understand what FakeModule is doing, because it's a gross hack.
4653 4677 But it solves Arnd's problem for now...
4654 4678
4655 4679 2004-02-27 Fernando Perez <fperez@colorado.edu>
4656 4680
4657 4681 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4658 4682 mode would behave erratically. Also increased the number of
4659 4683 possible logs in rotate mod to 999. Thanks to Rod Holland
4660 4684 <rhh@StructureLABS.com> for the report and fixes.
4661 4685
4662 4686 2004-02-26 Fernando Perez <fperez@colorado.edu>
4663 4687
4664 4688 * IPython/genutils.py (page): Check that the curses module really
4665 4689 has the initscr attribute before trying to use it. For some
4666 4690 reason, the Solaris curses module is missing this. I think this
4667 4691 should be considered a Solaris python bug, but I'm not sure.
4668 4692
4669 4693 2004-01-17 Fernando Perez <fperez@colorado.edu>
4670 4694
4671 4695 * IPython/genutils.py (Stream.__init__): Changes to try to make
4672 4696 ipython robust against stdin/out/err being closed by the user.
4673 4697 This is 'user error' (and blocks a normal python session, at least
4674 4698 the stdout case). However, Ipython should be able to survive such
4675 4699 instances of abuse as gracefully as possible. To simplify the
4676 4700 coding and maintain compatibility with Gary Bishop's Term
4677 4701 contributions, I've made use of classmethods for this. I think
4678 4702 this introduces a dependency on python 2.2.
4679 4703
4680 4704 2004-01-13 Fernando Perez <fperez@colorado.edu>
4681 4705
4682 4706 * IPython/numutils.py (exp_safe): simplified the code a bit and
4683 4707 removed the need for importing the kinds module altogether.
4684 4708
4685 4709 2004-01-06 Fernando Perez <fperez@colorado.edu>
4686 4710
4687 4711 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4688 4712 a magic function instead, after some community feedback. No
4689 4713 special syntax will exist for it, but its name is deliberately
4690 4714 very short.
4691 4715
4692 4716 2003-12-20 Fernando Perez <fperez@colorado.edu>
4693 4717
4694 4718 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4695 4719 new functionality, to automagically assign the result of a shell
4696 4720 command to a variable. I'll solicit some community feedback on
4697 4721 this before making it permanent.
4698 4722
4699 4723 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4700 4724 requested about callables for which inspect couldn't obtain a
4701 4725 proper argspec. Thanks to a crash report sent by Etienne
4702 4726 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4703 4727
4704 4728 2003-12-09 Fernando Perez <fperez@colorado.edu>
4705 4729
4706 4730 * IPython/genutils.py (page): patch for the pager to work across
4707 4731 various versions of Windows. By Gary Bishop.
4708 4732
4709 4733 2003-12-04 Fernando Perez <fperez@colorado.edu>
4710 4734
4711 4735 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4712 4736 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4713 4737 While I tested this and it looks ok, there may still be corner
4714 4738 cases I've missed.
4715 4739
4716 4740 2003-12-01 Fernando Perez <fperez@colorado.edu>
4717 4741
4718 4742 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4719 4743 where a line like 'p,q=1,2' would fail because the automagic
4720 4744 system would be triggered for @p.
4721 4745
4722 4746 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4723 4747 cleanups, code unmodified.
4724 4748
4725 4749 * IPython/genutils.py (Term): added a class for IPython to handle
4726 4750 output. In most cases it will just be a proxy for stdout/err, but
4727 4751 having this allows modifications to be made for some platforms,
4728 4752 such as handling color escapes under Windows. All of this code
4729 4753 was contributed by Gary Bishop, with minor modifications by me.
4730 4754 The actual changes affect many files.
4731 4755
4732 4756 2003-11-30 Fernando Perez <fperez@colorado.edu>
4733 4757
4734 4758 * IPython/iplib.py (file_matches): new completion code, courtesy
4735 4759 of Jeff Collins. This enables filename completion again under
4736 4760 python 2.3, which disabled it at the C level.
4737 4761
4738 4762 2003-11-11 Fernando Perez <fperez@colorado.edu>
4739 4763
4740 4764 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4741 4765 for Numeric.array(map(...)), but often convenient.
4742 4766
4743 4767 2003-11-05 Fernando Perez <fperez@colorado.edu>
4744 4768
4745 4769 * IPython/numutils.py (frange): Changed a call from int() to
4746 4770 int(round()) to prevent a problem reported with arange() in the
4747 4771 numpy list.
4748 4772
4749 4773 2003-10-06 Fernando Perez <fperez@colorado.edu>
4750 4774
4751 4775 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4752 4776 prevent crashes if sys lacks an argv attribute (it happens with
4753 4777 embedded interpreters which build a bare-bones sys module).
4754 4778 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4755 4779
4756 4780 2003-09-24 Fernando Perez <fperez@colorado.edu>
4757 4781
4758 4782 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4759 4783 to protect against poorly written user objects where __getattr__
4760 4784 raises exceptions other than AttributeError. Thanks to a bug
4761 4785 report by Oliver Sander <osander-AT-gmx.de>.
4762 4786
4763 4787 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4764 4788 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4765 4789
4766 4790 2003-09-09 Fernando Perez <fperez@colorado.edu>
4767 4791
4768 4792 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4769 4793 unpacking a list whith a callable as first element would
4770 4794 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4771 4795 Collins.
4772 4796
4773 4797 2003-08-25 *** Released version 0.5.0
4774 4798
4775 4799 2003-08-22 Fernando Perez <fperez@colorado.edu>
4776 4800
4777 4801 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4778 4802 improperly defined user exceptions. Thanks to feedback from Mark
4779 4803 Russell <mrussell-AT-verio.net>.
4780 4804
4781 4805 2003-08-20 Fernando Perez <fperez@colorado.edu>
4782 4806
4783 4807 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4784 4808 printing so that it would print multi-line string forms starting
4785 4809 with a new line. This way the formatting is better respected for
4786 4810 objects which work hard to make nice string forms.
4787 4811
4788 4812 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4789 4813 autocall would overtake data access for objects with both
4790 4814 __getitem__ and __call__.
4791 4815
4792 4816 2003-08-19 *** Released version 0.5.0-rc1
4793 4817
4794 4818 2003-08-19 Fernando Perez <fperez@colorado.edu>
4795 4819
4796 4820 * IPython/deep_reload.py (load_tail): single tiny change here
4797 4821 seems to fix the long-standing bug of dreload() failing to work
4798 4822 for dotted names. But this module is pretty tricky, so I may have
4799 4823 missed some subtlety. Needs more testing!.
4800 4824
4801 4825 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4802 4826 exceptions which have badly implemented __str__ methods.
4803 4827 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4804 4828 which I've been getting reports about from Python 2.3 users. I
4805 4829 wish I had a simple test case to reproduce the problem, so I could
4806 4830 either write a cleaner workaround or file a bug report if
4807 4831 necessary.
4808 4832
4809 4833 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4810 4834 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4811 4835 a bug report by Tjabo Kloppenburg.
4812 4836
4813 4837 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4814 4838 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4815 4839 seems rather unstable. Thanks to a bug report by Tjabo
4816 4840 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4817 4841
4818 4842 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4819 4843 this out soon because of the critical fixes in the inner loop for
4820 4844 generators.
4821 4845
4822 4846 * IPython/Magic.py (Magic.getargspec): removed. This (and
4823 4847 _get_def) have been obsoleted by OInspect for a long time, I
4824 4848 hadn't noticed that they were dead code.
4825 4849 (Magic._ofind): restored _ofind functionality for a few literals
4826 4850 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4827 4851 for things like "hello".capitalize?, since that would require a
4828 4852 potentially dangerous eval() again.
4829 4853
4830 4854 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4831 4855 logic a bit more to clean up the escapes handling and minimize the
4832 4856 use of _ofind to only necessary cases. The interactive 'feel' of
4833 4857 IPython should have improved quite a bit with the changes in
4834 4858 _prefilter and _ofind (besides being far safer than before).
4835 4859
4836 4860 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4837 4861 obscure, never reported). Edit would fail to find the object to
4838 4862 edit under some circumstances.
4839 4863 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4840 4864 which were causing double-calling of generators. Those eval calls
4841 4865 were _very_ dangerous, since code with side effects could be
4842 4866 triggered. As they say, 'eval is evil'... These were the
4843 4867 nastiest evals in IPython. Besides, _ofind is now far simpler,
4844 4868 and it should also be quite a bit faster. Its use of inspect is
4845 4869 also safer, so perhaps some of the inspect-related crashes I've
4846 4870 seen lately with Python 2.3 might be taken care of. That will
4847 4871 need more testing.
4848 4872
4849 4873 2003-08-17 Fernando Perez <fperez@colorado.edu>
4850 4874
4851 4875 * IPython/iplib.py (InteractiveShell._prefilter): significant
4852 4876 simplifications to the logic for handling user escapes. Faster
4853 4877 and simpler code.
4854 4878
4855 4879 2003-08-14 Fernando Perez <fperez@colorado.edu>
4856 4880
4857 4881 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4858 4882 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4859 4883 but it should be quite a bit faster. And the recursive version
4860 4884 generated O(log N) intermediate storage for all rank>1 arrays,
4861 4885 even if they were contiguous.
4862 4886 (l1norm): Added this function.
4863 4887 (norm): Added this function for arbitrary norms (including
4864 4888 l-infinity). l1 and l2 are still special cases for convenience
4865 4889 and speed.
4866 4890
4867 4891 2003-08-03 Fernando Perez <fperez@colorado.edu>
4868 4892
4869 4893 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4870 4894 exceptions, which now raise PendingDeprecationWarnings in Python
4871 4895 2.3. There were some in Magic and some in Gnuplot2.
4872 4896
4873 4897 2003-06-30 Fernando Perez <fperez@colorado.edu>
4874 4898
4875 4899 * IPython/genutils.py (page): modified to call curses only for
4876 4900 terminals where TERM=='xterm'. After problems under many other
4877 4901 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4878 4902
4879 4903 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4880 4904 would be triggered when readline was absent. This was just an old
4881 4905 debugging statement I'd forgotten to take out.
4882 4906
4883 4907 2003-06-20 Fernando Perez <fperez@colorado.edu>
4884 4908
4885 4909 * IPython/genutils.py (clock): modified to return only user time
4886 4910 (not counting system time), after a discussion on scipy. While
4887 4911 system time may be a useful quantity occasionally, it may much
4888 4912 more easily be skewed by occasional swapping or other similar
4889 4913 activity.
4890 4914
4891 4915 2003-06-05 Fernando Perez <fperez@colorado.edu>
4892 4916
4893 4917 * IPython/numutils.py (identity): new function, for building
4894 4918 arbitrary rank Kronecker deltas (mostly backwards compatible with
4895 4919 Numeric.identity)
4896 4920
4897 4921 2003-06-03 Fernando Perez <fperez@colorado.edu>
4898 4922
4899 4923 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4900 4924 arguments passed to magics with spaces, to allow trailing '\' to
4901 4925 work normally (mainly for Windows users).
4902 4926
4903 4927 2003-05-29 Fernando Perez <fperez@colorado.edu>
4904 4928
4905 4929 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4906 4930 instead of pydoc.help. This fixes a bizarre behavior where
4907 4931 printing '%s' % locals() would trigger the help system. Now
4908 4932 ipython behaves like normal python does.
4909 4933
4910 4934 Note that if one does 'from pydoc import help', the bizarre
4911 4935 behavior returns, but this will also happen in normal python, so
4912 4936 it's not an ipython bug anymore (it has to do with how pydoc.help
4913 4937 is implemented).
4914 4938
4915 4939 2003-05-22 Fernando Perez <fperez@colorado.edu>
4916 4940
4917 4941 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4918 4942 return [] instead of None when nothing matches, also match to end
4919 4943 of line. Patch by Gary Bishop.
4920 4944
4921 4945 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4922 4946 protection as before, for files passed on the command line. This
4923 4947 prevents the CrashHandler from kicking in if user files call into
4924 4948 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4925 4949 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4926 4950
4927 4951 2003-05-20 *** Released version 0.4.0
4928 4952
4929 4953 2003-05-20 Fernando Perez <fperez@colorado.edu>
4930 4954
4931 4955 * setup.py: added support for manpages. It's a bit hackish b/c of
4932 4956 a bug in the way the bdist_rpm distutils target handles gzipped
4933 4957 manpages, but it works. After a patch by Jack.
4934 4958
4935 4959 2003-05-19 Fernando Perez <fperez@colorado.edu>
4936 4960
4937 4961 * IPython/numutils.py: added a mockup of the kinds module, since
4938 4962 it was recently removed from Numeric. This way, numutils will
4939 4963 work for all users even if they are missing kinds.
4940 4964
4941 4965 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4942 4966 failure, which can occur with SWIG-wrapped extensions. After a
4943 4967 crash report from Prabhu.
4944 4968
4945 4969 2003-05-16 Fernando Perez <fperez@colorado.edu>
4946 4970
4947 4971 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4948 4972 protect ipython from user code which may call directly
4949 4973 sys.excepthook (this looks like an ipython crash to the user, even
4950 4974 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4951 4975 This is especially important to help users of WxWindows, but may
4952 4976 also be useful in other cases.
4953 4977
4954 4978 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4955 4979 an optional tb_offset to be specified, and to preserve exception
4956 4980 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4957 4981
4958 4982 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4959 4983
4960 4984 2003-05-15 Fernando Perez <fperez@colorado.edu>
4961 4985
4962 4986 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4963 4987 installing for a new user under Windows.
4964 4988
4965 4989 2003-05-12 Fernando Perez <fperez@colorado.edu>
4966 4990
4967 4991 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4968 4992 handler for Emacs comint-based lines. Currently it doesn't do
4969 4993 much (but importantly, it doesn't update the history cache). In
4970 4994 the future it may be expanded if Alex needs more functionality
4971 4995 there.
4972 4996
4973 4997 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4974 4998 info to crash reports.
4975 4999
4976 5000 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4977 5001 just like Python's -c. Also fixed crash with invalid -color
4978 5002 option value at startup. Thanks to Will French
4979 5003 <wfrench-AT-bestweb.net> for the bug report.
4980 5004
4981 5005 2003-05-09 Fernando Perez <fperez@colorado.edu>
4982 5006
4983 5007 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4984 5008 to EvalDict (it's a mapping, after all) and simplified its code
4985 5009 quite a bit, after a nice discussion on c.l.py where Gustavo
4986 5010 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4987 5011
4988 5012 2003-04-30 Fernando Perez <fperez@colorado.edu>
4989 5013
4990 5014 * IPython/genutils.py (timings_out): modified it to reduce its
4991 5015 overhead in the common reps==1 case.
4992 5016
4993 5017 2003-04-29 Fernando Perez <fperez@colorado.edu>
4994 5018
4995 5019 * IPython/genutils.py (timings_out): Modified to use the resource
4996 5020 module, which avoids the wraparound problems of time.clock().
4997 5021
4998 5022 2003-04-17 *** Released version 0.2.15pre4
4999 5023
5000 5024 2003-04-17 Fernando Perez <fperez@colorado.edu>
5001 5025
5002 5026 * setup.py (scriptfiles): Split windows-specific stuff over to a
5003 5027 separate file, in an attempt to have a Windows GUI installer.
5004 5028 That didn't work, but part of the groundwork is done.
5005 5029
5006 5030 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
5007 5031 indent/unindent with 4 spaces. Particularly useful in combination
5008 5032 with the new auto-indent option.
5009 5033
5010 5034 2003-04-16 Fernando Perez <fperez@colorado.edu>
5011 5035
5012 5036 * IPython/Magic.py: various replacements of self.rc for
5013 5037 self.shell.rc. A lot more remains to be done to fully disentangle
5014 5038 this class from the main Shell class.
5015 5039
5016 5040 * IPython/GnuplotRuntime.py: added checks for mouse support so
5017 5041 that we don't try to enable it if the current gnuplot doesn't
5018 5042 really support it. Also added checks so that we don't try to
5019 5043 enable persist under Windows (where Gnuplot doesn't recognize the
5020 5044 option).
5021 5045
5022 5046 * IPython/iplib.py (InteractiveShell.interact): Added optional
5023 5047 auto-indenting code, after a patch by King C. Shu
5024 5048 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
5025 5049 get along well with pasting indented code. If I ever figure out
5026 5050 how to make that part go well, it will become on by default.
5027 5051
5028 5052 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
5029 5053 crash ipython if there was an unmatched '%' in the user's prompt
5030 5054 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5031 5055
5032 5056 * IPython/iplib.py (InteractiveShell.interact): removed the
5033 5057 ability to ask the user whether he wants to crash or not at the
5034 5058 'last line' exception handler. Calling functions at that point
5035 5059 changes the stack, and the error reports would have incorrect
5036 5060 tracebacks.
5037 5061
5038 5062 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
5039 5063 pass through a peger a pretty-printed form of any object. After a
5040 5064 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
5041 5065
5042 5066 2003-04-14 Fernando Perez <fperez@colorado.edu>
5043 5067
5044 5068 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
5045 5069 all files in ~ would be modified at first install (instead of
5046 5070 ~/.ipython). This could be potentially disastrous, as the
5047 5071 modification (make line-endings native) could damage binary files.
5048 5072
5049 5073 2003-04-10 Fernando Perez <fperez@colorado.edu>
5050 5074
5051 5075 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
5052 5076 handle only lines which are invalid python. This now means that
5053 5077 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
5054 5078 for the bug report.
5055 5079
5056 5080 2003-04-01 Fernando Perez <fperez@colorado.edu>
5057 5081
5058 5082 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
5059 5083 where failing to set sys.last_traceback would crash pdb.pm().
5060 5084 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
5061 5085 report.
5062 5086
5063 5087 2003-03-25 Fernando Perez <fperez@colorado.edu>
5064 5088
5065 5089 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
5066 5090 before printing it (it had a lot of spurious blank lines at the
5067 5091 end).
5068 5092
5069 5093 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
5070 5094 output would be sent 21 times! Obviously people don't use this
5071 5095 too often, or I would have heard about it.
5072 5096
5073 5097 2003-03-24 Fernando Perez <fperez@colorado.edu>
5074 5098
5075 5099 * setup.py (scriptfiles): renamed the data_files parameter from
5076 5100 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
5077 5101 for the patch.
5078 5102
5079 5103 2003-03-20 Fernando Perez <fperez@colorado.edu>
5080 5104
5081 5105 * IPython/genutils.py (error): added error() and fatal()
5082 5106 functions.
5083 5107
5084 5108 2003-03-18 *** Released version 0.2.15pre3
5085 5109
5086 5110 2003-03-18 Fernando Perez <fperez@colorado.edu>
5087 5111
5088 5112 * setupext/install_data_ext.py
5089 5113 (install_data_ext.initialize_options): Class contributed by Jack
5090 5114 Moffit for fixing the old distutils hack. He is sending this to
5091 5115 the distutils folks so in the future we may not need it as a
5092 5116 private fix.
5093 5117
5094 5118 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
5095 5119 changes for Debian packaging. See his patch for full details.
5096 5120 The old distutils hack of making the ipythonrc* files carry a
5097 5121 bogus .py extension is gone, at last. Examples were moved to a
5098 5122 separate subdir under doc/, and the separate executable scripts
5099 5123 now live in their own directory. Overall a great cleanup. The
5100 5124 manual was updated to use the new files, and setup.py has been
5101 5125 fixed for this setup.
5102 5126
5103 5127 * IPython/PyColorize.py (Parser.usage): made non-executable and
5104 5128 created a pycolor wrapper around it to be included as a script.
5105 5129
5106 5130 2003-03-12 *** Released version 0.2.15pre2
5107 5131
5108 5132 2003-03-12 Fernando Perez <fperez@colorado.edu>
5109 5133
5110 5134 * IPython/ColorANSI.py (make_color_table): Finally fixed the
5111 5135 long-standing problem with garbage characters in some terminals.
5112 5136 The issue was really that the \001 and \002 escapes must _only_ be
5113 5137 passed to input prompts (which call readline), but _never_ to
5114 5138 normal text to be printed on screen. I changed ColorANSI to have
5115 5139 two classes: TermColors and InputTermColors, each with the
5116 5140 appropriate escapes for input prompts or normal text. The code in
5117 5141 Prompts.py got slightly more complicated, but this very old and
5118 5142 annoying bug is finally fixed.
5119 5143
5120 5144 All the credit for nailing down the real origin of this problem
5121 5145 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
5122 5146 *Many* thanks to him for spending quite a bit of effort on this.
5123 5147
5124 5148 2003-03-05 *** Released version 0.2.15pre1
5125 5149
5126 5150 2003-03-03 Fernando Perez <fperez@colorado.edu>
5127 5151
5128 5152 * IPython/FakeModule.py: Moved the former _FakeModule to a
5129 5153 separate file, because it's also needed by Magic (to fix a similar
5130 5154 pickle-related issue in @run).
5131 5155
5132 5156 2003-03-02 Fernando Perez <fperez@colorado.edu>
5133 5157
5134 5158 * IPython/Magic.py (Magic.magic_autocall): new magic to control
5135 5159 the autocall option at runtime.
5136 5160 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
5137 5161 across Magic.py to start separating Magic from InteractiveShell.
5138 5162 (Magic._ofind): Fixed to return proper namespace for dotted
5139 5163 names. Before, a dotted name would always return 'not currently
5140 5164 defined', because it would find the 'parent'. s.x would be found,
5141 5165 but since 'x' isn't defined by itself, it would get confused.
5142 5166 (Magic.magic_run): Fixed pickling problems reported by Ralf
5143 5167 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
5144 5168 that I'd used when Mike Heeter reported similar issues at the
5145 5169 top-level, but now for @run. It boils down to injecting the
5146 5170 namespace where code is being executed with something that looks
5147 5171 enough like a module to fool pickle.dump(). Since a pickle stores
5148 5172 a named reference to the importing module, we need this for
5149 5173 pickles to save something sensible.
5150 5174
5151 5175 * IPython/ipmaker.py (make_IPython): added an autocall option.
5152 5176
5153 5177 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
5154 5178 the auto-eval code. Now autocalling is an option, and the code is
5155 5179 also vastly safer. There is no more eval() involved at all.
5156 5180
5157 5181 2003-03-01 Fernando Perez <fperez@colorado.edu>
5158 5182
5159 5183 * IPython/Magic.py (Magic._ofind): Changed interface to return a
5160 5184 dict with named keys instead of a tuple.
5161 5185
5162 5186 * IPython: Started using CVS for IPython as of 0.2.15pre1.
5163 5187
5164 5188 * setup.py (make_shortcut): Fixed message about directories
5165 5189 created during Windows installation (the directories were ok, just
5166 5190 the printed message was misleading). Thanks to Chris Liechti
5167 5191 <cliechti-AT-gmx.net> for the heads up.
5168 5192
5169 5193 2003-02-21 Fernando Perez <fperez@colorado.edu>
5170 5194
5171 5195 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
5172 5196 of ValueError exception when checking for auto-execution. This
5173 5197 one is raised by things like Numeric arrays arr.flat when the
5174 5198 array is non-contiguous.
5175 5199
5176 5200 2003-01-31 Fernando Perez <fperez@colorado.edu>
5177 5201
5178 5202 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
5179 5203 not return any value at all (even though the command would get
5180 5204 executed).
5181 5205 (xsys): Flush stdout right after printing the command to ensure
5182 5206 proper ordering of commands and command output in the total
5183 5207 output.
5184 5208 (SystemExec/xsys/bq): Switched the names of xsys/bq and
5185 5209 system/getoutput as defaults. The old ones are kept for
5186 5210 compatibility reasons, so no code which uses this library needs
5187 5211 changing.
5188 5212
5189 5213 2003-01-27 *** Released version 0.2.14
5190 5214
5191 5215 2003-01-25 Fernando Perez <fperez@colorado.edu>
5192 5216
5193 5217 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
5194 5218 functions defined in previous edit sessions could not be re-edited
5195 5219 (because the temp files were immediately removed). Now temp files
5196 5220 are removed only at IPython's exit.
5197 5221 (Magic.magic_run): Improved @run to perform shell-like expansions
5198 5222 on its arguments (~users and $VARS). With this, @run becomes more
5199 5223 like a normal command-line.
5200 5224
5201 5225 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
5202 5226 bugs related to embedding and cleaned up that code. A fairly
5203 5227 important one was the impossibility to access the global namespace
5204 5228 through the embedded IPython (only local variables were visible).
5205 5229
5206 5230 2003-01-14 Fernando Perez <fperez@colorado.edu>
5207 5231
5208 5232 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
5209 5233 auto-calling to be a bit more conservative. Now it doesn't get
5210 5234 triggered if any of '!=()<>' are in the rest of the input line, to
5211 5235 allow comparing callables. Thanks to Alex for the heads up.
5212 5236
5213 5237 2003-01-07 Fernando Perez <fperez@colorado.edu>
5214 5238
5215 5239 * IPython/genutils.py (page): fixed estimation of the number of
5216 5240 lines in a string to be paged to simply count newlines. This
5217 5241 prevents over-guessing due to embedded escape sequences. A better
5218 5242 long-term solution would involve stripping out the control chars
5219 5243 for the count, but it's potentially so expensive I just don't
5220 5244 think it's worth doing.
5221 5245
5222 5246 2002-12-19 *** Released version 0.2.14pre50
5223 5247
5224 5248 2002-12-19 Fernando Perez <fperez@colorado.edu>
5225 5249
5226 5250 * tools/release (version): Changed release scripts to inform
5227 5251 Andrea and build a NEWS file with a list of recent changes.
5228 5252
5229 5253 * IPython/ColorANSI.py (__all__): changed terminal detection
5230 5254 code. Seems to work better for xterms without breaking
5231 5255 konsole. Will need more testing to determine if WinXP and Mac OSX
5232 5256 also work ok.
5233 5257
5234 5258 2002-12-18 *** Released version 0.2.14pre49
5235 5259
5236 5260 2002-12-18 Fernando Perez <fperez@colorado.edu>
5237 5261
5238 5262 * Docs: added new info about Mac OSX, from Andrea.
5239 5263
5240 5264 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5241 5265 allow direct plotting of python strings whose format is the same
5242 5266 of gnuplot data files.
5243 5267
5244 5268 2002-12-16 Fernando Perez <fperez@colorado.edu>
5245 5269
5246 5270 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5247 5271 value of exit question to be acknowledged.
5248 5272
5249 5273 2002-12-03 Fernando Perez <fperez@colorado.edu>
5250 5274
5251 5275 * IPython/ipmaker.py: removed generators, which had been added
5252 5276 by mistake in an earlier debugging run. This was causing trouble
5253 5277 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5254 5278 for pointing this out.
5255 5279
5256 5280 2002-11-17 Fernando Perez <fperez@colorado.edu>
5257 5281
5258 5282 * Manual: updated the Gnuplot section.
5259 5283
5260 5284 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5261 5285 a much better split of what goes in Runtime and what goes in
5262 5286 Interactive.
5263 5287
5264 5288 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5265 5289 being imported from iplib.
5266 5290
5267 5291 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5268 5292 for command-passing. Now the global Gnuplot instance is called
5269 5293 'gp' instead of 'g', which was really a far too fragile and
5270 5294 common name.
5271 5295
5272 5296 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5273 5297 bounding boxes generated by Gnuplot for square plots.
5274 5298
5275 5299 * IPython/genutils.py (popkey): new function added. I should
5276 5300 suggest this on c.l.py as a dict method, it seems useful.
5277 5301
5278 5302 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5279 5303 to transparently handle PostScript generation. MUCH better than
5280 5304 the previous plot_eps/replot_eps (which I removed now). The code
5281 5305 is also fairly clean and well documented now (including
5282 5306 docstrings).
5283 5307
5284 5308 2002-11-13 Fernando Perez <fperez@colorado.edu>
5285 5309
5286 5310 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5287 5311 (inconsistent with options).
5288 5312
5289 5313 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5290 5314 manually disabled, I don't know why. Fixed it.
5291 5315 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5292 5316 eps output.
5293 5317
5294 5318 2002-11-12 Fernando Perez <fperez@colorado.edu>
5295 5319
5296 5320 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5297 5321 don't propagate up to caller. Fixes crash reported by François
5298 5322 Pinard.
5299 5323
5300 5324 2002-11-09 Fernando Perez <fperez@colorado.edu>
5301 5325
5302 5326 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5303 5327 history file for new users.
5304 5328 (make_IPython): fixed bug where initial install would leave the
5305 5329 user running in the .ipython dir.
5306 5330 (make_IPython): fixed bug where config dir .ipython would be
5307 5331 created regardless of the given -ipythondir option. Thanks to Cory
5308 5332 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5309 5333
5310 5334 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5311 5335 type confirmations. Will need to use it in all of IPython's code
5312 5336 consistently.
5313 5337
5314 5338 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5315 5339 context to print 31 lines instead of the default 5. This will make
5316 5340 the crash reports extremely detailed in case the problem is in
5317 5341 libraries I don't have access to.
5318 5342
5319 5343 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5320 5344 line of defense' code to still crash, but giving users fair
5321 5345 warning. I don't want internal errors to go unreported: if there's
5322 5346 an internal problem, IPython should crash and generate a full
5323 5347 report.
5324 5348
5325 5349 2002-11-08 Fernando Perez <fperez@colorado.edu>
5326 5350
5327 5351 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5328 5352 otherwise uncaught exceptions which can appear if people set
5329 5353 sys.stdout to something badly broken. Thanks to a crash report
5330 5354 from henni-AT-mail.brainbot.com.
5331 5355
5332 5356 2002-11-04 Fernando Perez <fperez@colorado.edu>
5333 5357
5334 5358 * IPython/iplib.py (InteractiveShell.interact): added
5335 5359 __IPYTHON__active to the builtins. It's a flag which goes on when
5336 5360 the interaction starts and goes off again when it stops. This
5337 5361 allows embedding code to detect being inside IPython. Before this
5338 5362 was done via __IPYTHON__, but that only shows that an IPython
5339 5363 instance has been created.
5340 5364
5341 5365 * IPython/Magic.py (Magic.magic_env): I realized that in a
5342 5366 UserDict, instance.data holds the data as a normal dict. So I
5343 5367 modified @env to return os.environ.data instead of rebuilding a
5344 5368 dict by hand.
5345 5369
5346 5370 2002-11-02 Fernando Perez <fperez@colorado.edu>
5347 5371
5348 5372 * IPython/genutils.py (warn): changed so that level 1 prints no
5349 5373 header. Level 2 is now the default (with 'WARNING' header, as
5350 5374 before). I think I tracked all places where changes were needed in
5351 5375 IPython, but outside code using the old level numbering may have
5352 5376 broken.
5353 5377
5354 5378 * IPython/iplib.py (InteractiveShell.runcode): added this to
5355 5379 handle the tracebacks in SystemExit traps correctly. The previous
5356 5380 code (through interact) was printing more of the stack than
5357 5381 necessary, showing IPython internal code to the user.
5358 5382
5359 5383 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5360 5384 default. Now that the default at the confirmation prompt is yes,
5361 5385 it's not so intrusive. François' argument that ipython sessions
5362 5386 tend to be complex enough not to lose them from an accidental C-d,
5363 5387 is a valid one.
5364 5388
5365 5389 * IPython/iplib.py (InteractiveShell.interact): added a
5366 5390 showtraceback() call to the SystemExit trap, and modified the exit
5367 5391 confirmation to have yes as the default.
5368 5392
5369 5393 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5370 5394 this file. It's been gone from the code for a long time, this was
5371 5395 simply leftover junk.
5372 5396
5373 5397 2002-11-01 Fernando Perez <fperez@colorado.edu>
5374 5398
5375 5399 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5376 5400 added. If set, IPython now traps EOF and asks for
5377 5401 confirmation. After a request by François Pinard.
5378 5402
5379 5403 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5380 5404 of @abort, and with a new (better) mechanism for handling the
5381 5405 exceptions.
5382 5406
5383 5407 2002-10-27 Fernando Perez <fperez@colorado.edu>
5384 5408
5385 5409 * IPython/usage.py (__doc__): updated the --help information and
5386 5410 the ipythonrc file to indicate that -log generates
5387 5411 ./ipython.log. Also fixed the corresponding info in @logstart.
5388 5412 This and several other fixes in the manuals thanks to reports by
5389 5413 François Pinard <pinard-AT-iro.umontreal.ca>.
5390 5414
5391 5415 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5392 5416 refer to @logstart (instead of @log, which doesn't exist).
5393 5417
5394 5418 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5395 5419 AttributeError crash. Thanks to Christopher Armstrong
5396 5420 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5397 5421 introduced recently (in 0.2.14pre37) with the fix to the eval
5398 5422 problem mentioned below.
5399 5423
5400 5424 2002-10-17 Fernando Perez <fperez@colorado.edu>
5401 5425
5402 5426 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5403 5427 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5404 5428
5405 5429 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5406 5430 this function to fix a problem reported by Alex Schmolck. He saw
5407 5431 it with list comprehensions and generators, which were getting
5408 5432 called twice. The real problem was an 'eval' call in testing for
5409 5433 automagic which was evaluating the input line silently.
5410 5434
5411 5435 This is a potentially very nasty bug, if the input has side
5412 5436 effects which must not be repeated. The code is much cleaner now,
5413 5437 without any blanket 'except' left and with a regexp test for
5414 5438 actual function names.
5415 5439
5416 5440 But an eval remains, which I'm not fully comfortable with. I just
5417 5441 don't know how to find out if an expression could be a callable in
5418 5442 the user's namespace without doing an eval on the string. However
5419 5443 that string is now much more strictly checked so that no code
5420 5444 slips by, so the eval should only happen for things that can
5421 5445 really be only function/method names.
5422 5446
5423 5447 2002-10-15 Fernando Perez <fperez@colorado.edu>
5424 5448
5425 5449 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5426 5450 OSX information to main manual, removed README_Mac_OSX file from
5427 5451 distribution. Also updated credits for recent additions.
5428 5452
5429 5453 2002-10-10 Fernando Perez <fperez@colorado.edu>
5430 5454
5431 5455 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5432 5456 terminal-related issues. Many thanks to Andrea Riciputi
5433 5457 <andrea.riciputi-AT-libero.it> for writing it.
5434 5458
5435 5459 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5436 5460 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5437 5461
5438 5462 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5439 5463 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5440 5464 <syver-en-AT-online.no> who both submitted patches for this problem.
5441 5465
5442 5466 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5443 5467 global embedding to make sure that things don't overwrite user
5444 5468 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5445 5469
5446 5470 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5447 5471 compatibility. Thanks to Hayden Callow
5448 5472 <h.callow-AT-elec.canterbury.ac.nz>
5449 5473
5450 5474 2002-10-04 Fernando Perez <fperez@colorado.edu>
5451 5475
5452 5476 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5453 5477 Gnuplot.File objects.
5454 5478
5455 5479 2002-07-23 Fernando Perez <fperez@colorado.edu>
5456 5480
5457 5481 * IPython/genutils.py (timing): Added timings() and timing() for
5458 5482 quick access to the most commonly needed data, the execution
5459 5483 times. Old timing() renamed to timings_out().
5460 5484
5461 5485 2002-07-18 Fernando Perez <fperez@colorado.edu>
5462 5486
5463 5487 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5464 5488 bug with nested instances disrupting the parent's tab completion.
5465 5489
5466 5490 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5467 5491 all_completions code to begin the emacs integration.
5468 5492
5469 5493 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5470 5494 argument to allow titling individual arrays when plotting.
5471 5495
5472 5496 2002-07-15 Fernando Perez <fperez@colorado.edu>
5473 5497
5474 5498 * setup.py (make_shortcut): changed to retrieve the value of
5475 5499 'Program Files' directory from the registry (this value changes in
5476 5500 non-english versions of Windows). Thanks to Thomas Fanslau
5477 5501 <tfanslau-AT-gmx.de> for the report.
5478 5502
5479 5503 2002-07-10 Fernando Perez <fperez@colorado.edu>
5480 5504
5481 5505 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5482 5506 a bug in pdb, which crashes if a line with only whitespace is
5483 5507 entered. Bug report submitted to sourceforge.
5484 5508
5485 5509 2002-07-09 Fernando Perez <fperez@colorado.edu>
5486 5510
5487 5511 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5488 5512 reporting exceptions (it's a bug in inspect.py, I just set a
5489 5513 workaround).
5490 5514
5491 5515 2002-07-08 Fernando Perez <fperez@colorado.edu>
5492 5516
5493 5517 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5494 5518 __IPYTHON__ in __builtins__ to show up in user_ns.
5495 5519
5496 5520 2002-07-03 Fernando Perez <fperez@colorado.edu>
5497 5521
5498 5522 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5499 5523 name from @gp_set_instance to @gp_set_default.
5500 5524
5501 5525 * IPython/ipmaker.py (make_IPython): default editor value set to
5502 5526 '0' (a string), to match the rc file. Otherwise will crash when
5503 5527 .strip() is called on it.
5504 5528
5505 5529
5506 5530 2002-06-28 Fernando Perez <fperez@colorado.edu>
5507 5531
5508 5532 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5509 5533 of files in current directory when a file is executed via
5510 5534 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5511 5535
5512 5536 * setup.py (manfiles): fix for rpm builds, submitted by RA
5513 5537 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5514 5538
5515 5539 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5516 5540 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5517 5541 string!). A. Schmolck caught this one.
5518 5542
5519 5543 2002-06-27 Fernando Perez <fperez@colorado.edu>
5520 5544
5521 5545 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5522 5546 defined files at the cmd line. __name__ wasn't being set to
5523 5547 __main__.
5524 5548
5525 5549 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5526 5550 regular lists and tuples besides Numeric arrays.
5527 5551
5528 5552 * IPython/Prompts.py (CachedOutput.__call__): Added output
5529 5553 supression for input ending with ';'. Similar to Mathematica and
5530 5554 Matlab. The _* vars and Out[] list are still updated, just like
5531 5555 Mathematica behaves.
5532 5556
5533 5557 2002-06-25 Fernando Perez <fperez@colorado.edu>
5534 5558
5535 5559 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5536 5560 .ini extensions for profiels under Windows.
5537 5561
5538 5562 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5539 5563 string form. Fix contributed by Alexander Schmolck
5540 5564 <a.schmolck-AT-gmx.net>
5541 5565
5542 5566 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5543 5567 pre-configured Gnuplot instance.
5544 5568
5545 5569 2002-06-21 Fernando Perez <fperez@colorado.edu>
5546 5570
5547 5571 * IPython/numutils.py (exp_safe): new function, works around the
5548 5572 underflow problems in Numeric.
5549 5573 (log2): New fn. Safe log in base 2: returns exact integer answer
5550 5574 for exact integer powers of 2.
5551 5575
5552 5576 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5553 5577 properly.
5554 5578
5555 5579 2002-06-20 Fernando Perez <fperez@colorado.edu>
5556 5580
5557 5581 * IPython/genutils.py (timing): new function like
5558 5582 Mathematica's. Similar to time_test, but returns more info.
5559 5583
5560 5584 2002-06-18 Fernando Perez <fperez@colorado.edu>
5561 5585
5562 5586 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5563 5587 according to Mike Heeter's suggestions.
5564 5588
5565 5589 2002-06-16 Fernando Perez <fperez@colorado.edu>
5566 5590
5567 5591 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5568 5592 system. GnuplotMagic is gone as a user-directory option. New files
5569 5593 make it easier to use all the gnuplot stuff both from external
5570 5594 programs as well as from IPython. Had to rewrite part of
5571 5595 hardcopy() b/c of a strange bug: often the ps files simply don't
5572 5596 get created, and require a repeat of the command (often several
5573 5597 times).
5574 5598
5575 5599 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5576 5600 resolve output channel at call time, so that if sys.stderr has
5577 5601 been redirected by user this gets honored.
5578 5602
5579 5603 2002-06-13 Fernando Perez <fperez@colorado.edu>
5580 5604
5581 5605 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5582 5606 IPShell. Kept a copy with the old names to avoid breaking people's
5583 5607 embedded code.
5584 5608
5585 5609 * IPython/ipython: simplified it to the bare minimum after
5586 5610 Holger's suggestions. Added info about how to use it in
5587 5611 PYTHONSTARTUP.
5588 5612
5589 5613 * IPython/Shell.py (IPythonShell): changed the options passing
5590 5614 from a string with funky %s replacements to a straight list. Maybe
5591 5615 a bit more typing, but it follows sys.argv conventions, so there's
5592 5616 less special-casing to remember.
5593 5617
5594 5618 2002-06-12 Fernando Perez <fperez@colorado.edu>
5595 5619
5596 5620 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5597 5621 command. Thanks to a suggestion by Mike Heeter.
5598 5622 (Magic.magic_pfile): added behavior to look at filenames if given
5599 5623 arg is not a defined object.
5600 5624 (Magic.magic_save): New @save function to save code snippets. Also
5601 5625 a Mike Heeter idea.
5602 5626
5603 5627 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5604 5628 plot() and replot(). Much more convenient now, especially for
5605 5629 interactive use.
5606 5630
5607 5631 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5608 5632 filenames.
5609 5633
5610 5634 2002-06-02 Fernando Perez <fperez@colorado.edu>
5611 5635
5612 5636 * IPython/Struct.py (Struct.__init__): modified to admit
5613 5637 initialization via another struct.
5614 5638
5615 5639 * IPython/genutils.py (SystemExec.__init__): New stateful
5616 5640 interface to xsys and bq. Useful for writing system scripts.
5617 5641
5618 5642 2002-05-30 Fernando Perez <fperez@colorado.edu>
5619 5643
5620 5644 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5621 5645 documents. This will make the user download smaller (it's getting
5622 5646 too big).
5623 5647
5624 5648 2002-05-29 Fernando Perez <fperez@colorado.edu>
5625 5649
5626 5650 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5627 5651 fix problems with shelve and pickle. Seems to work, but I don't
5628 5652 know if corner cases break it. Thanks to Mike Heeter
5629 5653 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5630 5654
5631 5655 2002-05-24 Fernando Perez <fperez@colorado.edu>
5632 5656
5633 5657 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5634 5658 macros having broken.
5635 5659
5636 5660 2002-05-21 Fernando Perez <fperez@colorado.edu>
5637 5661
5638 5662 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5639 5663 introduced logging bug: all history before logging started was
5640 5664 being written one character per line! This came from the redesign
5641 5665 of the input history as a special list which slices to strings,
5642 5666 not to lists.
5643 5667
5644 5668 2002-05-20 Fernando Perez <fperez@colorado.edu>
5645 5669
5646 5670 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5647 5671 be an attribute of all classes in this module. The design of these
5648 5672 classes needs some serious overhauling.
5649 5673
5650 5674 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5651 5675 which was ignoring '_' in option names.
5652 5676
5653 5677 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5654 5678 'Verbose_novars' to 'Context' and made it the new default. It's a
5655 5679 bit more readable and also safer than verbose.
5656 5680
5657 5681 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5658 5682 triple-quoted strings.
5659 5683
5660 5684 * IPython/OInspect.py (__all__): new module exposing the object
5661 5685 introspection facilities. Now the corresponding magics are dummy
5662 5686 wrappers around this. Having this module will make it much easier
5663 5687 to put these functions into our modified pdb.
5664 5688 This new object inspector system uses the new colorizing module,
5665 5689 so source code and other things are nicely syntax highlighted.
5666 5690
5667 5691 2002-05-18 Fernando Perez <fperez@colorado.edu>
5668 5692
5669 5693 * IPython/ColorANSI.py: Split the coloring tools into a separate
5670 5694 module so I can use them in other code easier (they were part of
5671 5695 ultraTB).
5672 5696
5673 5697 2002-05-17 Fernando Perez <fperez@colorado.edu>
5674 5698
5675 5699 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5676 5700 fixed it to set the global 'g' also to the called instance, as
5677 5701 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5678 5702 user's 'g' variables).
5679 5703
5680 5704 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5681 5705 global variables (aliases to _ih,_oh) so that users which expect
5682 5706 In[5] or Out[7] to work aren't unpleasantly surprised.
5683 5707 (InputList.__getslice__): new class to allow executing slices of
5684 5708 input history directly. Very simple class, complements the use of
5685 5709 macros.
5686 5710
5687 5711 2002-05-16 Fernando Perez <fperez@colorado.edu>
5688 5712
5689 5713 * setup.py (docdirbase): make doc directory be just doc/IPython
5690 5714 without version numbers, it will reduce clutter for users.
5691 5715
5692 5716 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5693 5717 execfile call to prevent possible memory leak. See for details:
5694 5718 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5695 5719
5696 5720 2002-05-15 Fernando Perez <fperez@colorado.edu>
5697 5721
5698 5722 * IPython/Magic.py (Magic.magic_psource): made the object
5699 5723 introspection names be more standard: pdoc, pdef, pfile and
5700 5724 psource. They all print/page their output, and it makes
5701 5725 remembering them easier. Kept old names for compatibility as
5702 5726 aliases.
5703 5727
5704 5728 2002-05-14 Fernando Perez <fperez@colorado.edu>
5705 5729
5706 5730 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5707 5731 what the mouse problem was. The trick is to use gnuplot with temp
5708 5732 files and NOT with pipes (for data communication), because having
5709 5733 both pipes and the mouse on is bad news.
5710 5734
5711 5735 2002-05-13 Fernando Perez <fperez@colorado.edu>
5712 5736
5713 5737 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5714 5738 bug. Information would be reported about builtins even when
5715 5739 user-defined functions overrode them.
5716 5740
5717 5741 2002-05-11 Fernando Perez <fperez@colorado.edu>
5718 5742
5719 5743 * IPython/__init__.py (__all__): removed FlexCompleter from
5720 5744 __all__ so that things don't fail in platforms without readline.
5721 5745
5722 5746 2002-05-10 Fernando Perez <fperez@colorado.edu>
5723 5747
5724 5748 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5725 5749 it requires Numeric, effectively making Numeric a dependency for
5726 5750 IPython.
5727 5751
5728 5752 * Released 0.2.13
5729 5753
5730 5754 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5731 5755 profiler interface. Now all the major options from the profiler
5732 5756 module are directly supported in IPython, both for single
5733 5757 expressions (@prun) and for full programs (@run -p).
5734 5758
5735 5759 2002-05-09 Fernando Perez <fperez@colorado.edu>
5736 5760
5737 5761 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5738 5762 magic properly formatted for screen.
5739 5763
5740 5764 * setup.py (make_shortcut): Changed things to put pdf version in
5741 5765 doc/ instead of doc/manual (had to change lyxport a bit).
5742 5766
5743 5767 * IPython/Magic.py (Profile.string_stats): made profile runs go
5744 5768 through pager (they are long and a pager allows searching, saving,
5745 5769 etc.)
5746 5770
5747 5771 2002-05-08 Fernando Perez <fperez@colorado.edu>
5748 5772
5749 5773 * Released 0.2.12
5750 5774
5751 5775 2002-05-06 Fernando Perez <fperez@colorado.edu>
5752 5776
5753 5777 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5754 5778 introduced); 'hist n1 n2' was broken.
5755 5779 (Magic.magic_pdb): added optional on/off arguments to @pdb
5756 5780 (Magic.magic_run): added option -i to @run, which executes code in
5757 5781 the IPython namespace instead of a clean one. Also added @irun as
5758 5782 an alias to @run -i.
5759 5783
5760 5784 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5761 5785 fixed (it didn't really do anything, the namespaces were wrong).
5762 5786
5763 5787 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5764 5788
5765 5789 * IPython/__init__.py (__all__): Fixed package namespace, now
5766 5790 'import IPython' does give access to IPython.<all> as
5767 5791 expected. Also renamed __release__ to Release.
5768 5792
5769 5793 * IPython/Debugger.py (__license__): created new Pdb class which
5770 5794 functions like a drop-in for the normal pdb.Pdb but does NOT
5771 5795 import readline by default. This way it doesn't muck up IPython's
5772 5796 readline handling, and now tab-completion finally works in the
5773 5797 debugger -- sort of. It completes things globally visible, but the
5774 5798 completer doesn't track the stack as pdb walks it. That's a bit
5775 5799 tricky, and I'll have to implement it later.
5776 5800
5777 5801 2002-05-05 Fernando Perez <fperez@colorado.edu>
5778 5802
5779 5803 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5780 5804 magic docstrings when printed via ? (explicit \'s were being
5781 5805 printed).
5782 5806
5783 5807 * IPython/ipmaker.py (make_IPython): fixed namespace
5784 5808 identification bug. Now variables loaded via logs or command-line
5785 5809 files are recognized in the interactive namespace by @who.
5786 5810
5787 5811 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5788 5812 log replay system stemming from the string form of Structs.
5789 5813
5790 5814 * IPython/Magic.py (Macro.__init__): improved macros to properly
5791 5815 handle magic commands in them.
5792 5816 (Magic.magic_logstart): usernames are now expanded so 'logstart
5793 5817 ~/mylog' now works.
5794 5818
5795 5819 * IPython/iplib.py (complete): fixed bug where paths starting with
5796 5820 '/' would be completed as magic names.
5797 5821
5798 5822 2002-05-04 Fernando Perez <fperez@colorado.edu>
5799 5823
5800 5824 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5801 5825 allow running full programs under the profiler's control.
5802 5826
5803 5827 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5804 5828 mode to report exceptions verbosely but without formatting
5805 5829 variables. This addresses the issue of ipython 'freezing' (it's
5806 5830 not frozen, but caught in an expensive formatting loop) when huge
5807 5831 variables are in the context of an exception.
5808 5832 (VerboseTB.text): Added '--->' markers at line where exception was
5809 5833 triggered. Much clearer to read, especially in NoColor modes.
5810 5834
5811 5835 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5812 5836 implemented in reverse when changing to the new parse_options().
5813 5837
5814 5838 2002-05-03 Fernando Perez <fperez@colorado.edu>
5815 5839
5816 5840 * IPython/Magic.py (Magic.parse_options): new function so that
5817 5841 magics can parse options easier.
5818 5842 (Magic.magic_prun): new function similar to profile.run(),
5819 5843 suggested by Chris Hart.
5820 5844 (Magic.magic_cd): fixed behavior so that it only changes if
5821 5845 directory actually is in history.
5822 5846
5823 5847 * IPython/usage.py (__doc__): added information about potential
5824 5848 slowness of Verbose exception mode when there are huge data
5825 5849 structures to be formatted (thanks to Archie Paulson).
5826 5850
5827 5851 * IPython/ipmaker.py (make_IPython): Changed default logging
5828 5852 (when simply called with -log) to use curr_dir/ipython.log in
5829 5853 rotate mode. Fixed crash which was occuring with -log before
5830 5854 (thanks to Jim Boyle).
5831 5855
5832 5856 2002-05-01 Fernando Perez <fperez@colorado.edu>
5833 5857
5834 5858 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5835 5859 was nasty -- though somewhat of a corner case).
5836 5860
5837 5861 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5838 5862 text (was a bug).
5839 5863
5840 5864 2002-04-30 Fernando Perez <fperez@colorado.edu>
5841 5865
5842 5866 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5843 5867 a print after ^D or ^C from the user so that the In[] prompt
5844 5868 doesn't over-run the gnuplot one.
5845 5869
5846 5870 2002-04-29 Fernando Perez <fperez@colorado.edu>
5847 5871
5848 5872 * Released 0.2.10
5849 5873
5850 5874 * IPython/__release__.py (version): get date dynamically.
5851 5875
5852 5876 * Misc. documentation updates thanks to Arnd's comments. Also ran
5853 5877 a full spellcheck on the manual (hadn't been done in a while).
5854 5878
5855 5879 2002-04-27 Fernando Perez <fperez@colorado.edu>
5856 5880
5857 5881 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5858 5882 starting a log in mid-session would reset the input history list.
5859 5883
5860 5884 2002-04-26 Fernando Perez <fperez@colorado.edu>
5861 5885
5862 5886 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5863 5887 all files were being included in an update. Now anything in
5864 5888 UserConfig that matches [A-Za-z]*.py will go (this excludes
5865 5889 __init__.py)
5866 5890
5867 5891 2002-04-25 Fernando Perez <fperez@colorado.edu>
5868 5892
5869 5893 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5870 5894 to __builtins__ so that any form of embedded or imported code can
5871 5895 test for being inside IPython.
5872 5896
5873 5897 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5874 5898 changed to GnuplotMagic because it's now an importable module,
5875 5899 this makes the name follow that of the standard Gnuplot module.
5876 5900 GnuplotMagic can now be loaded at any time in mid-session.
5877 5901
5878 5902 2002-04-24 Fernando Perez <fperez@colorado.edu>
5879 5903
5880 5904 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5881 5905 the globals (IPython has its own namespace) and the
5882 5906 PhysicalQuantity stuff is much better anyway.
5883 5907
5884 5908 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5885 5909 embedding example to standard user directory for
5886 5910 distribution. Also put it in the manual.
5887 5911
5888 5912 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5889 5913 instance as first argument (so it doesn't rely on some obscure
5890 5914 hidden global).
5891 5915
5892 5916 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5893 5917 delimiters. While it prevents ().TAB from working, it allows
5894 5918 completions in open (... expressions. This is by far a more common
5895 5919 case.
5896 5920
5897 5921 2002-04-23 Fernando Perez <fperez@colorado.edu>
5898 5922
5899 5923 * IPython/Extensions/InterpreterPasteInput.py: new
5900 5924 syntax-processing module for pasting lines with >>> or ... at the
5901 5925 start.
5902 5926
5903 5927 * IPython/Extensions/PhysicalQ_Interactive.py
5904 5928 (PhysicalQuantityInteractive.__int__): fixed to work with either
5905 5929 Numeric or math.
5906 5930
5907 5931 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5908 5932 provided profiles. Now we have:
5909 5933 -math -> math module as * and cmath with its own namespace.
5910 5934 -numeric -> Numeric as *, plus gnuplot & grace
5911 5935 -physics -> same as before
5912 5936
5913 5937 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5914 5938 user-defined magics wouldn't be found by @magic if they were
5915 5939 defined as class methods. Also cleaned up the namespace search
5916 5940 logic and the string building (to use %s instead of many repeated
5917 5941 string adds).
5918 5942
5919 5943 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5920 5944 of user-defined magics to operate with class methods (cleaner, in
5921 5945 line with the gnuplot code).
5922 5946
5923 5947 2002-04-22 Fernando Perez <fperez@colorado.edu>
5924 5948
5925 5949 * setup.py: updated dependency list so that manual is updated when
5926 5950 all included files change.
5927 5951
5928 5952 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5929 5953 the delimiter removal option (the fix is ugly right now).
5930 5954
5931 5955 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5932 5956 all of the math profile (quicker loading, no conflict between
5933 5957 g-9.8 and g-gnuplot).
5934 5958
5935 5959 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5936 5960 name of post-mortem files to IPython_crash_report.txt.
5937 5961
5938 5962 * Cleanup/update of the docs. Added all the new readline info and
5939 5963 formatted all lists as 'real lists'.
5940 5964
5941 5965 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5942 5966 tab-completion options, since the full readline parse_and_bind is
5943 5967 now accessible.
5944 5968
5945 5969 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5946 5970 handling of readline options. Now users can specify any string to
5947 5971 be passed to parse_and_bind(), as well as the delimiters to be
5948 5972 removed.
5949 5973 (InteractiveShell.__init__): Added __name__ to the global
5950 5974 namespace so that things like Itpl which rely on its existence
5951 5975 don't crash.
5952 5976 (InteractiveShell._prefilter): Defined the default with a _ so
5953 5977 that prefilter() is easier to override, while the default one
5954 5978 remains available.
5955 5979
5956 5980 2002-04-18 Fernando Perez <fperez@colorado.edu>
5957 5981
5958 5982 * Added information about pdb in the docs.
5959 5983
5960 5984 2002-04-17 Fernando Perez <fperez@colorado.edu>
5961 5985
5962 5986 * IPython/ipmaker.py (make_IPython): added rc_override option to
5963 5987 allow passing config options at creation time which may override
5964 5988 anything set in the config files or command line. This is
5965 5989 particularly useful for configuring embedded instances.
5966 5990
5967 5991 2002-04-15 Fernando Perez <fperez@colorado.edu>
5968 5992
5969 5993 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5970 5994 crash embedded instances because of the input cache falling out of
5971 5995 sync with the output counter.
5972 5996
5973 5997 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5974 5998 mode which calls pdb after an uncaught exception in IPython itself.
5975 5999
5976 6000 2002-04-14 Fernando Perez <fperez@colorado.edu>
5977 6001
5978 6002 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5979 6003 readline, fix it back after each call.
5980 6004
5981 6005 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5982 6006 method to force all access via __call__(), which guarantees that
5983 6007 traceback references are properly deleted.
5984 6008
5985 6009 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5986 6010 improve printing when pprint is in use.
5987 6011
5988 6012 2002-04-13 Fernando Perez <fperez@colorado.edu>
5989 6013
5990 6014 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5991 6015 exceptions aren't caught anymore. If the user triggers one, he
5992 6016 should know why he's doing it and it should go all the way up,
5993 6017 just like any other exception. So now @abort will fully kill the
5994 6018 embedded interpreter and the embedding code (unless that happens
5995 6019 to catch SystemExit).
5996 6020
5997 6021 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5998 6022 and a debugger() method to invoke the interactive pdb debugger
5999 6023 after printing exception information. Also added the corresponding
6000 6024 -pdb option and @pdb magic to control this feature, and updated
6001 6025 the docs. After a suggestion from Christopher Hart
6002 6026 (hart-AT-caltech.edu).
6003 6027
6004 6028 2002-04-12 Fernando Perez <fperez@colorado.edu>
6005 6029
6006 6030 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
6007 6031 the exception handlers defined by the user (not the CrashHandler)
6008 6032 so that user exceptions don't trigger an ipython bug report.
6009 6033
6010 6034 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
6011 6035 configurable (it should have always been so).
6012 6036
6013 6037 2002-03-26 Fernando Perez <fperez@colorado.edu>
6014 6038
6015 6039 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
6016 6040 and there to fix embedding namespace issues. This should all be
6017 6041 done in a more elegant way.
6018 6042
6019 6043 2002-03-25 Fernando Perez <fperez@colorado.edu>
6020 6044
6021 6045 * IPython/genutils.py (get_home_dir): Try to make it work under
6022 6046 win9x also.
6023 6047
6024 6048 2002-03-20 Fernando Perez <fperez@colorado.edu>
6025 6049
6026 6050 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
6027 6051 sys.displayhook untouched upon __init__.
6028 6052
6029 6053 2002-03-19 Fernando Perez <fperez@colorado.edu>
6030 6054
6031 6055 * Released 0.2.9 (for embedding bug, basically).
6032 6056
6033 6057 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
6034 6058 exceptions so that enclosing shell's state can be restored.
6035 6059
6036 6060 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
6037 6061 naming conventions in the .ipython/ dir.
6038 6062
6039 6063 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
6040 6064 from delimiters list so filenames with - in them get expanded.
6041 6065
6042 6066 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
6043 6067 sys.displayhook not being properly restored after an embedded call.
6044 6068
6045 6069 2002-03-18 Fernando Perez <fperez@colorado.edu>
6046 6070
6047 6071 * Released 0.2.8
6048 6072
6049 6073 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
6050 6074 some files weren't being included in a -upgrade.
6051 6075 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
6052 6076 on' so that the first tab completes.
6053 6077 (InteractiveShell.handle_magic): fixed bug with spaces around
6054 6078 quotes breaking many magic commands.
6055 6079
6056 6080 * setup.py: added note about ignoring the syntax error messages at
6057 6081 installation.
6058 6082
6059 6083 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
6060 6084 streamlining the gnuplot interface, now there's only one magic @gp.
6061 6085
6062 6086 2002-03-17 Fernando Perez <fperez@colorado.edu>
6063 6087
6064 6088 * IPython/UserConfig/magic_gnuplot.py: new name for the
6065 6089 example-magic_pm.py file. Much enhanced system, now with a shell
6066 6090 for communicating directly with gnuplot, one command at a time.
6067 6091
6068 6092 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
6069 6093 setting __name__=='__main__'.
6070 6094
6071 6095 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
6072 6096 mini-shell for accessing gnuplot from inside ipython. Should
6073 6097 extend it later for grace access too. Inspired by Arnd's
6074 6098 suggestion.
6075 6099
6076 6100 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
6077 6101 calling magic functions with () in their arguments. Thanks to Arnd
6078 6102 Baecker for pointing this to me.
6079 6103
6080 6104 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
6081 6105 infinitely for integer or complex arrays (only worked with floats).
6082 6106
6083 6107 2002-03-16 Fernando Perez <fperez@colorado.edu>
6084 6108
6085 6109 * setup.py: Merged setup and setup_windows into a single script
6086 6110 which properly handles things for windows users.
6087 6111
6088 6112 2002-03-15 Fernando Perez <fperez@colorado.edu>
6089 6113
6090 6114 * Big change to the manual: now the magics are all automatically
6091 6115 documented. This information is generated from their docstrings
6092 6116 and put in a latex file included by the manual lyx file. This way
6093 6117 we get always up to date information for the magics. The manual
6094 6118 now also has proper version information, also auto-synced.
6095 6119
6096 6120 For this to work, an undocumented --magic_docstrings option was added.
6097 6121
6098 6122 2002-03-13 Fernando Perez <fperez@colorado.edu>
6099 6123
6100 6124 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
6101 6125 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
6102 6126
6103 6127 2002-03-12 Fernando Perez <fperez@colorado.edu>
6104 6128
6105 6129 * IPython/ultraTB.py (TermColors): changed color escapes again to
6106 6130 fix the (old, reintroduced) line-wrapping bug. Basically, if
6107 6131 \001..\002 aren't given in the color escapes, lines get wrapped
6108 6132 weirdly. But giving those screws up old xterms and emacs terms. So
6109 6133 I added some logic for emacs terms to be ok, but I can't identify old
6110 6134 xterms separately ($TERM=='xterm' for many terminals, like konsole).
6111 6135
6112 6136 2002-03-10 Fernando Perez <fperez@colorado.edu>
6113 6137
6114 6138 * IPython/usage.py (__doc__): Various documentation cleanups and
6115 6139 updates, both in usage docstrings and in the manual.
6116 6140
6117 6141 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
6118 6142 handling of caching. Set minimum acceptabe value for having a
6119 6143 cache at 20 values.
6120 6144
6121 6145 * IPython/iplib.py (InteractiveShell.user_setup): moved the
6122 6146 install_first_time function to a method, renamed it and added an
6123 6147 'upgrade' mode. Now people can update their config directory with
6124 6148 a simple command line switch (-upgrade, also new).
6125 6149
6126 6150 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
6127 6151 @file (convenient for automagic users under Python >= 2.2).
6128 6152 Removed @files (it seemed more like a plural than an abbrev. of
6129 6153 'file show').
6130 6154
6131 6155 * IPython/iplib.py (install_first_time): Fixed crash if there were
6132 6156 backup files ('~') in .ipython/ install directory.
6133 6157
6134 6158 * IPython/ipmaker.py (make_IPython): fixes for new prompt
6135 6159 system. Things look fine, but these changes are fairly
6136 6160 intrusive. Test them for a few days.
6137 6161
6138 6162 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
6139 6163 the prompts system. Now all in/out prompt strings are user
6140 6164 controllable. This is particularly useful for embedding, as one
6141 6165 can tag embedded instances with particular prompts.
6142 6166
6143 6167 Also removed global use of sys.ps1/2, which now allows nested
6144 6168 embeddings without any problems. Added command-line options for
6145 6169 the prompt strings.
6146 6170
6147 6171 2002-03-08 Fernando Perez <fperez@colorado.edu>
6148 6172
6149 6173 * IPython/UserConfig/example-embed-short.py (ipshell): added
6150 6174 example file with the bare minimum code for embedding.
6151 6175
6152 6176 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
6153 6177 functionality for the embeddable shell to be activated/deactivated
6154 6178 either globally or at each call.
6155 6179
6156 6180 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
6157 6181 rewriting the prompt with '--->' for auto-inputs with proper
6158 6182 coloring. Now the previous UGLY hack in handle_auto() is gone, and
6159 6183 this is handled by the prompts class itself, as it should.
6160 6184
6161 6185 2002-03-05 Fernando Perez <fperez@colorado.edu>
6162 6186
6163 6187 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
6164 6188 @logstart to avoid name clashes with the math log function.
6165 6189
6166 6190 * Big updates to X/Emacs section of the manual.
6167 6191
6168 6192 * Removed ipython_emacs. Milan explained to me how to pass
6169 6193 arguments to ipython through Emacs. Some day I'm going to end up
6170 6194 learning some lisp...
6171 6195
6172 6196 2002-03-04 Fernando Perez <fperez@colorado.edu>
6173 6197
6174 6198 * IPython/ipython_emacs: Created script to be used as the
6175 6199 py-python-command Emacs variable so we can pass IPython
6176 6200 parameters. I can't figure out how to tell Emacs directly to pass
6177 6201 parameters to IPython, so a dummy shell script will do it.
6178 6202
6179 6203 Other enhancements made for things to work better under Emacs'
6180 6204 various types of terminals. Many thanks to Milan Zamazal
6181 6205 <pdm-AT-zamazal.org> for all the suggestions and pointers.
6182 6206
6183 6207 2002-03-01 Fernando Perez <fperez@colorado.edu>
6184 6208
6185 6209 * IPython/ipmaker.py (make_IPython): added a --readline! option so
6186 6210 that loading of readline is now optional. This gives better
6187 6211 control to emacs users.
6188 6212
6189 6213 * IPython/ultraTB.py (__date__): Modified color escape sequences
6190 6214 and now things work fine under xterm and in Emacs' term buffers
6191 6215 (though not shell ones). Well, in emacs you get colors, but all
6192 6216 seem to be 'light' colors (no difference between dark and light
6193 6217 ones). But the garbage chars are gone, and also in xterms. It
6194 6218 seems that now I'm using 'cleaner' ansi sequences.
6195 6219
6196 6220 2002-02-21 Fernando Perez <fperez@colorado.edu>
6197 6221
6198 6222 * Released 0.2.7 (mainly to publish the scoping fix).
6199 6223
6200 6224 * IPython/Logger.py (Logger.logstate): added. A corresponding
6201 6225 @logstate magic was created.
6202 6226
6203 6227 * IPython/Magic.py: fixed nested scoping problem under Python
6204 6228 2.1.x (automagic wasn't working).
6205 6229
6206 6230 2002-02-20 Fernando Perez <fperez@colorado.edu>
6207 6231
6208 6232 * Released 0.2.6.
6209 6233
6210 6234 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6211 6235 option so that logs can come out without any headers at all.
6212 6236
6213 6237 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6214 6238 SciPy.
6215 6239
6216 6240 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6217 6241 that embedded IPython calls don't require vars() to be explicitly
6218 6242 passed. Now they are extracted from the caller's frame (code
6219 6243 snatched from Eric Jones' weave). Added better documentation to
6220 6244 the section on embedding and the example file.
6221 6245
6222 6246 * IPython/genutils.py (page): Changed so that under emacs, it just
6223 6247 prints the string. You can then page up and down in the emacs
6224 6248 buffer itself. This is how the builtin help() works.
6225 6249
6226 6250 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6227 6251 macro scoping: macros need to be executed in the user's namespace
6228 6252 to work as if they had been typed by the user.
6229 6253
6230 6254 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6231 6255 execute automatically (no need to type 'exec...'). They then
6232 6256 behave like 'true macros'. The printing system was also modified
6233 6257 for this to work.
6234 6258
6235 6259 2002-02-19 Fernando Perez <fperez@colorado.edu>
6236 6260
6237 6261 * IPython/genutils.py (page_file): new function for paging files
6238 6262 in an OS-independent way. Also necessary for file viewing to work
6239 6263 well inside Emacs buffers.
6240 6264 (page): Added checks for being in an emacs buffer.
6241 6265 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6242 6266 same bug in iplib.
6243 6267
6244 6268 2002-02-18 Fernando Perez <fperez@colorado.edu>
6245 6269
6246 6270 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6247 6271 of readline so that IPython can work inside an Emacs buffer.
6248 6272
6249 6273 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6250 6274 method signatures (they weren't really bugs, but it looks cleaner
6251 6275 and keeps PyChecker happy).
6252 6276
6253 6277 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6254 6278 for implementing various user-defined hooks. Currently only
6255 6279 display is done.
6256 6280
6257 6281 * IPython/Prompts.py (CachedOutput._display): changed display
6258 6282 functions so that they can be dynamically changed by users easily.
6259 6283
6260 6284 * IPython/Extensions/numeric_formats.py (num_display): added an
6261 6285 extension for printing NumPy arrays in flexible manners. It
6262 6286 doesn't do anything yet, but all the structure is in
6263 6287 place. Ultimately the plan is to implement output format control
6264 6288 like in Octave.
6265 6289
6266 6290 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6267 6291 methods are found at run-time by all the automatic machinery.
6268 6292
6269 6293 2002-02-17 Fernando Perez <fperez@colorado.edu>
6270 6294
6271 6295 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6272 6296 whole file a little.
6273 6297
6274 6298 * ToDo: closed this document. Now there's a new_design.lyx
6275 6299 document for all new ideas. Added making a pdf of it for the
6276 6300 end-user distro.
6277 6301
6278 6302 * IPython/Logger.py (Logger.switch_log): Created this to replace
6279 6303 logon() and logoff(). It also fixes a nasty crash reported by
6280 6304 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6281 6305
6282 6306 * IPython/iplib.py (complete): got auto-completion to work with
6283 6307 automagic (I had wanted this for a long time).
6284 6308
6285 6309 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6286 6310 to @file, since file() is now a builtin and clashes with automagic
6287 6311 for @file.
6288 6312
6289 6313 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6290 6314 of this was previously in iplib, which had grown to more than 2000
6291 6315 lines, way too long. No new functionality, but it makes managing
6292 6316 the code a bit easier.
6293 6317
6294 6318 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6295 6319 information to crash reports.
6296 6320
6297 6321 2002-02-12 Fernando Perez <fperez@colorado.edu>
6298 6322
6299 6323 * Released 0.2.5.
6300 6324
6301 6325 2002-02-11 Fernando Perez <fperez@colorado.edu>
6302 6326
6303 6327 * Wrote a relatively complete Windows installer. It puts
6304 6328 everything in place, creates Start Menu entries and fixes the
6305 6329 color issues. Nothing fancy, but it works.
6306 6330
6307 6331 2002-02-10 Fernando Perez <fperez@colorado.edu>
6308 6332
6309 6333 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6310 6334 os.path.expanduser() call so that we can type @run ~/myfile.py and
6311 6335 have thigs work as expected.
6312 6336
6313 6337 * IPython/genutils.py (page): fixed exception handling so things
6314 6338 work both in Unix and Windows correctly. Quitting a pager triggers
6315 6339 an IOError/broken pipe in Unix, and in windows not finding a pager
6316 6340 is also an IOError, so I had to actually look at the return value
6317 6341 of the exception, not just the exception itself. Should be ok now.
6318 6342
6319 6343 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6320 6344 modified to allow case-insensitive color scheme changes.
6321 6345
6322 6346 2002-02-09 Fernando Perez <fperez@colorado.edu>
6323 6347
6324 6348 * IPython/genutils.py (native_line_ends): new function to leave
6325 6349 user config files with os-native line-endings.
6326 6350
6327 6351 * README and manual updates.
6328 6352
6329 6353 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6330 6354 instead of StringType to catch Unicode strings.
6331 6355
6332 6356 * IPython/genutils.py (filefind): fixed bug for paths with
6333 6357 embedded spaces (very common in Windows).
6334 6358
6335 6359 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6336 6360 files under Windows, so that they get automatically associated
6337 6361 with a text editor. Windows makes it a pain to handle
6338 6362 extension-less files.
6339 6363
6340 6364 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6341 6365 warning about readline only occur for Posix. In Windows there's no
6342 6366 way to get readline, so why bother with the warning.
6343 6367
6344 6368 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6345 6369 for __str__ instead of dir(self), since dir() changed in 2.2.
6346 6370
6347 6371 * Ported to Windows! Tested on XP, I suspect it should work fine
6348 6372 on NT/2000, but I don't think it will work on 98 et al. That
6349 6373 series of Windows is such a piece of junk anyway that I won't try
6350 6374 porting it there. The XP port was straightforward, showed a few
6351 6375 bugs here and there (fixed all), in particular some string
6352 6376 handling stuff which required considering Unicode strings (which
6353 6377 Windows uses). This is good, but hasn't been too tested :) No
6354 6378 fancy installer yet, I'll put a note in the manual so people at
6355 6379 least make manually a shortcut.
6356 6380
6357 6381 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6358 6382 into a single one, "colors". This now controls both prompt and
6359 6383 exception color schemes, and can be changed both at startup
6360 6384 (either via command-line switches or via ipythonrc files) and at
6361 6385 runtime, with @colors.
6362 6386 (Magic.magic_run): renamed @prun to @run and removed the old
6363 6387 @run. The two were too similar to warrant keeping both.
6364 6388
6365 6389 2002-02-03 Fernando Perez <fperez@colorado.edu>
6366 6390
6367 6391 * IPython/iplib.py (install_first_time): Added comment on how to
6368 6392 configure the color options for first-time users. Put a <return>
6369 6393 request at the end so that small-terminal users get a chance to
6370 6394 read the startup info.
6371 6395
6372 6396 2002-01-23 Fernando Perez <fperez@colorado.edu>
6373 6397
6374 6398 * IPython/iplib.py (CachedOutput.update): Changed output memory
6375 6399 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6376 6400 input history we still use _i. Did this b/c these variable are
6377 6401 very commonly used in interactive work, so the less we need to
6378 6402 type the better off we are.
6379 6403 (Magic.magic_prun): updated @prun to better handle the namespaces
6380 6404 the file will run in, including a fix for __name__ not being set
6381 6405 before.
6382 6406
6383 6407 2002-01-20 Fernando Perez <fperez@colorado.edu>
6384 6408
6385 6409 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6386 6410 extra garbage for Python 2.2. Need to look more carefully into
6387 6411 this later.
6388 6412
6389 6413 2002-01-19 Fernando Perez <fperez@colorado.edu>
6390 6414
6391 6415 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6392 6416 display SyntaxError exceptions properly formatted when they occur
6393 6417 (they can be triggered by imported code).
6394 6418
6395 6419 2002-01-18 Fernando Perez <fperez@colorado.edu>
6396 6420
6397 6421 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6398 6422 SyntaxError exceptions are reported nicely formatted, instead of
6399 6423 spitting out only offset information as before.
6400 6424 (Magic.magic_prun): Added the @prun function for executing
6401 6425 programs with command line args inside IPython.
6402 6426
6403 6427 2002-01-16 Fernando Perez <fperez@colorado.edu>
6404 6428
6405 6429 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6406 6430 to *not* include the last item given in a range. This brings their
6407 6431 behavior in line with Python's slicing:
6408 6432 a[n1:n2] -> a[n1]...a[n2-1]
6409 6433 It may be a bit less convenient, but I prefer to stick to Python's
6410 6434 conventions *everywhere*, so users never have to wonder.
6411 6435 (Magic.magic_macro): Added @macro function to ease the creation of
6412 6436 macros.
6413 6437
6414 6438 2002-01-05 Fernando Perez <fperez@colorado.edu>
6415 6439
6416 6440 * Released 0.2.4.
6417 6441
6418 6442 * IPython/iplib.py (Magic.magic_pdef):
6419 6443 (InteractiveShell.safe_execfile): report magic lines and error
6420 6444 lines without line numbers so one can easily copy/paste them for
6421 6445 re-execution.
6422 6446
6423 6447 * Updated manual with recent changes.
6424 6448
6425 6449 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6426 6450 docstring printing when class? is called. Very handy for knowing
6427 6451 how to create class instances (as long as __init__ is well
6428 6452 documented, of course :)
6429 6453 (Magic.magic_doc): print both class and constructor docstrings.
6430 6454 (Magic.magic_pdef): give constructor info if passed a class and
6431 6455 __call__ info for callable object instances.
6432 6456
6433 6457 2002-01-04 Fernando Perez <fperez@colorado.edu>
6434 6458
6435 6459 * Made deep_reload() off by default. It doesn't always work
6436 6460 exactly as intended, so it's probably safer to have it off. It's
6437 6461 still available as dreload() anyway, so nothing is lost.
6438 6462
6439 6463 2002-01-02 Fernando Perez <fperez@colorado.edu>
6440 6464
6441 6465 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6442 6466 so I wanted an updated release).
6443 6467
6444 6468 2001-12-27 Fernando Perez <fperez@colorado.edu>
6445 6469
6446 6470 * IPython/iplib.py (InteractiveShell.interact): Added the original
6447 6471 code from 'code.py' for this module in order to change the
6448 6472 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6449 6473 the history cache would break when the user hit Ctrl-C, and
6450 6474 interact() offers no way to add any hooks to it.
6451 6475
6452 6476 2001-12-23 Fernando Perez <fperez@colorado.edu>
6453 6477
6454 6478 * setup.py: added check for 'MANIFEST' before trying to remove
6455 6479 it. Thanks to Sean Reifschneider.
6456 6480
6457 6481 2001-12-22 Fernando Perez <fperez@colorado.edu>
6458 6482
6459 6483 * Released 0.2.2.
6460 6484
6461 6485 * Finished (reasonably) writing the manual. Later will add the
6462 6486 python-standard navigation stylesheets, but for the time being
6463 6487 it's fairly complete. Distribution will include html and pdf
6464 6488 versions.
6465 6489
6466 6490 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6467 6491 (MayaVi author).
6468 6492
6469 6493 2001-12-21 Fernando Perez <fperez@colorado.edu>
6470 6494
6471 6495 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6472 6496 good public release, I think (with the manual and the distutils
6473 6497 installer). The manual can use some work, but that can go
6474 6498 slowly. Otherwise I think it's quite nice for end users. Next
6475 6499 summer, rewrite the guts of it...
6476 6500
6477 6501 * Changed format of ipythonrc files to use whitespace as the
6478 6502 separator instead of an explicit '='. Cleaner.
6479 6503
6480 6504 2001-12-20 Fernando Perez <fperez@colorado.edu>
6481 6505
6482 6506 * Started a manual in LyX. For now it's just a quick merge of the
6483 6507 various internal docstrings and READMEs. Later it may grow into a
6484 6508 nice, full-blown manual.
6485 6509
6486 6510 * Set up a distutils based installer. Installation should now be
6487 6511 trivially simple for end-users.
6488 6512
6489 6513 2001-12-11 Fernando Perez <fperez@colorado.edu>
6490 6514
6491 6515 * Released 0.2.0. First public release, announced it at
6492 6516 comp.lang.python. From now on, just bugfixes...
6493 6517
6494 6518 * Went through all the files, set copyright/license notices and
6495 6519 cleaned up things. Ready for release.
6496 6520
6497 6521 2001-12-10 Fernando Perez <fperez@colorado.edu>
6498 6522
6499 6523 * Changed the first-time installer not to use tarfiles. It's more
6500 6524 robust now and less unix-dependent. Also makes it easier for
6501 6525 people to later upgrade versions.
6502 6526
6503 6527 * Changed @exit to @abort to reflect the fact that it's pretty
6504 6528 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6505 6529 becomes significant only when IPyhton is embedded: in that case,
6506 6530 C-D closes IPython only, but @abort kills the enclosing program
6507 6531 too (unless it had called IPython inside a try catching
6508 6532 SystemExit).
6509 6533
6510 6534 * Created Shell module which exposes the actuall IPython Shell
6511 6535 classes, currently the normal and the embeddable one. This at
6512 6536 least offers a stable interface we won't need to change when
6513 6537 (later) the internals are rewritten. That rewrite will be confined
6514 6538 to iplib and ipmaker, but the Shell interface should remain as is.
6515 6539
6516 6540 * Added embed module which offers an embeddable IPShell object,
6517 6541 useful to fire up IPython *inside* a running program. Great for
6518 6542 debugging or dynamical data analysis.
6519 6543
6520 6544 2001-12-08 Fernando Perez <fperez@colorado.edu>
6521 6545
6522 6546 * Fixed small bug preventing seeing info from methods of defined
6523 6547 objects (incorrect namespace in _ofind()).
6524 6548
6525 6549 * Documentation cleanup. Moved the main usage docstrings to a
6526 6550 separate file, usage.py (cleaner to maintain, and hopefully in the
6527 6551 future some perlpod-like way of producing interactive, man and
6528 6552 html docs out of it will be found).
6529 6553
6530 6554 * Added @profile to see your profile at any time.
6531 6555
6532 6556 * Added @p as an alias for 'print'. It's especially convenient if
6533 6557 using automagic ('p x' prints x).
6534 6558
6535 6559 * Small cleanups and fixes after a pychecker run.
6536 6560
6537 6561 * Changed the @cd command to handle @cd - and @cd -<n> for
6538 6562 visiting any directory in _dh.
6539 6563
6540 6564 * Introduced _dh, a history of visited directories. @dhist prints
6541 6565 it out with numbers.
6542 6566
6543 6567 2001-12-07 Fernando Perez <fperez@colorado.edu>
6544 6568
6545 6569 * Released 0.1.22
6546 6570
6547 6571 * Made initialization a bit more robust against invalid color
6548 6572 options in user input (exit, not traceback-crash).
6549 6573
6550 6574 * Changed the bug crash reporter to write the report only in the
6551 6575 user's .ipython directory. That way IPython won't litter people's
6552 6576 hard disks with crash files all over the place. Also print on
6553 6577 screen the necessary mail command.
6554 6578
6555 6579 * With the new ultraTB, implemented LightBG color scheme for light
6556 6580 background terminals. A lot of people like white backgrounds, so I
6557 6581 guess we should at least give them something readable.
6558 6582
6559 6583 2001-12-06 Fernando Perez <fperez@colorado.edu>
6560 6584
6561 6585 * Modified the structure of ultraTB. Now there's a proper class
6562 6586 for tables of color schemes which allow adding schemes easily and
6563 6587 switching the active scheme without creating a new instance every
6564 6588 time (which was ridiculous). The syntax for creating new schemes
6565 6589 is also cleaner. I think ultraTB is finally done, with a clean
6566 6590 class structure. Names are also much cleaner (now there's proper
6567 6591 color tables, no need for every variable to also have 'color' in
6568 6592 its name).
6569 6593
6570 6594 * Broke down genutils into separate files. Now genutils only
6571 6595 contains utility functions, and classes have been moved to their
6572 6596 own files (they had enough independent functionality to warrant
6573 6597 it): ConfigLoader, OutputTrap, Struct.
6574 6598
6575 6599 2001-12-05 Fernando Perez <fperez@colorado.edu>
6576 6600
6577 6601 * IPython turns 21! Released version 0.1.21, as a candidate for
6578 6602 public consumption. If all goes well, release in a few days.
6579 6603
6580 6604 * Fixed path bug (files in Extensions/ directory wouldn't be found
6581 6605 unless IPython/ was explicitly in sys.path).
6582 6606
6583 6607 * Extended the FlexCompleter class as MagicCompleter to allow
6584 6608 completion of @-starting lines.
6585 6609
6586 6610 * Created __release__.py file as a central repository for release
6587 6611 info that other files can read from.
6588 6612
6589 6613 * Fixed small bug in logging: when logging was turned on in
6590 6614 mid-session, old lines with special meanings (!@?) were being
6591 6615 logged without the prepended comment, which is necessary since
6592 6616 they are not truly valid python syntax. This should make session
6593 6617 restores produce less errors.
6594 6618
6595 6619 * The namespace cleanup forced me to make a FlexCompleter class
6596 6620 which is nothing but a ripoff of rlcompleter, but with selectable
6597 6621 namespace (rlcompleter only works in __main__.__dict__). I'll try
6598 6622 to submit a note to the authors to see if this change can be
6599 6623 incorporated in future rlcompleter releases (Dec.6: done)
6600 6624
6601 6625 * More fixes to namespace handling. It was a mess! Now all
6602 6626 explicit references to __main__.__dict__ are gone (except when
6603 6627 really needed) and everything is handled through the namespace
6604 6628 dicts in the IPython instance. We seem to be getting somewhere
6605 6629 with this, finally...
6606 6630
6607 6631 * Small documentation updates.
6608 6632
6609 6633 * Created the Extensions directory under IPython (with an
6610 6634 __init__.py). Put the PhysicalQ stuff there. This directory should
6611 6635 be used for all special-purpose extensions.
6612 6636
6613 6637 * File renaming:
6614 6638 ipythonlib --> ipmaker
6615 6639 ipplib --> iplib
6616 6640 This makes a bit more sense in terms of what these files actually do.
6617 6641
6618 6642 * Moved all the classes and functions in ipythonlib to ipplib, so
6619 6643 now ipythonlib only has make_IPython(). This will ease up its
6620 6644 splitting in smaller functional chunks later.
6621 6645
6622 6646 * Cleaned up (done, I think) output of @whos. Better column
6623 6647 formatting, and now shows str(var) for as much as it can, which is
6624 6648 typically what one gets with a 'print var'.
6625 6649
6626 6650 2001-12-04 Fernando Perez <fperez@colorado.edu>
6627 6651
6628 6652 * Fixed namespace problems. Now builtin/IPyhton/user names get
6629 6653 properly reported in their namespace. Internal namespace handling
6630 6654 is finally getting decent (not perfect yet, but much better than
6631 6655 the ad-hoc mess we had).
6632 6656
6633 6657 * Removed -exit option. If people just want to run a python
6634 6658 script, that's what the normal interpreter is for. Less
6635 6659 unnecessary options, less chances for bugs.
6636 6660
6637 6661 * Added a crash handler which generates a complete post-mortem if
6638 6662 IPython crashes. This will help a lot in tracking bugs down the
6639 6663 road.
6640 6664
6641 6665 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6642 6666 which were boud to functions being reassigned would bypass the
6643 6667 logger, breaking the sync of _il with the prompt counter. This
6644 6668 would then crash IPython later when a new line was logged.
6645 6669
6646 6670 2001-12-02 Fernando Perez <fperez@colorado.edu>
6647 6671
6648 6672 * Made IPython a package. This means people don't have to clutter
6649 6673 their sys.path with yet another directory. Changed the INSTALL
6650 6674 file accordingly.
6651 6675
6652 6676 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6653 6677 sorts its output (so @who shows it sorted) and @whos formats the
6654 6678 table according to the width of the first column. Nicer, easier to
6655 6679 read. Todo: write a generic table_format() which takes a list of
6656 6680 lists and prints it nicely formatted, with optional row/column
6657 6681 separators and proper padding and justification.
6658 6682
6659 6683 * Released 0.1.20
6660 6684
6661 6685 * Fixed bug in @log which would reverse the inputcache list (a
6662 6686 copy operation was missing).
6663 6687
6664 6688 * Code cleanup. @config was changed to use page(). Better, since
6665 6689 its output is always quite long.
6666 6690
6667 6691 * Itpl is back as a dependency. I was having too many problems
6668 6692 getting the parametric aliases to work reliably, and it's just
6669 6693 easier to code weird string operations with it than playing %()s
6670 6694 games. It's only ~6k, so I don't think it's too big a deal.
6671 6695
6672 6696 * Found (and fixed) a very nasty bug with history. !lines weren't
6673 6697 getting cached, and the out of sync caches would crash
6674 6698 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6675 6699 division of labor a bit better. Bug fixed, cleaner structure.
6676 6700
6677 6701 2001-12-01 Fernando Perez <fperez@colorado.edu>
6678 6702
6679 6703 * Released 0.1.19
6680 6704
6681 6705 * Added option -n to @hist to prevent line number printing. Much
6682 6706 easier to copy/paste code this way.
6683 6707
6684 6708 * Created global _il to hold the input list. Allows easy
6685 6709 re-execution of blocks of code by slicing it (inspired by Janko's
6686 6710 comment on 'macros').
6687 6711
6688 6712 * Small fixes and doc updates.
6689 6713
6690 6714 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6691 6715 much too fragile with automagic. Handles properly multi-line
6692 6716 statements and takes parameters.
6693 6717
6694 6718 2001-11-30 Fernando Perez <fperez@colorado.edu>
6695 6719
6696 6720 * Version 0.1.18 released.
6697 6721
6698 6722 * Fixed nasty namespace bug in initial module imports.
6699 6723
6700 6724 * Added copyright/license notes to all code files (except
6701 6725 DPyGetOpt). For the time being, LGPL. That could change.
6702 6726
6703 6727 * Rewrote a much nicer README, updated INSTALL, cleaned up
6704 6728 ipythonrc-* samples.
6705 6729
6706 6730 * Overall code/documentation cleanup. Basically ready for
6707 6731 release. Only remaining thing: licence decision (LGPL?).
6708 6732
6709 6733 * Converted load_config to a class, ConfigLoader. Now recursion
6710 6734 control is better organized. Doesn't include the same file twice.
6711 6735
6712 6736 2001-11-29 Fernando Perez <fperez@colorado.edu>
6713 6737
6714 6738 * Got input history working. Changed output history variables from
6715 6739 _p to _o so that _i is for input and _o for output. Just cleaner
6716 6740 convention.
6717 6741
6718 6742 * Implemented parametric aliases. This pretty much allows the
6719 6743 alias system to offer full-blown shell convenience, I think.
6720 6744
6721 6745 * Version 0.1.17 released, 0.1.18 opened.
6722 6746
6723 6747 * dot_ipython/ipythonrc (alias): added documentation.
6724 6748 (xcolor): Fixed small bug (xcolors -> xcolor)
6725 6749
6726 6750 * Changed the alias system. Now alias is a magic command to define
6727 6751 aliases just like the shell. Rationale: the builtin magics should
6728 6752 be there for things deeply connected to IPython's
6729 6753 architecture. And this is a much lighter system for what I think
6730 6754 is the really important feature: allowing users to define quickly
6731 6755 magics that will do shell things for them, so they can customize
6732 6756 IPython easily to match their work habits. If someone is really
6733 6757 desperate to have another name for a builtin alias, they can
6734 6758 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6735 6759 works.
6736 6760
6737 6761 2001-11-28 Fernando Perez <fperez@colorado.edu>
6738 6762
6739 6763 * Changed @file so that it opens the source file at the proper
6740 6764 line. Since it uses less, if your EDITOR environment is
6741 6765 configured, typing v will immediately open your editor of choice
6742 6766 right at the line where the object is defined. Not as quick as
6743 6767 having a direct @edit command, but for all intents and purposes it
6744 6768 works. And I don't have to worry about writing @edit to deal with
6745 6769 all the editors, less does that.
6746 6770
6747 6771 * Version 0.1.16 released, 0.1.17 opened.
6748 6772
6749 6773 * Fixed some nasty bugs in the page/page_dumb combo that could
6750 6774 crash IPython.
6751 6775
6752 6776 2001-11-27 Fernando Perez <fperez@colorado.edu>
6753 6777
6754 6778 * Version 0.1.15 released, 0.1.16 opened.
6755 6779
6756 6780 * Finally got ? and ?? to work for undefined things: now it's
6757 6781 possible to type {}.get? and get information about the get method
6758 6782 of dicts, or os.path? even if only os is defined (so technically
6759 6783 os.path isn't). Works at any level. For example, after import os,
6760 6784 os?, os.path?, os.path.abspath? all work. This is great, took some
6761 6785 work in _ofind.
6762 6786
6763 6787 * Fixed more bugs with logging. The sanest way to do it was to add
6764 6788 to @log a 'mode' parameter. Killed two in one shot (this mode
6765 6789 option was a request of Janko's). I think it's finally clean
6766 6790 (famous last words).
6767 6791
6768 6792 * Added a page_dumb() pager which does a decent job of paging on
6769 6793 screen, if better things (like less) aren't available. One less
6770 6794 unix dependency (someday maybe somebody will port this to
6771 6795 windows).
6772 6796
6773 6797 * Fixed problem in magic_log: would lock of logging out if log
6774 6798 creation failed (because it would still think it had succeeded).
6775 6799
6776 6800 * Improved the page() function using curses to auto-detect screen
6777 6801 size. Now it can make a much better decision on whether to print
6778 6802 or page a string. Option screen_length was modified: a value 0
6779 6803 means auto-detect, and that's the default now.
6780 6804
6781 6805 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6782 6806 go out. I'll test it for a few days, then talk to Janko about
6783 6807 licences and announce it.
6784 6808
6785 6809 * Fixed the length of the auto-generated ---> prompt which appears
6786 6810 for auto-parens and auto-quotes. Getting this right isn't trivial,
6787 6811 with all the color escapes, different prompt types and optional
6788 6812 separators. But it seems to be working in all the combinations.
6789 6813
6790 6814 2001-11-26 Fernando Perez <fperez@colorado.edu>
6791 6815
6792 6816 * Wrote a regexp filter to get option types from the option names
6793 6817 string. This eliminates the need to manually keep two duplicate
6794 6818 lists.
6795 6819
6796 6820 * Removed the unneeded check_option_names. Now options are handled
6797 6821 in a much saner manner and it's easy to visually check that things
6798 6822 are ok.
6799 6823
6800 6824 * Updated version numbers on all files I modified to carry a
6801 6825 notice so Janko and Nathan have clear version markers.
6802 6826
6803 6827 * Updated docstring for ultraTB with my changes. I should send
6804 6828 this to Nathan.
6805 6829
6806 6830 * Lots of small fixes. Ran everything through pychecker again.
6807 6831
6808 6832 * Made loading of deep_reload an cmd line option. If it's not too
6809 6833 kosher, now people can just disable it. With -nodeep_reload it's
6810 6834 still available as dreload(), it just won't overwrite reload().
6811 6835
6812 6836 * Moved many options to the no| form (-opt and -noopt
6813 6837 accepted). Cleaner.
6814 6838
6815 6839 * Changed magic_log so that if called with no parameters, it uses
6816 6840 'rotate' mode. That way auto-generated logs aren't automatically
6817 6841 over-written. For normal logs, now a backup is made if it exists
6818 6842 (only 1 level of backups). A new 'backup' mode was added to the
6819 6843 Logger class to support this. This was a request by Janko.
6820 6844
6821 6845 * Added @logoff/@logon to stop/restart an active log.
6822 6846
6823 6847 * Fixed a lot of bugs in log saving/replay. It was pretty
6824 6848 broken. Now special lines (!@,/) appear properly in the command
6825 6849 history after a log replay.
6826 6850
6827 6851 * Tried and failed to implement full session saving via pickle. My
6828 6852 idea was to pickle __main__.__dict__, but modules can't be
6829 6853 pickled. This would be a better alternative to replaying logs, but
6830 6854 seems quite tricky to get to work. Changed -session to be called
6831 6855 -logplay, which more accurately reflects what it does. And if we
6832 6856 ever get real session saving working, -session is now available.
6833 6857
6834 6858 * Implemented color schemes for prompts also. As for tracebacks,
6835 6859 currently only NoColor and Linux are supported. But now the
6836 6860 infrastructure is in place, based on a generic ColorScheme
6837 6861 class. So writing and activating new schemes both for the prompts
6838 6862 and the tracebacks should be straightforward.
6839 6863
6840 6864 * Version 0.1.13 released, 0.1.14 opened.
6841 6865
6842 6866 * Changed handling of options for output cache. Now counter is
6843 6867 hardwired starting at 1 and one specifies the maximum number of
6844 6868 entries *in the outcache* (not the max prompt counter). This is
6845 6869 much better, since many statements won't increase the cache
6846 6870 count. It also eliminated some confusing options, now there's only
6847 6871 one: cache_size.
6848 6872
6849 6873 * Added 'alias' magic function and magic_alias option in the
6850 6874 ipythonrc file. Now the user can easily define whatever names he
6851 6875 wants for the magic functions without having to play weird
6852 6876 namespace games. This gives IPython a real shell-like feel.
6853 6877
6854 6878 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6855 6879 @ or not).
6856 6880
6857 6881 This was one of the last remaining 'visible' bugs (that I know
6858 6882 of). I think if I can clean up the session loading so it works
6859 6883 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6860 6884 about licensing).
6861 6885
6862 6886 2001-11-25 Fernando Perez <fperez@colorado.edu>
6863 6887
6864 6888 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6865 6889 there's a cleaner distinction between what ? and ?? show.
6866 6890
6867 6891 * Added screen_length option. Now the user can define his own
6868 6892 screen size for page() operations.
6869 6893
6870 6894 * Implemented magic shell-like functions with automatic code
6871 6895 generation. Now adding another function is just a matter of adding
6872 6896 an entry to a dict, and the function is dynamically generated at
6873 6897 run-time. Python has some really cool features!
6874 6898
6875 6899 * Renamed many options to cleanup conventions a little. Now all
6876 6900 are lowercase, and only underscores where needed. Also in the code
6877 6901 option name tables are clearer.
6878 6902
6879 6903 * Changed prompts a little. Now input is 'In [n]:' instead of
6880 6904 'In[n]:='. This allows it the numbers to be aligned with the
6881 6905 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6882 6906 Python (it was a Mathematica thing). The '...' continuation prompt
6883 6907 was also changed a little to align better.
6884 6908
6885 6909 * Fixed bug when flushing output cache. Not all _p<n> variables
6886 6910 exist, so their deletion needs to be wrapped in a try:
6887 6911
6888 6912 * Figured out how to properly use inspect.formatargspec() (it
6889 6913 requires the args preceded by *). So I removed all the code from
6890 6914 _get_pdef in Magic, which was just replicating that.
6891 6915
6892 6916 * Added test to prefilter to allow redefining magic function names
6893 6917 as variables. This is ok, since the @ form is always available,
6894 6918 but whe should allow the user to define a variable called 'ls' if
6895 6919 he needs it.
6896 6920
6897 6921 * Moved the ToDo information from README into a separate ToDo.
6898 6922
6899 6923 * General code cleanup and small bugfixes. I think it's close to a
6900 6924 state where it can be released, obviously with a big 'beta'
6901 6925 warning on it.
6902 6926
6903 6927 * Got the magic function split to work. Now all magics are defined
6904 6928 in a separate class. It just organizes things a bit, and now
6905 6929 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6906 6930 was too long).
6907 6931
6908 6932 * Changed @clear to @reset to avoid potential confusions with
6909 6933 the shell command clear. Also renamed @cl to @clear, which does
6910 6934 exactly what people expect it to from their shell experience.
6911 6935
6912 6936 Added a check to the @reset command (since it's so
6913 6937 destructive, it's probably a good idea to ask for confirmation).
6914 6938 But now reset only works for full namespace resetting. Since the
6915 6939 del keyword is already there for deleting a few specific
6916 6940 variables, I don't see the point of having a redundant magic
6917 6941 function for the same task.
6918 6942
6919 6943 2001-11-24 Fernando Perez <fperez@colorado.edu>
6920 6944
6921 6945 * Updated the builtin docs (esp. the ? ones).
6922 6946
6923 6947 * Ran all the code through pychecker. Not terribly impressed with
6924 6948 it: lots of spurious warnings and didn't really find anything of
6925 6949 substance (just a few modules being imported and not used).
6926 6950
6927 6951 * Implemented the new ultraTB functionality into IPython. New
6928 6952 option: xcolors. This chooses color scheme. xmode now only selects
6929 6953 between Plain and Verbose. Better orthogonality.
6930 6954
6931 6955 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6932 6956 mode and color scheme for the exception handlers. Now it's
6933 6957 possible to have the verbose traceback with no coloring.
6934 6958
6935 6959 2001-11-23 Fernando Perez <fperez@colorado.edu>
6936 6960
6937 6961 * Version 0.1.12 released, 0.1.13 opened.
6938 6962
6939 6963 * Removed option to set auto-quote and auto-paren escapes by
6940 6964 user. The chances of breaking valid syntax are just too high. If
6941 6965 someone *really* wants, they can always dig into the code.
6942 6966
6943 6967 * Made prompt separators configurable.
6944 6968
6945 6969 2001-11-22 Fernando Perez <fperez@colorado.edu>
6946 6970
6947 6971 * Small bugfixes in many places.
6948 6972
6949 6973 * Removed the MyCompleter class from ipplib. It seemed redundant
6950 6974 with the C-p,C-n history search functionality. Less code to
6951 6975 maintain.
6952 6976
6953 6977 * Moved all the original ipython.py code into ipythonlib.py. Right
6954 6978 now it's just one big dump into a function called make_IPython, so
6955 6979 no real modularity has been gained. But at least it makes the
6956 6980 wrapper script tiny, and since ipythonlib is a module, it gets
6957 6981 compiled and startup is much faster.
6958 6982
6959 6983 This is a reasobably 'deep' change, so we should test it for a
6960 6984 while without messing too much more with the code.
6961 6985
6962 6986 2001-11-21 Fernando Perez <fperez@colorado.edu>
6963 6987
6964 6988 * Version 0.1.11 released, 0.1.12 opened for further work.
6965 6989
6966 6990 * Removed dependency on Itpl. It was only needed in one place. It
6967 6991 would be nice if this became part of python, though. It makes life
6968 6992 *a lot* easier in some cases.
6969 6993
6970 6994 * Simplified the prefilter code a bit. Now all handlers are
6971 6995 expected to explicitly return a value (at least a blank string).
6972 6996
6973 6997 * Heavy edits in ipplib. Removed the help system altogether. Now
6974 6998 obj?/?? is used for inspecting objects, a magic @doc prints
6975 6999 docstrings, and full-blown Python help is accessed via the 'help'
6976 7000 keyword. This cleans up a lot of code (less to maintain) and does
6977 7001 the job. Since 'help' is now a standard Python component, might as
6978 7002 well use it and remove duplicate functionality.
6979 7003
6980 7004 Also removed the option to use ipplib as a standalone program. By
6981 7005 now it's too dependent on other parts of IPython to function alone.
6982 7006
6983 7007 * Fixed bug in genutils.pager. It would crash if the pager was
6984 7008 exited immediately after opening (broken pipe).
6985 7009
6986 7010 * Trimmed down the VerboseTB reporting a little. The header is
6987 7011 much shorter now and the repeated exception arguments at the end
6988 7012 have been removed. For interactive use the old header seemed a bit
6989 7013 excessive.
6990 7014
6991 7015 * Fixed small bug in output of @whos for variables with multi-word
6992 7016 types (only first word was displayed).
6993 7017
6994 7018 2001-11-17 Fernando Perez <fperez@colorado.edu>
6995 7019
6996 7020 * Version 0.1.10 released, 0.1.11 opened for further work.
6997 7021
6998 7022 * Modified dirs and friends. dirs now *returns* the stack (not
6999 7023 prints), so one can manipulate it as a variable. Convenient to
7000 7024 travel along many directories.
7001 7025
7002 7026 * Fixed bug in magic_pdef: would only work with functions with
7003 7027 arguments with default values.
7004 7028
7005 7029 2001-11-14 Fernando Perez <fperez@colorado.edu>
7006 7030
7007 7031 * Added the PhysicsInput stuff to dot_ipython so it ships as an
7008 7032 example with IPython. Various other minor fixes and cleanups.
7009 7033
7010 7034 * Version 0.1.9 released, 0.1.10 opened for further work.
7011 7035
7012 7036 * Added sys.path to the list of directories searched in the
7013 7037 execfile= option. It used to be the current directory and the
7014 7038 user's IPYTHONDIR only.
7015 7039
7016 7040 2001-11-13 Fernando Perez <fperez@colorado.edu>
7017 7041
7018 7042 * Reinstated the raw_input/prefilter separation that Janko had
7019 7043 initially. This gives a more convenient setup for extending the
7020 7044 pre-processor from the outside: raw_input always gets a string,
7021 7045 and prefilter has to process it. We can then redefine prefilter
7022 7046 from the outside and implement extensions for special
7023 7047 purposes.
7024 7048
7025 7049 Today I got one for inputting PhysicalQuantity objects
7026 7050 (from Scientific) without needing any function calls at
7027 7051 all. Extremely convenient, and it's all done as a user-level
7028 7052 extension (no IPython code was touched). Now instead of:
7029 7053 a = PhysicalQuantity(4.2,'m/s**2')
7030 7054 one can simply say
7031 7055 a = 4.2 m/s**2
7032 7056 or even
7033 7057 a = 4.2 m/s^2
7034 7058
7035 7059 I use this, but it's also a proof of concept: IPython really is
7036 7060 fully user-extensible, even at the level of the parsing of the
7037 7061 command line. It's not trivial, but it's perfectly doable.
7038 7062
7039 7063 * Added 'add_flip' method to inclusion conflict resolver. Fixes
7040 7064 the problem of modules being loaded in the inverse order in which
7041 7065 they were defined in
7042 7066
7043 7067 * Version 0.1.8 released, 0.1.9 opened for further work.
7044 7068
7045 7069 * Added magics pdef, source and file. They respectively show the
7046 7070 definition line ('prototype' in C), source code and full python
7047 7071 file for any callable object. The object inspector oinfo uses
7048 7072 these to show the same information.
7049 7073
7050 7074 * Version 0.1.7 released, 0.1.8 opened for further work.
7051 7075
7052 7076 * Separated all the magic functions into a class called Magic. The
7053 7077 InteractiveShell class was becoming too big for Xemacs to handle
7054 7078 (de-indenting a line would lock it up for 10 seconds while it
7055 7079 backtracked on the whole class!)
7056 7080
7057 7081 FIXME: didn't work. It can be done, but right now namespaces are
7058 7082 all messed up. Do it later (reverted it for now, so at least
7059 7083 everything works as before).
7060 7084
7061 7085 * Got the object introspection system (magic_oinfo) working! I
7062 7086 think this is pretty much ready for release to Janko, so he can
7063 7087 test it for a while and then announce it. Pretty much 100% of what
7064 7088 I wanted for the 'phase 1' release is ready. Happy, tired.
7065 7089
7066 7090 2001-11-12 Fernando Perez <fperez@colorado.edu>
7067 7091
7068 7092 * Version 0.1.6 released, 0.1.7 opened for further work.
7069 7093
7070 7094 * Fixed bug in printing: it used to test for truth before
7071 7095 printing, so 0 wouldn't print. Now checks for None.
7072 7096
7073 7097 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
7074 7098 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
7075 7099 reaches by hand into the outputcache. Think of a better way to do
7076 7100 this later.
7077 7101
7078 7102 * Various small fixes thanks to Nathan's comments.
7079 7103
7080 7104 * Changed magic_pprint to magic_Pprint. This way it doesn't
7081 7105 collide with pprint() and the name is consistent with the command
7082 7106 line option.
7083 7107
7084 7108 * Changed prompt counter behavior to be fully like
7085 7109 Mathematica's. That is, even input that doesn't return a result
7086 7110 raises the prompt counter. The old behavior was kind of confusing
7087 7111 (getting the same prompt number several times if the operation
7088 7112 didn't return a result).
7089 7113
7090 7114 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
7091 7115
7092 7116 * Fixed -Classic mode (wasn't working anymore).
7093 7117
7094 7118 * Added colored prompts using Nathan's new code. Colors are
7095 7119 currently hardwired, they can be user-configurable. For
7096 7120 developers, they can be chosen in file ipythonlib.py, at the
7097 7121 beginning of the CachedOutput class def.
7098 7122
7099 7123 2001-11-11 Fernando Perez <fperez@colorado.edu>
7100 7124
7101 7125 * Version 0.1.5 released, 0.1.6 opened for further work.
7102 7126
7103 7127 * Changed magic_env to *return* the environment as a dict (not to
7104 7128 print it). This way it prints, but it can also be processed.
7105 7129
7106 7130 * Added Verbose exception reporting to interactive
7107 7131 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
7108 7132 traceback. Had to make some changes to the ultraTB file. This is
7109 7133 probably the last 'big' thing in my mental todo list. This ties
7110 7134 in with the next entry:
7111 7135
7112 7136 * Changed -Xi and -Xf to a single -xmode option. Now all the user
7113 7137 has to specify is Plain, Color or Verbose for all exception
7114 7138 handling.
7115 7139
7116 7140 * Removed ShellServices option. All this can really be done via
7117 7141 the magic system. It's easier to extend, cleaner and has automatic
7118 7142 namespace protection and documentation.
7119 7143
7120 7144 2001-11-09 Fernando Perez <fperez@colorado.edu>
7121 7145
7122 7146 * Fixed bug in output cache flushing (missing parameter to
7123 7147 __init__). Other small bugs fixed (found using pychecker).
7124 7148
7125 7149 * Version 0.1.4 opened for bugfixing.
7126 7150
7127 7151 2001-11-07 Fernando Perez <fperez@colorado.edu>
7128 7152
7129 7153 * Version 0.1.3 released, mainly because of the raw_input bug.
7130 7154
7131 7155 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
7132 7156 and when testing for whether things were callable, a call could
7133 7157 actually be made to certain functions. They would get called again
7134 7158 once 'really' executed, with a resulting double call. A disaster
7135 7159 in many cases (list.reverse() would never work!).
7136 7160
7137 7161 * Removed prefilter() function, moved its code to raw_input (which
7138 7162 after all was just a near-empty caller for prefilter). This saves
7139 7163 a function call on every prompt, and simplifies the class a tiny bit.
7140 7164
7141 7165 * Fix _ip to __ip name in magic example file.
7142 7166
7143 7167 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
7144 7168 work with non-gnu versions of tar.
7145 7169
7146 7170 2001-11-06 Fernando Perez <fperez@colorado.edu>
7147 7171
7148 7172 * Version 0.1.2. Just to keep track of the recent changes.
7149 7173
7150 7174 * Fixed nasty bug in output prompt routine. It used to check 'if
7151 7175 arg != None...'. Problem is, this fails if arg implements a
7152 7176 special comparison (__cmp__) which disallows comparing to
7153 7177 None. Found it when trying to use the PhysicalQuantity module from
7154 7178 ScientificPython.
7155 7179
7156 7180 2001-11-05 Fernando Perez <fperez@colorado.edu>
7157 7181
7158 7182 * Also added dirs. Now the pushd/popd/dirs family functions
7159 7183 basically like the shell, with the added convenience of going home
7160 7184 when called with no args.
7161 7185
7162 7186 * pushd/popd slightly modified to mimic shell behavior more
7163 7187 closely.
7164 7188
7165 7189 * Added env,pushd,popd from ShellServices as magic functions. I
7166 7190 think the cleanest will be to port all desired functions from
7167 7191 ShellServices as magics and remove ShellServices altogether. This
7168 7192 will provide a single, clean way of adding functionality
7169 7193 (shell-type or otherwise) to IP.
7170 7194
7171 7195 2001-11-04 Fernando Perez <fperez@colorado.edu>
7172 7196
7173 7197 * Added .ipython/ directory to sys.path. This way users can keep
7174 7198 customizations there and access them via import.
7175 7199
7176 7200 2001-11-03 Fernando Perez <fperez@colorado.edu>
7177 7201
7178 7202 * Opened version 0.1.1 for new changes.
7179 7203
7180 7204 * Changed version number to 0.1.0: first 'public' release, sent to
7181 7205 Nathan and Janko.
7182 7206
7183 7207 * Lots of small fixes and tweaks.
7184 7208
7185 7209 * Minor changes to whos format. Now strings are shown, snipped if
7186 7210 too long.
7187 7211
7188 7212 * Changed ShellServices to work on __main__ so they show up in @who
7189 7213
7190 7214 * Help also works with ? at the end of a line:
7191 7215 ?sin and sin?
7192 7216 both produce the same effect. This is nice, as often I use the
7193 7217 tab-complete to find the name of a method, but I used to then have
7194 7218 to go to the beginning of the line to put a ? if I wanted more
7195 7219 info. Now I can just add the ? and hit return. Convenient.
7196 7220
7197 7221 2001-11-02 Fernando Perez <fperez@colorado.edu>
7198 7222
7199 7223 * Python version check (>=2.1) added.
7200 7224
7201 7225 * Added LazyPython documentation. At this point the docs are quite
7202 7226 a mess. A cleanup is in order.
7203 7227
7204 7228 * Auto-installer created. For some bizarre reason, the zipfiles
7205 7229 module isn't working on my system. So I made a tar version
7206 7230 (hopefully the command line options in various systems won't kill
7207 7231 me).
7208 7232
7209 7233 * Fixes to Struct in genutils. Now all dictionary-like methods are
7210 7234 protected (reasonably).
7211 7235
7212 7236 * Added pager function to genutils and changed ? to print usage
7213 7237 note through it (it was too long).
7214 7238
7215 7239 * Added the LazyPython functionality. Works great! I changed the
7216 7240 auto-quote escape to ';', it's on home row and next to '. But
7217 7241 both auto-quote and auto-paren (still /) escapes are command-line
7218 7242 parameters.
7219 7243
7220 7244
7221 7245 2001-11-01 Fernando Perez <fperez@colorado.edu>
7222 7246
7223 7247 * Version changed to 0.0.7. Fairly large change: configuration now
7224 7248 is all stored in a directory, by default .ipython. There, all
7225 7249 config files have normal looking names (not .names)
7226 7250
7227 7251 * Version 0.0.6 Released first to Lucas and Archie as a test
7228 7252 run. Since it's the first 'semi-public' release, change version to
7229 7253 > 0.0.6 for any changes now.
7230 7254
7231 7255 * Stuff I had put in the ipplib.py changelog:
7232 7256
7233 7257 Changes to InteractiveShell:
7234 7258
7235 7259 - Made the usage message a parameter.
7236 7260
7237 7261 - Require the name of the shell variable to be given. It's a bit
7238 7262 of a hack, but allows the name 'shell' not to be hardwired in the
7239 7263 magic (@) handler, which is problematic b/c it requires
7240 7264 polluting the global namespace with 'shell'. This in turn is
7241 7265 fragile: if a user redefines a variable called shell, things
7242 7266 break.
7243 7267
7244 7268 - magic @: all functions available through @ need to be defined
7245 7269 as magic_<name>, even though they can be called simply as
7246 7270 @<name>. This allows the special command @magic to gather
7247 7271 information automatically about all existing magic functions,
7248 7272 even if they are run-time user extensions, by parsing the shell
7249 7273 instance __dict__ looking for special magic_ names.
7250 7274
7251 7275 - mainloop: added *two* local namespace parameters. This allows
7252 7276 the class to differentiate between parameters which were there
7253 7277 before and after command line initialization was processed. This
7254 7278 way, later @who can show things loaded at startup by the
7255 7279 user. This trick was necessary to make session saving/reloading
7256 7280 really work: ideally after saving/exiting/reloading a session,
7257 7281 *everything* should look the same, including the output of @who. I
7258 7282 was only able to make this work with this double namespace
7259 7283 trick.
7260 7284
7261 7285 - added a header to the logfile which allows (almost) full
7262 7286 session restoring.
7263 7287
7264 7288 - prepend lines beginning with @ or !, with a and log
7265 7289 them. Why? !lines: may be useful to know what you did @lines:
7266 7290 they may affect session state. So when restoring a session, at
7267 7291 least inform the user of their presence. I couldn't quite get
7268 7292 them to properly re-execute, but at least the user is warned.
7269 7293
7270 7294 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now