##// END OF EJS Templates
mglob dir fix, ipy_fsops.py added, var_expand for callable aliases
vivainio -
Show More
@@ -0,0 +1,173 b''
1 """ File system operations
2
3 Contains: Simple variants of normal unix shell commands (icp, imv, irm,
4 imkdir, igrep).
5
6 Some "otherwise handy" utils ('collect' for gathering files to
7 ~/_ipython/collect, 'inote' for collecting single note lines to
8 ~/_ipython/note.txt)
9
10 Mostly of use for bare windows installations where cygwin/equivalent is not
11 installed and you would otherwise need to deal with dos versions of the
12 commands (that e.g. don't understand / as path separator). These can
13 do some useful tricks on their own, though (like use 'mglob' patterns).
14
15 Not to be confused with ipipe commands (ils etc.) that also start with i.
16 """
17
18 import IPython.ipapi
19 ip = IPython.ipapi.get()
20
21 import shutil,os,shlex
22 from IPython.external import mglob
23 class IpyShellCmdException(Exception):
24 pass
25
26 def parse_args(args):
27 """ Given arg string 'CMD files... target', return ([files], target) """
28
29 tup = args.split(None, 1)
30 if len(tup) == 1:
31 raise IpyShellCmdException("Expected arguments for " + tup[0])
32
33 tup2 = shlex.split(tup[1])
34
35 flist, trg = mglob.expand(tup2[0:-1]), tup2[-1]
36 if not flist:
37 raise IpyShellCmdException("No files found:" + str(tup2[0:-1]))
38 return flist, trg
39
40 def icp(arg):
41 """ icp files... targetdir
42
43 Copy all files to target, creating dirs for target if necessary
44
45 icp srcdir dstdir
46
47 Copy srcdir to distdir
48
49 """
50 import distutils.dir_util
51
52 fs, targetdir = parse_args(arg)
53 if not os.path.isdir(targetdir):
54 distutils.dir_util.mkpath(targetdir,verbose =1)
55 for f in fs:
56 shutil.copy2(f,targetdir)
57 return fs
58 ip.defalias("icp",icp)
59
60 def imv(arg):
61 """ imv src tgt
62
63 Move source to target.
64 """
65
66 fs, target = parse_args(arg)
67 if len(fs) > 1:
68 assert os.path.isdir(target)
69 for f in fs:
70 shutil.move(f, target)
71 return fs
72 ip.defalias("imv",imv)
73
74 def irm(arg):
75 """ irm path[s]...
76
77 Remove file[s] or dir[s] path. Dirs are deleted recursively.
78 """
79 paths = mglob.expand(arg.split(None,1)[1])
80 import distutils.dir_util
81 for p in paths:
82 print "rm",p
83 if os.path.isdir(p):
84 distutils.dir_util.remove_tree(p, verbose = 1)
85 else:
86 os.remove(p)
87
88 ip.defalias("irm",irm)
89
90 def imkdir(arg):
91 """ imkdir path
92
93 Creates dir path, and all dirs on the road
94 """
95 import distutils.dir_util
96 targetdir = arg.split(None,1)[1]
97 distutils.dir_util.mkpath(targetdir,verbose =1)
98
99 ip.defalias("imkdir",imkdir)
100
101 def igrep(arg):
102 """ igrep PAT files...
103
104 Very dumb file scan, case-insensitive.
105
106 e.g.
107
108 igrep "test this" rec:*.py
109
110 """
111 elems = shlex.split(arg)
112 dummy, pat, fs = elems[0], elems[1], mglob.expand(elems[2:])
113 res = []
114 for f in fs:
115 found = False
116 for l in open(f):
117 if pat.lower() in l.lower():
118 if not found:
119 print "[[",f,"]]"
120 found = True
121 res.append(f)
122 print l.rstrip()
123 return res
124
125 ip.defalias("igrep",igrep)
126
127 def collect(arg):
128 """ collect foo/a.txt rec:bar=*.py
129
130 Copies foo/a.txt to ~/_ipython/collect/foo/a.txt and *.py from bar,
131 likewise
132
133 Without args, try to open ~/_ipython/collect dir (in win32 at least).
134 """
135 from path import path
136 basedir = path(ip.options.ipythondir + '/collect')
137 try:
138 fs = mglob.expand(arg.split(None,1)[1])
139 except IndexError:
140 os.startfile(basedir)
141 return
142 for f in fs:
143 f = path(f)
144 trg = basedir / f.splitdrive()[1].lstrip('/\\')
145 if f.isdir():
146 f.makedirs()
147 continue
148 dname = trg.dirname()
149 if not dname.isdir():
150 dname.makedirs()
151 print f,"=>",trg
152 shutil.copy2(f,trg)
153
154 ip.defalias("collect",collect)
155
156 def inote(arg):
157 """ inote Hello world
158
159 Adds timestamp and Hello world to ~/_ipython/notes.txt
160
161 Without args, opens notes.txt for editing.
162 """
163 import time
164 fname = ip.options.ipythondir + '/notes.txt'
165
166 try:
167 entry = time.asctime() + ':\n' + arg.split(None,1)[1] + '\n'
168 f= open(fname, 'a').write(entry)
169 except IndexError:
170 ip.IP.hooks.editor(fname)
171
172 ip.defalias("inote",inote)
173
@@ -1,2529 +1,2530 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 2696 2007-08-30 17:17:15Z fperez $
9 $Id: iplib.py 2713 2007-09-05 18:34:29Z vivainio $
10 10 """
11 11
12 12 #*****************************************************************************
13 13 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
14 14 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
15 15 #
16 16 # Distributed under the terms of the BSD License. The full license is in
17 17 # the file COPYING, distributed as part of this software.
18 18 #
19 19 # Note: this code originally subclassed code.InteractiveConsole from the
20 20 # Python standard library. Over time, all of that class has been copied
21 21 # verbatim here for modifications which could not be accomplished by
22 22 # subclassing. At this point, there are no dependencies at all on the code
23 23 # module anymore (it is not even imported). The Python License (sec. 2)
24 24 # allows for this, but it's always nice to acknowledge credit where credit is
25 25 # due.
26 26 #*****************************************************************************
27 27
28 28 #****************************************************************************
29 29 # Modules and globals
30 30
31 31 from IPython import Release
32 32 __author__ = '%s <%s>\n%s <%s>' % \
33 33 ( Release.authors['Janko'] + Release.authors['Fernando'] )
34 34 __license__ = Release.license
35 35 __version__ = Release.version
36 36
37 37 # Python standard modules
38 38 import __main__
39 39 import __builtin__
40 40 import StringIO
41 41 import bdb
42 42 import cPickle as pickle
43 43 import codeop
44 44 import doctest
45 45 import exceptions
46 46 import glob
47 47 import inspect
48 48 import keyword
49 49 import new
50 50 import os
51 51 import pydoc
52 52 import re
53 53 import shutil
54 54 import string
55 55 import sys
56 56 import tempfile
57 57 import traceback
58 58 import types
59 59 import pickleshare
60 60 from sets import Set
61 61 from pprint import pprint, pformat
62 62
63 63 # IPython's own modules
64 64 #import IPython
65 65 from IPython import Debugger,OInspect,PyColorize,ultraTB
66 66 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
67 67 from IPython.FakeModule import FakeModule
68 68 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
69 69 from IPython.Logger import Logger
70 70 from IPython.Magic import Magic
71 71 from IPython.Prompts import CachedOutput
72 72 from IPython.ipstruct import Struct
73 73 from IPython.background_jobs import BackgroundJobManager
74 74 from IPython.usage import cmd_line_usage,interactive_usage
75 75 from IPython.genutils import *
76 76 from IPython.strdispatch import StrDispatch
77 77 import IPython.ipapi
78 78 import IPython.history
79 79 import IPython.prefilter as prefilter
80 80 import IPython.shadowns
81 81 # Globals
82 82
83 83 # store the builtin raw_input globally, and use this always, in case user code
84 84 # overwrites it (like wx.py.PyShell does)
85 85 raw_input_original = raw_input
86 86
87 87 # compiled regexps for autoindent management
88 88 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
89 89
90 90
91 91 #****************************************************************************
92 92 # Some utility function definitions
93 93
94 94 ini_spaces_re = re.compile(r'^(\s+)')
95 95
96 96 def num_ini_spaces(strng):
97 97 """Return the number of initial spaces in a string"""
98 98
99 99 ini_spaces = ini_spaces_re.match(strng)
100 100 if ini_spaces:
101 101 return ini_spaces.end()
102 102 else:
103 103 return 0
104 104
105 105 def softspace(file, newvalue):
106 106 """Copied from code.py, to remove the dependency"""
107 107
108 108 oldvalue = 0
109 109 try:
110 110 oldvalue = file.softspace
111 111 except AttributeError:
112 112 pass
113 113 try:
114 114 file.softspace = newvalue
115 115 except (AttributeError, TypeError):
116 116 # "attribute-less object" or "read-only attributes"
117 117 pass
118 118 return oldvalue
119 119
120 120
121 121 #****************************************************************************
122 122 # Local use exceptions
123 123 class SpaceInInput(exceptions.Exception): pass
124 124
125 125
126 126 #****************************************************************************
127 127 # Local use classes
128 128 class Bunch: pass
129 129
130 130 class Undefined: pass
131 131
132 132 class Quitter(object):
133 133 """Simple class to handle exit, similar to Python 2.5's.
134 134
135 135 It handles exiting in an ipython-safe manner, which the one in Python 2.5
136 136 doesn't do (obviously, since it doesn't know about ipython)."""
137 137
138 138 def __init__(self,shell,name):
139 139 self.shell = shell
140 140 self.name = name
141 141
142 142 def __repr__(self):
143 143 return 'Type %s() to exit.' % self.name
144 144 __str__ = __repr__
145 145
146 146 def __call__(self):
147 147 self.shell.exit()
148 148
149 149 class InputList(list):
150 150 """Class to store user input.
151 151
152 152 It's basically a list, but slices return a string instead of a list, thus
153 153 allowing things like (assuming 'In' is an instance):
154 154
155 155 exec In[4:7]
156 156
157 157 or
158 158
159 159 exec In[5:9] + In[14] + In[21:25]"""
160 160
161 161 def __getslice__(self,i,j):
162 162 return ''.join(list.__getslice__(self,i,j))
163 163
164 164 class SyntaxTB(ultraTB.ListTB):
165 165 """Extension which holds some state: the last exception value"""
166 166
167 167 def __init__(self,color_scheme = 'NoColor'):
168 168 ultraTB.ListTB.__init__(self,color_scheme)
169 169 self.last_syntax_error = None
170 170
171 171 def __call__(self, etype, value, elist):
172 172 self.last_syntax_error = value
173 173 ultraTB.ListTB.__call__(self,etype,value,elist)
174 174
175 175 def clear_err_state(self):
176 176 """Return the current error state and clear it"""
177 177 e = self.last_syntax_error
178 178 self.last_syntax_error = None
179 179 return e
180 180
181 181 #****************************************************************************
182 182 # Main IPython class
183 183
184 184 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
185 185 # until a full rewrite is made. I've cleaned all cross-class uses of
186 186 # attributes and methods, but too much user code out there relies on the
187 187 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
188 188 #
189 189 # But at least now, all the pieces have been separated and we could, in
190 190 # principle, stop using the mixin. This will ease the transition to the
191 191 # chainsaw branch.
192 192
193 193 # For reference, the following is the list of 'self.foo' uses in the Magic
194 194 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
195 195 # class, to prevent clashes.
196 196
197 197 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
198 198 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
199 199 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
200 200 # 'self.value']
201 201
202 202 class InteractiveShell(object,Magic):
203 203 """An enhanced console for Python."""
204 204
205 205 # class attribute to indicate whether the class supports threads or not.
206 206 # Subclasses with thread support should override this as needed.
207 207 isthreaded = False
208 208
209 209 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
210 210 user_ns = None,user_global_ns=None,banner2='',
211 211 custom_exceptions=((),None),embedded=False):
212 212
213 213 # log system
214 214 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
215 215
216 216 # some minimal strict typechecks. For some core data structures, I
217 217 # want actual basic python types, not just anything that looks like
218 218 # one. This is especially true for namespaces.
219 219 for ns in (user_ns,user_global_ns):
220 220 if ns is not None and type(ns) != types.DictType:
221 221 raise TypeError,'namespace must be a dictionary'
222 222
223 223 # Job manager (for jobs run as background threads)
224 224 self.jobs = BackgroundJobManager()
225 225
226 226 # Store the actual shell's name
227 227 self.name = name
228 228
229 229 # We need to know whether the instance is meant for embedding, since
230 230 # global/local namespaces need to be handled differently in that case
231 231 self.embedded = embedded
232 232 if embedded:
233 233 # Control variable so users can, from within the embedded instance,
234 234 # permanently deactivate it.
235 235 self.embedded_active = True
236 236
237 237 # command compiler
238 238 self.compile = codeop.CommandCompiler()
239 239
240 240 # User input buffer
241 241 self.buffer = []
242 242
243 243 # Default name given in compilation of code
244 244 self.filename = '<ipython console>'
245 245
246 246 # Install our own quitter instead of the builtins. For python2.3-2.4,
247 247 # this brings in behavior like 2.5, and for 2.5 it's identical.
248 248 __builtin__.exit = Quitter(self,'exit')
249 249 __builtin__.quit = Quitter(self,'quit')
250 250
251 251 # Make an empty namespace, which extension writers can rely on both
252 252 # existing and NEVER being used by ipython itself. This gives them a
253 253 # convenient location for storing additional information and state
254 254 # their extensions may require, without fear of collisions with other
255 255 # ipython names that may develop later.
256 256 self.meta = Struct()
257 257
258 258 # Create the namespace where the user will operate. user_ns is
259 259 # normally the only one used, and it is passed to the exec calls as
260 260 # the locals argument. But we do carry a user_global_ns namespace
261 261 # given as the exec 'globals' argument, This is useful in embedding
262 262 # situations where the ipython shell opens in a context where the
263 263 # distinction between locals and globals is meaningful.
264 264
265 265 # FIXME. For some strange reason, __builtins__ is showing up at user
266 266 # level as a dict instead of a module. This is a manual fix, but I
267 267 # should really track down where the problem is coming from. Alex
268 268 # Schmolck reported this problem first.
269 269
270 270 # A useful post by Alex Martelli on this topic:
271 271 # Re: inconsistent value from __builtins__
272 272 # Von: Alex Martelli <aleaxit@yahoo.com>
273 273 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
274 274 # Gruppen: comp.lang.python
275 275
276 276 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
277 277 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
278 278 # > <type 'dict'>
279 279 # > >>> print type(__builtins__)
280 280 # > <type 'module'>
281 281 # > Is this difference in return value intentional?
282 282
283 283 # Well, it's documented that '__builtins__' can be either a dictionary
284 284 # or a module, and it's been that way for a long time. Whether it's
285 285 # intentional (or sensible), I don't know. In any case, the idea is
286 286 # that if you need to access the built-in namespace directly, you
287 287 # should start with "import __builtin__" (note, no 's') which will
288 288 # definitely give you a module. Yeah, it's somewhat confusing:-(.
289 289
290 290 # These routines return properly built dicts as needed by the rest of
291 291 # the code, and can also be used by extension writers to generate
292 292 # properly initialized namespaces.
293 293 user_ns = IPython.ipapi.make_user_ns(user_ns)
294 294 user_global_ns = IPython.ipapi.make_user_global_ns(user_global_ns)
295 295
296 296 # Assign namespaces
297 297 # This is the namespace where all normal user variables live
298 298 self.user_ns = user_ns
299 299 # Embedded instances require a separate namespace for globals.
300 300 # Normally this one is unused by non-embedded instances.
301 301 self.user_global_ns = user_global_ns
302 302 # A namespace to keep track of internal data structures to prevent
303 303 # them from cluttering user-visible stuff. Will be updated later
304 304 self.internal_ns = {}
305 305
306 306 # Namespace of system aliases. Each entry in the alias
307 307 # table must be a 2-tuple of the form (N,name), where N is the number
308 308 # of positional arguments of the alias.
309 309 self.alias_table = {}
310 310
311 311 # A table holding all the namespaces IPython deals with, so that
312 312 # introspection facilities can search easily.
313 313 self.ns_table = {'user':user_ns,
314 314 'user_global':user_global_ns,
315 315 'alias':self.alias_table,
316 316 'internal':self.internal_ns,
317 317 'builtin':__builtin__.__dict__
318 318 }
319 319
320 320 # The user namespace MUST have a pointer to the shell itself.
321 321 self.user_ns[name] = self
322 322
323 323 # We need to insert into sys.modules something that looks like a
324 324 # module but which accesses the IPython namespace, for shelve and
325 325 # pickle to work interactively. Normally they rely on getting
326 326 # everything out of __main__, but for embedding purposes each IPython
327 327 # instance has its own private namespace, so we can't go shoving
328 328 # everything into __main__.
329 329
330 330 # note, however, that we should only do this for non-embedded
331 331 # ipythons, which really mimic the __main__.__dict__ with their own
332 332 # namespace. Embedded instances, on the other hand, should not do
333 333 # this because they need to manage the user local/global namespaces
334 334 # only, but they live within a 'normal' __main__ (meaning, they
335 335 # shouldn't overtake the execution environment of the script they're
336 336 # embedded in).
337 337
338 338 if not embedded:
339 339 try:
340 340 main_name = self.user_ns['__name__']
341 341 except KeyError:
342 342 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
343 343 else:
344 344 #print "pickle hack in place" # dbg
345 345 #print 'main_name:',main_name # dbg
346 346 sys.modules[main_name] = FakeModule(self.user_ns)
347 347
348 348 # List of input with multi-line handling.
349 349 # Fill its zero entry, user counter starts at 1
350 350 self.input_hist = InputList(['\n'])
351 351 # This one will hold the 'raw' input history, without any
352 352 # pre-processing. This will allow users to retrieve the input just as
353 353 # it was exactly typed in by the user, with %hist -r.
354 354 self.input_hist_raw = InputList(['\n'])
355 355
356 356 # list of visited directories
357 357 try:
358 358 self.dir_hist = [os.getcwd()]
359 359 except OSError:
360 360 self.dir_hist = []
361 361
362 362 # dict of output history
363 363 self.output_hist = {}
364 364
365 365 # Get system encoding at startup time. Certain terminals (like Emacs
366 366 # under Win32 have it set to None, and we need to have a known valid
367 367 # encoding to use in the raw_input() method
368 368 self.stdin_encoding = sys.stdin.encoding or 'ascii'
369 369
370 370 # dict of things NOT to alias (keywords, builtins and some magics)
371 371 no_alias = {}
372 372 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
373 373 for key in keyword.kwlist + no_alias_magics:
374 374 no_alias[key] = 1
375 375 no_alias.update(__builtin__.__dict__)
376 376 self.no_alias = no_alias
377 377
378 378 # make global variables for user access to these
379 379 self.user_ns['_ih'] = self.input_hist
380 380 self.user_ns['_oh'] = self.output_hist
381 381 self.user_ns['_dh'] = self.dir_hist
382 382
383 383 # user aliases to input and output histories
384 384 self.user_ns['In'] = self.input_hist
385 385 self.user_ns['Out'] = self.output_hist
386 386
387 387 self.user_ns['_sh'] = IPython.shadowns
388 388 # Object variable to store code object waiting execution. This is
389 389 # used mainly by the multithreaded shells, but it can come in handy in
390 390 # other situations. No need to use a Queue here, since it's a single
391 391 # item which gets cleared once run.
392 392 self.code_to_run = None
393 393
394 394 # escapes for automatic behavior on the command line
395 395 self.ESC_SHELL = '!'
396 396 self.ESC_SH_CAP = '!!'
397 397 self.ESC_HELP = '?'
398 398 self.ESC_MAGIC = '%'
399 399 self.ESC_QUOTE = ','
400 400 self.ESC_QUOTE2 = ';'
401 401 self.ESC_PAREN = '/'
402 402
403 403 # And their associated handlers
404 404 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
405 405 self.ESC_QUOTE : self.handle_auto,
406 406 self.ESC_QUOTE2 : self.handle_auto,
407 407 self.ESC_MAGIC : self.handle_magic,
408 408 self.ESC_HELP : self.handle_help,
409 409 self.ESC_SHELL : self.handle_shell_escape,
410 410 self.ESC_SH_CAP : self.handle_shell_escape,
411 411 }
412 412
413 413 # class initializations
414 414 Magic.__init__(self,self)
415 415
416 416 # Python source parser/formatter for syntax highlighting
417 417 pyformat = PyColorize.Parser().format
418 418 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
419 419
420 420 # hooks holds pointers used for user-side customizations
421 421 self.hooks = Struct()
422 422
423 423 self.strdispatchers = {}
424 424
425 425 # Set all default hooks, defined in the IPython.hooks module.
426 426 hooks = IPython.hooks
427 427 for hook_name in hooks.__all__:
428 428 # default hooks have priority 100, i.e. low; user hooks should have
429 429 # 0-100 priority
430 430 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
431 431 #print "bound hook",hook_name
432 432
433 433 # Flag to mark unconditional exit
434 434 self.exit_now = False
435 435
436 436 self.usage_min = """\
437 437 An enhanced console for Python.
438 438 Some of its features are:
439 439 - Readline support if the readline library is present.
440 440 - Tab completion in the local namespace.
441 441 - Logging of input, see command-line options.
442 442 - System shell escape via ! , eg !ls.
443 443 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
444 444 - Keeps track of locally defined variables via %who, %whos.
445 445 - Show object information with a ? eg ?x or x? (use ?? for more info).
446 446 """
447 447 if usage: self.usage = usage
448 448 else: self.usage = self.usage_min
449 449
450 450 # Storage
451 451 self.rc = rc # This will hold all configuration information
452 452 self.pager = 'less'
453 453 # temporary files used for various purposes. Deleted at exit.
454 454 self.tempfiles = []
455 455
456 456 # Keep track of readline usage (later set by init_readline)
457 457 self.has_readline = False
458 458
459 459 # template for logfile headers. It gets resolved at runtime by the
460 460 # logstart method.
461 461 self.loghead_tpl = \
462 462 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
463 463 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
464 464 #log# opts = %s
465 465 #log# args = %s
466 466 #log# It is safe to make manual edits below here.
467 467 #log#-----------------------------------------------------------------------
468 468 """
469 469 # for pushd/popd management
470 470 try:
471 471 self.home_dir = get_home_dir()
472 472 except HomeDirError,msg:
473 473 fatal(msg)
474 474
475 475 self.dir_stack = [os.getcwd().replace(self.home_dir,'~')]
476 476
477 477 # Functions to call the underlying shell.
478 478
479 479 # The first is similar to os.system, but it doesn't return a value,
480 480 # and it allows interpolation of variables in the user's namespace.
481 481 self.system = lambda cmd: \
482 482 shell(self.var_expand(cmd,depth=2),
483 483 header=self.rc.system_header,
484 484 verbose=self.rc.system_verbose)
485 485
486 486 # These are for getoutput and getoutputerror:
487 487 self.getoutput = lambda cmd: \
488 488 getoutput(self.var_expand(cmd,depth=2),
489 489 header=self.rc.system_header,
490 490 verbose=self.rc.system_verbose)
491 491
492 492 self.getoutputerror = lambda cmd: \
493 493 getoutputerror(self.var_expand(cmd,depth=2),
494 494 header=self.rc.system_header,
495 495 verbose=self.rc.system_verbose)
496 496
497 497
498 498 # keep track of where we started running (mainly for crash post-mortem)
499 499 self.starting_dir = os.getcwd()
500 500
501 501 # Various switches which can be set
502 502 self.CACHELENGTH = 5000 # this is cheap, it's just text
503 503 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
504 504 self.banner2 = banner2
505 505
506 506 # TraceBack handlers:
507 507
508 508 # Syntax error handler.
509 509 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
510 510
511 511 # The interactive one is initialized with an offset, meaning we always
512 512 # want to remove the topmost item in the traceback, which is our own
513 513 # internal code. Valid modes: ['Plain','Context','Verbose']
514 514 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
515 515 color_scheme='NoColor',
516 516 tb_offset = 1)
517 517
518 518 # IPython itself shouldn't crash. This will produce a detailed
519 519 # post-mortem if it does. But we only install the crash handler for
520 520 # non-threaded shells, the threaded ones use a normal verbose reporter
521 521 # and lose the crash handler. This is because exceptions in the main
522 522 # thread (such as in GUI code) propagate directly to sys.excepthook,
523 523 # and there's no point in printing crash dumps for every user exception.
524 524 if self.isthreaded:
525 525 ipCrashHandler = ultraTB.FormattedTB()
526 526 else:
527 527 from IPython import CrashHandler
528 528 ipCrashHandler = CrashHandler.IPythonCrashHandler(self)
529 529 self.set_crash_handler(ipCrashHandler)
530 530
531 531 # and add any custom exception handlers the user may have specified
532 532 self.set_custom_exc(*custom_exceptions)
533 533
534 534 # indentation management
535 535 self.autoindent = False
536 536 self.indent_current_nsp = 0
537 537
538 538 # Make some aliases automatically
539 539 # Prepare list of shell aliases to auto-define
540 540 if os.name == 'posix':
541 541 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
542 542 'mv mv -i','rm rm -i','cp cp -i',
543 543 'cat cat','less less','clear clear',
544 544 # a better ls
545 545 'ls ls -F',
546 546 # long ls
547 547 'll ls -lF')
548 548 # Extra ls aliases with color, which need special treatment on BSD
549 549 # variants
550 550 ls_extra = ( # color ls
551 551 'lc ls -F -o --color',
552 552 # ls normal files only
553 553 'lf ls -F -o --color %l | grep ^-',
554 554 # ls symbolic links
555 555 'lk ls -F -o --color %l | grep ^l',
556 556 # directories or links to directories,
557 557 'ldir ls -F -o --color %l | grep /$',
558 558 # things which are executable
559 559 'lx ls -F -o --color %l | grep ^-..x',
560 560 )
561 561 # The BSDs don't ship GNU ls, so they don't understand the
562 562 # --color switch out of the box
563 563 if 'bsd' in sys.platform:
564 564 ls_extra = ( # ls normal files only
565 565 'lf ls -lF | grep ^-',
566 566 # ls symbolic links
567 567 'lk ls -lF | grep ^l',
568 568 # directories or links to directories,
569 569 'ldir ls -lF | grep /$',
570 570 # things which are executable
571 571 'lx ls -lF | grep ^-..x',
572 572 )
573 573 auto_alias = auto_alias + ls_extra
574 574 elif os.name in ['nt','dos']:
575 575 auto_alias = ('dir dir /on', 'ls dir /on',
576 576 'ddir dir /ad /on', 'ldir dir /ad /on',
577 577 'mkdir mkdir','rmdir rmdir','echo echo',
578 578 'ren ren','cls cls','copy copy')
579 579 else:
580 580 auto_alias = ()
581 581 self.auto_alias = [s.split(None,1) for s in auto_alias]
582 582
583 583 # Produce a public API instance
584 584 self.api = IPython.ipapi.IPApi(self)
585 585
586 586 # Call the actual (public) initializer
587 587 self.init_auto_alias()
588 588
589 589 # track which builtins we add, so we can clean up later
590 590 self.builtins_added = {}
591 591 # This method will add the necessary builtins for operation, but
592 592 # tracking what it did via the builtins_added dict.
593 593 self.add_builtins()
594 594
595 595 # end __init__
596 596
597 597 def var_expand(self,cmd,depth=0):
598 598 """Expand python variables in a string.
599 599
600 600 The depth argument indicates how many frames above the caller should
601 601 be walked to look for the local namespace where to expand variables.
602 602
603 603 The global namespace for expansion is always the user's interactive
604 604 namespace.
605 605 """
606 606
607 607 return str(ItplNS(cmd.replace('#','\#'),
608 608 self.user_ns, # globals
609 609 # Skip our own frame in searching for locals:
610 610 sys._getframe(depth+1).f_locals # locals
611 611 ))
612 612
613 613 def pre_config_initialization(self):
614 614 """Pre-configuration init method
615 615
616 616 This is called before the configuration files are processed to
617 617 prepare the services the config files might need.
618 618
619 619 self.rc already has reasonable default values at this point.
620 620 """
621 621 rc = self.rc
622 622 try:
623 623 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
624 624 except exceptions.UnicodeDecodeError:
625 625 print "Your ipythondir can't be decoded to unicode!"
626 626 print "Please set HOME environment variable to something that"
627 627 print r"only has ASCII characters, e.g. c:\home"
628 628 print "Now it is",rc.ipythondir
629 629 sys.exit()
630 630 self.shadowhist = IPython.history.ShadowHist(self.db)
631 631
632 632
633 633 def post_config_initialization(self):
634 634 """Post configuration init method
635 635
636 636 This is called after the configuration files have been processed to
637 637 'finalize' the initialization."""
638 638
639 639 rc = self.rc
640 640
641 641 # Object inspector
642 642 self.inspector = OInspect.Inspector(OInspect.InspectColors,
643 643 PyColorize.ANSICodeColors,
644 644 'NoColor',
645 645 rc.object_info_string_level)
646 646
647 647 self.rl_next_input = None
648 648 self.rl_do_indent = False
649 649 # Load readline proper
650 650 if rc.readline:
651 651 self.init_readline()
652 652
653 653
654 654 # local shortcut, this is used a LOT
655 655 self.log = self.logger.log
656 656
657 657 # Initialize cache, set in/out prompts and printing system
658 658 self.outputcache = CachedOutput(self,
659 659 rc.cache_size,
660 660 rc.pprint,
661 661 input_sep = rc.separate_in,
662 662 output_sep = rc.separate_out,
663 663 output_sep2 = rc.separate_out2,
664 664 ps1 = rc.prompt_in1,
665 665 ps2 = rc.prompt_in2,
666 666 ps_out = rc.prompt_out,
667 667 pad_left = rc.prompts_pad_left)
668 668
669 669 # user may have over-ridden the default print hook:
670 670 try:
671 671 self.outputcache.__class__.display = self.hooks.display
672 672 except AttributeError:
673 673 pass
674 674
675 675 # I don't like assigning globally to sys, because it means when
676 676 # embedding instances, each embedded instance overrides the previous
677 677 # choice. But sys.displayhook seems to be called internally by exec,
678 678 # so I don't see a way around it. We first save the original and then
679 679 # overwrite it.
680 680 self.sys_displayhook = sys.displayhook
681 681 sys.displayhook = self.outputcache
682 682
683 683 # Monkeypatch doctest so that its core test runner method is protected
684 684 # from IPython's modified displayhook. Doctest expects the default
685 685 # displayhook behavior deep down, so our modification breaks it
686 686 # completely. For this reason, a hard monkeypatch seems like a
687 687 # reasonable solution rather than asking users to manually use a
688 688 # different doctest runner when under IPython.
689 689 try:
690 690 doctest.DocTestRunner
691 691 except AttributeError:
692 692 # This is only for python 2.3 compatibility, remove once we move to
693 693 # 2.4 only.
694 694 pass
695 695 else:
696 696 doctest.DocTestRunner.run = dhook_wrap(doctest.DocTestRunner.run)
697 697
698 698 # Set user colors (don't do it in the constructor above so that it
699 699 # doesn't crash if colors option is invalid)
700 700 self.magic_colors(rc.colors)
701 701
702 702 # Set calling of pdb on exceptions
703 703 self.call_pdb = rc.pdb
704 704
705 705 # Load user aliases
706 706 for alias in rc.alias:
707 707 self.magic_alias(alias)
708 708
709 709 self.hooks.late_startup_hook()
710 710
711 711 batchrun = False
712 712 for batchfile in [path(arg) for arg in self.rc.args
713 713 if arg.lower().endswith('.ipy')]:
714 714 if not batchfile.isfile():
715 715 print "No such batch file:", batchfile
716 716 continue
717 717 self.api.runlines(batchfile.text())
718 718 batchrun = True
719 719 # without -i option, exit after running the batch file
720 720 if batchrun and not self.rc.interact:
721 721 self.exit_now = True
722 722
723 723 def add_builtins(self):
724 724 """Store ipython references into the builtin namespace.
725 725
726 726 Some parts of ipython operate via builtins injected here, which hold a
727 727 reference to IPython itself."""
728 728
729 729 # TODO: deprecate all except _ip; 'jobs' should be installed
730 730 # by an extension and the rest are under _ip, ipalias is redundant
731 731 builtins_new = dict(__IPYTHON__ = self,
732 732 ip_set_hook = self.set_hook,
733 733 jobs = self.jobs,
734 734 ipmagic = wrap_deprecated(self.ipmagic,'_ip.magic()'),
735 735 ipalias = wrap_deprecated(self.ipalias),
736 736 ipsystem = wrap_deprecated(self.ipsystem,'_ip.system()'),
737 737 _ip = self.api
738 738 )
739 739 for biname,bival in builtins_new.items():
740 740 try:
741 741 # store the orignal value so we can restore it
742 742 self.builtins_added[biname] = __builtin__.__dict__[biname]
743 743 except KeyError:
744 744 # or mark that it wasn't defined, and we'll just delete it at
745 745 # cleanup
746 746 self.builtins_added[biname] = Undefined
747 747 __builtin__.__dict__[biname] = bival
748 748
749 749 # Keep in the builtins a flag for when IPython is active. We set it
750 750 # with setdefault so that multiple nested IPythons don't clobber one
751 751 # another. Each will increase its value by one upon being activated,
752 752 # which also gives us a way to determine the nesting level.
753 753 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
754 754
755 755 def clean_builtins(self):
756 756 """Remove any builtins which might have been added by add_builtins, or
757 757 restore overwritten ones to their previous values."""
758 758 for biname,bival in self.builtins_added.items():
759 759 if bival is Undefined:
760 760 del __builtin__.__dict__[biname]
761 761 else:
762 762 __builtin__.__dict__[biname] = bival
763 763 self.builtins_added.clear()
764 764
765 765 def set_hook(self,name,hook, priority = 50, str_key = None, re_key = None):
766 766 """set_hook(name,hook) -> sets an internal IPython hook.
767 767
768 768 IPython exposes some of its internal API as user-modifiable hooks. By
769 769 adding your function to one of these hooks, you can modify IPython's
770 770 behavior to call at runtime your own routines."""
771 771
772 772 # At some point in the future, this should validate the hook before it
773 773 # accepts it. Probably at least check that the hook takes the number
774 774 # of args it's supposed to.
775 775
776 776 f = new.instancemethod(hook,self,self.__class__)
777 777
778 778 # check if the hook is for strdispatcher first
779 779 if str_key is not None:
780 780 sdp = self.strdispatchers.get(name, StrDispatch())
781 781 sdp.add_s(str_key, f, priority )
782 782 self.strdispatchers[name] = sdp
783 783 return
784 784 if re_key is not None:
785 785 sdp = self.strdispatchers.get(name, StrDispatch())
786 786 sdp.add_re(re.compile(re_key), f, priority )
787 787 self.strdispatchers[name] = sdp
788 788 return
789 789
790 790 dp = getattr(self.hooks, name, None)
791 791 if name not in IPython.hooks.__all__:
792 792 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
793 793 if not dp:
794 794 dp = IPython.hooks.CommandChainDispatcher()
795 795
796 796 try:
797 797 dp.add(f,priority)
798 798 except AttributeError:
799 799 # it was not commandchain, plain old func - replace
800 800 dp = f
801 801
802 802 setattr(self.hooks,name, dp)
803 803
804 804
805 805 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
806 806
807 807 def set_crash_handler(self,crashHandler):
808 808 """Set the IPython crash handler.
809 809
810 810 This must be a callable with a signature suitable for use as
811 811 sys.excepthook."""
812 812
813 813 # Install the given crash handler as the Python exception hook
814 814 sys.excepthook = crashHandler
815 815
816 816 # The instance will store a pointer to this, so that runtime code
817 817 # (such as magics) can access it. This is because during the
818 818 # read-eval loop, it gets temporarily overwritten (to deal with GUI
819 819 # frameworks).
820 820 self.sys_excepthook = sys.excepthook
821 821
822 822
823 823 def set_custom_exc(self,exc_tuple,handler):
824 824 """set_custom_exc(exc_tuple,handler)
825 825
826 826 Set a custom exception handler, which will be called if any of the
827 827 exceptions in exc_tuple occur in the mainloop (specifically, in the
828 828 runcode() method.
829 829
830 830 Inputs:
831 831
832 832 - exc_tuple: a *tuple* of valid exceptions to call the defined
833 833 handler for. It is very important that you use a tuple, and NOT A
834 834 LIST here, because of the way Python's except statement works. If
835 835 you only want to trap a single exception, use a singleton tuple:
836 836
837 837 exc_tuple == (MyCustomException,)
838 838
839 839 - handler: this must be defined as a function with the following
840 840 basic interface: def my_handler(self,etype,value,tb).
841 841
842 842 This will be made into an instance method (via new.instancemethod)
843 843 of IPython itself, and it will be called if any of the exceptions
844 844 listed in the exc_tuple are caught. If the handler is None, an
845 845 internal basic one is used, which just prints basic info.
846 846
847 847 WARNING: by putting in your own exception handler into IPython's main
848 848 execution loop, you run a very good chance of nasty crashes. This
849 849 facility should only be used if you really know what you are doing."""
850 850
851 851 assert type(exc_tuple)==type(()) , \
852 852 "The custom exceptions must be given AS A TUPLE."
853 853
854 854 def dummy_handler(self,etype,value,tb):
855 855 print '*** Simple custom exception handler ***'
856 856 print 'Exception type :',etype
857 857 print 'Exception value:',value
858 858 print 'Traceback :',tb
859 859 print 'Source code :','\n'.join(self.buffer)
860 860
861 861 if handler is None: handler = dummy_handler
862 862
863 863 self.CustomTB = new.instancemethod(handler,self,self.__class__)
864 864 self.custom_exceptions = exc_tuple
865 865
866 866 def set_custom_completer(self,completer,pos=0):
867 867 """set_custom_completer(completer,pos=0)
868 868
869 869 Adds a new custom completer function.
870 870
871 871 The position argument (defaults to 0) is the index in the completers
872 872 list where you want the completer to be inserted."""
873 873
874 874 newcomp = new.instancemethod(completer,self.Completer,
875 875 self.Completer.__class__)
876 876 self.Completer.matchers.insert(pos,newcomp)
877 877
878 878 def set_completer(self):
879 879 """reset readline's completer to be our own."""
880 880 self.readline.set_completer(self.Completer.complete)
881 881
882 882 def _get_call_pdb(self):
883 883 return self._call_pdb
884 884
885 885 def _set_call_pdb(self,val):
886 886
887 887 if val not in (0,1,False,True):
888 888 raise ValueError,'new call_pdb value must be boolean'
889 889
890 890 # store value in instance
891 891 self._call_pdb = val
892 892
893 893 # notify the actual exception handlers
894 894 self.InteractiveTB.call_pdb = val
895 895 if self.isthreaded:
896 896 try:
897 897 self.sys_excepthook.call_pdb = val
898 898 except:
899 899 warn('Failed to activate pdb for threaded exception handler')
900 900
901 901 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
902 902 'Control auto-activation of pdb at exceptions')
903 903
904 904
905 905 # These special functions get installed in the builtin namespace, to
906 906 # provide programmatic (pure python) access to magics, aliases and system
907 907 # calls. This is important for logging, user scripting, and more.
908 908
909 909 # We are basically exposing, via normal python functions, the three
910 910 # mechanisms in which ipython offers special call modes (magics for
911 911 # internal control, aliases for direct system access via pre-selected
912 912 # names, and !cmd for calling arbitrary system commands).
913 913
914 914 def ipmagic(self,arg_s):
915 915 """Call a magic function by name.
916 916
917 917 Input: a string containing the name of the magic function to call and any
918 918 additional arguments to be passed to the magic.
919 919
920 920 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
921 921 prompt:
922 922
923 923 In[1]: %name -opt foo bar
924 924
925 925 To call a magic without arguments, simply use ipmagic('name').
926 926
927 927 This provides a proper Python function to call IPython's magics in any
928 928 valid Python code you can type at the interpreter, including loops and
929 929 compound statements. It is added by IPython to the Python builtin
930 930 namespace upon initialization."""
931 931
932 932 args = arg_s.split(' ',1)
933 933 magic_name = args[0]
934 934 magic_name = magic_name.lstrip(self.ESC_MAGIC)
935 935
936 936 try:
937 937 magic_args = args[1]
938 938 except IndexError:
939 939 magic_args = ''
940 940 fn = getattr(self,'magic_'+magic_name,None)
941 941 if fn is None:
942 942 error("Magic function `%s` not found." % magic_name)
943 943 else:
944 944 magic_args = self.var_expand(magic_args,1)
945 945 return fn(magic_args)
946 946
947 947 def ipalias(self,arg_s):
948 948 """Call an alias by name.
949 949
950 950 Input: a string containing the name of the alias to call and any
951 951 additional arguments to be passed to the magic.
952 952
953 953 ipalias('name -opt foo bar') is equivalent to typing at the ipython
954 954 prompt:
955 955
956 956 In[1]: name -opt foo bar
957 957
958 958 To call an alias without arguments, simply use ipalias('name').
959 959
960 960 This provides a proper Python function to call IPython's aliases in any
961 961 valid Python code you can type at the interpreter, including loops and
962 962 compound statements. It is added by IPython to the Python builtin
963 963 namespace upon initialization."""
964 964
965 965 args = arg_s.split(' ',1)
966 966 alias_name = args[0]
967 967 try:
968 968 alias_args = args[1]
969 969 except IndexError:
970 970 alias_args = ''
971 971 if alias_name in self.alias_table:
972 972 self.call_alias(alias_name,alias_args)
973 973 else:
974 974 error("Alias `%s` not found." % alias_name)
975 975
976 976 def ipsystem(self,arg_s):
977 977 """Make a system call, using IPython."""
978 978
979 979 self.system(arg_s)
980 980
981 981 def complete(self,text):
982 982 """Return a sorted list of all possible completions on text.
983 983
984 984 Inputs:
985 985
986 986 - text: a string of text to be completed on.
987 987
988 988 This is a wrapper around the completion mechanism, similar to what
989 989 readline does at the command line when the TAB key is hit. By
990 990 exposing it as a method, it can be used by other non-readline
991 991 environments (such as GUIs) for text completion.
992 992
993 993 Simple usage example:
994 994
995 995 In [1]: x = 'hello'
996 996
997 997 In [2]: __IP.complete('x.l')
998 998 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
999 999
1000 1000 complete = self.Completer.complete
1001 1001 state = 0
1002 1002 # use a dict so we get unique keys, since ipyhton's multiple
1003 1003 # completers can return duplicates. When we make 2.4 a requirement,
1004 1004 # start using sets instead, which are faster.
1005 1005 comps = {}
1006 1006 while True:
1007 1007 newcomp = complete(text,state,line_buffer=text)
1008 1008 if newcomp is None:
1009 1009 break
1010 1010 comps[newcomp] = 1
1011 1011 state += 1
1012 1012 outcomps = comps.keys()
1013 1013 outcomps.sort()
1014 1014 return outcomps
1015 1015
1016 1016 def set_completer_frame(self, frame=None):
1017 1017 if frame:
1018 1018 self.Completer.namespace = frame.f_locals
1019 1019 self.Completer.global_namespace = frame.f_globals
1020 1020 else:
1021 1021 self.Completer.namespace = self.user_ns
1022 1022 self.Completer.global_namespace = self.user_global_ns
1023 1023
1024 1024 def init_auto_alias(self):
1025 1025 """Define some aliases automatically.
1026 1026
1027 1027 These are ALL parameter-less aliases"""
1028 1028
1029 1029 for alias,cmd in self.auto_alias:
1030 1030 self.getapi().defalias(alias,cmd)
1031 1031
1032 1032
1033 1033 def alias_table_validate(self,verbose=0):
1034 1034 """Update information about the alias table.
1035 1035
1036 1036 In particular, make sure no Python keywords/builtins are in it."""
1037 1037
1038 1038 no_alias = self.no_alias
1039 1039 for k in self.alias_table.keys():
1040 1040 if k in no_alias:
1041 1041 del self.alias_table[k]
1042 1042 if verbose:
1043 1043 print ("Deleting alias <%s>, it's a Python "
1044 1044 "keyword or builtin." % k)
1045 1045
1046 1046 def set_autoindent(self,value=None):
1047 1047 """Set the autoindent flag, checking for readline support.
1048 1048
1049 1049 If called with no arguments, it acts as a toggle."""
1050 1050
1051 1051 if not self.has_readline:
1052 1052 if os.name == 'posix':
1053 1053 warn("The auto-indent feature requires the readline library")
1054 1054 self.autoindent = 0
1055 1055 return
1056 1056 if value is None:
1057 1057 self.autoindent = not self.autoindent
1058 1058 else:
1059 1059 self.autoindent = value
1060 1060
1061 1061 def rc_set_toggle(self,rc_field,value=None):
1062 1062 """Set or toggle a field in IPython's rc config. structure.
1063 1063
1064 1064 If called with no arguments, it acts as a toggle.
1065 1065
1066 1066 If called with a non-existent field, the resulting AttributeError
1067 1067 exception will propagate out."""
1068 1068
1069 1069 rc_val = getattr(self.rc,rc_field)
1070 1070 if value is None:
1071 1071 value = not rc_val
1072 1072 setattr(self.rc,rc_field,value)
1073 1073
1074 1074 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1075 1075 """Install the user configuration directory.
1076 1076
1077 1077 Can be called when running for the first time or to upgrade the user's
1078 1078 .ipython/ directory with the mode parameter. Valid modes are 'install'
1079 1079 and 'upgrade'."""
1080 1080
1081 1081 def wait():
1082 1082 try:
1083 1083 raw_input("Please press <RETURN> to start IPython.")
1084 1084 except EOFError:
1085 1085 print >> Term.cout
1086 1086 print '*'*70
1087 1087
1088 1088 cwd = os.getcwd() # remember where we started
1089 1089 glb = glob.glob
1090 1090 print '*'*70
1091 1091 if mode == 'install':
1092 1092 print \
1093 1093 """Welcome to IPython. I will try to create a personal configuration directory
1094 1094 where you can customize many aspects of IPython's functionality in:\n"""
1095 1095 else:
1096 1096 print 'I am going to upgrade your configuration in:'
1097 1097
1098 1098 print ipythondir
1099 1099
1100 1100 rcdirend = os.path.join('IPython','UserConfig')
1101 1101 cfg = lambda d: os.path.join(d,rcdirend)
1102 1102 try:
1103 1103 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1104 1104 except IOError:
1105 1105 warning = """
1106 1106 Installation error. IPython's directory was not found.
1107 1107
1108 1108 Check the following:
1109 1109
1110 1110 The ipython/IPython directory should be in a directory belonging to your
1111 1111 PYTHONPATH environment variable (that is, it should be in a directory
1112 1112 belonging to sys.path). You can copy it explicitly there or just link to it.
1113 1113
1114 1114 IPython will proceed with builtin defaults.
1115 1115 """
1116 1116 warn(warning)
1117 1117 wait()
1118 1118 return
1119 1119
1120 1120 if mode == 'install':
1121 1121 try:
1122 1122 shutil.copytree(rcdir,ipythondir)
1123 1123 os.chdir(ipythondir)
1124 1124 rc_files = glb("ipythonrc*")
1125 1125 for rc_file in rc_files:
1126 1126 os.rename(rc_file,rc_file+rc_suffix)
1127 1127 except:
1128 1128 warning = """
1129 1129
1130 1130 There was a problem with the installation:
1131 1131 %s
1132 1132 Try to correct it or contact the developers if you think it's a bug.
1133 1133 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1134 1134 warn(warning)
1135 1135 wait()
1136 1136 return
1137 1137
1138 1138 elif mode == 'upgrade':
1139 1139 try:
1140 1140 os.chdir(ipythondir)
1141 1141 except:
1142 1142 print """
1143 1143 Can not upgrade: changing to directory %s failed. Details:
1144 1144 %s
1145 1145 """ % (ipythondir,sys.exc_info()[1])
1146 1146 wait()
1147 1147 return
1148 1148 else:
1149 1149 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1150 1150 for new_full_path in sources:
1151 1151 new_filename = os.path.basename(new_full_path)
1152 1152 if new_filename.startswith('ipythonrc'):
1153 1153 new_filename = new_filename + rc_suffix
1154 1154 # The config directory should only contain files, skip any
1155 1155 # directories which may be there (like CVS)
1156 1156 if os.path.isdir(new_full_path):
1157 1157 continue
1158 1158 if os.path.exists(new_filename):
1159 1159 old_file = new_filename+'.old'
1160 1160 if os.path.exists(old_file):
1161 1161 os.remove(old_file)
1162 1162 os.rename(new_filename,old_file)
1163 1163 shutil.copy(new_full_path,new_filename)
1164 1164 else:
1165 1165 raise ValueError,'unrecognized mode for install:',`mode`
1166 1166
1167 1167 # Fix line-endings to those native to each platform in the config
1168 1168 # directory.
1169 1169 try:
1170 1170 os.chdir(ipythondir)
1171 1171 except:
1172 1172 print """
1173 1173 Problem: changing to directory %s failed.
1174 1174 Details:
1175 1175 %s
1176 1176
1177 1177 Some configuration files may have incorrect line endings. This should not
1178 1178 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1179 1179 wait()
1180 1180 else:
1181 1181 for fname in glb('ipythonrc*'):
1182 1182 try:
1183 1183 native_line_ends(fname,backup=0)
1184 1184 except IOError:
1185 1185 pass
1186 1186
1187 1187 if mode == 'install':
1188 1188 print """
1189 1189 Successful installation!
1190 1190
1191 1191 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1192 1192 IPython manual (there are both HTML and PDF versions supplied with the
1193 1193 distribution) to make sure that your system environment is properly configured
1194 1194 to take advantage of IPython's features.
1195 1195
1196 1196 Important note: the configuration system has changed! The old system is
1197 1197 still in place, but its setting may be partly overridden by the settings in
1198 1198 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1199 1199 if some of the new settings bother you.
1200 1200
1201 1201 """
1202 1202 else:
1203 1203 print """
1204 1204 Successful upgrade!
1205 1205
1206 1206 All files in your directory:
1207 1207 %(ipythondir)s
1208 1208 which would have been overwritten by the upgrade were backed up with a .old
1209 1209 extension. If you had made particular customizations in those files you may
1210 1210 want to merge them back into the new files.""" % locals()
1211 1211 wait()
1212 1212 os.chdir(cwd)
1213 1213 # end user_setup()
1214 1214
1215 1215 def atexit_operations(self):
1216 1216 """This will be executed at the time of exit.
1217 1217
1218 1218 Saving of persistent data should be performed here. """
1219 1219
1220 1220 #print '*** IPython exit cleanup ***' # dbg
1221 1221 # input history
1222 1222 self.savehist()
1223 1223
1224 1224 # Cleanup all tempfiles left around
1225 1225 for tfile in self.tempfiles:
1226 1226 try:
1227 1227 os.unlink(tfile)
1228 1228 except OSError:
1229 1229 pass
1230 1230
1231 1231 self.hooks.shutdown_hook()
1232 1232
1233 1233 def savehist(self):
1234 1234 """Save input history to a file (via readline library)."""
1235 1235 try:
1236 1236 self.readline.write_history_file(self.histfile)
1237 1237 except:
1238 1238 print 'Unable to save IPython command history to file: ' + \
1239 1239 `self.histfile`
1240 1240
1241 1241 def reloadhist(self):
1242 1242 """Reload the input history from disk file."""
1243 1243
1244 1244 if self.has_readline:
1245 1245 self.readline.clear_history()
1246 1246 self.readline.read_history_file(self.shell.histfile)
1247 1247
1248 1248 def history_saving_wrapper(self, func):
1249 1249 """ Wrap func for readline history saving
1250 1250
1251 1251 Convert func into callable that saves & restores
1252 1252 history around the call """
1253 1253
1254 1254 if not self.has_readline:
1255 1255 return func
1256 1256
1257 1257 def wrapper():
1258 1258 self.savehist()
1259 1259 try:
1260 1260 func()
1261 1261 finally:
1262 1262 readline.read_history_file(self.histfile)
1263 1263 return wrapper
1264 1264
1265 1265
1266 1266 def pre_readline(self):
1267 1267 """readline hook to be used at the start of each line.
1268 1268
1269 1269 Currently it handles auto-indent only."""
1270 1270
1271 1271 #debugx('self.indent_current_nsp','pre_readline:')
1272 1272
1273 1273 if self.rl_do_indent:
1274 1274 self.readline.insert_text(self.indent_current_str())
1275 1275 if self.rl_next_input is not None:
1276 1276 self.readline.insert_text(self.rl_next_input)
1277 1277 self.rl_next_input = None
1278 1278
1279 1279 def init_readline(self):
1280 1280 """Command history completion/saving/reloading."""
1281 1281
1282 1282
1283 1283 import IPython.rlineimpl as readline
1284 1284
1285 1285 if not readline.have_readline:
1286 1286 self.has_readline = 0
1287 1287 self.readline = None
1288 1288 # no point in bugging windows users with this every time:
1289 1289 warn('Readline services not available on this platform.')
1290 1290 else:
1291 1291 sys.modules['readline'] = readline
1292 1292 import atexit
1293 1293 from IPython.completer import IPCompleter
1294 1294 self.Completer = IPCompleter(self,
1295 1295 self.user_ns,
1296 1296 self.user_global_ns,
1297 1297 self.rc.readline_omit__names,
1298 1298 self.alias_table)
1299 1299 sdisp = self.strdispatchers.get('complete_command', StrDispatch())
1300 1300 self.strdispatchers['complete_command'] = sdisp
1301 1301 self.Completer.custom_completers = sdisp
1302 1302 # Platform-specific configuration
1303 1303 if os.name == 'nt':
1304 1304 self.readline_startup_hook = readline.set_pre_input_hook
1305 1305 else:
1306 1306 self.readline_startup_hook = readline.set_startup_hook
1307 1307
1308 1308 # Load user's initrc file (readline config)
1309 1309 inputrc_name = os.environ.get('INPUTRC')
1310 1310 if inputrc_name is None:
1311 1311 home_dir = get_home_dir()
1312 1312 if home_dir is not None:
1313 1313 inputrc_name = os.path.join(home_dir,'.inputrc')
1314 1314 if os.path.isfile(inputrc_name):
1315 1315 try:
1316 1316 readline.read_init_file(inputrc_name)
1317 1317 except:
1318 1318 warn('Problems reading readline initialization file <%s>'
1319 1319 % inputrc_name)
1320 1320
1321 1321 self.has_readline = 1
1322 1322 self.readline = readline
1323 1323 # save this in sys so embedded copies can restore it properly
1324 1324 sys.ipcompleter = self.Completer.complete
1325 1325 self.set_completer()
1326 1326
1327 1327 # Configure readline according to user's prefs
1328 1328 for rlcommand in self.rc.readline_parse_and_bind:
1329 1329 readline.parse_and_bind(rlcommand)
1330 1330
1331 1331 # remove some chars from the delimiters list
1332 1332 delims = readline.get_completer_delims()
1333 1333 delims = delims.translate(string._idmap,
1334 1334 self.rc.readline_remove_delims)
1335 1335 readline.set_completer_delims(delims)
1336 1336 # otherwise we end up with a monster history after a while:
1337 1337 readline.set_history_length(1000)
1338 1338 try:
1339 1339 #print '*** Reading readline history' # dbg
1340 1340 readline.read_history_file(self.histfile)
1341 1341 except IOError:
1342 1342 pass # It doesn't exist yet.
1343 1343
1344 1344 atexit.register(self.atexit_operations)
1345 1345 del atexit
1346 1346
1347 1347 # Configure auto-indent for all platforms
1348 1348 self.set_autoindent(self.rc.autoindent)
1349 1349
1350 1350 def ask_yes_no(self,prompt,default=True):
1351 1351 if self.rc.quiet:
1352 1352 return True
1353 1353 return ask_yes_no(prompt,default)
1354 1354
1355 1355 def _should_recompile(self,e):
1356 1356 """Utility routine for edit_syntax_error"""
1357 1357
1358 1358 if e.filename in ('<ipython console>','<input>','<string>',
1359 1359 '<console>','<BackgroundJob compilation>',
1360 1360 None):
1361 1361
1362 1362 return False
1363 1363 try:
1364 1364 if (self.rc.autoedit_syntax and
1365 1365 not self.ask_yes_no('Return to editor to correct syntax error? '
1366 1366 '[Y/n] ','y')):
1367 1367 return False
1368 1368 except EOFError:
1369 1369 return False
1370 1370
1371 1371 def int0(x):
1372 1372 try:
1373 1373 return int(x)
1374 1374 except TypeError:
1375 1375 return 0
1376 1376 # always pass integer line and offset values to editor hook
1377 1377 self.hooks.fix_error_editor(e.filename,
1378 1378 int0(e.lineno),int0(e.offset),e.msg)
1379 1379 return True
1380 1380
1381 1381 def edit_syntax_error(self):
1382 1382 """The bottom half of the syntax error handler called in the main loop.
1383 1383
1384 1384 Loop until syntax error is fixed or user cancels.
1385 1385 """
1386 1386
1387 1387 while self.SyntaxTB.last_syntax_error:
1388 1388 # copy and clear last_syntax_error
1389 1389 err = self.SyntaxTB.clear_err_state()
1390 1390 if not self._should_recompile(err):
1391 1391 return
1392 1392 try:
1393 1393 # may set last_syntax_error again if a SyntaxError is raised
1394 1394 self.safe_execfile(err.filename,self.user_ns)
1395 1395 except:
1396 1396 self.showtraceback()
1397 1397 else:
1398 1398 try:
1399 1399 f = file(err.filename)
1400 1400 try:
1401 1401 sys.displayhook(f.read())
1402 1402 finally:
1403 1403 f.close()
1404 1404 except:
1405 1405 self.showtraceback()
1406 1406
1407 1407 def showsyntaxerror(self, filename=None):
1408 1408 """Display the syntax error that just occurred.
1409 1409
1410 1410 This doesn't display a stack trace because there isn't one.
1411 1411
1412 1412 If a filename is given, it is stuffed in the exception instead
1413 1413 of what was there before (because Python's parser always uses
1414 1414 "<string>" when reading from a string).
1415 1415 """
1416 1416 etype, value, last_traceback = sys.exc_info()
1417 1417
1418 1418 # See note about these variables in showtraceback() below
1419 1419 sys.last_type = etype
1420 1420 sys.last_value = value
1421 1421 sys.last_traceback = last_traceback
1422 1422
1423 1423 if filename and etype is SyntaxError:
1424 1424 # Work hard to stuff the correct filename in the exception
1425 1425 try:
1426 1426 msg, (dummy_filename, lineno, offset, line) = value
1427 1427 except:
1428 1428 # Not the format we expect; leave it alone
1429 1429 pass
1430 1430 else:
1431 1431 # Stuff in the right filename
1432 1432 try:
1433 1433 # Assume SyntaxError is a class exception
1434 1434 value = SyntaxError(msg, (filename, lineno, offset, line))
1435 1435 except:
1436 1436 # If that failed, assume SyntaxError is a string
1437 1437 value = msg, (filename, lineno, offset, line)
1438 1438 self.SyntaxTB(etype,value,[])
1439 1439
1440 1440 def debugger(self,force=False):
1441 1441 """Call the pydb/pdb debugger.
1442 1442
1443 1443 Keywords:
1444 1444
1445 1445 - force(False): by default, this routine checks the instance call_pdb
1446 1446 flag and does not actually invoke the debugger if the flag is false.
1447 1447 The 'force' option forces the debugger to activate even if the flag
1448 1448 is false.
1449 1449 """
1450 1450
1451 1451 if not (force or self.call_pdb):
1452 1452 return
1453 1453
1454 1454 if not hasattr(sys,'last_traceback'):
1455 1455 error('No traceback has been produced, nothing to debug.')
1456 1456 return
1457 1457
1458 1458 # use pydb if available
1459 1459 if Debugger.has_pydb:
1460 1460 from pydb import pm
1461 1461 else:
1462 1462 # fallback to our internal debugger
1463 1463 pm = lambda : self.InteractiveTB.debugger(force=True)
1464 1464 self.history_saving_wrapper(pm)()
1465 1465
1466 1466 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1467 1467 """Display the exception that just occurred.
1468 1468
1469 1469 If nothing is known about the exception, this is the method which
1470 1470 should be used throughout the code for presenting user tracebacks,
1471 1471 rather than directly invoking the InteractiveTB object.
1472 1472
1473 1473 A specific showsyntaxerror() also exists, but this method can take
1474 1474 care of calling it if needed, so unless you are explicitly catching a
1475 1475 SyntaxError exception, don't try to analyze the stack manually and
1476 1476 simply call this method."""
1477 1477
1478 1478
1479 1479 # Though this won't be called by syntax errors in the input line,
1480 1480 # there may be SyntaxError cases whith imported code.
1481 1481
1482 1482
1483 1483 if exc_tuple is None:
1484 1484 etype, value, tb = sys.exc_info()
1485 1485 else:
1486 1486 etype, value, tb = exc_tuple
1487 1487
1488 1488 if etype is SyntaxError:
1489 1489 self.showsyntaxerror(filename)
1490 1490 else:
1491 1491 # WARNING: these variables are somewhat deprecated and not
1492 1492 # necessarily safe to use in a threaded environment, but tools
1493 1493 # like pdb depend on their existence, so let's set them. If we
1494 1494 # find problems in the field, we'll need to revisit their use.
1495 1495 sys.last_type = etype
1496 1496 sys.last_value = value
1497 1497 sys.last_traceback = tb
1498 1498
1499 1499 if etype in self.custom_exceptions:
1500 1500 self.CustomTB(etype,value,tb)
1501 1501 else:
1502 1502 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1503 1503 if self.InteractiveTB.call_pdb and self.has_readline:
1504 1504 # pdb mucks up readline, fix it back
1505 1505 self.set_completer()
1506 1506
1507 1507
1508 1508 def mainloop(self,banner=None):
1509 1509 """Creates the local namespace and starts the mainloop.
1510 1510
1511 1511 If an optional banner argument is given, it will override the
1512 1512 internally created default banner."""
1513 1513
1514 1514 if self.rc.c: # Emulate Python's -c option
1515 1515 self.exec_init_cmd()
1516 1516 if banner is None:
1517 1517 if not self.rc.banner:
1518 1518 banner = ''
1519 1519 # banner is string? Use it directly!
1520 1520 elif isinstance(self.rc.banner,basestring):
1521 1521 banner = self.rc.banner
1522 1522 else:
1523 1523 banner = self.BANNER+self.banner2
1524 1524
1525 1525 self.interact(banner)
1526 1526
1527 1527 def exec_init_cmd(self):
1528 1528 """Execute a command given at the command line.
1529 1529
1530 1530 This emulates Python's -c option."""
1531 1531
1532 1532 #sys.argv = ['-c']
1533 1533 self.push(self.prefilter(self.rc.c, False))
1534 1534 if not self.rc.interact:
1535 1535 self.exit_now = True
1536 1536
1537 1537 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1538 1538 """Embeds IPython into a running python program.
1539 1539
1540 1540 Input:
1541 1541
1542 1542 - header: An optional header message can be specified.
1543 1543
1544 1544 - local_ns, global_ns: working namespaces. If given as None, the
1545 1545 IPython-initialized one is updated with __main__.__dict__, so that
1546 1546 program variables become visible but user-specific configuration
1547 1547 remains possible.
1548 1548
1549 1549 - stack_depth: specifies how many levels in the stack to go to
1550 1550 looking for namespaces (when local_ns and global_ns are None). This
1551 1551 allows an intermediate caller to make sure that this function gets
1552 1552 the namespace from the intended level in the stack. By default (0)
1553 1553 it will get its locals and globals from the immediate caller.
1554 1554
1555 1555 Warning: it's possible to use this in a program which is being run by
1556 1556 IPython itself (via %run), but some funny things will happen (a few
1557 1557 globals get overwritten). In the future this will be cleaned up, as
1558 1558 there is no fundamental reason why it can't work perfectly."""
1559 1559
1560 1560 # Get locals and globals from caller
1561 1561 if local_ns is None or global_ns is None:
1562 1562 call_frame = sys._getframe(stack_depth).f_back
1563 1563
1564 1564 if local_ns is None:
1565 1565 local_ns = call_frame.f_locals
1566 1566 if global_ns is None:
1567 1567 global_ns = call_frame.f_globals
1568 1568
1569 1569 # Update namespaces and fire up interpreter
1570 1570
1571 1571 # The global one is easy, we can just throw it in
1572 1572 self.user_global_ns = global_ns
1573 1573
1574 1574 # but the user/local one is tricky: ipython needs it to store internal
1575 1575 # data, but we also need the locals. We'll copy locals in the user
1576 1576 # one, but will track what got copied so we can delete them at exit.
1577 1577 # This is so that a later embedded call doesn't see locals from a
1578 1578 # previous call (which most likely existed in a separate scope).
1579 1579 local_varnames = local_ns.keys()
1580 1580 self.user_ns.update(local_ns)
1581 1581
1582 1582 # Patch for global embedding to make sure that things don't overwrite
1583 1583 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1584 1584 # FIXME. Test this a bit more carefully (the if.. is new)
1585 1585 if local_ns is None and global_ns is None:
1586 1586 self.user_global_ns.update(__main__.__dict__)
1587 1587
1588 1588 # make sure the tab-completer has the correct frame information, so it
1589 1589 # actually completes using the frame's locals/globals
1590 1590 self.set_completer_frame()
1591 1591
1592 1592 # before activating the interactive mode, we need to make sure that
1593 1593 # all names in the builtin namespace needed by ipython point to
1594 1594 # ourselves, and not to other instances.
1595 1595 self.add_builtins()
1596 1596
1597 1597 self.interact(header)
1598 1598
1599 1599 # now, purge out the user namespace from anything we might have added
1600 1600 # from the caller's local namespace
1601 1601 delvar = self.user_ns.pop
1602 1602 for var in local_varnames:
1603 1603 delvar(var,None)
1604 1604 # and clean builtins we may have overridden
1605 1605 self.clean_builtins()
1606 1606
1607 1607 def interact(self, banner=None):
1608 1608 """Closely emulate the interactive Python console.
1609 1609
1610 1610 The optional banner argument specify the banner to print
1611 1611 before the first interaction; by default it prints a banner
1612 1612 similar to the one printed by the real Python interpreter,
1613 1613 followed by the current class name in parentheses (so as not
1614 1614 to confuse this with the real interpreter -- since it's so
1615 1615 close!).
1616 1616
1617 1617 """
1618 1618
1619 1619 if self.exit_now:
1620 1620 # batch run -> do not interact
1621 1621 return
1622 1622 cprt = 'Type "copyright", "credits" or "license" for more information.'
1623 1623 if banner is None:
1624 1624 self.write("Python %s on %s\n%s\n(%s)\n" %
1625 1625 (sys.version, sys.platform, cprt,
1626 1626 self.__class__.__name__))
1627 1627 else:
1628 1628 self.write(banner)
1629 1629
1630 1630 more = 0
1631 1631
1632 1632 # Mark activity in the builtins
1633 1633 __builtin__.__dict__['__IPYTHON__active'] += 1
1634 1634
1635 1635 if self.has_readline:
1636 1636 self.readline_startup_hook(self.pre_readline)
1637 1637 # exit_now is set by a call to %Exit or %Quit
1638 1638
1639 1639 while not self.exit_now:
1640 1640 if more:
1641 1641 prompt = self.hooks.generate_prompt(True)
1642 1642 if self.autoindent:
1643 1643 self.rl_do_indent = True
1644 1644
1645 1645 else:
1646 1646 prompt = self.hooks.generate_prompt(False)
1647 1647 try:
1648 1648 line = self.raw_input(prompt,more)
1649 1649 if self.exit_now:
1650 1650 # quick exit on sys.std[in|out] close
1651 1651 break
1652 1652 if self.autoindent:
1653 1653 self.rl_do_indent = False
1654 1654
1655 1655 except KeyboardInterrupt:
1656 1656 self.write('\nKeyboardInterrupt\n')
1657 1657 self.resetbuffer()
1658 1658 # keep cache in sync with the prompt counter:
1659 1659 self.outputcache.prompt_count -= 1
1660 1660
1661 1661 if self.autoindent:
1662 1662 self.indent_current_nsp = 0
1663 1663 more = 0
1664 1664 except EOFError:
1665 1665 if self.autoindent:
1666 1666 self.rl_do_indent = False
1667 1667 self.readline_startup_hook(None)
1668 1668 self.write('\n')
1669 1669 self.exit()
1670 1670 except bdb.BdbQuit:
1671 1671 warn('The Python debugger has exited with a BdbQuit exception.\n'
1672 1672 'Because of how pdb handles the stack, it is impossible\n'
1673 1673 'for IPython to properly format this particular exception.\n'
1674 1674 'IPython will resume normal operation.')
1675 1675 except:
1676 1676 # exceptions here are VERY RARE, but they can be triggered
1677 1677 # asynchronously by signal handlers, for example.
1678 1678 self.showtraceback()
1679 1679 else:
1680 1680 more = self.push(line)
1681 1681 if (self.SyntaxTB.last_syntax_error and
1682 1682 self.rc.autoedit_syntax):
1683 1683 self.edit_syntax_error()
1684 1684
1685 1685 # We are off again...
1686 1686 __builtin__.__dict__['__IPYTHON__active'] -= 1
1687 1687
1688 1688 def excepthook(self, etype, value, tb):
1689 1689 """One more defense for GUI apps that call sys.excepthook.
1690 1690
1691 1691 GUI frameworks like wxPython trap exceptions and call
1692 1692 sys.excepthook themselves. I guess this is a feature that
1693 1693 enables them to keep running after exceptions that would
1694 1694 otherwise kill their mainloop. This is a bother for IPython
1695 1695 which excepts to catch all of the program exceptions with a try:
1696 1696 except: statement.
1697 1697
1698 1698 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1699 1699 any app directly invokes sys.excepthook, it will look to the user like
1700 1700 IPython crashed. In order to work around this, we can disable the
1701 1701 CrashHandler and replace it with this excepthook instead, which prints a
1702 1702 regular traceback using our InteractiveTB. In this fashion, apps which
1703 1703 call sys.excepthook will generate a regular-looking exception from
1704 1704 IPython, and the CrashHandler will only be triggered by real IPython
1705 1705 crashes.
1706 1706
1707 1707 This hook should be used sparingly, only in places which are not likely
1708 1708 to be true IPython errors.
1709 1709 """
1710 1710 self.showtraceback((etype,value,tb),tb_offset=0)
1711 1711
1712 1712 def expand_aliases(self,fn,rest):
1713 1713 """ Expand multiple levels of aliases:
1714 1714
1715 1715 if:
1716 1716
1717 1717 alias foo bar /tmp
1718 1718 alias baz foo
1719 1719
1720 1720 then:
1721 1721
1722 1722 baz huhhahhei -> bar /tmp huhhahhei
1723 1723
1724 1724 """
1725 1725 line = fn + " " + rest
1726 1726
1727 1727 done = Set()
1728 1728 while 1:
1729 1729 pre,fn,rest = prefilter.splitUserInput(line,
1730 1730 prefilter.shell_line_split)
1731 1731 if fn in self.alias_table:
1732 1732 if fn in done:
1733 1733 warn("Cyclic alias definition, repeated '%s'" % fn)
1734 1734 return ""
1735 1735 done.add(fn)
1736 1736
1737 1737 l2 = self.transform_alias(fn,rest)
1738 1738 # dir -> dir
1739 1739 # print "alias",line, "->",l2 #dbg
1740 1740 if l2 == line:
1741 1741 break
1742 1742 # ls -> ls -F should not recurse forever
1743 1743 if l2.split(None,1)[0] == line.split(None,1)[0]:
1744 1744 line = l2
1745 1745 break
1746 1746
1747 1747 line=l2
1748 1748
1749 1749
1750 1750 # print "al expand to",line #dbg
1751 1751 else:
1752 1752 break
1753 1753
1754 1754 return line
1755 1755
1756 1756 def transform_alias(self, alias,rest=''):
1757 1757 """ Transform alias to system command string.
1758 1758 """
1759 1759 trg = self.alias_table[alias]
1760 1760
1761 1761 nargs,cmd = trg
1762 1762 # print trg #dbg
1763 1763 if ' ' in cmd and os.path.isfile(cmd):
1764 1764 cmd = '"%s"' % cmd
1765 1765
1766 1766 # Expand the %l special to be the user's input line
1767 1767 if cmd.find('%l') >= 0:
1768 1768 cmd = cmd.replace('%l',rest)
1769 1769 rest = ''
1770 1770 if nargs==0:
1771 1771 # Simple, argument-less aliases
1772 1772 cmd = '%s %s' % (cmd,rest)
1773 1773 else:
1774 1774 # Handle aliases with positional arguments
1775 1775 args = rest.split(None,nargs)
1776 1776 if len(args)< nargs:
1777 1777 error('Alias <%s> requires %s arguments, %s given.' %
1778 1778 (alias,nargs,len(args)))
1779 1779 return None
1780 1780 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1781 1781 # Now call the macro, evaluating in the user's namespace
1782 1782 #print 'new command: <%r>' % cmd # dbg
1783 1783 return cmd
1784 1784
1785 1785 def call_alias(self,alias,rest=''):
1786 1786 """Call an alias given its name and the rest of the line.
1787 1787
1788 1788 This is only used to provide backwards compatibility for users of
1789 1789 ipalias(), use of which is not recommended for anymore."""
1790 1790
1791 1791 # Now call the macro, evaluating in the user's namespace
1792 1792 cmd = self.transform_alias(alias, rest)
1793 1793 try:
1794 1794 self.system(cmd)
1795 1795 except:
1796 1796 self.showtraceback()
1797 1797
1798 1798 def indent_current_str(self):
1799 1799 """return the current level of indentation as a string"""
1800 1800 return self.indent_current_nsp * ' '
1801 1801
1802 1802 def autoindent_update(self,line):
1803 1803 """Keep track of the indent level."""
1804 1804
1805 1805 #debugx('line')
1806 1806 #debugx('self.indent_current_nsp')
1807 1807 if self.autoindent:
1808 1808 if line:
1809 1809 inisp = num_ini_spaces(line)
1810 1810 if inisp < self.indent_current_nsp:
1811 1811 self.indent_current_nsp = inisp
1812 1812
1813 1813 if line[-1] == ':':
1814 1814 self.indent_current_nsp += 4
1815 1815 elif dedent_re.match(line):
1816 1816 self.indent_current_nsp -= 4
1817 1817 else:
1818 1818 self.indent_current_nsp = 0
1819 1819 def runlines(self,lines):
1820 1820 """Run a string of one or more lines of source.
1821 1821
1822 1822 This method is capable of running a string containing multiple source
1823 1823 lines, as if they had been entered at the IPython prompt. Since it
1824 1824 exposes IPython's processing machinery, the given strings can contain
1825 1825 magic calls (%magic), special shell access (!cmd), etc."""
1826 1826
1827 1827 # We must start with a clean buffer, in case this is run from an
1828 1828 # interactive IPython session (via a magic, for example).
1829 1829 self.resetbuffer()
1830 1830 lines = lines.split('\n')
1831 1831 more = 0
1832 1832
1833 1833 for line in lines:
1834 1834 # skip blank lines so we don't mess up the prompt counter, but do
1835 1835 # NOT skip even a blank line if we are in a code block (more is
1836 1836 # true)
1837 1837
1838 1838
1839 1839 if line or more:
1840 1840 # push to raw history, so hist line numbers stay in sync
1841 1841 self.input_hist_raw.append("# " + line + "\n")
1842 1842 more = self.push(self.prefilter(line,more))
1843 1843 # IPython's runsource returns None if there was an error
1844 1844 # compiling the code. This allows us to stop processing right
1845 1845 # away, so the user gets the error message at the right place.
1846 1846 if more is None:
1847 1847 break
1848 1848 else:
1849 1849 self.input_hist_raw.append("\n")
1850 1850 # final newline in case the input didn't have it, so that the code
1851 1851 # actually does get executed
1852 1852 if more:
1853 1853 self.push('\n')
1854 1854
1855 1855 def runsource(self, source, filename='<input>', symbol='single'):
1856 1856 """Compile and run some source in the interpreter.
1857 1857
1858 1858 Arguments are as for compile_command().
1859 1859
1860 1860 One several things can happen:
1861 1861
1862 1862 1) The input is incorrect; compile_command() raised an
1863 1863 exception (SyntaxError or OverflowError). A syntax traceback
1864 1864 will be printed by calling the showsyntaxerror() method.
1865 1865
1866 1866 2) The input is incomplete, and more input is required;
1867 1867 compile_command() returned None. Nothing happens.
1868 1868
1869 1869 3) The input is complete; compile_command() returned a code
1870 1870 object. The code is executed by calling self.runcode() (which
1871 1871 also handles run-time exceptions, except for SystemExit).
1872 1872
1873 1873 The return value is:
1874 1874
1875 1875 - True in case 2
1876 1876
1877 1877 - False in the other cases, unless an exception is raised, where
1878 1878 None is returned instead. This can be used by external callers to
1879 1879 know whether to continue feeding input or not.
1880 1880
1881 1881 The return value can be used to decide whether to use sys.ps1 or
1882 1882 sys.ps2 to prompt the next line."""
1883 1883
1884 1884 # if the source code has leading blanks, add 'if 1:\n' to it
1885 1885 # this allows execution of indented pasted code. It is tempting
1886 1886 # to add '\n' at the end of source to run commands like ' a=1'
1887 1887 # directly, but this fails for more complicated scenarios
1888 1888 if source[:1] in [' ', '\t']:
1889 1889 source = 'if 1:\n%s' % source
1890 1890
1891 1891 try:
1892 1892 code = self.compile(source,filename,symbol)
1893 1893 except (OverflowError, SyntaxError, ValueError):
1894 1894 # Case 1
1895 1895 self.showsyntaxerror(filename)
1896 1896 return None
1897 1897
1898 1898 if code is None:
1899 1899 # Case 2
1900 1900 return True
1901 1901
1902 1902 # Case 3
1903 1903 # We store the code object so that threaded shells and
1904 1904 # custom exception handlers can access all this info if needed.
1905 1905 # The source corresponding to this can be obtained from the
1906 1906 # buffer attribute as '\n'.join(self.buffer).
1907 1907 self.code_to_run = code
1908 1908 # now actually execute the code object
1909 1909 if self.runcode(code) == 0:
1910 1910 return False
1911 1911 else:
1912 1912 return None
1913 1913
1914 1914 def runcode(self,code_obj):
1915 1915 """Execute a code object.
1916 1916
1917 1917 When an exception occurs, self.showtraceback() is called to display a
1918 1918 traceback.
1919 1919
1920 1920 Return value: a flag indicating whether the code to be run completed
1921 1921 successfully:
1922 1922
1923 1923 - 0: successful execution.
1924 1924 - 1: an error occurred.
1925 1925 """
1926 1926
1927 1927 # Set our own excepthook in case the user code tries to call it
1928 1928 # directly, so that the IPython crash handler doesn't get triggered
1929 1929 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1930 1930
1931 1931 # we save the original sys.excepthook in the instance, in case config
1932 1932 # code (such as magics) needs access to it.
1933 1933 self.sys_excepthook = old_excepthook
1934 1934 outflag = 1 # happens in more places, so it's easier as default
1935 1935 try:
1936 1936 try:
1937 1937 # Embedded instances require separate global/local namespaces
1938 1938 # so they can see both the surrounding (local) namespace and
1939 1939 # the module-level globals when called inside another function.
1940 1940 if self.embedded:
1941 1941 exec code_obj in self.user_global_ns, self.user_ns
1942 1942 # Normal (non-embedded) instances should only have a single
1943 1943 # namespace for user code execution, otherwise functions won't
1944 1944 # see interactive top-level globals.
1945 1945 else:
1946 1946 exec code_obj in self.user_ns
1947 1947 finally:
1948 1948 # Reset our crash handler in place
1949 1949 sys.excepthook = old_excepthook
1950 1950 except SystemExit:
1951 1951 self.resetbuffer()
1952 1952 self.showtraceback()
1953 1953 warn("Type %exit or %quit to exit IPython "
1954 1954 "(%Exit or %Quit do so unconditionally).",level=1)
1955 1955 except self.custom_exceptions:
1956 1956 etype,value,tb = sys.exc_info()
1957 1957 self.CustomTB(etype,value,tb)
1958 1958 except:
1959 1959 self.showtraceback()
1960 1960 else:
1961 1961 outflag = 0
1962 1962 if softspace(sys.stdout, 0):
1963 1963 print
1964 1964 # Flush out code object which has been run (and source)
1965 1965 self.code_to_run = None
1966 1966 return outflag
1967 1967
1968 1968 def push(self, line):
1969 1969 """Push a line to the interpreter.
1970 1970
1971 1971 The line should not have a trailing newline; it may have
1972 1972 internal newlines. The line is appended to a buffer and the
1973 1973 interpreter's runsource() method is called with the
1974 1974 concatenated contents of the buffer as source. If this
1975 1975 indicates that the command was executed or invalid, the buffer
1976 1976 is reset; otherwise, the command is incomplete, and the buffer
1977 1977 is left as it was after the line was appended. The return
1978 1978 value is 1 if more input is required, 0 if the line was dealt
1979 1979 with in some way (this is the same as runsource()).
1980 1980 """
1981 1981
1982 1982 # autoindent management should be done here, and not in the
1983 1983 # interactive loop, since that one is only seen by keyboard input. We
1984 1984 # need this done correctly even for code run via runlines (which uses
1985 1985 # push).
1986 1986
1987 1987 #print 'push line: <%s>' % line # dbg
1988 1988 for subline in line.splitlines():
1989 1989 self.autoindent_update(subline)
1990 1990 self.buffer.append(line)
1991 1991 more = self.runsource('\n'.join(self.buffer), self.filename)
1992 1992 if not more:
1993 1993 self.resetbuffer()
1994 1994 return more
1995 1995
1996 1996 def split_user_input(self, line):
1997 1997 # This is really a hold-over to support ipapi and some extensions
1998 1998 return prefilter.splitUserInput(line)
1999 1999
2000 2000 def resetbuffer(self):
2001 2001 """Reset the input buffer."""
2002 2002 self.buffer[:] = []
2003 2003
2004 2004 def raw_input(self,prompt='',continue_prompt=False):
2005 2005 """Write a prompt and read a line.
2006 2006
2007 2007 The returned line does not include the trailing newline.
2008 2008 When the user enters the EOF key sequence, EOFError is raised.
2009 2009
2010 2010 Optional inputs:
2011 2011
2012 2012 - prompt(''): a string to be printed to prompt the user.
2013 2013
2014 2014 - continue_prompt(False): whether this line is the first one or a
2015 2015 continuation in a sequence of inputs.
2016 2016 """
2017 2017
2018 2018 # Code run by the user may have modified the readline completer state.
2019 2019 # We must ensure that our completer is back in place.
2020 2020 if self.has_readline:
2021 2021 self.set_completer()
2022 2022
2023 2023 try:
2024 2024 line = raw_input_original(prompt).decode(self.stdin_encoding)
2025 2025 except ValueError:
2026 2026 warn("\n********\nYou or a %run:ed script called sys.stdin.close()"
2027 2027 " or sys.stdout.close()!\nExiting IPython!")
2028 2028 self.exit_now = True
2029 2029 return ""
2030 2030
2031 2031 # Try to be reasonably smart about not re-indenting pasted input more
2032 2032 # than necessary. We do this by trimming out the auto-indent initial
2033 2033 # spaces, if the user's actual input started itself with whitespace.
2034 2034 #debugx('self.buffer[-1]')
2035 2035
2036 2036 if self.autoindent:
2037 2037 if num_ini_spaces(line) > self.indent_current_nsp:
2038 2038 line = line[self.indent_current_nsp:]
2039 2039 self.indent_current_nsp = 0
2040 2040
2041 2041 # store the unfiltered input before the user has any chance to modify
2042 2042 # it.
2043 2043 if line.strip():
2044 2044 if continue_prompt:
2045 2045 self.input_hist_raw[-1] += '%s\n' % line
2046 2046 if self.has_readline: # and some config option is set?
2047 2047 try:
2048 2048 histlen = self.readline.get_current_history_length()
2049 2049 newhist = self.input_hist_raw[-1].rstrip()
2050 2050 self.readline.remove_history_item(histlen-1)
2051 2051 self.readline.replace_history_item(histlen-2,newhist)
2052 2052 except AttributeError:
2053 2053 pass # re{move,place}_history_item are new in 2.4.
2054 2054 else:
2055 2055 self.input_hist_raw.append('%s\n' % line)
2056 2056 # only entries starting at first column go to shadow history
2057 2057 if line.lstrip() == line:
2058 2058 self.shadowhist.add(line.strip())
2059 2059 elif not continue_prompt:
2060 2060 self.input_hist_raw.append('\n')
2061 2061 try:
2062 2062 lineout = self.prefilter(line,continue_prompt)
2063 2063 except:
2064 2064 # blanket except, in case a user-defined prefilter crashes, so it
2065 2065 # can't take all of ipython with it.
2066 2066 self.showtraceback()
2067 2067 return ''
2068 2068 else:
2069 2069 return lineout
2070 2070
2071 2071 def _prefilter(self, line, continue_prompt):
2072 2072 """Calls different preprocessors, depending on the form of line."""
2073 2073
2074 2074 # All handlers *must* return a value, even if it's blank ('').
2075 2075
2076 2076 # Lines are NOT logged here. Handlers should process the line as
2077 2077 # needed, update the cache AND log it (so that the input cache array
2078 2078 # stays synced).
2079 2079
2080 2080 #.....................................................................
2081 2081 # Code begins
2082 2082
2083 2083 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
2084 2084
2085 2085 # save the line away in case we crash, so the post-mortem handler can
2086 2086 # record it
2087 2087 self._last_input_line = line
2088 2088
2089 2089 #print '***line: <%s>' % line # dbg
2090 2090
2091 2091 if not line:
2092 2092 # Return immediately on purely empty lines, so that if the user
2093 2093 # previously typed some whitespace that started a continuation
2094 2094 # prompt, he can break out of that loop with just an empty line.
2095 2095 # This is how the default python prompt works.
2096 2096
2097 2097 # Only return if the accumulated input buffer was just whitespace!
2098 2098 if ''.join(self.buffer).isspace():
2099 2099 self.buffer[:] = []
2100 2100 return ''
2101 2101
2102 2102 line_info = prefilter.LineInfo(line, continue_prompt)
2103 2103
2104 2104 # the input history needs to track even empty lines
2105 2105 stripped = line.strip()
2106 2106
2107 2107 if not stripped:
2108 2108 if not continue_prompt:
2109 2109 self.outputcache.prompt_count -= 1
2110 2110 return self.handle_normal(line_info)
2111 2111
2112 2112 # print '***cont',continue_prompt # dbg
2113 2113 # special handlers are only allowed for single line statements
2114 2114 if continue_prompt and not self.rc.multi_line_specials:
2115 2115 return self.handle_normal(line_info)
2116 2116
2117 2117
2118 2118 # See whether any pre-existing handler can take care of it
2119 2119 rewritten = self.hooks.input_prefilter(stripped)
2120 2120 if rewritten != stripped: # ok, some prefilter did something
2121 2121 rewritten = line_info.pre + rewritten # add indentation
2122 2122 return self.handle_normal(prefilter.LineInfo(rewritten,
2123 2123 continue_prompt))
2124 2124
2125 2125 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2126 2126
2127 2127 return prefilter.prefilter(line_info, self)
2128 2128
2129 2129
2130 2130 def _prefilter_dumb(self, line, continue_prompt):
2131 2131 """simple prefilter function, for debugging"""
2132 2132 return self.handle_normal(line,continue_prompt)
2133 2133
2134 2134
2135 2135 def multiline_prefilter(self, line, continue_prompt):
2136 2136 """ Run _prefilter for each line of input
2137 2137
2138 2138 Covers cases where there are multiple lines in the user entry,
2139 2139 which is the case when the user goes back to a multiline history
2140 2140 entry and presses enter.
2141 2141
2142 2142 """
2143 2143 out = []
2144 2144 for l in line.rstrip('\n').split('\n'):
2145 2145 out.append(self._prefilter(l, continue_prompt))
2146 2146 return '\n'.join(out)
2147 2147
2148 2148 # Set the default prefilter() function (this can be user-overridden)
2149 2149 prefilter = multiline_prefilter
2150 2150
2151 2151 def handle_normal(self,line_info):
2152 2152 """Handle normal input lines. Use as a template for handlers."""
2153 2153
2154 2154 # With autoindent on, we need some way to exit the input loop, and I
2155 2155 # don't want to force the user to have to backspace all the way to
2156 2156 # clear the line. The rule will be in this case, that either two
2157 2157 # lines of pure whitespace in a row, or a line of pure whitespace but
2158 2158 # of a size different to the indent level, will exit the input loop.
2159 2159 line = line_info.line
2160 2160 continue_prompt = line_info.continue_prompt
2161 2161
2162 2162 if (continue_prompt and self.autoindent and line.isspace() and
2163 2163 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2164 2164 (self.buffer[-1]).isspace() )):
2165 2165 line = ''
2166 2166
2167 2167 self.log(line,line,continue_prompt)
2168 2168 return line
2169 2169
2170 2170 def handle_alias(self,line_info):
2171 2171 """Handle alias input lines. """
2172 2172 tgt = self.alias_table[line_info.iFun]
2173 2173 # print "=>",tgt #dbg
2174 2174 if callable(tgt):
2175 line_out = "_sh." + line_info.iFun + '(r"""' + line_info.line + '""")'
2175 line_out = "_sh.%s(%s)" % (line_info.iFun,
2176 make_quoted_expr(self.var_expand(line_info.line, depth=2)))
2176 2177 else:
2177 2178 transformed = self.expand_aliases(line_info.iFun,line_info.theRest)
2178 2179
2179 2180 # pre is needed, because it carries the leading whitespace. Otherwise
2180 2181 # aliases won't work in indented sections.
2181 2182 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2182 2183 make_quoted_expr( transformed ))
2183 2184
2184 2185 self.log(line_info.line,line_out,line_info.continue_prompt)
2185 2186 #print 'line out:',line_out # dbg
2186 2187 return line_out
2187 2188
2188 2189 def handle_shell_escape(self, line_info):
2189 2190 """Execute the line in a shell, empty return value"""
2190 2191 #print 'line in :', `line` # dbg
2191 2192 line = line_info.line
2192 2193 if line.lstrip().startswith('!!'):
2193 2194 # rewrite LineInfo's line, iFun and theRest to properly hold the
2194 2195 # call to %sx and the actual command to be executed, so
2195 2196 # handle_magic can work correctly. Note that this works even if
2196 2197 # the line is indented, so it handles multi_line_specials
2197 2198 # properly.
2198 2199 new_rest = line.lstrip()[2:]
2199 2200 line_info.line = '%ssx %s' % (self.ESC_MAGIC,new_rest)
2200 2201 line_info.iFun = 'sx'
2201 2202 line_info.theRest = new_rest
2202 2203 return self.handle_magic(line_info)
2203 2204 else:
2204 2205 cmd = line.lstrip().lstrip('!')
2205 2206 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2206 2207 make_quoted_expr(cmd))
2207 2208 # update cache/log and return
2208 2209 self.log(line,line_out,line_info.continue_prompt)
2209 2210 return line_out
2210 2211
2211 2212 def handle_magic(self, line_info):
2212 2213 """Execute magic functions."""
2213 2214 iFun = line_info.iFun
2214 2215 theRest = line_info.theRest
2215 2216 cmd = '%s_ip.magic(%s)' % (line_info.preWhitespace,
2216 2217 make_quoted_expr(iFun + " " + theRest))
2217 2218 self.log(line_info.line,cmd,line_info.continue_prompt)
2218 2219 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2219 2220 return cmd
2220 2221
2221 2222 def handle_auto(self, line_info):
2222 2223 """Hande lines which can be auto-executed, quoting if requested."""
2223 2224
2224 2225 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2225 2226 line = line_info.line
2226 2227 iFun = line_info.iFun
2227 2228 theRest = line_info.theRest
2228 2229 pre = line_info.pre
2229 2230 continue_prompt = line_info.continue_prompt
2230 2231 obj = line_info.ofind(self)['obj']
2231 2232
2232 2233 # This should only be active for single-line input!
2233 2234 if continue_prompt:
2234 2235 self.log(line,line,continue_prompt)
2235 2236 return line
2236 2237
2237 2238 force_auto = isinstance(obj, IPython.ipapi.IPyAutocall)
2238 2239 auto_rewrite = True
2239 2240
2240 2241 if pre == self.ESC_QUOTE:
2241 2242 # Auto-quote splitting on whitespace
2242 2243 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2243 2244 elif pre == self.ESC_QUOTE2:
2244 2245 # Auto-quote whole string
2245 2246 newcmd = '%s("%s")' % (iFun,theRest)
2246 2247 elif pre == self.ESC_PAREN:
2247 2248 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2248 2249 else:
2249 2250 # Auto-paren.
2250 2251 # We only apply it to argument-less calls if the autocall
2251 2252 # parameter is set to 2. We only need to check that autocall is <
2252 2253 # 2, since this function isn't called unless it's at least 1.
2253 2254 if not theRest and (self.rc.autocall < 2) and not force_auto:
2254 2255 newcmd = '%s %s' % (iFun,theRest)
2255 2256 auto_rewrite = False
2256 2257 else:
2257 2258 if not force_auto and theRest.startswith('['):
2258 2259 if hasattr(obj,'__getitem__'):
2259 2260 # Don't autocall in this case: item access for an object
2260 2261 # which is BOTH callable and implements __getitem__.
2261 2262 newcmd = '%s %s' % (iFun,theRest)
2262 2263 auto_rewrite = False
2263 2264 else:
2264 2265 # if the object doesn't support [] access, go ahead and
2265 2266 # autocall
2266 2267 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2267 2268 elif theRest.endswith(';'):
2268 2269 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2269 2270 else:
2270 2271 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2271 2272
2272 2273 if auto_rewrite:
2273 2274 rw = self.outputcache.prompt1.auto_rewrite() + newcmd
2274 2275
2275 2276 try:
2276 2277 # plain ascii works better w/ pyreadline, on some machines, so
2277 2278 # we use it and only print uncolored rewrite if we have unicode
2278 2279 rw = str(rw)
2279 2280 print >>Term.cout, rw
2280 2281 except UnicodeEncodeError:
2281 2282 print "-------------->" + newcmd
2282 2283
2283 2284 # log what is now valid Python, not the actual user input (without the
2284 2285 # final newline)
2285 2286 self.log(line,newcmd,continue_prompt)
2286 2287 return newcmd
2287 2288
2288 2289 def handle_help(self, line_info):
2289 2290 """Try to get some help for the object.
2290 2291
2291 2292 obj? or ?obj -> basic information.
2292 2293 obj?? or ??obj -> more details.
2293 2294 """
2294 2295
2295 2296 line = line_info.line
2296 2297 # We need to make sure that we don't process lines which would be
2297 2298 # otherwise valid python, such as "x=1 # what?"
2298 2299 try:
2299 2300 codeop.compile_command(line)
2300 2301 except SyntaxError:
2301 2302 # We should only handle as help stuff which is NOT valid syntax
2302 2303 if line[0]==self.ESC_HELP:
2303 2304 line = line[1:]
2304 2305 elif line[-1]==self.ESC_HELP:
2305 2306 line = line[:-1]
2306 2307 self.log(line,'#?'+line,line_info.continue_prompt)
2307 2308 if line:
2308 2309 #print 'line:<%r>' % line # dbg
2309 2310 self.magic_pinfo(line)
2310 2311 else:
2311 2312 page(self.usage,screen_lines=self.rc.screen_length)
2312 2313 return '' # Empty string is needed here!
2313 2314 except:
2314 2315 # Pass any other exceptions through to the normal handler
2315 2316 return self.handle_normal(line_info)
2316 2317 else:
2317 2318 # If the code compiles ok, we should handle it normally
2318 2319 return self.handle_normal(line_info)
2319 2320
2320 2321 def getapi(self):
2321 2322 """ Get an IPApi object for this shell instance
2322 2323
2323 2324 Getting an IPApi object is always preferable to accessing the shell
2324 2325 directly, but this holds true especially for extensions.
2325 2326
2326 2327 It should always be possible to implement an extension with IPApi
2327 2328 alone. If not, contact maintainer to request an addition.
2328 2329
2329 2330 """
2330 2331 return self.api
2331 2332
2332 2333 def handle_emacs(self, line_info):
2333 2334 """Handle input lines marked by python-mode."""
2334 2335
2335 2336 # Currently, nothing is done. Later more functionality can be added
2336 2337 # here if needed.
2337 2338
2338 2339 # The input cache shouldn't be updated
2339 2340 return line_info.line
2340 2341
2341 2342
2342 2343 def mktempfile(self,data=None):
2343 2344 """Make a new tempfile and return its filename.
2344 2345
2345 2346 This makes a call to tempfile.mktemp, but it registers the created
2346 2347 filename internally so ipython cleans it up at exit time.
2347 2348
2348 2349 Optional inputs:
2349 2350
2350 2351 - data(None): if data is given, it gets written out to the temp file
2351 2352 immediately, and the file is closed again."""
2352 2353
2353 2354 filename = tempfile.mktemp('.py','ipython_edit_')
2354 2355 self.tempfiles.append(filename)
2355 2356
2356 2357 if data:
2357 2358 tmp_file = open(filename,'w')
2358 2359 tmp_file.write(data)
2359 2360 tmp_file.close()
2360 2361 return filename
2361 2362
2362 2363 def write(self,data):
2363 2364 """Write a string to the default output"""
2364 2365 Term.cout.write(data)
2365 2366
2366 2367 def write_err(self,data):
2367 2368 """Write a string to the default error output"""
2368 2369 Term.cerr.write(data)
2369 2370
2370 2371 def exit(self):
2371 2372 """Handle interactive exit.
2372 2373
2373 2374 This method sets the exit_now attribute."""
2374 2375
2375 2376 if self.rc.confirm_exit:
2376 2377 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2377 2378 self.exit_now = True
2378 2379 else:
2379 2380 self.exit_now = True
2380 2381
2381 2382 def safe_execfile(self,fname,*where,**kw):
2382 2383 """A safe version of the builtin execfile().
2383 2384
2384 2385 This version will never throw an exception, and knows how to handle
2385 2386 ipython logs as well."""
2386 2387
2387 2388 def syspath_cleanup():
2388 2389 """Internal cleanup routine for sys.path."""
2389 2390 if add_dname:
2390 2391 try:
2391 2392 sys.path.remove(dname)
2392 2393 except ValueError:
2393 2394 # For some reason the user has already removed it, ignore.
2394 2395 pass
2395 2396
2396 2397 fname = os.path.expanduser(fname)
2397 2398
2398 2399 # Find things also in current directory. This is needed to mimic the
2399 2400 # behavior of running a script from the system command line, where
2400 2401 # Python inserts the script's directory into sys.path
2401 2402 dname = os.path.dirname(os.path.abspath(fname))
2402 2403 add_dname = False
2403 2404 if dname not in sys.path:
2404 2405 sys.path.insert(0,dname)
2405 2406 add_dname = True
2406 2407
2407 2408 try:
2408 2409 xfile = open(fname)
2409 2410 except:
2410 2411 print >> Term.cerr, \
2411 2412 'Could not open file <%s> for safe execution.' % fname
2412 2413 syspath_cleanup()
2413 2414 return None
2414 2415
2415 2416 kw.setdefault('islog',0)
2416 2417 kw.setdefault('quiet',1)
2417 2418 kw.setdefault('exit_ignore',0)
2418 2419 first = xfile.readline()
2419 2420 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2420 2421 xfile.close()
2421 2422 # line by line execution
2422 2423 if first.startswith(loghead) or kw['islog']:
2423 2424 print 'Loading log file <%s> one line at a time...' % fname
2424 2425 if kw['quiet']:
2425 2426 stdout_save = sys.stdout
2426 2427 sys.stdout = StringIO.StringIO()
2427 2428 try:
2428 2429 globs,locs = where[0:2]
2429 2430 except:
2430 2431 try:
2431 2432 globs = locs = where[0]
2432 2433 except:
2433 2434 globs = locs = globals()
2434 2435 badblocks = []
2435 2436
2436 2437 # we also need to identify indented blocks of code when replaying
2437 2438 # logs and put them together before passing them to an exec
2438 2439 # statement. This takes a bit of regexp and look-ahead work in the
2439 2440 # file. It's easiest if we swallow the whole thing in memory
2440 2441 # first, and manually walk through the lines list moving the
2441 2442 # counter ourselves.
2442 2443 indent_re = re.compile('\s+\S')
2443 2444 xfile = open(fname)
2444 2445 filelines = xfile.readlines()
2445 2446 xfile.close()
2446 2447 nlines = len(filelines)
2447 2448 lnum = 0
2448 2449 while lnum < nlines:
2449 2450 line = filelines[lnum]
2450 2451 lnum += 1
2451 2452 # don't re-insert logger status info into cache
2452 2453 if line.startswith('#log#'):
2453 2454 continue
2454 2455 else:
2455 2456 # build a block of code (maybe a single line) for execution
2456 2457 block = line
2457 2458 try:
2458 2459 next = filelines[lnum] # lnum has already incremented
2459 2460 except:
2460 2461 next = None
2461 2462 while next and indent_re.match(next):
2462 2463 block += next
2463 2464 lnum += 1
2464 2465 try:
2465 2466 next = filelines[lnum]
2466 2467 except:
2467 2468 next = None
2468 2469 # now execute the block of one or more lines
2469 2470 try:
2470 2471 exec block in globs,locs
2471 2472 except SystemExit:
2472 2473 pass
2473 2474 except:
2474 2475 badblocks.append(block.rstrip())
2475 2476 if kw['quiet']: # restore stdout
2476 2477 sys.stdout.close()
2477 2478 sys.stdout = stdout_save
2478 2479 print 'Finished replaying log file <%s>' % fname
2479 2480 if badblocks:
2480 2481 print >> sys.stderr, ('\nThe following lines/blocks in file '
2481 2482 '<%s> reported errors:' % fname)
2482 2483
2483 2484 for badline in badblocks:
2484 2485 print >> sys.stderr, badline
2485 2486 else: # regular file execution
2486 2487 try:
2487 2488 if sys.platform == 'win32' and sys.version_info < (2,5,1):
2488 2489 # Work around a bug in Python for Windows. The bug was
2489 2490 # fixed in in Python 2.5 r54159 and 54158, but that's still
2490 2491 # SVN Python as of March/07. For details, see:
2491 2492 # http://projects.scipy.org/ipython/ipython/ticket/123
2492 2493 try:
2493 2494 globs,locs = where[0:2]
2494 2495 except:
2495 2496 try:
2496 2497 globs = locs = where[0]
2497 2498 except:
2498 2499 globs = locs = globals()
2499 2500 exec file(fname) in globs,locs
2500 2501 else:
2501 2502 execfile(fname,*where)
2502 2503 except SyntaxError:
2503 2504 self.showsyntaxerror()
2504 2505 warn('Failure executing file: <%s>' % fname)
2505 2506 except SystemExit,status:
2506 2507 # Code that correctly sets the exit status flag to success (0)
2507 2508 # shouldn't be bothered with a traceback. Note that a plain
2508 2509 # sys.exit() does NOT set the message to 0 (it's empty) so that
2509 2510 # will still get a traceback. Note that the structure of the
2510 2511 # SystemExit exception changed between Python 2.4 and 2.5, so
2511 2512 # the checks must be done in a version-dependent way.
2512 2513 show = False
2513 2514
2514 2515 if sys.version_info[:2] > (2,5):
2515 2516 if status.message!=0 and not kw['exit_ignore']:
2516 2517 show = True
2517 2518 else:
2518 2519 if status.code and not kw['exit_ignore']:
2519 2520 show = True
2520 2521 if show:
2521 2522 self.showtraceback()
2522 2523 warn('Failure executing file: <%s>' % fname)
2523 2524 except:
2524 2525 self.showtraceback()
2525 2526 warn('Failure executing file: <%s>' % fname)
2526 2527
2527 2528 syspath_cleanup()
2528 2529
2529 2530 #************************* end of file <iplib.py> *****************************
@@ -1,7081 +1,7094 b''
1 2007-09-05 Ville Vainio <vivainio@gmail.com>
2
3 * external/mglob.py: expand('dirname') => ['dirname'], instead
4 of ['dirname/foo','dirname/bar', ...].
5
6 * Extensions/ipy_fsops.py: added, has usefull shell utils for plain
7 win32 installations: icp, imv, imkdir, igrep, collect (collect
8 is useful for others as well).
9
10 * iplib.py: on callable aliases (as opposed to old style aliases),
11 do var_expand() immediately, and use make_quoted_expr instead
12 of hardcoded r"""
13
1 14 2007-09-04 Ville Vainio <vivainio@gmail.com>
2 15
3 16 * ipy_profile_zope.py: add zope profile, by Stefan Eletzhofer.
4 17 Relicensed under BSD with the authors approval.
5 18
6 19 * ipmaker.py, usage.py: Remove %magic from default banner, improve
7 20 %quickref
8 21
9 22 2007-09-03 Ville Vainio <vivainio@gmail.com>
10 23
11 24 * Magic.py: %time now passes expression through prefilter,
12 25 allowing IPython syntax.
13 26
14 27 2007-09-01 Ville Vainio <vivainio@gmail.com>
15 28
16 29 * ipmaker.py: Always show full traceback when newstyle config fails
17 30
18 31 2007-08-27 Ville Vainio <vivainio@gmail.com>
19 32
20 33 * Magic.py: fix %cd for nonexistent dir when dhist is empty, close #180
21 34
22 35 2007-08-26 Ville Vainio <vivainio@gmail.com>
23 36
24 37 * ipmaker.py: Command line args have the highest priority again
25 38
26 39 * iplib.py, ipmaker.py: -i command line argument now behaves as in
27 40 normal python, i.e. leaves the IPython session running after -c
28 41 command or running a batch file from command line.
29 42
30 43 2007-08-22 Ville Vainio <vivainio@gmail.com>
31 44
32 45 * iplib.py: no extra empty (last) line in raw hist w/ multiline
33 46 statements
34 47
35 48 * logger.py: Fix bug where blank lines in history were not
36 49 added until AFTER adding the current line; translated and raw
37 50 history should finally be in sync with prompt now.
38 51
39 52 * ipy_completers.py: quick_completer now makes it easy to create
40 53 trivial custom completers
41 54
42 55 * clearcmd.py: shadow history compression & erasing, fixed input hist
43 56 clearing.
44 57
45 58 * envpersist.py, history.py: %env (sh profile only), %hist completers
46 59
47 60 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
48 61 term title now include the drive letter, and always use / instead of
49 62 os.sep (as per recommended approach for win32 ipython in general).
50 63
51 64 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
52 65 plain python scripts from ipykit command line by running
53 66 "py myscript.py", even w/o installed python.
54 67
55 68 2007-08-21 Ville Vainio <vivainio@gmail.com>
56 69
57 70 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
58 71 (for backwards compatibility)
59 72
60 73 * history.py: switch back to %hist -t from %hist -r as default.
61 74 At least until raw history is fixed for good.
62 75
63 76 2007-08-20 Ville Vainio <vivainio@gmail.com>
64 77
65 78 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
66 79 locate alias redeclarations etc. Also, avoid handling
67 80 _ip.IP.alias_table directly, prefer using _ip.defalias.
68 81
69 82
70 83 2007-08-15 Ville Vainio <vivainio@gmail.com>
71 84
72 85 * prefilter.py: ! is now always served first
73 86
74 87 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
75 88
76 89 * IPython/iplib.py (safe_execfile): fix the SystemExit
77 90 auto-suppression code to work in Python2.4 (the internal structure
78 91 of that exception changed and I'd only tested the code with 2.5).
79 92 Bug reported by a SciPy attendee.
80 93
81 94 2007-08-13 Ville Vainio <vivainio@gmail.com>
82 95
83 96 * prefilter.py: reverted !c:/bin/foo fix, made % in
84 97 multiline specials work again
85 98
86 99 2007-08-13 Ville Vainio <vivainio@gmail.com>
87 100
88 101 * prefilter.py: Take more care to special-case !, so that
89 102 !c:/bin/foo.exe works.
90 103
91 104 * setup.py: if we are building eggs, strip all docs and
92 105 examples (it doesn't make sense to bytecompile examples,
93 106 and docs would be in an awkward place anyway).
94 107
95 108 * Ryan Krauss' patch fixes start menu shortcuts when IPython
96 109 is installed into a directory that has spaces in the name.
97 110
98 111 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
99 112
100 113 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
101 114 doctest profile and %doctest_mode, so they actually generate the
102 115 blank lines needed by doctest to separate individual tests.
103 116
104 117 * IPython/iplib.py (safe_execfile): modify so that running code
105 118 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
106 119 doesn't get a printed traceback. Any other value in sys.exit(),
107 120 including the empty call, still generates a traceback. This
108 121 enables use of %run without having to pass '-e' for codes that
109 122 correctly set the exit status flag.
110 123
111 124 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
112 125
113 126 * IPython/iplib.py (InteractiveShell.post_config_initialization):
114 127 fix problems with doctests failing when run inside IPython due to
115 128 IPython's modifications of sys.displayhook.
116 129
117 130 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
118 131
119 132 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
120 133 a string with names.
121 134
122 135 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
123 136
124 137 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
125 138 magic to toggle on/off the doctest pasting support without having
126 139 to leave a session to switch to a separate profile.
127 140
128 141 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
129 142
130 143 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
131 144 introduce a blank line between inputs, to conform to doctest
132 145 requirements.
133 146
134 147 * IPython/OInspect.py (Inspector.pinfo): fix another part where
135 148 auto-generated docstrings for new-style classes were showing up.
136 149
137 150 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
138 151
139 152 * api_changes: Add new file to track backward-incompatible
140 153 user-visible changes.
141 154
142 155 2007-08-06 Ville Vainio <vivainio@gmail.com>
143 156
144 157 * ipmaker.py: fix bug where user_config_ns didn't exist at all
145 158 before all the config files were handled.
146 159
147 160 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
148 161
149 162 * IPython/irunner.py (RunnerFactory): Add new factory class for
150 163 creating reusable runners based on filenames.
151 164
152 165 * IPython/Extensions/ipy_profile_doctest.py: New profile for
153 166 doctest support. It sets prompts/exceptions as similar to
154 167 standard Python as possible, so that ipython sessions in this
155 168 profile can be easily pasted as doctests with minimal
156 169 modifications. It also enables pasting of doctests from external
157 170 sources (even if they have leading whitespace), so that you can
158 171 rerun doctests from existing sources.
159 172
160 173 * IPython/iplib.py (_prefilter): fix a buglet where after entering
161 174 some whitespace, the prompt would become a continuation prompt
162 175 with no way of exiting it other than Ctrl-C. This fix brings us
163 176 into conformity with how the default python prompt works.
164 177
165 178 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
166 179 Add support for pasting not only lines that start with '>>>', but
167 180 also with ' >>>'. That is, arbitrary whitespace can now precede
168 181 the prompts. This makes the system useful for pasting doctests
169 182 from docstrings back into a normal session.
170 183
171 184 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
172 185
173 186 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
174 187 r1357, which had killed multiple invocations of an embedded
175 188 ipython (this means that example-embed has been broken for over 1
176 189 year!!!). Rather than possibly breaking the batch stuff for which
177 190 the code in iplib.py/interact was introduced, I worked around the
178 191 problem in the embedding class in Shell.py. We really need a
179 192 bloody test suite for this code, I'm sick of finding stuff that
180 193 used to work breaking left and right every time I use an old
181 194 feature I hadn't touched in a few months.
182 195 (kill_embedded): Add a new magic that only shows up in embedded
183 196 mode, to allow users to permanently deactivate an embedded instance.
184 197
185 198 2007-08-01 Ville Vainio <vivainio@gmail.com>
186 199
187 200 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
188 201 history gets out of sync on runlines (e.g. when running macros).
189 202
190 203 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
191 204
192 205 * IPython/Magic.py (magic_colors): fix win32-related error message
193 206 that could appear under *nix when readline was missing. Patch by
194 207 Scott Jackson, closes #175.
195 208
196 209 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
197 210
198 211 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
199 212 completer that it traits-aware, so that traits objects don't show
200 213 all of their internal attributes all the time.
201 214
202 215 * IPython/genutils.py (dir2): moved this code from inside
203 216 completer.py to expose it publicly, so I could use it in the
204 217 wildcards bugfix.
205 218
206 219 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
207 220 Stefan with Traits.
208 221
209 222 * IPython/completer.py (Completer.attr_matches): change internal
210 223 var name from 'object' to 'obj', since 'object' is now a builtin
211 224 and this can lead to weird bugs if reusing this code elsewhere.
212 225
213 226 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
214 227
215 228 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
216 229 'foo?' and update the code to prevent printing of default
217 230 docstrings that started appearing after I added support for
218 231 new-style classes. The approach I'm using isn't ideal (I just
219 232 special-case those strings) but I'm not sure how to more robustly
220 233 differentiate between truly user-written strings and Python's
221 234 automatic ones.
222 235
223 236 2007-07-09 Ville Vainio <vivainio@gmail.com>
224 237
225 238 * completer.py: Applied Matthew Neeley's patch:
226 239 Dynamic attributes from trait_names and _getAttributeNames are added
227 240 to the list of tab completions, but when this happens, the attribute
228 241 list is turned into a set, so the attributes are unordered when
229 242 printed, which makes it hard to find the right completion. This patch
230 243 turns this set back into a list and sort it.
231 244
232 245 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
233 246
234 247 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
235 248 classes in various inspector functions.
236 249
237 250 2007-06-28 Ville Vainio <vivainio@gmail.com>
238 251
239 252 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
240 253 Implement "shadow" namespace, and callable aliases that reside there.
241 254 Use them by:
242 255
243 256 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
244 257
245 258 foo hello world
246 259 (gets translated to:)
247 260 _sh.foo(r"""hello world""")
248 261
249 262 In practice, this kind of alias can take the role of a magic function
250 263
251 264 * New generic inspect_object, called on obj? and obj??
252 265
253 266 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
254 267
255 268 * IPython/ultraTB.py (findsource): fix a problem with
256 269 inspect.getfile that can cause crashes during traceback construction.
257 270
258 271 2007-06-14 Ville Vainio <vivainio@gmail.com>
259 272
260 273 * iplib.py (handle_auto): Try to use ascii for printing "--->"
261 274 autocall rewrite indication, becausesometimes unicode fails to print
262 275 properly (and you get ' - - - '). Use plain uncoloured ---> for
263 276 unicode.
264 277
265 278 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
266 279
267 280 . pickleshare 'hash' commands (hget, hset, hcompress,
268 281 hdict) for efficient shadow history storage.
269 282
270 283 2007-06-13 Ville Vainio <vivainio@gmail.com>
271 284
272 285 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
273 286 Added kw arg 'interactive', tell whether vars should be visible
274 287 with %whos.
275 288
276 289 2007-06-11 Ville Vainio <vivainio@gmail.com>
277 290
278 291 * pspersistence.py, Magic.py, iplib.py: directory history now saved
279 292 to db
280 293
281 294 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
282 295 Also, it exits IPython immediately after evaluating the command (just like
283 296 std python)
284 297
285 298 2007-06-05 Walter Doerwald <walter@livinglogic.de>
286 299
287 300 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
288 301 Python string and captures the output. (Idea and original patch by
289 302 StοΏ½fan van der Walt)
290 303
291 304 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
292 305
293 306 * IPython/ultraTB.py (VerboseTB.text): update printing of
294 307 exception types for Python 2.5 (now all exceptions in the stdlib
295 308 are new-style classes).
296 309
297 310 2007-05-31 Walter Doerwald <walter@livinglogic.de>
298 311
299 312 * IPython/Extensions/igrid.py: Add new commands refresh and
300 313 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
301 314 the iterator once (refresh) or after every x seconds (refresh_timer).
302 315 Add a working implementation of "searchexpression", where the text
303 316 entered is not the text to search for, but an expression that must
304 317 be true. Added display of shortcuts to the menu. Added commands "pickinput"
305 318 and "pickinputattr" that put the object or attribute under the cursor
306 319 in the input line. Split the statusbar to be able to display the currently
307 320 active refresh interval. (Patch by Nik Tautenhahn)
308 321
309 322 2007-05-29 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
310 323
311 324 * fixing set_term_title to use ctypes as default
312 325
313 326 * fixing set_term_title fallback to work when curent dir
314 327 is on a windows network share
315 328
316 329 2007-05-28 Ville Vainio <vivainio@gmail.com>
317 330
318 331 * %cpaste: strip + with > from left (diffs).
319 332
320 333 * iplib.py: Fix crash when readline not installed
321 334
322 335 2007-05-26 Ville Vainio <vivainio@gmail.com>
323 336
324 337 * generics.py: intruduce easy to extend result_display generic
325 338 function (using simplegeneric.py).
326 339
327 340 * Fixed the append functionality of %set.
328 341
329 342 2007-05-25 Ville Vainio <vivainio@gmail.com>
330 343
331 344 * New magic: %rep (fetch / run old commands from history)
332 345
333 346 * New extension: mglob (%mglob magic), for powerful glob / find /filter
334 347 like functionality
335 348
336 349 % maghistory.py: %hist -g PATTERM greps the history for pattern
337 350
338 351 2007-05-24 Walter Doerwald <walter@livinglogic.de>
339 352
340 353 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
341 354 browse the IPython input history
342 355
343 356 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
344 357 (mapped to "i") can be used to put the object under the curser in the input
345 358 line. pickinputattr (mapped to "I") does the same for the attribute under
346 359 the cursor.
347 360
348 361 2007-05-24 Ville Vainio <vivainio@gmail.com>
349 362
350 363 * Grand magic cleansing (changeset [2380]):
351 364
352 365 * Introduce ipy_legacy.py where the following magics were
353 366 moved:
354 367
355 368 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
356 369
357 370 If you need them, either use default profile or "import ipy_legacy"
358 371 in your ipy_user_conf.py
359 372
360 373 * Move sh and scipy profile to Extensions from UserConfig. this implies
361 374 you should not edit them, but you don't need to run %upgrade when
362 375 upgrading IPython anymore.
363 376
364 377 * %hist/%history now operates in "raw" mode by default. To get the old
365 378 behaviour, run '%hist -n' (native mode).
366 379
367 380 * split ipy_stock_completers.py to ipy_stock_completers.py and
368 381 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
369 382 installed as default.
370 383
371 384 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
372 385 handling.
373 386
374 387 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
375 388 input if readline is available.
376 389
377 390 2007-05-23 Ville Vainio <vivainio@gmail.com>
378 391
379 392 * macro.py: %store uses __getstate__ properly
380 393
381 394 * exesetup.py: added new setup script for creating
382 395 standalone IPython executables with py2exe (i.e.
383 396 no python installation required).
384 397
385 398 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
386 399 its place.
387 400
388 401 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
389 402
390 403 2007-05-21 Ville Vainio <vivainio@gmail.com>
391 404
392 405 * platutil_win32.py (set_term_title): handle
393 406 failure of 'title' system call properly.
394 407
395 408 2007-05-17 Walter Doerwald <walter@livinglogic.de>
396 409
397 410 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
398 411 (Bug detected by Paul Mueller).
399 412
400 413 2007-05-16 Ville Vainio <vivainio@gmail.com>
401 414
402 415 * ipy_profile_sci.py, ipython_win_post_install.py: Create
403 416 new "sci" profile, effectively a modern version of the old
404 417 "scipy" profile (which is now slated for deprecation).
405 418
406 419 2007-05-15 Ville Vainio <vivainio@gmail.com>
407 420
408 421 * pycolorize.py, pycolor.1: Paul Mueller's patches that
409 422 make pycolorize read input from stdin when run without arguments.
410 423
411 424 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
412 425
413 426 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
414 427 it in sh profile (instead of ipy_system_conf.py).
415 428
416 429 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
417 430 aliases are now lower case on windows (MyCommand.exe => mycommand).
418 431
419 432 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
420 433 Macros are now callable objects that inherit from ipapi.IPyAutocall,
421 434 i.e. get autocalled regardless of system autocall setting.
422 435
423 436 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
424 437
425 438 * IPython/rlineimpl.py: check for clear_history in readline and
426 439 make it a dummy no-op if not available. This function isn't
427 440 guaranteed to be in the API and appeared in Python 2.4, so we need
428 441 to check it ourselves. Also, clean up this file quite a bit.
429 442
430 443 * ipython.1: update man page and full manual with information
431 444 about threads (remove outdated warning). Closes #151.
432 445
433 446 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
434 447
435 448 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
436 449 in trunk (note that this made it into the 0.8.1 release already,
437 450 but the changelogs didn't get coordinated). Many thanks to Gael
438 451 Varoquaux <gael.varoquaux-AT-normalesup.org>
439 452
440 453 2007-05-09 *** Released version 0.8.1
441 454
442 455 2007-05-10 Walter Doerwald <walter@livinglogic.de>
443 456
444 457 * IPython/Extensions/igrid.py: Incorporate html help into
445 458 the module, so we don't have to search for the file.
446 459
447 460 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
448 461
449 462 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
450 463
451 464 2007-04-30 Ville Vainio <vivainio@gmail.com>
452 465
453 466 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
454 467 user has illegal (non-ascii) home directory name
455 468
456 469 2007-04-27 Ville Vainio <vivainio@gmail.com>
457 470
458 471 * platutils_win32.py: implement set_term_title for windows
459 472
460 473 * Update version number
461 474
462 475 * ipy_profile_sh.py: more informative prompt (2 dir levels)
463 476
464 477 2007-04-26 Walter Doerwald <walter@livinglogic.de>
465 478
466 479 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
467 480 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
468 481 bug discovered by Ville).
469 482
470 483 2007-04-26 Ville Vainio <vivainio@gmail.com>
471 484
472 485 * Extensions/ipy_completers.py: Olivier's module completer now
473 486 saves the list of root modules if it takes > 4 secs on the first run.
474 487
475 488 * Magic.py (%rehashx): %rehashx now clears the completer cache
476 489
477 490
478 491 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
479 492
480 493 * ipython.el: fix incorrect color scheme, reported by Stefan.
481 494 Closes #149.
482 495
483 496 * IPython/PyColorize.py (Parser.format2): fix state-handling
484 497 logic. I still don't like how that code handles state, but at
485 498 least now it should be correct, if inelegant. Closes #146.
486 499
487 500 2007-04-25 Ville Vainio <vivainio@gmail.com>
488 501
489 502 * Extensions/ipy_which.py: added extension for %which magic, works
490 503 a lot like unix 'which' but also finds and expands aliases, and
491 504 allows wildcards.
492 505
493 506 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
494 507 as opposed to returning nothing.
495 508
496 509 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
497 510 ipy_stock_completers on default profile, do import on sh profile.
498 511
499 512 2007-04-22 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
500 513
501 514 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
502 515 like ipython.py foo.py which raised a IndexError.
503 516
504 517 2007-04-21 Ville Vainio <vivainio@gmail.com>
505 518
506 519 * Extensions/ipy_extutil.py: added extension to manage other ipython
507 520 extensions. Now only supports 'ls' == list extensions.
508 521
509 522 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
510 523
511 524 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
512 525 would prevent use of the exception system outside of a running
513 526 IPython instance.
514 527
515 528 2007-04-20 Ville Vainio <vivainio@gmail.com>
516 529
517 530 * Extensions/ipy_render.py: added extension for easy
518 531 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
519 532 'Iptl' template notation,
520 533
521 534 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
522 535 safer & faster 'import' completer.
523 536
524 537 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
525 538 and _ip.defalias(name, command).
526 539
527 540 * Extensions/ipy_exportdb.py: New extension for exporting all the
528 541 %store'd data in a portable format (normal ipapi calls like
529 542 defmacro() etc.)
530 543
531 544 2007-04-19 Ville Vainio <vivainio@gmail.com>
532 545
533 546 * upgrade_dir.py: skip junk files like *.pyc
534 547
535 548 * Release.py: version number to 0.8.1
536 549
537 550 2007-04-18 Ville Vainio <vivainio@gmail.com>
538 551
539 552 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
540 553 and later on win32.
541 554
542 555 2007-04-16 Ville Vainio <vivainio@gmail.com>
543 556
544 557 * iplib.py (showtraceback): Do not crash when running w/o readline.
545 558
546 559 2007-04-12 Walter Doerwald <walter@livinglogic.de>
547 560
548 561 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
549 562 sorted (case sensitive with files and dirs mixed).
550 563
551 564 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
552 565
553 566 * IPython/Release.py (version): Open trunk for 0.8.1 development.
554 567
555 568 2007-04-10 *** Released version 0.8.0
556 569
557 570 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
558 571
559 572 * Tag 0.8.0 for release.
560 573
561 574 * IPython/iplib.py (reloadhist): add API function to cleanly
562 575 reload the readline history, which was growing inappropriately on
563 576 every %run call.
564 577
565 578 * win32_manual_post_install.py (run): apply last part of Nicolas
566 579 Pernetty's patch (I'd accidentally applied it in a different
567 580 directory and this particular file didn't get patched).
568 581
569 582 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
570 583
571 584 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
572 585 find the main thread id and use the proper API call. Thanks to
573 586 Stefan for the fix.
574 587
575 588 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
576 589 unit tests to reflect fixed ticket #52, and add more tests sent by
577 590 him.
578 591
579 592 * IPython/iplib.py (raw_input): restore the readline completer
580 593 state on every input, in case third-party code messed it up.
581 594 (_prefilter): revert recent addition of early-escape checks which
582 595 prevent many valid alias calls from working.
583 596
584 597 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
585 598 flag for sigint handler so we don't run a full signal() call on
586 599 each runcode access.
587 600
588 601 * IPython/Magic.py (magic_whos): small improvement to diagnostic
589 602 message.
590 603
591 604 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
592 605
593 606 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
594 607 asynchronous exceptions working, i.e., Ctrl-C can actually
595 608 interrupt long-running code in the multithreaded shells.
596 609
597 610 This is using Tomer Filiba's great ctypes-based trick:
598 611 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
599 612 this in the past, but hadn't been able to make it work before. So
600 613 far it looks like it's actually running, but this needs more
601 614 testing. If it really works, I'll be *very* happy, and we'll owe
602 615 a huge thank you to Tomer. My current implementation is ugly,
603 616 hackish and uses nasty globals, but I don't want to try and clean
604 617 anything up until we know if it actually works.
605 618
606 619 NOTE: this feature needs ctypes to work. ctypes is included in
607 620 Python2.5, but 2.4 users will need to manually install it. This
608 621 feature makes multi-threaded shells so much more usable that it's
609 622 a minor price to pay (ctypes is very easy to install, already a
610 623 requirement for win32 and available in major linux distros).
611 624
612 625 2007-04-04 Ville Vainio <vivainio@gmail.com>
613 626
614 627 * Extensions/ipy_completers.py, ipy_stock_completers.py:
615 628 Moved implementations of 'bundled' completers to ipy_completers.py,
616 629 they are only enabled in ipy_stock_completers.py.
617 630
618 631 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
619 632
620 633 * IPython/PyColorize.py (Parser.format2): Fix identation of
621 634 colorzied output and return early if color scheme is NoColor, to
622 635 avoid unnecessary and expensive tokenization. Closes #131.
623 636
624 637 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
625 638
626 639 * IPython/Debugger.py: disable the use of pydb version 1.17. It
627 640 has a critical bug (a missing import that makes post-mortem not
628 641 work at all). Unfortunately as of this time, this is the version
629 642 shipped with Ubuntu Edgy, so quite a few people have this one. I
630 643 hope Edgy will update to a more recent package.
631 644
632 645 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
633 646
634 647 * IPython/iplib.py (_prefilter): close #52, second part of a patch
635 648 set by Stefan (only the first part had been applied before).
636 649
637 650 * IPython/Extensions/ipy_stock_completers.py (module_completer):
638 651 remove usage of the dangerous pkgutil.walk_packages(). See
639 652 details in comments left in the code.
640 653
641 654 * IPython/Magic.py (magic_whos): add support for numpy arrays
642 655 similar to what we had for Numeric.
643 656
644 657 * IPython/completer.py (IPCompleter.complete): extend the
645 658 complete() call API to support completions by other mechanisms
646 659 than readline. Closes #109.
647 660
648 661 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
649 662 protect against a bug in Python's execfile(). Closes #123.
650 663
651 664 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
652 665
653 666 * IPython/iplib.py (split_user_input): ensure that when splitting
654 667 user input, the part that can be treated as a python name is pure
655 668 ascii (Python identifiers MUST be pure ascii). Part of the
656 669 ongoing Unicode support work.
657 670
658 671 * IPython/Prompts.py (prompt_specials_color): Add \N for the
659 672 actual prompt number, without any coloring. This allows users to
660 673 produce numbered prompts with their own colors. Added after a
661 674 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
662 675
663 676 2007-03-31 Walter Doerwald <walter@livinglogic.de>
664 677
665 678 * IPython/Extensions/igrid.py: Map the return key
666 679 to enter() and shift-return to enterattr().
667 680
668 681 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
669 682
670 683 * IPython/Magic.py (magic_psearch): add unicode support by
671 684 encoding to ascii the input, since this routine also only deals
672 685 with valid Python names. Fixes a bug reported by Stefan.
673 686
674 687 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
675 688
676 689 * IPython/Magic.py (_inspect): convert unicode input into ascii
677 690 before trying to evaluate it as a Python identifier. This fixes a
678 691 problem that the new unicode support had introduced when analyzing
679 692 long definition lines for functions.
680 693
681 694 2007-03-24 Walter Doerwald <walter@livinglogic.de>
682 695
683 696 * IPython/Extensions/igrid.py: Fix picking. Using
684 697 igrid with wxPython 2.6 and -wthread should work now.
685 698 igrid.display() simply tries to create a frame without
686 699 an application. Only if this fails an application is created.
687 700
688 701 2007-03-23 Walter Doerwald <walter@livinglogic.de>
689 702
690 703 * IPython/Extensions/path.py: Updated to version 2.2.
691 704
692 705 2007-03-23 Ville Vainio <vivainio@gmail.com>
693 706
694 707 * iplib.py: recursive alias expansion now works better, so that
695 708 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
696 709 doesn't trip up the process, if 'd' has been aliased to 'ls'.
697 710
698 711 * Extensions/ipy_gnuglobal.py added, provides %global magic
699 712 for users of http://www.gnu.org/software/global
700 713
701 714 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
702 715 Closes #52. Patch by Stefan van der Walt.
703 716
704 717 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
705 718
706 719 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
707 720 respect the __file__ attribute when using %run. Thanks to a bug
708 721 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
709 722
710 723 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
711 724
712 725 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
713 726 input. Patch sent by Stefan.
714 727
715 728 2007-03-20 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
716 729 * IPython/Extensions/ipy_stock_completer.py
717 730 shlex_split, fix bug in shlex_split. len function
718 731 call was missing an if statement. Caused shlex_split to
719 732 sometimes return "" as last element.
720 733
721 734 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
722 735
723 736 * IPython/completer.py
724 737 (IPCompleter.file_matches.single_dir_expand): fix a problem
725 738 reported by Stefan, where directories containign a single subdir
726 739 would be completed too early.
727 740
728 741 * IPython/Shell.py (_load_pylab): Make the execution of 'from
729 742 pylab import *' when -pylab is given be optional. A new flag,
730 743 pylab_import_all controls this behavior, the default is True for
731 744 backwards compatibility.
732 745
733 746 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
734 747 modified) R. Bernstein's patch for fully syntax highlighted
735 748 tracebacks. The functionality is also available under ultraTB for
736 749 non-ipython users (someone using ultraTB but outside an ipython
737 750 session). They can select the color scheme by setting the
738 751 module-level global DEFAULT_SCHEME. The highlight functionality
739 752 also works when debugging.
740 753
741 754 * IPython/genutils.py (IOStream.close): small patch by
742 755 R. Bernstein for improved pydb support.
743 756
744 757 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
745 758 DaveS <davls@telus.net> to improve support of debugging under
746 759 NTEmacs, including improved pydb behavior.
747 760
748 761 * IPython/Magic.py (magic_prun): Fix saving of profile info for
749 762 Python 2.5, where the stats object API changed a little. Thanks
750 763 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
751 764
752 765 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
753 766 Pernetty's patch to improve support for (X)Emacs under Win32.
754 767
755 768 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
756 769
757 770 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
758 771 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
759 772 a report by Nik Tautenhahn.
760 773
761 774 2007-03-16 Walter Doerwald <walter@livinglogic.de>
762 775
763 776 * setup.py: Add the igrid help files to the list of data files
764 777 to be installed alongside igrid.
765 778 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
766 779 Show the input object of the igrid browser as the window tile.
767 780 Show the object the cursor is on in the statusbar.
768 781
769 782 2007-03-15 Ville Vainio <vivainio@gmail.com>
770 783
771 784 * Extensions/ipy_stock_completers.py: Fixed exception
772 785 on mismatching quotes in %run completer. Patch by
773 786 JοΏ½rgen Stenarson. Closes #127.
774 787
775 788 2007-03-14 Ville Vainio <vivainio@gmail.com>
776 789
777 790 * Extensions/ext_rehashdir.py: Do not do auto_alias
778 791 in %rehashdir, it clobbers %store'd aliases.
779 792
780 793 * UserConfig/ipy_profile_sh.py: envpersist.py extension
781 794 (beefed up %env) imported for sh profile.
782 795
783 796 2007-03-10 Walter Doerwald <walter@livinglogic.de>
784 797
785 798 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
786 799 as the default browser.
787 800 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
788 801 As igrid displays all attributes it ever encounters, fetch() (which has
789 802 been renamed to _fetch()) doesn't have to recalculate the display attributes
790 803 every time a new item is fetched. This should speed up scrolling.
791 804
792 805 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
793 806
794 807 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
795 808 Schmolck's recently reported tab-completion bug (my previous one
796 809 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
797 810
798 811 2007-03-09 Walter Doerwald <walter@livinglogic.de>
799 812
800 813 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
801 814 Close help window if exiting igrid.
802 815
803 816 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
804 817
805 818 * IPython/Extensions/ipy_defaults.py: Check if readline is available
806 819 before calling functions from readline.
807 820
808 821 2007-03-02 Walter Doerwald <walter@livinglogic.de>
809 822
810 823 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
811 824 igrid is a wxPython-based display object for ipipe. If your system has
812 825 wx installed igrid will be the default display. Without wx ipipe falls
813 826 back to ibrowse (which needs curses). If no curses is installed ipipe
814 827 falls back to idump.
815 828
816 829 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
817 830
818 831 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
819 832 my changes from yesterday, they introduced bugs. Will reactivate
820 833 once I get a correct solution, which will be much easier thanks to
821 834 Dan Milstein's new prefilter test suite.
822 835
823 836 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
824 837
825 838 * IPython/iplib.py (split_user_input): fix input splitting so we
826 839 don't attempt attribute accesses on things that can't possibly be
827 840 valid Python attributes. After a bug report by Alex Schmolck.
828 841 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
829 842 %magic with explicit % prefix.
830 843
831 844 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
832 845
833 846 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
834 847 avoid a DeprecationWarning from GTK.
835 848
836 849 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
837 850
838 851 * IPython/genutils.py (clock): I modified clock() to return total
839 852 time, user+system. This is a more commonly needed metric. I also
840 853 introduced the new clocku/clocks to get only user/system time if
841 854 one wants those instead.
842 855
843 856 ***WARNING: API CHANGE*** clock() used to return only user time,
844 857 so if you want exactly the same results as before, use clocku
845 858 instead.
846 859
847 860 2007-02-22 Ville Vainio <vivainio@gmail.com>
848 861
849 862 * IPython/Extensions/ipy_p4.py: Extension for improved
850 863 p4 (perforce version control system) experience.
851 864 Adds %p4 magic with p4 command completion and
852 865 automatic -G argument (marshall output as python dict)
853 866
854 867 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
855 868
856 869 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
857 870 stop marks.
858 871 (ClearingMixin): a simple mixin to easily make a Demo class clear
859 872 the screen in between blocks and have empty marquees. The
860 873 ClearDemo and ClearIPDemo classes that use it are included.
861 874
862 875 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
863 876
864 877 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
865 878 protect against exceptions at Python shutdown time. Patch
866 879 sumbmitted to upstream.
867 880
868 881 2007-02-14 Walter Doerwald <walter@livinglogic.de>
869 882
870 883 * IPython/Extensions/ibrowse.py: If entering the first object level
871 884 (i.e. the object for which the browser has been started) fails,
872 885 now the error is raised directly (aborting the browser) instead of
873 886 running into an empty levels list later.
874 887
875 888 2007-02-03 Walter Doerwald <walter@livinglogic.de>
876 889
877 890 * IPython/Extensions/ipipe.py: Add an xrepr implementation
878 891 for the noitem object.
879 892
880 893 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
881 894
882 895 * IPython/completer.py (Completer.attr_matches): Fix small
883 896 tab-completion bug with Enthought Traits objects with units.
884 897 Thanks to a bug report by Tom Denniston
885 898 <tom.denniston-AT-alum.dartmouth.org>.
886 899
887 900 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
888 901
889 902 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
890 903 bug where only .ipy or .py would be completed. Once the first
891 904 argument to %run has been given, all completions are valid because
892 905 they are the arguments to the script, which may well be non-python
893 906 filenames.
894 907
895 908 * IPython/irunner.py (InteractiveRunner.run_source): major updates
896 909 to irunner to allow it to correctly support real doctesting of
897 910 out-of-process ipython code.
898 911
899 912 * IPython/Magic.py (magic_cd): Make the setting of the terminal
900 913 title an option (-noterm_title) because it completely breaks
901 914 doctesting.
902 915
903 916 * IPython/demo.py: fix IPythonDemo class that was not actually working.
904 917
905 918 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
906 919
907 920 * IPython/irunner.py (main): fix small bug where extensions were
908 921 not being correctly recognized.
909 922
910 923 2007-01-23 Walter Doerwald <walter@livinglogic.de>
911 924
912 925 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
913 926 a string containing a single line yields the string itself as the
914 927 only item.
915 928
916 929 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
917 930 object if it's the same as the one on the last level (This avoids
918 931 infinite recursion for one line strings).
919 932
920 933 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
921 934
922 935 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
923 936 all output streams before printing tracebacks. This ensures that
924 937 user output doesn't end up interleaved with traceback output.
925 938
926 939 2007-01-10 Ville Vainio <vivainio@gmail.com>
927 940
928 941 * Extensions/envpersist.py: Turbocharged %env that remembers
929 942 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
930 943 "%env VISUAL=jed".
931 944
932 945 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
933 946
934 947 * IPython/iplib.py (showtraceback): ensure that we correctly call
935 948 custom handlers in all cases (some with pdb were slipping through,
936 949 but I'm not exactly sure why).
937 950
938 951 * IPython/Debugger.py (Tracer.__init__): added new class to
939 952 support set_trace-like usage of IPython's enhanced debugger.
940 953
941 954 2006-12-24 Ville Vainio <vivainio@gmail.com>
942 955
943 956 * ipmaker.py: more informative message when ipy_user_conf
944 957 import fails (suggest running %upgrade).
945 958
946 959 * tools/run_ipy_in_profiler.py: Utility to see where
947 960 the time during IPython startup is spent.
948 961
949 962 2006-12-20 Ville Vainio <vivainio@gmail.com>
950 963
951 964 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
952 965
953 966 * ipapi.py: Add new ipapi method, expand_alias.
954 967
955 968 * Release.py: Bump up version to 0.7.4.svn
956 969
957 970 2006-12-17 Ville Vainio <vivainio@gmail.com>
958 971
959 972 * Extensions/jobctrl.py: Fixed &cmd arg arg...
960 973 to work properly on posix too
961 974
962 975 * Release.py: Update revnum (version is still just 0.7.3).
963 976
964 977 2006-12-15 Ville Vainio <vivainio@gmail.com>
965 978
966 979 * scripts/ipython_win_post_install: create ipython.py in
967 980 prefix + "/scripts".
968 981
969 982 * Release.py: Update version to 0.7.3.
970 983
971 984 2006-12-14 Ville Vainio <vivainio@gmail.com>
972 985
973 986 * scripts/ipython_win_post_install: Overwrite old shortcuts
974 987 if they already exist
975 988
976 989 * Release.py: release 0.7.3rc2
977 990
978 991 2006-12-13 Ville Vainio <vivainio@gmail.com>
979 992
980 993 * Branch and update Release.py for 0.7.3rc1
981 994
982 995 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
983 996
984 997 * IPython/Shell.py (IPShellWX): update for current WX naming
985 998 conventions, to avoid a deprecation warning with current WX
986 999 versions. Thanks to a report by Danny Shevitz.
987 1000
988 1001 2006-12-12 Ville Vainio <vivainio@gmail.com>
989 1002
990 1003 * ipmaker.py: apply david cournapeau's patch to make
991 1004 import_some work properly even when ipythonrc does
992 1005 import_some on empty list (it was an old bug!).
993 1006
994 1007 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
995 1008 Add deprecation note to ipythonrc and a url to wiki
996 1009 in ipy_user_conf.py
997 1010
998 1011
999 1012 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
1000 1013 as if it was typed on IPython command prompt, i.e.
1001 1014 as IPython script.
1002 1015
1003 1016 * example-magic.py, magic_grepl.py: remove outdated examples
1004 1017
1005 1018 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
1006 1019
1007 1020 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
1008 1021 is called before any exception has occurred.
1009 1022
1010 1023 2006-12-08 Ville Vainio <vivainio@gmail.com>
1011 1024
1012 1025 * Extensions/ipy_stock_completers.py: fix cd completer
1013 1026 to translate /'s to \'s again.
1014 1027
1015 1028 * completer.py: prevent traceback on file completions w/
1016 1029 backslash.
1017 1030
1018 1031 * Release.py: Update release number to 0.7.3b3 for release
1019 1032
1020 1033 2006-12-07 Ville Vainio <vivainio@gmail.com>
1021 1034
1022 1035 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1023 1036 while executing external code. Provides more shell-like behaviour
1024 1037 and overall better response to ctrl + C / ctrl + break.
1025 1038
1026 1039 * tools/make_tarball.py: new script to create tarball straight from svn
1027 1040 (setup.py sdist doesn't work on win32).
1028 1041
1029 1042 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1030 1043 on dirnames with spaces and use the default completer instead.
1031 1044
1032 1045 * Revision.py: Change version to 0.7.3b2 for release.
1033 1046
1034 1047 2006-12-05 Ville Vainio <vivainio@gmail.com>
1035 1048
1036 1049 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1037 1050 pydb patch 4 (rm debug printing, py 2.5 checking)
1038 1051
1039 1052 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1040 1053 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1041 1054 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1042 1055 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1043 1056 object the cursor was on before the refresh. The command "markrange" is
1044 1057 mapped to "%" now.
1045 1058 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1046 1059
1047 1060 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1048 1061
1049 1062 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1050 1063 interactive debugger on the last traceback, without having to call
1051 1064 %pdb and rerun your code. Made minor changes in various modules,
1052 1065 should automatically recognize pydb if available.
1053 1066
1054 1067 2006-11-28 Ville Vainio <vivainio@gmail.com>
1055 1068
1056 1069 * completer.py: If the text start with !, show file completions
1057 1070 properly. This helps when trying to complete command name
1058 1071 for shell escapes.
1059 1072
1060 1073 2006-11-27 Ville Vainio <vivainio@gmail.com>
1061 1074
1062 1075 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1063 1076 der Walt. Clean up svn and hg completers by using a common
1064 1077 vcs_completer.
1065 1078
1066 1079 2006-11-26 Ville Vainio <vivainio@gmail.com>
1067 1080
1068 1081 * Remove ipconfig and %config; you should use _ip.options structure
1069 1082 directly instead!
1070 1083
1071 1084 * genutils.py: add wrap_deprecated function for deprecating callables
1072 1085
1073 1086 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1074 1087 _ip.system instead. ipalias is redundant.
1075 1088
1076 1089 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1077 1090 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1078 1091 explicit.
1079 1092
1080 1093 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1081 1094 completer. Try it by entering 'hg ' and pressing tab.
1082 1095
1083 1096 * macro.py: Give Macro a useful __repr__ method
1084 1097
1085 1098 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1086 1099
1087 1100 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1088 1101 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1089 1102 we don't get a duplicate ipipe module, where registration of the xrepr
1090 1103 implementation for Text is useless.
1091 1104
1092 1105 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1093 1106
1094 1107 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1095 1108
1096 1109 2006-11-24 Ville Vainio <vivainio@gmail.com>
1097 1110
1098 1111 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1099 1112 try to use "cProfile" instead of the slower pure python
1100 1113 "profile"
1101 1114
1102 1115 2006-11-23 Ville Vainio <vivainio@gmail.com>
1103 1116
1104 1117 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1105 1118 Qt+IPython+Designer link in documentation.
1106 1119
1107 1120 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1108 1121 correct Pdb object to %pydb.
1109 1122
1110 1123
1111 1124 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1112 1125 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1113 1126 generic xrepr(), otherwise the list implementation would kick in.
1114 1127
1115 1128 2006-11-21 Ville Vainio <vivainio@gmail.com>
1116 1129
1117 1130 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1118 1131 with one from UserConfig.
1119 1132
1120 1133 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1121 1134 it was missing which broke the sh profile.
1122 1135
1123 1136 * completer.py: file completer now uses explicit '/' instead
1124 1137 of os.path.join, expansion of 'foo' was broken on win32
1125 1138 if there was one directory with name 'foobar'.
1126 1139
1127 1140 * A bunch of patches from Kirill Smelkov:
1128 1141
1129 1142 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1130 1143
1131 1144 * [patch 7/9] Implement %page -r (page in raw mode) -
1132 1145
1133 1146 * [patch 5/9] ScientificPython webpage has moved
1134 1147
1135 1148 * [patch 4/9] The manual mentions %ds, should be %dhist
1136 1149
1137 1150 * [patch 3/9] Kill old bits from %prun doc.
1138 1151
1139 1152 * [patch 1/9] Fix typos here and there.
1140 1153
1141 1154 2006-11-08 Ville Vainio <vivainio@gmail.com>
1142 1155
1143 1156 * completer.py (attr_matches): catch all exceptions raised
1144 1157 by eval of expr with dots.
1145 1158
1146 1159 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1147 1160
1148 1161 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1149 1162 input if it starts with whitespace. This allows you to paste
1150 1163 indented input from any editor without manually having to type in
1151 1164 the 'if 1:', which is convenient when working interactively.
1152 1165 Slightly modifed version of a patch by Bo Peng
1153 1166 <bpeng-AT-rice.edu>.
1154 1167
1155 1168 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1156 1169
1157 1170 * IPython/irunner.py (main): modified irunner so it automatically
1158 1171 recognizes the right runner to use based on the extension (.py for
1159 1172 python, .ipy for ipython and .sage for sage).
1160 1173
1161 1174 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1162 1175 visible in ipapi as ip.config(), to programatically control the
1163 1176 internal rc object. There's an accompanying %config magic for
1164 1177 interactive use, which has been enhanced to match the
1165 1178 funtionality in ipconfig.
1166 1179
1167 1180 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1168 1181 so it's not just a toggle, it now takes an argument. Add support
1169 1182 for a customizable header when making system calls, as the new
1170 1183 system_header variable in the ipythonrc file.
1171 1184
1172 1185 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1173 1186
1174 1187 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1175 1188 generic functions (using Philip J. Eby's simplegeneric package).
1176 1189 This makes it possible to customize the display of third-party classes
1177 1190 without having to monkeypatch them. xiter() no longer supports a mode
1178 1191 argument and the XMode class has been removed. The same functionality can
1179 1192 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1180 1193 One consequence of the switch to generic functions is that xrepr() and
1181 1194 xattrs() implementation must define the default value for the mode
1182 1195 argument themselves and xattrs() implementations must return real
1183 1196 descriptors.
1184 1197
1185 1198 * IPython/external: This new subpackage will contain all third-party
1186 1199 packages that are bundled with IPython. (The first one is simplegeneric).
1187 1200
1188 1201 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1189 1202 directory which as been dropped in r1703.
1190 1203
1191 1204 * IPython/Extensions/ipipe.py (iless): Fixed.
1192 1205
1193 1206 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1194 1207
1195 1208 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1196 1209
1197 1210 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1198 1211 handling in variable expansion so that shells and magics recognize
1199 1212 function local scopes correctly. Bug reported by Brian.
1200 1213
1201 1214 * scripts/ipython: remove the very first entry in sys.path which
1202 1215 Python auto-inserts for scripts, so that sys.path under IPython is
1203 1216 as similar as possible to that under plain Python.
1204 1217
1205 1218 * IPython/completer.py (IPCompleter.file_matches): Fix
1206 1219 tab-completion so that quotes are not closed unless the completion
1207 1220 is unambiguous. After a request by Stefan. Minor cleanups in
1208 1221 ipy_stock_completers.
1209 1222
1210 1223 2006-11-02 Ville Vainio <vivainio@gmail.com>
1211 1224
1212 1225 * ipy_stock_completers.py: Add %run and %cd completers.
1213 1226
1214 1227 * completer.py: Try running custom completer for both
1215 1228 "foo" and "%foo" if the command is just "foo". Ignore case
1216 1229 when filtering possible completions.
1217 1230
1218 1231 * UserConfig/ipy_user_conf.py: install stock completers as default
1219 1232
1220 1233 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1221 1234 simplified readline history save / restore through a wrapper
1222 1235 function
1223 1236
1224 1237
1225 1238 2006-10-31 Ville Vainio <vivainio@gmail.com>
1226 1239
1227 1240 * strdispatch.py, completer.py, ipy_stock_completers.py:
1228 1241 Allow str_key ("command") in completer hooks. Implement
1229 1242 trivial completer for 'import' (stdlib modules only). Rename
1230 1243 ipy_linux_package_managers.py to ipy_stock_completers.py.
1231 1244 SVN completer.
1232 1245
1233 1246 * Extensions/ledit.py: %magic line editor for easily and
1234 1247 incrementally manipulating lists of strings. The magic command
1235 1248 name is %led.
1236 1249
1237 1250 2006-10-30 Ville Vainio <vivainio@gmail.com>
1238 1251
1239 1252 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1240 1253 Bernsteins's patches for pydb integration.
1241 1254 http://bashdb.sourceforge.net/pydb/
1242 1255
1243 1256 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1244 1257 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1245 1258 custom completer hook to allow the users to implement their own
1246 1259 completers. See ipy_linux_package_managers.py for example. The
1247 1260 hook name is 'complete_command'.
1248 1261
1249 1262 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1250 1263
1251 1264 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1252 1265 Numeric leftovers.
1253 1266
1254 1267 * ipython.el (py-execute-region): apply Stefan's patch to fix
1255 1268 garbled results if the python shell hasn't been previously started.
1256 1269
1257 1270 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1258 1271 pretty generic function and useful for other things.
1259 1272
1260 1273 * IPython/OInspect.py (getsource): Add customizable source
1261 1274 extractor. After a request/patch form W. Stein (SAGE).
1262 1275
1263 1276 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1264 1277 window size to a more reasonable value from what pexpect does,
1265 1278 since their choice causes wrapping bugs with long input lines.
1266 1279
1267 1280 2006-10-28 Ville Vainio <vivainio@gmail.com>
1268 1281
1269 1282 * Magic.py (%run): Save and restore the readline history from
1270 1283 file around %run commands to prevent side effects from
1271 1284 %runned programs that might use readline (e.g. pydb).
1272 1285
1273 1286 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1274 1287 invoking the pydb enhanced debugger.
1275 1288
1276 1289 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1277 1290
1278 1291 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1279 1292 call the base class method and propagate the return value to
1280 1293 ifile. This is now done by path itself.
1281 1294
1282 1295 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1283 1296
1284 1297 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1285 1298 api: set_crash_handler(), to expose the ability to change the
1286 1299 internal crash handler.
1287 1300
1288 1301 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1289 1302 the various parameters of the crash handler so that apps using
1290 1303 IPython as their engine can customize crash handling. Ipmlemented
1291 1304 at the request of SAGE.
1292 1305
1293 1306 2006-10-14 Ville Vainio <vivainio@gmail.com>
1294 1307
1295 1308 * Magic.py, ipython.el: applied first "safe" part of Rocky
1296 1309 Bernstein's patch set for pydb integration.
1297 1310
1298 1311 * Magic.py (%unalias, %alias): %store'd aliases can now be
1299 1312 removed with '%unalias'. %alias w/o args now shows most
1300 1313 interesting (stored / manually defined) aliases last
1301 1314 where they catch the eye w/o scrolling.
1302 1315
1303 1316 * Magic.py (%rehashx), ext_rehashdir.py: files with
1304 1317 'py' extension are always considered executable, even
1305 1318 when not in PATHEXT environment variable.
1306 1319
1307 1320 2006-10-12 Ville Vainio <vivainio@gmail.com>
1308 1321
1309 1322 * jobctrl.py: Add new "jobctrl" extension for spawning background
1310 1323 processes with "&find /". 'import jobctrl' to try it out. Requires
1311 1324 'subprocess' module, standard in python 2.4+.
1312 1325
1313 1326 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1314 1327 so if foo -> bar and bar -> baz, then foo -> baz.
1315 1328
1316 1329 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1317 1330
1318 1331 * IPython/Magic.py (Magic.parse_options): add a new posix option
1319 1332 to allow parsing of input args in magics that doesn't strip quotes
1320 1333 (if posix=False). This also closes %timeit bug reported by
1321 1334 Stefan.
1322 1335
1323 1336 2006-10-03 Ville Vainio <vivainio@gmail.com>
1324 1337
1325 1338 * iplib.py (raw_input, interact): Return ValueError catching for
1326 1339 raw_input. Fixes infinite loop for sys.stdin.close() or
1327 1340 sys.stdout.close().
1328 1341
1329 1342 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1330 1343
1331 1344 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1332 1345 to help in handling doctests. irunner is now pretty useful for
1333 1346 running standalone scripts and simulate a full interactive session
1334 1347 in a format that can be then pasted as a doctest.
1335 1348
1336 1349 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1337 1350 on top of the default (useless) ones. This also fixes the nasty
1338 1351 way in which 2.5's Quitter() exits (reverted [1785]).
1339 1352
1340 1353 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1341 1354 2.5.
1342 1355
1343 1356 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1344 1357 color scheme is updated as well when color scheme is changed
1345 1358 interactively.
1346 1359
1347 1360 2006-09-27 Ville Vainio <vivainio@gmail.com>
1348 1361
1349 1362 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1350 1363 infinite loop and just exit. It's a hack, but will do for a while.
1351 1364
1352 1365 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1353 1366
1354 1367 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1355 1368 the constructor, this makes it possible to get a list of only directories
1356 1369 or only files.
1357 1370
1358 1371 2006-08-12 Ville Vainio <vivainio@gmail.com>
1359 1372
1360 1373 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1361 1374 they broke unittest
1362 1375
1363 1376 2006-08-11 Ville Vainio <vivainio@gmail.com>
1364 1377
1365 1378 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1366 1379 by resolving issue properly, i.e. by inheriting FakeModule
1367 1380 from types.ModuleType. Pickling ipython interactive data
1368 1381 should still work as usual (testing appreciated).
1369 1382
1370 1383 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1371 1384
1372 1385 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1373 1386 running under python 2.3 with code from 2.4 to fix a bug with
1374 1387 help(). Reported by the Debian maintainers, Norbert Tretkowski
1375 1388 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1376 1389 <afayolle-AT-debian.org>.
1377 1390
1378 1391 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1379 1392
1380 1393 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1381 1394 (which was displaying "quit" twice).
1382 1395
1383 1396 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1384 1397
1385 1398 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1386 1399 the mode argument).
1387 1400
1388 1401 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1389 1402
1390 1403 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1391 1404 not running under IPython.
1392 1405
1393 1406 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1394 1407 and make it iterable (iterating over the attribute itself). Add two new
1395 1408 magic strings for __xattrs__(): If the string starts with "-", the attribute
1396 1409 will not be displayed in ibrowse's detail view (but it can still be
1397 1410 iterated over). This makes it possible to add attributes that are large
1398 1411 lists or generator methods to the detail view. Replace magic attribute names
1399 1412 and _attrname() and _getattr() with "descriptors": For each type of magic
1400 1413 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1401 1414 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1402 1415 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1403 1416 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1404 1417 are still supported.
1405 1418
1406 1419 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1407 1420 fails in ibrowse.fetch(), the exception object is added as the last item
1408 1421 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1409 1422 a generator throws an exception midway through execution.
1410 1423
1411 1424 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1412 1425 encoding into methods.
1413 1426
1414 1427 2006-07-26 Ville Vainio <vivainio@gmail.com>
1415 1428
1416 1429 * iplib.py: history now stores multiline input as single
1417 1430 history entries. Patch by Jorgen Cederlof.
1418 1431
1419 1432 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1420 1433
1421 1434 * IPython/Extensions/ibrowse.py: Make cursor visible over
1422 1435 non existing attributes.
1423 1436
1424 1437 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1425 1438
1426 1439 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1427 1440 error output of the running command doesn't mess up the screen.
1428 1441
1429 1442 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1430 1443
1431 1444 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1432 1445 argument. This sorts the items themselves.
1433 1446
1434 1447 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1435 1448
1436 1449 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1437 1450 Compile expression strings into code objects. This should speed
1438 1451 up ifilter and friends somewhat.
1439 1452
1440 1453 2006-07-08 Ville Vainio <vivainio@gmail.com>
1441 1454
1442 1455 * Magic.py: %cpaste now strips > from the beginning of lines
1443 1456 to ease pasting quoted code from emails. Contributed by
1444 1457 Stefan van der Walt.
1445 1458
1446 1459 2006-06-29 Ville Vainio <vivainio@gmail.com>
1447 1460
1448 1461 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1449 1462 mode, patch contributed by Darren Dale. NEEDS TESTING!
1450 1463
1451 1464 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1452 1465
1453 1466 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1454 1467 a blue background. Fix fetching new display rows when the browser
1455 1468 scrolls more than a screenful (e.g. by using the goto command).
1456 1469
1457 1470 2006-06-27 Ville Vainio <vivainio@gmail.com>
1458 1471
1459 1472 * Magic.py (_inspect, _ofind) Apply David Huard's
1460 1473 patch for displaying the correct docstring for 'property'
1461 1474 attributes.
1462 1475
1463 1476 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1464 1477
1465 1478 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1466 1479 commands into the methods implementing them.
1467 1480
1468 1481 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1469 1482
1470 1483 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1471 1484 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1472 1485 autoindent support was authored by Jin Liu.
1473 1486
1474 1487 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1475 1488
1476 1489 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1477 1490 for keymaps with a custom class that simplifies handling.
1478 1491
1479 1492 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1480 1493
1481 1494 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1482 1495 resizing. This requires Python 2.5 to work.
1483 1496
1484 1497 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1485 1498
1486 1499 * IPython/Extensions/ibrowse.py: Add two new commands to
1487 1500 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1488 1501 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1489 1502 attributes again. Remapped the help command to "?". Display
1490 1503 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1491 1504 as keys for the "home" and "end" commands. Add three new commands
1492 1505 to the input mode for "find" and friends: "delend" (CTRL-K)
1493 1506 deletes to the end of line. "incsearchup" searches upwards in the
1494 1507 command history for an input that starts with the text before the cursor.
1495 1508 "incsearchdown" does the same downwards. Removed a bogus mapping of
1496 1509 the x key to "delete".
1497 1510
1498 1511 2006-06-15 Ville Vainio <vivainio@gmail.com>
1499 1512
1500 1513 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1501 1514 used to create prompts dynamically, instead of the "old" way of
1502 1515 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1503 1516 way still works (it's invoked by the default hook), of course.
1504 1517
1505 1518 * Prompts.py: added generate_output_prompt hook for altering output
1506 1519 prompt
1507 1520
1508 1521 * Release.py: Changed version string to 0.7.3.svn.
1509 1522
1510 1523 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1511 1524
1512 1525 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1513 1526 the call to fetch() always tries to fetch enough data for at least one
1514 1527 full screen. This makes it possible to simply call moveto(0,0,True) in
1515 1528 the constructor. Fix typos and removed the obsolete goto attribute.
1516 1529
1517 1530 2006-06-12 Ville Vainio <vivainio@gmail.com>
1518 1531
1519 1532 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1520 1533 allowing $variable interpolation within multiline statements,
1521 1534 though so far only with "sh" profile for a testing period.
1522 1535 The patch also enables splitting long commands with \ but it
1523 1536 doesn't work properly yet.
1524 1537
1525 1538 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1526 1539
1527 1540 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1528 1541 input history and the position of the cursor in the input history for
1529 1542 the find, findbackwards and goto command.
1530 1543
1531 1544 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1532 1545
1533 1546 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1534 1547 implements the basic functionality of browser commands that require
1535 1548 input. Reimplement the goto, find and findbackwards commands as
1536 1549 subclasses of _CommandInput. Add an input history and keymaps to those
1537 1550 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1538 1551 execute commands.
1539 1552
1540 1553 2006-06-07 Ville Vainio <vivainio@gmail.com>
1541 1554
1542 1555 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1543 1556 running the batch files instead of leaving the session open.
1544 1557
1545 1558 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1546 1559
1547 1560 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1548 1561 the original fix was incomplete. Patch submitted by W. Maier.
1549 1562
1550 1563 2006-06-07 Ville Vainio <vivainio@gmail.com>
1551 1564
1552 1565 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1553 1566 Confirmation prompts can be supressed by 'quiet' option.
1554 1567 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1555 1568
1556 1569 2006-06-06 *** Released version 0.7.2
1557 1570
1558 1571 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1559 1572
1560 1573 * IPython/Release.py (version): Made 0.7.2 final for release.
1561 1574 Repo tagged and release cut.
1562 1575
1563 1576 2006-06-05 Ville Vainio <vivainio@gmail.com>
1564 1577
1565 1578 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1566 1579 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1567 1580
1568 1581 * upgrade_dir.py: try import 'path' module a bit harder
1569 1582 (for %upgrade)
1570 1583
1571 1584 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1572 1585
1573 1586 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1574 1587 instead of looping 20 times.
1575 1588
1576 1589 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1577 1590 correctly at initialization time. Bug reported by Krishna Mohan
1578 1591 Gundu <gkmohan-AT-gmail.com> on the user list.
1579 1592
1580 1593 * IPython/Release.py (version): Mark 0.7.2 version to start
1581 1594 testing for release on 06/06.
1582 1595
1583 1596 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1584 1597
1585 1598 * scripts/irunner: thin script interface so users don't have to
1586 1599 find the module and call it as an executable, since modules rarely
1587 1600 live in people's PATH.
1588 1601
1589 1602 * IPython/irunner.py (InteractiveRunner.__init__): added
1590 1603 delaybeforesend attribute to control delays with newer versions of
1591 1604 pexpect. Thanks to detailed help from pexpect's author, Noah
1592 1605 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1593 1606 correctly (it works in NoColor mode).
1594 1607
1595 1608 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1596 1609 SAGE list, from improper log() calls.
1597 1610
1598 1611 2006-05-31 Ville Vainio <vivainio@gmail.com>
1599 1612
1600 1613 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1601 1614 with args in parens to work correctly with dirs that have spaces.
1602 1615
1603 1616 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1604 1617
1605 1618 * IPython/Logger.py (Logger.logstart): add option to log raw input
1606 1619 instead of the processed one. A -r flag was added to the
1607 1620 %logstart magic used for controlling logging.
1608 1621
1609 1622 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1610 1623
1611 1624 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1612 1625 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1613 1626 recognize the option. After a bug report by Will Maier. This
1614 1627 closes #64 (will do it after confirmation from W. Maier).
1615 1628
1616 1629 * IPython/irunner.py: New module to run scripts as if manually
1617 1630 typed into an interactive environment, based on pexpect. After a
1618 1631 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1619 1632 ipython-user list. Simple unittests in the tests/ directory.
1620 1633
1621 1634 * tools/release: add Will Maier, OpenBSD port maintainer, to
1622 1635 recepients list. We are now officially part of the OpenBSD ports:
1623 1636 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1624 1637 work.
1625 1638
1626 1639 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1627 1640
1628 1641 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1629 1642 so that it doesn't break tkinter apps.
1630 1643
1631 1644 * IPython/iplib.py (_prefilter): fix bug where aliases would
1632 1645 shadow variables when autocall was fully off. Reported by SAGE
1633 1646 author William Stein.
1634 1647
1635 1648 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1636 1649 at what detail level strings are computed when foo? is requested.
1637 1650 This allows users to ask for example that the string form of an
1638 1651 object is only computed when foo?? is called, or even never, by
1639 1652 setting the object_info_string_level >= 2 in the configuration
1640 1653 file. This new option has been added and documented. After a
1641 1654 request by SAGE to be able to control the printing of very large
1642 1655 objects more easily.
1643 1656
1644 1657 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1645 1658
1646 1659 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1647 1660 from sys.argv, to be 100% consistent with how Python itself works
1648 1661 (as seen for example with python -i file.py). After a bug report
1649 1662 by Jeffrey Collins.
1650 1663
1651 1664 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1652 1665 nasty bug which was preventing custom namespaces with -pylab,
1653 1666 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1654 1667 compatibility (long gone from mpl).
1655 1668
1656 1669 * IPython/ipapi.py (make_session): name change: create->make. We
1657 1670 use make in other places (ipmaker,...), it's shorter and easier to
1658 1671 type and say, etc. I'm trying to clean things before 0.7.2 so
1659 1672 that I can keep things stable wrt to ipapi in the chainsaw branch.
1660 1673
1661 1674 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1662 1675 python-mode recognizes our debugger mode. Add support for
1663 1676 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1664 1677 <m.liu.jin-AT-gmail.com> originally written by
1665 1678 doxgen-AT-newsmth.net (with minor modifications for xemacs
1666 1679 compatibility)
1667 1680
1668 1681 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1669 1682 tracebacks when walking the stack so that the stack tracking system
1670 1683 in emacs' python-mode can identify the frames correctly.
1671 1684
1672 1685 * IPython/ipmaker.py (make_IPython): make the internal (and
1673 1686 default config) autoedit_syntax value false by default. Too many
1674 1687 users have complained to me (both on and off-list) about problems
1675 1688 with this option being on by default, so I'm making it default to
1676 1689 off. It can still be enabled by anyone via the usual mechanisms.
1677 1690
1678 1691 * IPython/completer.py (Completer.attr_matches): add support for
1679 1692 PyCrust-style _getAttributeNames magic method. Patch contributed
1680 1693 by <mscott-AT-goldenspud.com>. Closes #50.
1681 1694
1682 1695 * IPython/iplib.py (InteractiveShell.__init__): remove the
1683 1696 deletion of exit/quit from __builtin__, which can break
1684 1697 third-party tools like the Zope debugging console. The
1685 1698 %exit/%quit magics remain. In general, it's probably a good idea
1686 1699 not to delete anything from __builtin__, since we never know what
1687 1700 that will break. In any case, python now (for 2.5) will support
1688 1701 'real' exit/quit, so this issue is moot. Closes #55.
1689 1702
1690 1703 * IPython/genutils.py (with_obj): rename the 'with' function to
1691 1704 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1692 1705 becomes a language keyword. Closes #53.
1693 1706
1694 1707 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1695 1708 __file__ attribute to this so it fools more things into thinking
1696 1709 it is a real module. Closes #59.
1697 1710
1698 1711 * IPython/Magic.py (magic_edit): add -n option to open the editor
1699 1712 at a specific line number. After a patch by Stefan van der Walt.
1700 1713
1701 1714 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1702 1715
1703 1716 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1704 1717 reason the file could not be opened. After automatic crash
1705 1718 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1706 1719 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1707 1720 (_should_recompile): Don't fire editor if using %bg, since there
1708 1721 is no file in the first place. From the same report as above.
1709 1722 (raw_input): protect against faulty third-party prefilters. After
1710 1723 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1711 1724 while running under SAGE.
1712 1725
1713 1726 2006-05-23 Ville Vainio <vivainio@gmail.com>
1714 1727
1715 1728 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1716 1729 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1717 1730 now returns None (again), unless dummy is specifically allowed by
1718 1731 ipapi.get(allow_dummy=True).
1719 1732
1720 1733 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1721 1734
1722 1735 * IPython: remove all 2.2-compatibility objects and hacks from
1723 1736 everywhere, since we only support 2.3 at this point. Docs
1724 1737 updated.
1725 1738
1726 1739 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1727 1740 Anything requiring extra validation can be turned into a Python
1728 1741 property in the future. I used a property for the db one b/c
1729 1742 there was a nasty circularity problem with the initialization
1730 1743 order, which right now I don't have time to clean up.
1731 1744
1732 1745 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1733 1746 another locking bug reported by Jorgen. I'm not 100% sure though,
1734 1747 so more testing is needed...
1735 1748
1736 1749 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1737 1750
1738 1751 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1739 1752 local variables from any routine in user code (typically executed
1740 1753 with %run) directly into the interactive namespace. Very useful
1741 1754 when doing complex debugging.
1742 1755 (IPythonNotRunning): Changed the default None object to a dummy
1743 1756 whose attributes can be queried as well as called without
1744 1757 exploding, to ease writing code which works transparently both in
1745 1758 and out of ipython and uses some of this API.
1746 1759
1747 1760 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1748 1761
1749 1762 * IPython/hooks.py (result_display): Fix the fact that our display
1750 1763 hook was using str() instead of repr(), as the default python
1751 1764 console does. This had gone unnoticed b/c it only happened if
1752 1765 %Pprint was off, but the inconsistency was there.
1753 1766
1754 1767 2006-05-15 Ville Vainio <vivainio@gmail.com>
1755 1768
1756 1769 * Oinspect.py: Only show docstring for nonexisting/binary files
1757 1770 when doing object??, closing ticket #62
1758 1771
1759 1772 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1760 1773
1761 1774 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1762 1775 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1763 1776 was being released in a routine which hadn't checked if it had
1764 1777 been the one to acquire it.
1765 1778
1766 1779 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1767 1780
1768 1781 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1769 1782
1770 1783 2006-04-11 Ville Vainio <vivainio@gmail.com>
1771 1784
1772 1785 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1773 1786 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1774 1787 prefilters, allowing stuff like magics and aliases in the file.
1775 1788
1776 1789 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1777 1790 added. Supported now are "%clear in" and "%clear out" (clear input and
1778 1791 output history, respectively). Also fixed CachedOutput.flush to
1779 1792 properly flush the output cache.
1780 1793
1781 1794 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1782 1795 half-success (and fail explicitly).
1783 1796
1784 1797 2006-03-28 Ville Vainio <vivainio@gmail.com>
1785 1798
1786 1799 * iplib.py: Fix quoting of aliases so that only argless ones
1787 1800 are quoted
1788 1801
1789 1802 2006-03-28 Ville Vainio <vivainio@gmail.com>
1790 1803
1791 1804 * iplib.py: Quote aliases with spaces in the name.
1792 1805 "c:\program files\blah\bin" is now legal alias target.
1793 1806
1794 1807 * ext_rehashdir.py: Space no longer allowed as arg
1795 1808 separator, since space is legal in path names.
1796 1809
1797 1810 2006-03-16 Ville Vainio <vivainio@gmail.com>
1798 1811
1799 1812 * upgrade_dir.py: Take path.py from Extensions, correcting
1800 1813 %upgrade magic
1801 1814
1802 1815 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1803 1816
1804 1817 * hooks.py: Only enclose editor binary in quotes if legal and
1805 1818 necessary (space in the name, and is an existing file). Fixes a bug
1806 1819 reported by Zachary Pincus.
1807 1820
1808 1821 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1809 1822
1810 1823 * Manual: thanks to a tip on proper color handling for Emacs, by
1811 1824 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1812 1825
1813 1826 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1814 1827 by applying the provided patch. Thanks to Liu Jin
1815 1828 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1816 1829 XEmacs/Linux, I'm trusting the submitter that it actually helps
1817 1830 under win32/GNU Emacs. Will revisit if any problems are reported.
1818 1831
1819 1832 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1820 1833
1821 1834 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1822 1835 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1823 1836
1824 1837 2006-03-12 Ville Vainio <vivainio@gmail.com>
1825 1838
1826 1839 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1827 1840 Torsten Marek.
1828 1841
1829 1842 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1830 1843
1831 1844 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1832 1845 line ranges works again.
1833 1846
1834 1847 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1835 1848
1836 1849 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1837 1850 and friends, after a discussion with Zach Pincus on ipython-user.
1838 1851 I'm not 100% sure, but after thinking about it quite a bit, it may
1839 1852 be OK. Testing with the multithreaded shells didn't reveal any
1840 1853 problems, but let's keep an eye out.
1841 1854
1842 1855 In the process, I fixed a few things which were calling
1843 1856 self.InteractiveTB() directly (like safe_execfile), which is a
1844 1857 mistake: ALL exception reporting should be done by calling
1845 1858 self.showtraceback(), which handles state and tab-completion and
1846 1859 more.
1847 1860
1848 1861 2006-03-01 Ville Vainio <vivainio@gmail.com>
1849 1862
1850 1863 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1851 1864 To use, do "from ipipe import *".
1852 1865
1853 1866 2006-02-24 Ville Vainio <vivainio@gmail.com>
1854 1867
1855 1868 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1856 1869 "cleanly" and safely than the older upgrade mechanism.
1857 1870
1858 1871 2006-02-21 Ville Vainio <vivainio@gmail.com>
1859 1872
1860 1873 * Magic.py: %save works again.
1861 1874
1862 1875 2006-02-15 Ville Vainio <vivainio@gmail.com>
1863 1876
1864 1877 * Magic.py: %Pprint works again
1865 1878
1866 1879 * Extensions/ipy_sane_defaults.py: Provide everything provided
1867 1880 in default ipythonrc, to make it possible to have a completely empty
1868 1881 ipythonrc (and thus completely rc-file free configuration)
1869 1882
1870 1883 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1871 1884
1872 1885 * IPython/hooks.py (editor): quote the call to the editor command,
1873 1886 to allow commands with spaces in them. Problem noted by watching
1874 1887 Ian Oswald's video about textpad under win32 at
1875 1888 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1876 1889
1877 1890 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1878 1891 describing magics (we haven't used @ for a loong time).
1879 1892
1880 1893 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1881 1894 contributed by marienz to close
1882 1895 http://www.scipy.net/roundup/ipython/issue53.
1883 1896
1884 1897 2006-02-10 Ville Vainio <vivainio@gmail.com>
1885 1898
1886 1899 * genutils.py: getoutput now works in win32 too
1887 1900
1888 1901 * completer.py: alias and magic completion only invoked
1889 1902 at the first "item" in the line, to avoid "cd %store"
1890 1903 nonsense.
1891 1904
1892 1905 2006-02-09 Ville Vainio <vivainio@gmail.com>
1893 1906
1894 1907 * test/*: Added a unit testing framework (finally).
1895 1908 '%run runtests.py' to run test_*.
1896 1909
1897 1910 * ipapi.py: Exposed runlines and set_custom_exc
1898 1911
1899 1912 2006-02-07 Ville Vainio <vivainio@gmail.com>
1900 1913
1901 1914 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1902 1915 instead use "f(1 2)" as before.
1903 1916
1904 1917 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1905 1918
1906 1919 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1907 1920 facilities, for demos processed by the IPython input filter
1908 1921 (IPythonDemo), and for running a script one-line-at-a-time as a
1909 1922 demo, both for pure Python (LineDemo) and for IPython-processed
1910 1923 input (IPythonLineDemo). After a request by Dave Kohel, from the
1911 1924 SAGE team.
1912 1925 (Demo.edit): added an edit() method to the demo objects, to edit
1913 1926 the in-memory copy of the last executed block.
1914 1927
1915 1928 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1916 1929 processing to %edit, %macro and %save. These commands can now be
1917 1930 invoked on the unprocessed input as it was typed by the user
1918 1931 (without any prefilters applied). After requests by the SAGE team
1919 1932 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1920 1933
1921 1934 2006-02-01 Ville Vainio <vivainio@gmail.com>
1922 1935
1923 1936 * setup.py, eggsetup.py: easy_install ipython==dev works
1924 1937 correctly now (on Linux)
1925 1938
1926 1939 * ipy_user_conf,ipmaker: user config changes, removed spurious
1927 1940 warnings
1928 1941
1929 1942 * iplib: if rc.banner is string, use it as is.
1930 1943
1931 1944 * Magic: %pycat accepts a string argument and pages it's contents.
1932 1945
1933 1946
1934 1947 2006-01-30 Ville Vainio <vivainio@gmail.com>
1935 1948
1936 1949 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1937 1950 Now %store and bookmarks work through PickleShare, meaning that
1938 1951 concurrent access is possible and all ipython sessions see the
1939 1952 same database situation all the time, instead of snapshot of
1940 1953 the situation when the session was started. Hence, %bookmark
1941 1954 results are immediately accessible from othes sessions. The database
1942 1955 is also available for use by user extensions. See:
1943 1956 http://www.python.org/pypi/pickleshare
1944 1957
1945 1958 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1946 1959
1947 1960 * aliases can now be %store'd
1948 1961
1949 1962 * path.py moved to Extensions so that pickleshare does not need
1950 1963 IPython-specific import. Extensions added to pythonpath right
1951 1964 at __init__.
1952 1965
1953 1966 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1954 1967 called with _ip.system and the pre-transformed command string.
1955 1968
1956 1969 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1957 1970
1958 1971 * IPython/iplib.py (interact): Fix that we were not catching
1959 1972 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1960 1973 logic here had to change, but it's fixed now.
1961 1974
1962 1975 2006-01-29 Ville Vainio <vivainio@gmail.com>
1963 1976
1964 1977 * iplib.py: Try to import pyreadline on Windows.
1965 1978
1966 1979 2006-01-27 Ville Vainio <vivainio@gmail.com>
1967 1980
1968 1981 * iplib.py: Expose ipapi as _ip in builtin namespace.
1969 1982 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1970 1983 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1971 1984 syntax now produce _ip.* variant of the commands.
1972 1985
1973 1986 * "_ip.options().autoedit_syntax = 2" automatically throws
1974 1987 user to editor for syntax error correction without prompting.
1975 1988
1976 1989 2006-01-27 Ville Vainio <vivainio@gmail.com>
1977 1990
1978 1991 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1979 1992 'ipython' at argv[0]) executed through command line.
1980 1993 NOTE: this DEPRECATES calling ipython with multiple scripts
1981 1994 ("ipython a.py b.py c.py")
1982 1995
1983 1996 * iplib.py, hooks.py: Added configurable input prefilter,
1984 1997 named 'input_prefilter'. See ext_rescapture.py for example
1985 1998 usage.
1986 1999
1987 2000 * ext_rescapture.py, Magic.py: Better system command output capture
1988 2001 through 'var = !ls' (deprecates user-visible %sc). Same notation
1989 2002 applies for magics, 'var = %alias' assigns alias list to var.
1990 2003
1991 2004 * ipapi.py: added meta() for accessing extension-usable data store.
1992 2005
1993 2006 * iplib.py: added InteractiveShell.getapi(). New magics should be
1994 2007 written doing self.getapi() instead of using the shell directly.
1995 2008
1996 2009 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1997 2010 %store foo >> ~/myfoo.txt to store variables to files (in clean
1998 2011 textual form, not a restorable pickle).
1999 2012
2000 2013 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
2001 2014
2002 2015 * usage.py, Magic.py: added %quickref
2003 2016
2004 2017 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
2005 2018
2006 2019 * GetoptErrors when invoking magics etc. with wrong args
2007 2020 are now more helpful:
2008 2021 GetoptError: option -l not recognized (allowed: "qb" )
2009 2022
2010 2023 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
2011 2024
2012 2025 * IPython/demo.py (Demo.show): Flush stdout after each block, so
2013 2026 computationally intensive blocks don't appear to stall the demo.
2014 2027
2015 2028 2006-01-24 Ville Vainio <vivainio@gmail.com>
2016 2029
2017 2030 * iplib.py, hooks.py: 'result_display' hook can return a non-None
2018 2031 value to manipulate resulting history entry.
2019 2032
2020 2033 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2021 2034 to instance methods of IPApi class, to make extending an embedded
2022 2035 IPython feasible. See ext_rehashdir.py for example usage.
2023 2036
2024 2037 * Merged 1071-1076 from branches/0.7.1
2025 2038
2026 2039
2027 2040 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2028 2041
2029 2042 * tools/release (daystamp): Fix build tools to use the new
2030 2043 eggsetup.py script to build lightweight eggs.
2031 2044
2032 2045 * Applied changesets 1062 and 1064 before 0.7.1 release.
2033 2046
2034 2047 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2035 2048 see the raw input history (without conversions like %ls ->
2036 2049 ipmagic("ls")). After a request from W. Stein, SAGE
2037 2050 (http://modular.ucsd.edu/sage) developer. This information is
2038 2051 stored in the input_hist_raw attribute of the IPython instance, so
2039 2052 developers can access it if needed (it's an InputList instance).
2040 2053
2041 2054 * Versionstring = 0.7.2.svn
2042 2055
2043 2056 * eggsetup.py: A separate script for constructing eggs, creates
2044 2057 proper launch scripts even on Windows (an .exe file in
2045 2058 \python24\scripts).
2046 2059
2047 2060 * ipapi.py: launch_new_instance, launch entry point needed for the
2048 2061 egg.
2049 2062
2050 2063 2006-01-23 Ville Vainio <vivainio@gmail.com>
2051 2064
2052 2065 * Added %cpaste magic for pasting python code
2053 2066
2054 2067 2006-01-22 Ville Vainio <vivainio@gmail.com>
2055 2068
2056 2069 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2057 2070
2058 2071 * Versionstring = 0.7.2.svn
2059 2072
2060 2073 * eggsetup.py: A separate script for constructing eggs, creates
2061 2074 proper launch scripts even on Windows (an .exe file in
2062 2075 \python24\scripts).
2063 2076
2064 2077 * ipapi.py: launch_new_instance, launch entry point needed for the
2065 2078 egg.
2066 2079
2067 2080 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2068 2081
2069 2082 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2070 2083 %pfile foo would print the file for foo even if it was a binary.
2071 2084 Now, extensions '.so' and '.dll' are skipped.
2072 2085
2073 2086 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2074 2087 bug, where macros would fail in all threaded modes. I'm not 100%
2075 2088 sure, so I'm going to put out an rc instead of making a release
2076 2089 today, and wait for feedback for at least a few days.
2077 2090
2078 2091 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2079 2092 it...) the handling of pasting external code with autoindent on.
2080 2093 To get out of a multiline input, the rule will appear for most
2081 2094 users unchanged: two blank lines or change the indent level
2082 2095 proposed by IPython. But there is a twist now: you can
2083 2096 add/subtract only *one or two spaces*. If you add/subtract three
2084 2097 or more (unless you completely delete the line), IPython will
2085 2098 accept that line, and you'll need to enter a second one of pure
2086 2099 whitespace. I know it sounds complicated, but I can't find a
2087 2100 different solution that covers all the cases, with the right
2088 2101 heuristics. Hopefully in actual use, nobody will really notice
2089 2102 all these strange rules and things will 'just work'.
2090 2103
2091 2104 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2092 2105
2093 2106 * IPython/iplib.py (interact): catch exceptions which can be
2094 2107 triggered asynchronously by signal handlers. Thanks to an
2095 2108 automatic crash report, submitted by Colin Kingsley
2096 2109 <tercel-AT-gentoo.org>.
2097 2110
2098 2111 2006-01-20 Ville Vainio <vivainio@gmail.com>
2099 2112
2100 2113 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2101 2114 (%rehashdir, very useful, try it out) of how to extend ipython
2102 2115 with new magics. Also added Extensions dir to pythonpath to make
2103 2116 importing extensions easy.
2104 2117
2105 2118 * %store now complains when trying to store interactively declared
2106 2119 classes / instances of those classes.
2107 2120
2108 2121 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2109 2122 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2110 2123 if they exist, and ipy_user_conf.py with some defaults is created for
2111 2124 the user.
2112 2125
2113 2126 * Startup rehashing done by the config file, not InterpreterExec.
2114 2127 This means system commands are available even without selecting the
2115 2128 pysh profile. It's the sensible default after all.
2116 2129
2117 2130 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2118 2131
2119 2132 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2120 2133 multiline code with autoindent on working. But I am really not
2121 2134 sure, so this needs more testing. Will commit a debug-enabled
2122 2135 version for now, while I test it some more, so that Ville and
2123 2136 others may also catch any problems. Also made
2124 2137 self.indent_current_str() a method, to ensure that there's no
2125 2138 chance of the indent space count and the corresponding string
2126 2139 falling out of sync. All code needing the string should just call
2127 2140 the method.
2128 2141
2129 2142 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2130 2143
2131 2144 * IPython/Magic.py (magic_edit): fix check for when users don't
2132 2145 save their output files, the try/except was in the wrong section.
2133 2146
2134 2147 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2135 2148
2136 2149 * IPython/Magic.py (magic_run): fix __file__ global missing from
2137 2150 script's namespace when executed via %run. After a report by
2138 2151 Vivian.
2139 2152
2140 2153 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2141 2154 when using python 2.4. The parent constructor changed in 2.4, and
2142 2155 we need to track it directly (we can't call it, as it messes up
2143 2156 readline and tab-completion inside our pdb would stop working).
2144 2157 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2145 2158
2146 2159 2006-01-16 Ville Vainio <vivainio@gmail.com>
2147 2160
2148 2161 * Ipython/magic.py: Reverted back to old %edit functionality
2149 2162 that returns file contents on exit.
2150 2163
2151 2164 * IPython/path.py: Added Jason Orendorff's "path" module to
2152 2165 IPython tree, http://www.jorendorff.com/articles/python/path/.
2153 2166 You can get path objects conveniently through %sc, and !!, e.g.:
2154 2167 sc files=ls
2155 2168 for p in files.paths: # or files.p
2156 2169 print p,p.mtime
2157 2170
2158 2171 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2159 2172 now work again without considering the exclusion regexp -
2160 2173 hence, things like ',foo my/path' turn to 'foo("my/path")'
2161 2174 instead of syntax error.
2162 2175
2163 2176
2164 2177 2006-01-14 Ville Vainio <vivainio@gmail.com>
2165 2178
2166 2179 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2167 2180 ipapi decorators for python 2.4 users, options() provides access to rc
2168 2181 data.
2169 2182
2170 2183 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2171 2184 as path separators (even on Linux ;-). Space character after
2172 2185 backslash (as yielded by tab completer) is still space;
2173 2186 "%cd long\ name" works as expected.
2174 2187
2175 2188 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2176 2189 as "chain of command", with priority. API stays the same,
2177 2190 TryNext exception raised by a hook function signals that
2178 2191 current hook failed and next hook should try handling it, as
2179 2192 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2180 2193 requested configurable display hook, which is now implemented.
2181 2194
2182 2195 2006-01-13 Ville Vainio <vivainio@gmail.com>
2183 2196
2184 2197 * IPython/platutils*.py: platform specific utility functions,
2185 2198 so far only set_term_title is implemented (change terminal
2186 2199 label in windowing systems). %cd now changes the title to
2187 2200 current dir.
2188 2201
2189 2202 * IPython/Release.py: Added myself to "authors" list,
2190 2203 had to create new files.
2191 2204
2192 2205 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2193 2206 shell escape; not a known bug but had potential to be one in the
2194 2207 future.
2195 2208
2196 2209 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2197 2210 extension API for IPython! See the module for usage example. Fix
2198 2211 OInspect for docstring-less magic functions.
2199 2212
2200 2213
2201 2214 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2202 2215
2203 2216 * IPython/iplib.py (raw_input): temporarily deactivate all
2204 2217 attempts at allowing pasting of code with autoindent on. It
2205 2218 introduced bugs (reported by Prabhu) and I can't seem to find a
2206 2219 robust combination which works in all cases. Will have to revisit
2207 2220 later.
2208 2221
2209 2222 * IPython/genutils.py: remove isspace() function. We've dropped
2210 2223 2.2 compatibility, so it's OK to use the string method.
2211 2224
2212 2225 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2213 2226
2214 2227 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2215 2228 matching what NOT to autocall on, to include all python binary
2216 2229 operators (including things like 'and', 'or', 'is' and 'in').
2217 2230 Prompted by a bug report on 'foo & bar', but I realized we had
2218 2231 many more potential bug cases with other operators. The regexp is
2219 2232 self.re_exclude_auto, it's fairly commented.
2220 2233
2221 2234 2006-01-12 Ville Vainio <vivainio@gmail.com>
2222 2235
2223 2236 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2224 2237 Prettified and hardened string/backslash quoting with ipsystem(),
2225 2238 ipalias() and ipmagic(). Now even \ characters are passed to
2226 2239 %magics, !shell escapes and aliases exactly as they are in the
2227 2240 ipython command line. Should improve backslash experience,
2228 2241 particularly in Windows (path delimiter for some commands that
2229 2242 won't understand '/'), but Unix benefits as well (regexps). %cd
2230 2243 magic still doesn't support backslash path delimiters, though. Also
2231 2244 deleted all pretense of supporting multiline command strings in
2232 2245 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2233 2246
2234 2247 * doc/build_doc_instructions.txt added. Documentation on how to
2235 2248 use doc/update_manual.py, added yesterday. Both files contributed
2236 2249 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2237 2250 doc/*.sh for deprecation at a later date.
2238 2251
2239 2252 * /ipython.py Added ipython.py to root directory for
2240 2253 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2241 2254 ipython.py) and development convenience (no need to keep doing
2242 2255 "setup.py install" between changes).
2243 2256
2244 2257 * Made ! and !! shell escapes work (again) in multiline expressions:
2245 2258 if 1:
2246 2259 !ls
2247 2260 !!ls
2248 2261
2249 2262 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2250 2263
2251 2264 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2252 2265 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2253 2266 module in case-insensitive installation. Was causing crashes
2254 2267 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2255 2268
2256 2269 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2257 2270 <marienz-AT-gentoo.org>, closes
2258 2271 http://www.scipy.net/roundup/ipython/issue51.
2259 2272
2260 2273 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2261 2274
2262 2275 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2263 2276 problem of excessive CPU usage under *nix and keyboard lag under
2264 2277 win32.
2265 2278
2266 2279 2006-01-10 *** Released version 0.7.0
2267 2280
2268 2281 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2269 2282
2270 2283 * IPython/Release.py (revision): tag version number to 0.7.0,
2271 2284 ready for release.
2272 2285
2273 2286 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2274 2287 it informs the user of the name of the temp. file used. This can
2275 2288 help if you decide later to reuse that same file, so you know
2276 2289 where to copy the info from.
2277 2290
2278 2291 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2279 2292
2280 2293 * setup_bdist_egg.py: little script to build an egg. Added
2281 2294 support in the release tools as well.
2282 2295
2283 2296 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2284 2297
2285 2298 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2286 2299 version selection (new -wxversion command line and ipythonrc
2287 2300 parameter). Patch contributed by Arnd Baecker
2288 2301 <arnd.baecker-AT-web.de>.
2289 2302
2290 2303 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2291 2304 embedded instances, for variables defined at the interactive
2292 2305 prompt of the embedded ipython. Reported by Arnd.
2293 2306
2294 2307 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2295 2308 it can be used as a (stateful) toggle, or with a direct parameter.
2296 2309
2297 2310 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2298 2311 could be triggered in certain cases and cause the traceback
2299 2312 printer not to work.
2300 2313
2301 2314 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2302 2315
2303 2316 * IPython/iplib.py (_should_recompile): Small fix, closes
2304 2317 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2305 2318
2306 2319 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2307 2320
2308 2321 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2309 2322 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2310 2323 Moad for help with tracking it down.
2311 2324
2312 2325 * IPython/iplib.py (handle_auto): fix autocall handling for
2313 2326 objects which support BOTH __getitem__ and __call__ (so that f [x]
2314 2327 is left alone, instead of becoming f([x]) automatically).
2315 2328
2316 2329 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2317 2330 Ville's patch.
2318 2331
2319 2332 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2320 2333
2321 2334 * IPython/iplib.py (handle_auto): changed autocall semantics to
2322 2335 include 'smart' mode, where the autocall transformation is NOT
2323 2336 applied if there are no arguments on the line. This allows you to
2324 2337 just type 'foo' if foo is a callable to see its internal form,
2325 2338 instead of having it called with no arguments (typically a
2326 2339 mistake). The old 'full' autocall still exists: for that, you
2327 2340 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2328 2341
2329 2342 * IPython/completer.py (Completer.attr_matches): add
2330 2343 tab-completion support for Enthoughts' traits. After a report by
2331 2344 Arnd and a patch by Prabhu.
2332 2345
2333 2346 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2334 2347
2335 2348 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2336 2349 Schmolck's patch to fix inspect.getinnerframes().
2337 2350
2338 2351 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2339 2352 for embedded instances, regarding handling of namespaces and items
2340 2353 added to the __builtin__ one. Multiple embedded instances and
2341 2354 recursive embeddings should work better now (though I'm not sure
2342 2355 I've got all the corner cases fixed, that code is a bit of a brain
2343 2356 twister).
2344 2357
2345 2358 * IPython/Magic.py (magic_edit): added support to edit in-memory
2346 2359 macros (automatically creates the necessary temp files). %edit
2347 2360 also doesn't return the file contents anymore, it's just noise.
2348 2361
2349 2362 * IPython/completer.py (Completer.attr_matches): revert change to
2350 2363 complete only on attributes listed in __all__. I realized it
2351 2364 cripples the tab-completion system as a tool for exploring the
2352 2365 internals of unknown libraries (it renders any non-__all__
2353 2366 attribute off-limits). I got bit by this when trying to see
2354 2367 something inside the dis module.
2355 2368
2356 2369 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2357 2370
2358 2371 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2359 2372 namespace for users and extension writers to hold data in. This
2360 2373 follows the discussion in
2361 2374 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2362 2375
2363 2376 * IPython/completer.py (IPCompleter.complete): small patch to help
2364 2377 tab-completion under Emacs, after a suggestion by John Barnard
2365 2378 <barnarj-AT-ccf.org>.
2366 2379
2367 2380 * IPython/Magic.py (Magic.extract_input_slices): added support for
2368 2381 the slice notation in magics to use N-M to represent numbers N...M
2369 2382 (closed endpoints). This is used by %macro and %save.
2370 2383
2371 2384 * IPython/completer.py (Completer.attr_matches): for modules which
2372 2385 define __all__, complete only on those. After a patch by Jeffrey
2373 2386 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2374 2387 speed up this routine.
2375 2388
2376 2389 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2377 2390 don't know if this is the end of it, but the behavior now is
2378 2391 certainly much more correct. Note that coupled with macros,
2379 2392 slightly surprising (at first) behavior may occur: a macro will in
2380 2393 general expand to multiple lines of input, so upon exiting, the
2381 2394 in/out counters will both be bumped by the corresponding amount
2382 2395 (as if the macro's contents had been typed interactively). Typing
2383 2396 %hist will reveal the intermediate (silently processed) lines.
2384 2397
2385 2398 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2386 2399 pickle to fail (%run was overwriting __main__ and not restoring
2387 2400 it, but pickle relies on __main__ to operate).
2388 2401
2389 2402 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2390 2403 using properties, but forgot to make the main InteractiveShell
2391 2404 class a new-style class. Properties fail silently, and
2392 2405 mysteriously, with old-style class (getters work, but
2393 2406 setters don't do anything).
2394 2407
2395 2408 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2396 2409
2397 2410 * IPython/Magic.py (magic_history): fix history reporting bug (I
2398 2411 know some nasties are still there, I just can't seem to find a
2399 2412 reproducible test case to track them down; the input history is
2400 2413 falling out of sync...)
2401 2414
2402 2415 * IPython/iplib.py (handle_shell_escape): fix bug where both
2403 2416 aliases and system accesses where broken for indented code (such
2404 2417 as loops).
2405 2418
2406 2419 * IPython/genutils.py (shell): fix small but critical bug for
2407 2420 win32 system access.
2408 2421
2409 2422 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2410 2423
2411 2424 * IPython/iplib.py (showtraceback): remove use of the
2412 2425 sys.last_{type/value/traceback} structures, which are non
2413 2426 thread-safe.
2414 2427 (_prefilter): change control flow to ensure that we NEVER
2415 2428 introspect objects when autocall is off. This will guarantee that
2416 2429 having an input line of the form 'x.y', where access to attribute
2417 2430 'y' has side effects, doesn't trigger the side effect TWICE. It
2418 2431 is important to note that, with autocall on, these side effects
2419 2432 can still happen.
2420 2433 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2421 2434 trio. IPython offers these three kinds of special calls which are
2422 2435 not python code, and it's a good thing to have their call method
2423 2436 be accessible as pure python functions (not just special syntax at
2424 2437 the command line). It gives us a better internal implementation
2425 2438 structure, as well as exposing these for user scripting more
2426 2439 cleanly.
2427 2440
2428 2441 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2429 2442 file. Now that they'll be more likely to be used with the
2430 2443 persistance system (%store), I want to make sure their module path
2431 2444 doesn't change in the future, so that we don't break things for
2432 2445 users' persisted data.
2433 2446
2434 2447 * IPython/iplib.py (autoindent_update): move indentation
2435 2448 management into the _text_ processing loop, not the keyboard
2436 2449 interactive one. This is necessary to correctly process non-typed
2437 2450 multiline input (such as macros).
2438 2451
2439 2452 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2440 2453 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2441 2454 which was producing problems in the resulting manual.
2442 2455 (magic_whos): improve reporting of instances (show their class,
2443 2456 instead of simply printing 'instance' which isn't terribly
2444 2457 informative).
2445 2458
2446 2459 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2447 2460 (minor mods) to support network shares under win32.
2448 2461
2449 2462 * IPython/winconsole.py (get_console_size): add new winconsole
2450 2463 module and fixes to page_dumb() to improve its behavior under
2451 2464 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2452 2465
2453 2466 * IPython/Magic.py (Macro): simplified Macro class to just
2454 2467 subclass list. We've had only 2.2 compatibility for a very long
2455 2468 time, yet I was still avoiding subclassing the builtin types. No
2456 2469 more (I'm also starting to use properties, though I won't shift to
2457 2470 2.3-specific features quite yet).
2458 2471 (magic_store): added Ville's patch for lightweight variable
2459 2472 persistence, after a request on the user list by Matt Wilkie
2460 2473 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2461 2474 details.
2462 2475
2463 2476 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2464 2477 changed the default logfile name from 'ipython.log' to
2465 2478 'ipython_log.py'. These logs are real python files, and now that
2466 2479 we have much better multiline support, people are more likely to
2467 2480 want to use them as such. Might as well name them correctly.
2468 2481
2469 2482 * IPython/Magic.py: substantial cleanup. While we can't stop
2470 2483 using magics as mixins, due to the existing customizations 'out
2471 2484 there' which rely on the mixin naming conventions, at least I
2472 2485 cleaned out all cross-class name usage. So once we are OK with
2473 2486 breaking compatibility, the two systems can be separated.
2474 2487
2475 2488 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2476 2489 anymore, and the class is a fair bit less hideous as well. New
2477 2490 features were also introduced: timestamping of input, and logging
2478 2491 of output results. These are user-visible with the -t and -o
2479 2492 options to %logstart. Closes
2480 2493 http://www.scipy.net/roundup/ipython/issue11 and a request by
2481 2494 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2482 2495
2483 2496 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2484 2497
2485 2498 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2486 2499 better handle backslashes in paths. See the thread 'More Windows
2487 2500 questions part 2 - \/ characters revisited' on the iypthon user
2488 2501 list:
2489 2502 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2490 2503
2491 2504 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2492 2505
2493 2506 (InteractiveShell.__init__): change threaded shells to not use the
2494 2507 ipython crash handler. This was causing more problems than not,
2495 2508 as exceptions in the main thread (GUI code, typically) would
2496 2509 always show up as a 'crash', when they really weren't.
2497 2510
2498 2511 The colors and exception mode commands (%colors/%xmode) have been
2499 2512 synchronized to also take this into account, so users can get
2500 2513 verbose exceptions for their threaded code as well. I also added
2501 2514 support for activating pdb inside this exception handler as well,
2502 2515 so now GUI authors can use IPython's enhanced pdb at runtime.
2503 2516
2504 2517 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2505 2518 true by default, and add it to the shipped ipythonrc file. Since
2506 2519 this asks the user before proceeding, I think it's OK to make it
2507 2520 true by default.
2508 2521
2509 2522 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2510 2523 of the previous special-casing of input in the eval loop. I think
2511 2524 this is cleaner, as they really are commands and shouldn't have
2512 2525 a special role in the middle of the core code.
2513 2526
2514 2527 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2515 2528
2516 2529 * IPython/iplib.py (edit_syntax_error): added support for
2517 2530 automatically reopening the editor if the file had a syntax error
2518 2531 in it. Thanks to scottt who provided the patch at:
2519 2532 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2520 2533 version committed).
2521 2534
2522 2535 * IPython/iplib.py (handle_normal): add suport for multi-line
2523 2536 input with emtpy lines. This fixes
2524 2537 http://www.scipy.net/roundup/ipython/issue43 and a similar
2525 2538 discussion on the user list.
2526 2539
2527 2540 WARNING: a behavior change is necessarily introduced to support
2528 2541 blank lines: now a single blank line with whitespace does NOT
2529 2542 break the input loop, which means that when autoindent is on, by
2530 2543 default hitting return on the next (indented) line does NOT exit.
2531 2544
2532 2545 Instead, to exit a multiline input you can either have:
2533 2546
2534 2547 - TWO whitespace lines (just hit return again), or
2535 2548 - a single whitespace line of a different length than provided
2536 2549 by the autoindent (add or remove a space).
2537 2550
2538 2551 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2539 2552 module to better organize all readline-related functionality.
2540 2553 I've deleted FlexCompleter and put all completion clases here.
2541 2554
2542 2555 * IPython/iplib.py (raw_input): improve indentation management.
2543 2556 It is now possible to paste indented code with autoindent on, and
2544 2557 the code is interpreted correctly (though it still looks bad on
2545 2558 screen, due to the line-oriented nature of ipython).
2546 2559 (MagicCompleter.complete): change behavior so that a TAB key on an
2547 2560 otherwise empty line actually inserts a tab, instead of completing
2548 2561 on the entire global namespace. This makes it easier to use the
2549 2562 TAB key for indentation. After a request by Hans Meine
2550 2563 <hans_meine-AT-gmx.net>
2551 2564 (_prefilter): add support so that typing plain 'exit' or 'quit'
2552 2565 does a sensible thing. Originally I tried to deviate as little as
2553 2566 possible from the default python behavior, but even that one may
2554 2567 change in this direction (thread on python-dev to that effect).
2555 2568 Regardless, ipython should do the right thing even if CPython's
2556 2569 '>>>' prompt doesn't.
2557 2570 (InteractiveShell): removed subclassing code.InteractiveConsole
2558 2571 class. By now we'd overridden just about all of its methods: I've
2559 2572 copied the remaining two over, and now ipython is a standalone
2560 2573 class. This will provide a clearer picture for the chainsaw
2561 2574 branch refactoring.
2562 2575
2563 2576 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2564 2577
2565 2578 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2566 2579 failures for objects which break when dir() is called on them.
2567 2580
2568 2581 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2569 2582 distinct local and global namespaces in the completer API. This
2570 2583 change allows us to properly handle completion with distinct
2571 2584 scopes, including in embedded instances (this had never really
2572 2585 worked correctly).
2573 2586
2574 2587 Note: this introduces a change in the constructor for
2575 2588 MagicCompleter, as a new global_namespace parameter is now the
2576 2589 second argument (the others were bumped one position).
2577 2590
2578 2591 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2579 2592
2580 2593 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2581 2594 embedded instances (which can be done now thanks to Vivian's
2582 2595 frame-handling fixes for pdb).
2583 2596 (InteractiveShell.__init__): Fix namespace handling problem in
2584 2597 embedded instances. We were overwriting __main__ unconditionally,
2585 2598 and this should only be done for 'full' (non-embedded) IPython;
2586 2599 embedded instances must respect the caller's __main__. Thanks to
2587 2600 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2588 2601
2589 2602 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2590 2603
2591 2604 * setup.py: added download_url to setup(). This registers the
2592 2605 download address at PyPI, which is not only useful to humans
2593 2606 browsing the site, but is also picked up by setuptools (the Eggs
2594 2607 machinery). Thanks to Ville and R. Kern for the info/discussion
2595 2608 on this.
2596 2609
2597 2610 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2598 2611
2599 2612 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2600 2613 This brings a lot of nice functionality to the pdb mode, which now
2601 2614 has tab-completion, syntax highlighting, and better stack handling
2602 2615 than before. Many thanks to Vivian De Smedt
2603 2616 <vivian-AT-vdesmedt.com> for the original patches.
2604 2617
2605 2618 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2606 2619
2607 2620 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2608 2621 sequence to consistently accept the banner argument. The
2609 2622 inconsistency was tripping SAGE, thanks to Gary Zablackis
2610 2623 <gzabl-AT-yahoo.com> for the report.
2611 2624
2612 2625 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2613 2626
2614 2627 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2615 2628 Fix bug where a naked 'alias' call in the ipythonrc file would
2616 2629 cause a crash. Bug reported by Jorgen Stenarson.
2617 2630
2618 2631 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2619 2632
2620 2633 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2621 2634 startup time.
2622 2635
2623 2636 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2624 2637 instances had introduced a bug with globals in normal code. Now
2625 2638 it's working in all cases.
2626 2639
2627 2640 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2628 2641 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2629 2642 has been introduced to set the default case sensitivity of the
2630 2643 searches. Users can still select either mode at runtime on a
2631 2644 per-search basis.
2632 2645
2633 2646 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2634 2647
2635 2648 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2636 2649 attributes in wildcard searches for subclasses. Modified version
2637 2650 of a patch by Jorgen.
2638 2651
2639 2652 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2640 2653
2641 2654 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2642 2655 embedded instances. I added a user_global_ns attribute to the
2643 2656 InteractiveShell class to handle this.
2644 2657
2645 2658 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2646 2659
2647 2660 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2648 2661 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2649 2662 (reported under win32, but may happen also in other platforms).
2650 2663 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2651 2664
2652 2665 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2653 2666
2654 2667 * IPython/Magic.py (magic_psearch): new support for wildcard
2655 2668 patterns. Now, typing ?a*b will list all names which begin with a
2656 2669 and end in b, for example. The %psearch magic has full
2657 2670 docstrings. Many thanks to JΓΆrgen Stenarson
2658 2671 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2659 2672 implementing this functionality.
2660 2673
2661 2674 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2662 2675
2663 2676 * Manual: fixed long-standing annoyance of double-dashes (as in
2664 2677 --prefix=~, for example) being stripped in the HTML version. This
2665 2678 is a latex2html bug, but a workaround was provided. Many thanks
2666 2679 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2667 2680 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2668 2681 rolling. This seemingly small issue had tripped a number of users
2669 2682 when first installing, so I'm glad to see it gone.
2670 2683
2671 2684 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2672 2685
2673 2686 * IPython/Extensions/numeric_formats.py: fix missing import,
2674 2687 reported by Stephen Walton.
2675 2688
2676 2689 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2677 2690
2678 2691 * IPython/demo.py: finish demo module, fully documented now.
2679 2692
2680 2693 * IPython/genutils.py (file_read): simple little utility to read a
2681 2694 file and ensure it's closed afterwards.
2682 2695
2683 2696 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2684 2697
2685 2698 * IPython/demo.py (Demo.__init__): added support for individually
2686 2699 tagging blocks for automatic execution.
2687 2700
2688 2701 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2689 2702 syntax-highlighted python sources, requested by John.
2690 2703
2691 2704 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2692 2705
2693 2706 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2694 2707 finishing.
2695 2708
2696 2709 * IPython/genutils.py (shlex_split): moved from Magic to here,
2697 2710 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2698 2711
2699 2712 * IPython/demo.py (Demo.__init__): added support for silent
2700 2713 blocks, improved marks as regexps, docstrings written.
2701 2714 (Demo.__init__): better docstring, added support for sys.argv.
2702 2715
2703 2716 * IPython/genutils.py (marquee): little utility used by the demo
2704 2717 code, handy in general.
2705 2718
2706 2719 * IPython/demo.py (Demo.__init__): new class for interactive
2707 2720 demos. Not documented yet, I just wrote it in a hurry for
2708 2721 scipy'05. Will docstring later.
2709 2722
2710 2723 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2711 2724
2712 2725 * IPython/Shell.py (sigint_handler): Drastic simplification which
2713 2726 also seems to make Ctrl-C work correctly across threads! This is
2714 2727 so simple, that I can't beleive I'd missed it before. Needs more
2715 2728 testing, though.
2716 2729 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2717 2730 like this before...
2718 2731
2719 2732 * IPython/genutils.py (get_home_dir): add protection against
2720 2733 non-dirs in win32 registry.
2721 2734
2722 2735 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2723 2736 bug where dict was mutated while iterating (pysh crash).
2724 2737
2725 2738 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2726 2739
2727 2740 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2728 2741 spurious newlines added by this routine. After a report by
2729 2742 F. Mantegazza.
2730 2743
2731 2744 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2732 2745
2733 2746 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2734 2747 calls. These were a leftover from the GTK 1.x days, and can cause
2735 2748 problems in certain cases (after a report by John Hunter).
2736 2749
2737 2750 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2738 2751 os.getcwd() fails at init time. Thanks to patch from David Remahl
2739 2752 <chmod007-AT-mac.com>.
2740 2753 (InteractiveShell.__init__): prevent certain special magics from
2741 2754 being shadowed by aliases. Closes
2742 2755 http://www.scipy.net/roundup/ipython/issue41.
2743 2756
2744 2757 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2745 2758
2746 2759 * IPython/iplib.py (InteractiveShell.complete): Added new
2747 2760 top-level completion method to expose the completion mechanism
2748 2761 beyond readline-based environments.
2749 2762
2750 2763 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2751 2764
2752 2765 * tools/ipsvnc (svnversion): fix svnversion capture.
2753 2766
2754 2767 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2755 2768 attribute to self, which was missing. Before, it was set by a
2756 2769 routine which in certain cases wasn't being called, so the
2757 2770 instance could end up missing the attribute. This caused a crash.
2758 2771 Closes http://www.scipy.net/roundup/ipython/issue40.
2759 2772
2760 2773 2005-08-16 Fernando Perez <fperez@colorado.edu>
2761 2774
2762 2775 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2763 2776 contains non-string attribute. Closes
2764 2777 http://www.scipy.net/roundup/ipython/issue38.
2765 2778
2766 2779 2005-08-14 Fernando Perez <fperez@colorado.edu>
2767 2780
2768 2781 * tools/ipsvnc: Minor improvements, to add changeset info.
2769 2782
2770 2783 2005-08-12 Fernando Perez <fperez@colorado.edu>
2771 2784
2772 2785 * IPython/iplib.py (runsource): remove self.code_to_run_src
2773 2786 attribute. I realized this is nothing more than
2774 2787 '\n'.join(self.buffer), and having the same data in two different
2775 2788 places is just asking for synchronization bugs. This may impact
2776 2789 people who have custom exception handlers, so I need to warn
2777 2790 ipython-dev about it (F. Mantegazza may use them).
2778 2791
2779 2792 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2780 2793
2781 2794 * IPython/genutils.py: fix 2.2 compatibility (generators)
2782 2795
2783 2796 2005-07-18 Fernando Perez <fperez@colorado.edu>
2784 2797
2785 2798 * IPython/genutils.py (get_home_dir): fix to help users with
2786 2799 invalid $HOME under win32.
2787 2800
2788 2801 2005-07-17 Fernando Perez <fperez@colorado.edu>
2789 2802
2790 2803 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2791 2804 some old hacks and clean up a bit other routines; code should be
2792 2805 simpler and a bit faster.
2793 2806
2794 2807 * IPython/iplib.py (interact): removed some last-resort attempts
2795 2808 to survive broken stdout/stderr. That code was only making it
2796 2809 harder to abstract out the i/o (necessary for gui integration),
2797 2810 and the crashes it could prevent were extremely rare in practice
2798 2811 (besides being fully user-induced in a pretty violent manner).
2799 2812
2800 2813 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2801 2814 Nothing major yet, but the code is simpler to read; this should
2802 2815 make it easier to do more serious modifications in the future.
2803 2816
2804 2817 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2805 2818 which broke in .15 (thanks to a report by Ville).
2806 2819
2807 2820 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2808 2821 be quite correct, I know next to nothing about unicode). This
2809 2822 will allow unicode strings to be used in prompts, amongst other
2810 2823 cases. It also will prevent ipython from crashing when unicode
2811 2824 shows up unexpectedly in many places. If ascii encoding fails, we
2812 2825 assume utf_8. Currently the encoding is not a user-visible
2813 2826 setting, though it could be made so if there is demand for it.
2814 2827
2815 2828 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2816 2829
2817 2830 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2818 2831
2819 2832 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2820 2833
2821 2834 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2822 2835 code can work transparently for 2.2/2.3.
2823 2836
2824 2837 2005-07-16 Fernando Perez <fperez@colorado.edu>
2825 2838
2826 2839 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2827 2840 out of the color scheme table used for coloring exception
2828 2841 tracebacks. This allows user code to add new schemes at runtime.
2829 2842 This is a minimally modified version of the patch at
2830 2843 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2831 2844 for the contribution.
2832 2845
2833 2846 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2834 2847 slightly modified version of the patch in
2835 2848 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2836 2849 to remove the previous try/except solution (which was costlier).
2837 2850 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2838 2851
2839 2852 2005-06-08 Fernando Perez <fperez@colorado.edu>
2840 2853
2841 2854 * IPython/iplib.py (write/write_err): Add methods to abstract all
2842 2855 I/O a bit more.
2843 2856
2844 2857 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2845 2858 warning, reported by Aric Hagberg, fix by JD Hunter.
2846 2859
2847 2860 2005-06-02 *** Released version 0.6.15
2848 2861
2849 2862 2005-06-01 Fernando Perez <fperez@colorado.edu>
2850 2863
2851 2864 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2852 2865 tab-completion of filenames within open-quoted strings. Note that
2853 2866 this requires that in ~/.ipython/ipythonrc, users change the
2854 2867 readline delimiters configuration to read:
2855 2868
2856 2869 readline_remove_delims -/~
2857 2870
2858 2871
2859 2872 2005-05-31 *** Released version 0.6.14
2860 2873
2861 2874 2005-05-29 Fernando Perez <fperez@colorado.edu>
2862 2875
2863 2876 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2864 2877 with files not on the filesystem. Reported by Eliyahu Sandler
2865 2878 <eli@gondolin.net>
2866 2879
2867 2880 2005-05-22 Fernando Perez <fperez@colorado.edu>
2868 2881
2869 2882 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2870 2883 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2871 2884
2872 2885 2005-05-19 Fernando Perez <fperez@colorado.edu>
2873 2886
2874 2887 * IPython/iplib.py (safe_execfile): close a file which could be
2875 2888 left open (causing problems in win32, which locks open files).
2876 2889 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2877 2890
2878 2891 2005-05-18 Fernando Perez <fperez@colorado.edu>
2879 2892
2880 2893 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2881 2894 keyword arguments correctly to safe_execfile().
2882 2895
2883 2896 2005-05-13 Fernando Perez <fperez@colorado.edu>
2884 2897
2885 2898 * ipython.1: Added info about Qt to manpage, and threads warning
2886 2899 to usage page (invoked with --help).
2887 2900
2888 2901 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2889 2902 new matcher (it goes at the end of the priority list) to do
2890 2903 tab-completion on named function arguments. Submitted by George
2891 2904 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2892 2905 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2893 2906 for more details.
2894 2907
2895 2908 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2896 2909 SystemExit exceptions in the script being run. Thanks to a report
2897 2910 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2898 2911 producing very annoying behavior when running unit tests.
2899 2912
2900 2913 2005-05-12 Fernando Perez <fperez@colorado.edu>
2901 2914
2902 2915 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2903 2916 which I'd broken (again) due to a changed regexp. In the process,
2904 2917 added ';' as an escape to auto-quote the whole line without
2905 2918 splitting its arguments. Thanks to a report by Jerry McRae
2906 2919 <qrs0xyc02-AT-sneakemail.com>.
2907 2920
2908 2921 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2909 2922 possible crashes caused by a TokenError. Reported by Ed Schofield
2910 2923 <schofield-AT-ftw.at>.
2911 2924
2912 2925 2005-05-06 Fernando Perez <fperez@colorado.edu>
2913 2926
2914 2927 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2915 2928
2916 2929 2005-04-29 Fernando Perez <fperez@colorado.edu>
2917 2930
2918 2931 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2919 2932 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2920 2933 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2921 2934 which provides support for Qt interactive usage (similar to the
2922 2935 existing one for WX and GTK). This had been often requested.
2923 2936
2924 2937 2005-04-14 *** Released version 0.6.13
2925 2938
2926 2939 2005-04-08 Fernando Perez <fperez@colorado.edu>
2927 2940
2928 2941 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2929 2942 from _ofind, which gets called on almost every input line. Now,
2930 2943 we only try to get docstrings if they are actually going to be
2931 2944 used (the overhead of fetching unnecessary docstrings can be
2932 2945 noticeable for certain objects, such as Pyro proxies).
2933 2946
2934 2947 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2935 2948 for completers. For some reason I had been passing them the state
2936 2949 variable, which completers never actually need, and was in
2937 2950 conflict with the rlcompleter API. Custom completers ONLY need to
2938 2951 take the text parameter.
2939 2952
2940 2953 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2941 2954 work correctly in pysh. I've also moved all the logic which used
2942 2955 to be in pysh.py here, which will prevent problems with future
2943 2956 upgrades. However, this time I must warn users to update their
2944 2957 pysh profile to include the line
2945 2958
2946 2959 import_all IPython.Extensions.InterpreterExec
2947 2960
2948 2961 because otherwise things won't work for them. They MUST also
2949 2962 delete pysh.py and the line
2950 2963
2951 2964 execfile pysh.py
2952 2965
2953 2966 from their ipythonrc-pysh.
2954 2967
2955 2968 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2956 2969 robust in the face of objects whose dir() returns non-strings
2957 2970 (which it shouldn't, but some broken libs like ITK do). Thanks to
2958 2971 a patch by John Hunter (implemented differently, though). Also
2959 2972 minor improvements by using .extend instead of + on lists.
2960 2973
2961 2974 * pysh.py:
2962 2975
2963 2976 2005-04-06 Fernando Perez <fperez@colorado.edu>
2964 2977
2965 2978 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2966 2979 by default, so that all users benefit from it. Those who don't
2967 2980 want it can still turn it off.
2968 2981
2969 2982 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2970 2983 config file, I'd forgotten about this, so users were getting it
2971 2984 off by default.
2972 2985
2973 2986 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2974 2987 consistency. Now magics can be called in multiline statements,
2975 2988 and python variables can be expanded in magic calls via $var.
2976 2989 This makes the magic system behave just like aliases or !system
2977 2990 calls.
2978 2991
2979 2992 2005-03-28 Fernando Perez <fperez@colorado.edu>
2980 2993
2981 2994 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2982 2995 expensive string additions for building command. Add support for
2983 2996 trailing ';' when autocall is used.
2984 2997
2985 2998 2005-03-26 Fernando Perez <fperez@colorado.edu>
2986 2999
2987 3000 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2988 3001 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2989 3002 ipython.el robust against prompts with any number of spaces
2990 3003 (including 0) after the ':' character.
2991 3004
2992 3005 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2993 3006 continuation prompt, which misled users to think the line was
2994 3007 already indented. Closes debian Bug#300847, reported to me by
2995 3008 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2996 3009
2997 3010 2005-03-23 Fernando Perez <fperez@colorado.edu>
2998 3011
2999 3012 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
3000 3013 properly aligned if they have embedded newlines.
3001 3014
3002 3015 * IPython/iplib.py (runlines): Add a public method to expose
3003 3016 IPython's code execution machinery, so that users can run strings
3004 3017 as if they had been typed at the prompt interactively.
3005 3018 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
3006 3019 methods which can call the system shell, but with python variable
3007 3020 expansion. The three such methods are: __IPYTHON__.system,
3008 3021 .getoutput and .getoutputerror. These need to be documented in a
3009 3022 'public API' section (to be written) of the manual.
3010 3023
3011 3024 2005-03-20 Fernando Perez <fperez@colorado.edu>
3012 3025
3013 3026 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
3014 3027 for custom exception handling. This is quite powerful, and it
3015 3028 allows for user-installable exception handlers which can trap
3016 3029 custom exceptions at runtime and treat them separately from
3017 3030 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
3018 3031 Mantegazza <mantegazza-AT-ill.fr>.
3019 3032 (InteractiveShell.set_custom_completer): public API function to
3020 3033 add new completers at runtime.
3021 3034
3022 3035 2005-03-19 Fernando Perez <fperez@colorado.edu>
3023 3036
3024 3037 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3025 3038 allow objects which provide their docstrings via non-standard
3026 3039 mechanisms (like Pyro proxies) to still be inspected by ipython's
3027 3040 ? system.
3028 3041
3029 3042 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3030 3043 automatic capture system. I tried quite hard to make it work
3031 3044 reliably, and simply failed. I tried many combinations with the
3032 3045 subprocess module, but eventually nothing worked in all needed
3033 3046 cases (not blocking stdin for the child, duplicating stdout
3034 3047 without blocking, etc). The new %sc/%sx still do capture to these
3035 3048 magical list/string objects which make shell use much more
3036 3049 conveninent, so not all is lost.
3037 3050
3038 3051 XXX - FIX MANUAL for the change above!
3039 3052
3040 3053 (runsource): I copied code.py's runsource() into ipython to modify
3041 3054 it a bit. Now the code object and source to be executed are
3042 3055 stored in ipython. This makes this info accessible to third-party
3043 3056 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
3044 3057 Mantegazza <mantegazza-AT-ill.fr>.
3045 3058
3046 3059 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3047 3060 history-search via readline (like C-p/C-n). I'd wanted this for a
3048 3061 long time, but only recently found out how to do it. For users
3049 3062 who already have their ipythonrc files made and want this, just
3050 3063 add:
3051 3064
3052 3065 readline_parse_and_bind "\e[A": history-search-backward
3053 3066 readline_parse_and_bind "\e[B": history-search-forward
3054 3067
3055 3068 2005-03-18 Fernando Perez <fperez@colorado.edu>
3056 3069
3057 3070 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3058 3071 LSString and SList classes which allow transparent conversions
3059 3072 between list mode and whitespace-separated string.
3060 3073 (magic_r): Fix recursion problem in %r.
3061 3074
3062 3075 * IPython/genutils.py (LSString): New class to be used for
3063 3076 automatic storage of the results of all alias/system calls in _o
3064 3077 and _e (stdout/err). These provide a .l/.list attribute which
3065 3078 does automatic splitting on newlines. This means that for most
3066 3079 uses, you'll never need to do capturing of output with %sc/%sx
3067 3080 anymore, since ipython keeps this always done for you. Note that
3068 3081 only the LAST results are stored, the _o/e variables are
3069 3082 overwritten on each call. If you need to save their contents
3070 3083 further, simply bind them to any other name.
3071 3084
3072 3085 2005-03-17 Fernando Perez <fperez@colorado.edu>
3073 3086
3074 3087 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3075 3088 prompt namespace handling.
3076 3089
3077 3090 2005-03-16 Fernando Perez <fperez@colorado.edu>
3078 3091
3079 3092 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3080 3093 classic prompts to be '>>> ' (final space was missing, and it
3081 3094 trips the emacs python mode).
3082 3095 (BasePrompt.__str__): Added safe support for dynamic prompt
3083 3096 strings. Now you can set your prompt string to be '$x', and the
3084 3097 value of x will be printed from your interactive namespace. The
3085 3098 interpolation syntax includes the full Itpl support, so
3086 3099 ${foo()+x+bar()} is a valid prompt string now, and the function
3087 3100 calls will be made at runtime.
3088 3101
3089 3102 2005-03-15 Fernando Perez <fperez@colorado.edu>
3090 3103
3091 3104 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3092 3105 avoid name clashes in pylab. %hist still works, it just forwards
3093 3106 the call to %history.
3094 3107
3095 3108 2005-03-02 *** Released version 0.6.12
3096 3109
3097 3110 2005-03-02 Fernando Perez <fperez@colorado.edu>
3098 3111
3099 3112 * IPython/iplib.py (handle_magic): log magic calls properly as
3100 3113 ipmagic() function calls.
3101 3114
3102 3115 * IPython/Magic.py (magic_time): Improved %time to support
3103 3116 statements and provide wall-clock as well as CPU time.
3104 3117
3105 3118 2005-02-27 Fernando Perez <fperez@colorado.edu>
3106 3119
3107 3120 * IPython/hooks.py: New hooks module, to expose user-modifiable
3108 3121 IPython functionality in a clean manner. For now only the editor
3109 3122 hook is actually written, and other thigns which I intend to turn
3110 3123 into proper hooks aren't yet there. The display and prefilter
3111 3124 stuff, for example, should be hooks. But at least now the
3112 3125 framework is in place, and the rest can be moved here with more
3113 3126 time later. IPython had had a .hooks variable for a long time for
3114 3127 this purpose, but I'd never actually used it for anything.
3115 3128
3116 3129 2005-02-26 Fernando Perez <fperez@colorado.edu>
3117 3130
3118 3131 * IPython/ipmaker.py (make_IPython): make the default ipython
3119 3132 directory be called _ipython under win32, to follow more the
3120 3133 naming peculiarities of that platform (where buggy software like
3121 3134 Visual Sourcesafe breaks with .named directories). Reported by
3122 3135 Ville Vainio.
3123 3136
3124 3137 2005-02-23 Fernando Perez <fperez@colorado.edu>
3125 3138
3126 3139 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3127 3140 auto_aliases for win32 which were causing problems. Users can
3128 3141 define the ones they personally like.
3129 3142
3130 3143 2005-02-21 Fernando Perez <fperez@colorado.edu>
3131 3144
3132 3145 * IPython/Magic.py (magic_time): new magic to time execution of
3133 3146 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3134 3147
3135 3148 2005-02-19 Fernando Perez <fperez@colorado.edu>
3136 3149
3137 3150 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3138 3151 into keys (for prompts, for example).
3139 3152
3140 3153 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3141 3154 prompts in case users want them. This introduces a small behavior
3142 3155 change: ipython does not automatically add a space to all prompts
3143 3156 anymore. To get the old prompts with a space, users should add it
3144 3157 manually to their ipythonrc file, so for example prompt_in1 should
3145 3158 now read 'In [\#]: ' instead of 'In [\#]:'.
3146 3159 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3147 3160 file) to control left-padding of secondary prompts.
3148 3161
3149 3162 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3150 3163 the profiler can't be imported. Fix for Debian, which removed
3151 3164 profile.py because of License issues. I applied a slightly
3152 3165 modified version of the original Debian patch at
3153 3166 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3154 3167
3155 3168 2005-02-17 Fernando Perez <fperez@colorado.edu>
3156 3169
3157 3170 * IPython/genutils.py (native_line_ends): Fix bug which would
3158 3171 cause improper line-ends under win32 b/c I was not opening files
3159 3172 in binary mode. Bug report and fix thanks to Ville.
3160 3173
3161 3174 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3162 3175 trying to catch spurious foo[1] autocalls. My fix actually broke
3163 3176 ',/' autoquote/call with explicit escape (bad regexp).
3164 3177
3165 3178 2005-02-15 *** Released version 0.6.11
3166 3179
3167 3180 2005-02-14 Fernando Perez <fperez@colorado.edu>
3168 3181
3169 3182 * IPython/background_jobs.py: New background job management
3170 3183 subsystem. This is implemented via a new set of classes, and
3171 3184 IPython now provides a builtin 'jobs' object for background job
3172 3185 execution. A convenience %bg magic serves as a lightweight
3173 3186 frontend for starting the more common type of calls. This was
3174 3187 inspired by discussions with B. Granger and the BackgroundCommand
3175 3188 class described in the book Python Scripting for Computational
3176 3189 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3177 3190 (although ultimately no code from this text was used, as IPython's
3178 3191 system is a separate implementation).
3179 3192
3180 3193 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3181 3194 to control the completion of single/double underscore names
3182 3195 separately. As documented in the example ipytonrc file, the
3183 3196 readline_omit__names variable can now be set to 2, to omit even
3184 3197 single underscore names. Thanks to a patch by Brian Wong
3185 3198 <BrianWong-AT-AirgoNetworks.Com>.
3186 3199 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3187 3200 be autocalled as foo([1]) if foo were callable. A problem for
3188 3201 things which are both callable and implement __getitem__.
3189 3202 (init_readline): Fix autoindentation for win32. Thanks to a patch
3190 3203 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3191 3204
3192 3205 2005-02-12 Fernando Perez <fperez@colorado.edu>
3193 3206
3194 3207 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3195 3208 which I had written long ago to sort out user error messages which
3196 3209 may occur during startup. This seemed like a good idea initially,
3197 3210 but it has proven a disaster in retrospect. I don't want to
3198 3211 change much code for now, so my fix is to set the internal 'debug'
3199 3212 flag to true everywhere, whose only job was precisely to control
3200 3213 this subsystem. This closes issue 28 (as well as avoiding all
3201 3214 sorts of strange hangups which occur from time to time).
3202 3215
3203 3216 2005-02-07 Fernando Perez <fperez@colorado.edu>
3204 3217
3205 3218 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3206 3219 previous call produced a syntax error.
3207 3220
3208 3221 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3209 3222 classes without constructor.
3210 3223
3211 3224 2005-02-06 Fernando Perez <fperez@colorado.edu>
3212 3225
3213 3226 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3214 3227 completions with the results of each matcher, so we return results
3215 3228 to the user from all namespaces. This breaks with ipython
3216 3229 tradition, but I think it's a nicer behavior. Now you get all
3217 3230 possible completions listed, from all possible namespaces (python,
3218 3231 filesystem, magics...) After a request by John Hunter
3219 3232 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3220 3233
3221 3234 2005-02-05 Fernando Perez <fperez@colorado.edu>
3222 3235
3223 3236 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3224 3237 the call had quote characters in it (the quotes were stripped).
3225 3238
3226 3239 2005-01-31 Fernando Perez <fperez@colorado.edu>
3227 3240
3228 3241 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3229 3242 Itpl.itpl() to make the code more robust against psyco
3230 3243 optimizations.
3231 3244
3232 3245 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3233 3246 of causing an exception. Quicker, cleaner.
3234 3247
3235 3248 2005-01-28 Fernando Perez <fperez@colorado.edu>
3236 3249
3237 3250 * scripts/ipython_win_post_install.py (install): hardcode
3238 3251 sys.prefix+'python.exe' as the executable path. It turns out that
3239 3252 during the post-installation run, sys.executable resolves to the
3240 3253 name of the binary installer! I should report this as a distutils
3241 3254 bug, I think. I updated the .10 release with this tiny fix, to
3242 3255 avoid annoying the lists further.
3243 3256
3244 3257 2005-01-27 *** Released version 0.6.10
3245 3258
3246 3259 2005-01-27 Fernando Perez <fperez@colorado.edu>
3247 3260
3248 3261 * IPython/numutils.py (norm): Added 'inf' as optional name for
3249 3262 L-infinity norm, included references to mathworld.com for vector
3250 3263 norm definitions.
3251 3264 (amin/amax): added amin/amax for array min/max. Similar to what
3252 3265 pylab ships with after the recent reorganization of names.
3253 3266 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3254 3267
3255 3268 * ipython.el: committed Alex's recent fixes and improvements.
3256 3269 Tested with python-mode from CVS, and it looks excellent. Since
3257 3270 python-mode hasn't released anything in a while, I'm temporarily
3258 3271 putting a copy of today's CVS (v 4.70) of python-mode in:
3259 3272 http://ipython.scipy.org/tmp/python-mode.el
3260 3273
3261 3274 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3262 3275 sys.executable for the executable name, instead of assuming it's
3263 3276 called 'python.exe' (the post-installer would have produced broken
3264 3277 setups on systems with a differently named python binary).
3265 3278
3266 3279 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3267 3280 references to os.linesep, to make the code more
3268 3281 platform-independent. This is also part of the win32 coloring
3269 3282 fixes.
3270 3283
3271 3284 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3272 3285 lines, which actually cause coloring bugs because the length of
3273 3286 the line is very difficult to correctly compute with embedded
3274 3287 escapes. This was the source of all the coloring problems under
3275 3288 Win32. I think that _finally_, Win32 users have a properly
3276 3289 working ipython in all respects. This would never have happened
3277 3290 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3278 3291
3279 3292 2005-01-26 *** Released version 0.6.9
3280 3293
3281 3294 2005-01-25 Fernando Perez <fperez@colorado.edu>
3282 3295
3283 3296 * setup.py: finally, we have a true Windows installer, thanks to
3284 3297 the excellent work of Viktor Ransmayr
3285 3298 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3286 3299 Windows users. The setup routine is quite a bit cleaner thanks to
3287 3300 this, and the post-install script uses the proper functions to
3288 3301 allow a clean de-installation using the standard Windows Control
3289 3302 Panel.
3290 3303
3291 3304 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3292 3305 environment variable under all OSes (including win32) if
3293 3306 available. This will give consistency to win32 users who have set
3294 3307 this variable for any reason. If os.environ['HOME'] fails, the
3295 3308 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3296 3309
3297 3310 2005-01-24 Fernando Perez <fperez@colorado.edu>
3298 3311
3299 3312 * IPython/numutils.py (empty_like): add empty_like(), similar to
3300 3313 zeros_like() but taking advantage of the new empty() Numeric routine.
3301 3314
3302 3315 2005-01-23 *** Released version 0.6.8
3303 3316
3304 3317 2005-01-22 Fernando Perez <fperez@colorado.edu>
3305 3318
3306 3319 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3307 3320 automatic show() calls. After discussing things with JDH, it
3308 3321 turns out there are too many corner cases where this can go wrong.
3309 3322 It's best not to try to be 'too smart', and simply have ipython
3310 3323 reproduce as much as possible the default behavior of a normal
3311 3324 python shell.
3312 3325
3313 3326 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3314 3327 line-splitting regexp and _prefilter() to avoid calling getattr()
3315 3328 on assignments. This closes
3316 3329 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3317 3330 readline uses getattr(), so a simple <TAB> keypress is still
3318 3331 enough to trigger getattr() calls on an object.
3319 3332
3320 3333 2005-01-21 Fernando Perez <fperez@colorado.edu>
3321 3334
3322 3335 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3323 3336 docstring under pylab so it doesn't mask the original.
3324 3337
3325 3338 2005-01-21 *** Released version 0.6.7
3326 3339
3327 3340 2005-01-21 Fernando Perez <fperez@colorado.edu>
3328 3341
3329 3342 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3330 3343 signal handling for win32 users in multithreaded mode.
3331 3344
3332 3345 2005-01-17 Fernando Perez <fperez@colorado.edu>
3333 3346
3334 3347 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3335 3348 instances with no __init__. After a crash report by Norbert Nemec
3336 3349 <Norbert-AT-nemec-online.de>.
3337 3350
3338 3351 2005-01-14 Fernando Perez <fperez@colorado.edu>
3339 3352
3340 3353 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3341 3354 names for verbose exceptions, when multiple dotted names and the
3342 3355 'parent' object were present on the same line.
3343 3356
3344 3357 2005-01-11 Fernando Perez <fperez@colorado.edu>
3345 3358
3346 3359 * IPython/genutils.py (flag_calls): new utility to trap and flag
3347 3360 calls in functions. I need it to clean up matplotlib support.
3348 3361 Also removed some deprecated code in genutils.
3349 3362
3350 3363 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3351 3364 that matplotlib scripts called with %run, which don't call show()
3352 3365 themselves, still have their plotting windows open.
3353 3366
3354 3367 2005-01-05 Fernando Perez <fperez@colorado.edu>
3355 3368
3356 3369 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3357 3370 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3358 3371
3359 3372 2004-12-19 Fernando Perez <fperez@colorado.edu>
3360 3373
3361 3374 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3362 3375 parent_runcode, which was an eyesore. The same result can be
3363 3376 obtained with Python's regular superclass mechanisms.
3364 3377
3365 3378 2004-12-17 Fernando Perez <fperez@colorado.edu>
3366 3379
3367 3380 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3368 3381 reported by Prabhu.
3369 3382 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3370 3383 sys.stderr) instead of explicitly calling sys.stderr. This helps
3371 3384 maintain our I/O abstractions clean, for future GUI embeddings.
3372 3385
3373 3386 * IPython/genutils.py (info): added new utility for sys.stderr
3374 3387 unified info message handling (thin wrapper around warn()).
3375 3388
3376 3389 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3377 3390 composite (dotted) names on verbose exceptions.
3378 3391 (VerboseTB.nullrepr): harden against another kind of errors which
3379 3392 Python's inspect module can trigger, and which were crashing
3380 3393 IPython. Thanks to a report by Marco Lombardi
3381 3394 <mlombard-AT-ma010192.hq.eso.org>.
3382 3395
3383 3396 2004-12-13 *** Released version 0.6.6
3384 3397
3385 3398 2004-12-12 Fernando Perez <fperez@colorado.edu>
3386 3399
3387 3400 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3388 3401 generated by pygtk upon initialization if it was built without
3389 3402 threads (for matplotlib users). After a crash reported by
3390 3403 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3391 3404
3392 3405 * IPython/ipmaker.py (make_IPython): fix small bug in the
3393 3406 import_some parameter for multiple imports.
3394 3407
3395 3408 * IPython/iplib.py (ipmagic): simplified the interface of
3396 3409 ipmagic() to take a single string argument, just as it would be
3397 3410 typed at the IPython cmd line.
3398 3411 (ipalias): Added new ipalias() with an interface identical to
3399 3412 ipmagic(). This completes exposing a pure python interface to the
3400 3413 alias and magic system, which can be used in loops or more complex
3401 3414 code where IPython's automatic line mangling is not active.
3402 3415
3403 3416 * IPython/genutils.py (timing): changed interface of timing to
3404 3417 simply run code once, which is the most common case. timings()
3405 3418 remains unchanged, for the cases where you want multiple runs.
3406 3419
3407 3420 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3408 3421 bug where Python2.2 crashes with exec'ing code which does not end
3409 3422 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3410 3423 before.
3411 3424
3412 3425 2004-12-10 Fernando Perez <fperez@colorado.edu>
3413 3426
3414 3427 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3415 3428 -t to -T, to accomodate the new -t flag in %run (the %run and
3416 3429 %prun options are kind of intermixed, and it's not easy to change
3417 3430 this with the limitations of python's getopt).
3418 3431
3419 3432 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3420 3433 the execution of scripts. It's not as fine-tuned as timeit.py,
3421 3434 but it works from inside ipython (and under 2.2, which lacks
3422 3435 timeit.py). Optionally a number of runs > 1 can be given for
3423 3436 timing very short-running code.
3424 3437
3425 3438 * IPython/genutils.py (uniq_stable): new routine which returns a
3426 3439 list of unique elements in any iterable, but in stable order of
3427 3440 appearance. I needed this for the ultraTB fixes, and it's a handy
3428 3441 utility.
3429 3442
3430 3443 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3431 3444 dotted names in Verbose exceptions. This had been broken since
3432 3445 the very start, now x.y will properly be printed in a Verbose
3433 3446 traceback, instead of x being shown and y appearing always as an
3434 3447 'undefined global'. Getting this to work was a bit tricky,
3435 3448 because by default python tokenizers are stateless. Saved by
3436 3449 python's ability to easily add a bit of state to an arbitrary
3437 3450 function (without needing to build a full-blown callable object).
3438 3451
3439 3452 Also big cleanup of this code, which had horrendous runtime
3440 3453 lookups of zillions of attributes for colorization. Moved all
3441 3454 this code into a few templates, which make it cleaner and quicker.
3442 3455
3443 3456 Printout quality was also improved for Verbose exceptions: one
3444 3457 variable per line, and memory addresses are printed (this can be
3445 3458 quite handy in nasty debugging situations, which is what Verbose
3446 3459 is for).
3447 3460
3448 3461 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3449 3462 the command line as scripts to be loaded by embedded instances.
3450 3463 Doing so has the potential for an infinite recursion if there are
3451 3464 exceptions thrown in the process. This fixes a strange crash
3452 3465 reported by Philippe MULLER <muller-AT-irit.fr>.
3453 3466
3454 3467 2004-12-09 Fernando Perez <fperez@colorado.edu>
3455 3468
3456 3469 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3457 3470 to reflect new names in matplotlib, which now expose the
3458 3471 matlab-compatible interface via a pylab module instead of the
3459 3472 'matlab' name. The new code is backwards compatible, so users of
3460 3473 all matplotlib versions are OK. Patch by J. Hunter.
3461 3474
3462 3475 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3463 3476 of __init__ docstrings for instances (class docstrings are already
3464 3477 automatically printed). Instances with customized docstrings
3465 3478 (indep. of the class) are also recognized and all 3 separate
3466 3479 docstrings are printed (instance, class, constructor). After some
3467 3480 comments/suggestions by J. Hunter.
3468 3481
3469 3482 2004-12-05 Fernando Perez <fperez@colorado.edu>
3470 3483
3471 3484 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3472 3485 warnings when tab-completion fails and triggers an exception.
3473 3486
3474 3487 2004-12-03 Fernando Perez <fperez@colorado.edu>
3475 3488
3476 3489 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3477 3490 be triggered when using 'run -p'. An incorrect option flag was
3478 3491 being set ('d' instead of 'D').
3479 3492 (manpage): fix missing escaped \- sign.
3480 3493
3481 3494 2004-11-30 *** Released version 0.6.5
3482 3495
3483 3496 2004-11-30 Fernando Perez <fperez@colorado.edu>
3484 3497
3485 3498 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3486 3499 setting with -d option.
3487 3500
3488 3501 * setup.py (docfiles): Fix problem where the doc glob I was using
3489 3502 was COMPLETELY BROKEN. It was giving the right files by pure
3490 3503 accident, but failed once I tried to include ipython.el. Note:
3491 3504 glob() does NOT allow you to do exclusion on multiple endings!
3492 3505
3493 3506 2004-11-29 Fernando Perez <fperez@colorado.edu>
3494 3507
3495 3508 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3496 3509 the manpage as the source. Better formatting & consistency.
3497 3510
3498 3511 * IPython/Magic.py (magic_run): Added new -d option, to run
3499 3512 scripts under the control of the python pdb debugger. Note that
3500 3513 this required changing the %prun option -d to -D, to avoid a clash
3501 3514 (since %run must pass options to %prun, and getopt is too dumb to
3502 3515 handle options with string values with embedded spaces). Thanks
3503 3516 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3504 3517 (magic_who_ls): added type matching to %who and %whos, so that one
3505 3518 can filter their output to only include variables of certain
3506 3519 types. Another suggestion by Matthew.
3507 3520 (magic_whos): Added memory summaries in kb and Mb for arrays.
3508 3521 (magic_who): Improve formatting (break lines every 9 vars).
3509 3522
3510 3523 2004-11-28 Fernando Perez <fperez@colorado.edu>
3511 3524
3512 3525 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3513 3526 cache when empty lines were present.
3514 3527
3515 3528 2004-11-24 Fernando Perez <fperez@colorado.edu>
3516 3529
3517 3530 * IPython/usage.py (__doc__): document the re-activated threading
3518 3531 options for WX and GTK.
3519 3532
3520 3533 2004-11-23 Fernando Perez <fperez@colorado.edu>
3521 3534
3522 3535 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3523 3536 the -wthread and -gthread options, along with a new -tk one to try
3524 3537 and coordinate Tk threading with wx/gtk. The tk support is very
3525 3538 platform dependent, since it seems to require Tcl and Tk to be
3526 3539 built with threads (Fedora1/2 appears NOT to have it, but in
3527 3540 Prabhu's Debian boxes it works OK). But even with some Tk
3528 3541 limitations, this is a great improvement.
3529 3542
3530 3543 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3531 3544 info in user prompts. Patch by Prabhu.
3532 3545
3533 3546 2004-11-18 Fernando Perez <fperez@colorado.edu>
3534 3547
3535 3548 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3536 3549 EOFErrors and bail, to avoid infinite loops if a non-terminating
3537 3550 file is fed into ipython. Patch submitted in issue 19 by user,
3538 3551 many thanks.
3539 3552
3540 3553 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3541 3554 autoquote/parens in continuation prompts, which can cause lots of
3542 3555 problems. Closes roundup issue 20.
3543 3556
3544 3557 2004-11-17 Fernando Perez <fperez@colorado.edu>
3545 3558
3546 3559 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3547 3560 reported as debian bug #280505. I'm not sure my local changelog
3548 3561 entry has the proper debian format (Jack?).
3549 3562
3550 3563 2004-11-08 *** Released version 0.6.4
3551 3564
3552 3565 2004-11-08 Fernando Perez <fperez@colorado.edu>
3553 3566
3554 3567 * IPython/iplib.py (init_readline): Fix exit message for Windows
3555 3568 when readline is active. Thanks to a report by Eric Jones
3556 3569 <eric-AT-enthought.com>.
3557 3570
3558 3571 2004-11-07 Fernando Perez <fperez@colorado.edu>
3559 3572
3560 3573 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3561 3574 sometimes seen by win2k/cygwin users.
3562 3575
3563 3576 2004-11-06 Fernando Perez <fperez@colorado.edu>
3564 3577
3565 3578 * IPython/iplib.py (interact): Change the handling of %Exit from
3566 3579 trying to propagate a SystemExit to an internal ipython flag.
3567 3580 This is less elegant than using Python's exception mechanism, but
3568 3581 I can't get that to work reliably with threads, so under -pylab
3569 3582 %Exit was hanging IPython. Cross-thread exception handling is
3570 3583 really a bitch. Thaks to a bug report by Stephen Walton
3571 3584 <stephen.walton-AT-csun.edu>.
3572 3585
3573 3586 2004-11-04 Fernando Perez <fperez@colorado.edu>
3574 3587
3575 3588 * IPython/iplib.py (raw_input_original): store a pointer to the
3576 3589 true raw_input to harden against code which can modify it
3577 3590 (wx.py.PyShell does this and would otherwise crash ipython).
3578 3591 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3579 3592
3580 3593 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3581 3594 Ctrl-C problem, which does not mess up the input line.
3582 3595
3583 3596 2004-11-03 Fernando Perez <fperez@colorado.edu>
3584 3597
3585 3598 * IPython/Release.py: Changed licensing to BSD, in all files.
3586 3599 (name): lowercase name for tarball/RPM release.
3587 3600
3588 3601 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3589 3602 use throughout ipython.
3590 3603
3591 3604 * IPython/Magic.py (Magic._ofind): Switch to using the new
3592 3605 OInspect.getdoc() function.
3593 3606
3594 3607 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3595 3608 of the line currently being canceled via Ctrl-C. It's extremely
3596 3609 ugly, but I don't know how to do it better (the problem is one of
3597 3610 handling cross-thread exceptions).
3598 3611
3599 3612 2004-10-28 Fernando Perez <fperez@colorado.edu>
3600 3613
3601 3614 * IPython/Shell.py (signal_handler): add signal handlers to trap
3602 3615 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3603 3616 report by Francesc Alted.
3604 3617
3605 3618 2004-10-21 Fernando Perez <fperez@colorado.edu>
3606 3619
3607 3620 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3608 3621 to % for pysh syntax extensions.
3609 3622
3610 3623 2004-10-09 Fernando Perez <fperez@colorado.edu>
3611 3624
3612 3625 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3613 3626 arrays to print a more useful summary, without calling str(arr).
3614 3627 This avoids the problem of extremely lengthy computations which
3615 3628 occur if arr is large, and appear to the user as a system lockup
3616 3629 with 100% cpu activity. After a suggestion by Kristian Sandberg
3617 3630 <Kristian.Sandberg@colorado.edu>.
3618 3631 (Magic.__init__): fix bug in global magic escapes not being
3619 3632 correctly set.
3620 3633
3621 3634 2004-10-08 Fernando Perez <fperez@colorado.edu>
3622 3635
3623 3636 * IPython/Magic.py (__license__): change to absolute imports of
3624 3637 ipython's own internal packages, to start adapting to the absolute
3625 3638 import requirement of PEP-328.
3626 3639
3627 3640 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3628 3641 files, and standardize author/license marks through the Release
3629 3642 module instead of having per/file stuff (except for files with
3630 3643 particular licenses, like the MIT/PSF-licensed codes).
3631 3644
3632 3645 * IPython/Debugger.py: remove dead code for python 2.1
3633 3646
3634 3647 2004-10-04 Fernando Perez <fperez@colorado.edu>
3635 3648
3636 3649 * IPython/iplib.py (ipmagic): New function for accessing magics
3637 3650 via a normal python function call.
3638 3651
3639 3652 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3640 3653 from '@' to '%', to accomodate the new @decorator syntax of python
3641 3654 2.4.
3642 3655
3643 3656 2004-09-29 Fernando Perez <fperez@colorado.edu>
3644 3657
3645 3658 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3646 3659 matplotlib.use to prevent running scripts which try to switch
3647 3660 interactive backends from within ipython. This will just crash
3648 3661 the python interpreter, so we can't allow it (but a detailed error
3649 3662 is given to the user).
3650 3663
3651 3664 2004-09-28 Fernando Perez <fperez@colorado.edu>
3652 3665
3653 3666 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3654 3667 matplotlib-related fixes so that using @run with non-matplotlib
3655 3668 scripts doesn't pop up spurious plot windows. This requires
3656 3669 matplotlib >= 0.63, where I had to make some changes as well.
3657 3670
3658 3671 * IPython/ipmaker.py (make_IPython): update version requirement to
3659 3672 python 2.2.
3660 3673
3661 3674 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3662 3675 banner arg for embedded customization.
3663 3676
3664 3677 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3665 3678 explicit uses of __IP as the IPython's instance name. Now things
3666 3679 are properly handled via the shell.name value. The actual code
3667 3680 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3668 3681 is much better than before. I'll clean things completely when the
3669 3682 magic stuff gets a real overhaul.
3670 3683
3671 3684 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3672 3685 minor changes to debian dir.
3673 3686
3674 3687 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3675 3688 pointer to the shell itself in the interactive namespace even when
3676 3689 a user-supplied dict is provided. This is needed for embedding
3677 3690 purposes (found by tests with Michel Sanner).
3678 3691
3679 3692 2004-09-27 Fernando Perez <fperez@colorado.edu>
3680 3693
3681 3694 * IPython/UserConfig/ipythonrc: remove []{} from
3682 3695 readline_remove_delims, so that things like [modname.<TAB> do
3683 3696 proper completion. This disables [].TAB, but that's a less common
3684 3697 case than module names in list comprehensions, for example.
3685 3698 Thanks to a report by Andrea Riciputi.
3686 3699
3687 3700 2004-09-09 Fernando Perez <fperez@colorado.edu>
3688 3701
3689 3702 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3690 3703 blocking problems in win32 and osx. Fix by John.
3691 3704
3692 3705 2004-09-08 Fernando Perez <fperez@colorado.edu>
3693 3706
3694 3707 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3695 3708 for Win32 and OSX. Fix by John Hunter.
3696 3709
3697 3710 2004-08-30 *** Released version 0.6.3
3698 3711
3699 3712 2004-08-30 Fernando Perez <fperez@colorado.edu>
3700 3713
3701 3714 * setup.py (isfile): Add manpages to list of dependent files to be
3702 3715 updated.
3703 3716
3704 3717 2004-08-27 Fernando Perez <fperez@colorado.edu>
3705 3718
3706 3719 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3707 3720 for now. They don't really work with standalone WX/GTK code
3708 3721 (though matplotlib IS working fine with both of those backends).
3709 3722 This will neeed much more testing. I disabled most things with
3710 3723 comments, so turning it back on later should be pretty easy.
3711 3724
3712 3725 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3713 3726 autocalling of expressions like r'foo', by modifying the line
3714 3727 split regexp. Closes
3715 3728 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3716 3729 Riley <ipythonbugs-AT-sabi.net>.
3717 3730 (InteractiveShell.mainloop): honor --nobanner with banner
3718 3731 extensions.
3719 3732
3720 3733 * IPython/Shell.py: Significant refactoring of all classes, so
3721 3734 that we can really support ALL matplotlib backends and threading
3722 3735 models (John spotted a bug with Tk which required this). Now we
3723 3736 should support single-threaded, WX-threads and GTK-threads, both
3724 3737 for generic code and for matplotlib.
3725 3738
3726 3739 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3727 3740 -pylab, to simplify things for users. Will also remove the pylab
3728 3741 profile, since now all of matplotlib configuration is directly
3729 3742 handled here. This also reduces startup time.
3730 3743
3731 3744 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3732 3745 shell wasn't being correctly called. Also in IPShellWX.
3733 3746
3734 3747 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3735 3748 fine-tune banner.
3736 3749
3737 3750 * IPython/numutils.py (spike): Deprecate these spike functions,
3738 3751 delete (long deprecated) gnuplot_exec handler.
3739 3752
3740 3753 2004-08-26 Fernando Perez <fperez@colorado.edu>
3741 3754
3742 3755 * ipython.1: Update for threading options, plus some others which
3743 3756 were missing.
3744 3757
3745 3758 * IPython/ipmaker.py (__call__): Added -wthread option for
3746 3759 wxpython thread handling. Make sure threading options are only
3747 3760 valid at the command line.
3748 3761
3749 3762 * scripts/ipython: moved shell selection into a factory function
3750 3763 in Shell.py, to keep the starter script to a minimum.
3751 3764
3752 3765 2004-08-25 Fernando Perez <fperez@colorado.edu>
3753 3766
3754 3767 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3755 3768 John. Along with some recent changes he made to matplotlib, the
3756 3769 next versions of both systems should work very well together.
3757 3770
3758 3771 2004-08-24 Fernando Perez <fperez@colorado.edu>
3759 3772
3760 3773 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3761 3774 tried to switch the profiling to using hotshot, but I'm getting
3762 3775 strange errors from prof.runctx() there. I may be misreading the
3763 3776 docs, but it looks weird. For now the profiling code will
3764 3777 continue to use the standard profiler.
3765 3778
3766 3779 2004-08-23 Fernando Perez <fperez@colorado.edu>
3767 3780
3768 3781 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3769 3782 threaded shell, by John Hunter. It's not quite ready yet, but
3770 3783 close.
3771 3784
3772 3785 2004-08-22 Fernando Perez <fperez@colorado.edu>
3773 3786
3774 3787 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3775 3788 in Magic and ultraTB.
3776 3789
3777 3790 * ipython.1: document threading options in manpage.
3778 3791
3779 3792 * scripts/ipython: Changed name of -thread option to -gthread,
3780 3793 since this is GTK specific. I want to leave the door open for a
3781 3794 -wthread option for WX, which will most likely be necessary. This
3782 3795 change affects usage and ipmaker as well.
3783 3796
3784 3797 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3785 3798 handle the matplotlib shell issues. Code by John Hunter
3786 3799 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3787 3800 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3788 3801 broken (and disabled for end users) for now, but it puts the
3789 3802 infrastructure in place.
3790 3803
3791 3804 2004-08-21 Fernando Perez <fperez@colorado.edu>
3792 3805
3793 3806 * ipythonrc-pylab: Add matplotlib support.
3794 3807
3795 3808 * matplotlib_config.py: new files for matplotlib support, part of
3796 3809 the pylab profile.
3797 3810
3798 3811 * IPython/usage.py (__doc__): documented the threading options.
3799 3812
3800 3813 2004-08-20 Fernando Perez <fperez@colorado.edu>
3801 3814
3802 3815 * ipython: Modified the main calling routine to handle the -thread
3803 3816 and -mpthread options. This needs to be done as a top-level hack,
3804 3817 because it determines which class to instantiate for IPython
3805 3818 itself.
3806 3819
3807 3820 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3808 3821 classes to support multithreaded GTK operation without blocking,
3809 3822 and matplotlib with all backends. This is a lot of still very
3810 3823 experimental code, and threads are tricky. So it may still have a
3811 3824 few rough edges... This code owes a lot to
3812 3825 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3813 3826 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3814 3827 to John Hunter for all the matplotlib work.
3815 3828
3816 3829 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3817 3830 options for gtk thread and matplotlib support.
3818 3831
3819 3832 2004-08-16 Fernando Perez <fperez@colorado.edu>
3820 3833
3821 3834 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3822 3835 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3823 3836 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3824 3837
3825 3838 2004-08-11 Fernando Perez <fperez@colorado.edu>
3826 3839
3827 3840 * setup.py (isfile): Fix build so documentation gets updated for
3828 3841 rpms (it was only done for .tgz builds).
3829 3842
3830 3843 2004-08-10 Fernando Perez <fperez@colorado.edu>
3831 3844
3832 3845 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3833 3846
3834 3847 * iplib.py : Silence syntax error exceptions in tab-completion.
3835 3848
3836 3849 2004-08-05 Fernando Perez <fperez@colorado.edu>
3837 3850
3838 3851 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3839 3852 'color off' mark for continuation prompts. This was causing long
3840 3853 continuation lines to mis-wrap.
3841 3854
3842 3855 2004-08-01 Fernando Perez <fperez@colorado.edu>
3843 3856
3844 3857 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3845 3858 for building ipython to be a parameter. All this is necessary
3846 3859 right now to have a multithreaded version, but this insane
3847 3860 non-design will be cleaned up soon. For now, it's a hack that
3848 3861 works.
3849 3862
3850 3863 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3851 3864 args in various places. No bugs so far, but it's a dangerous
3852 3865 practice.
3853 3866
3854 3867 2004-07-31 Fernando Perez <fperez@colorado.edu>
3855 3868
3856 3869 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3857 3870 fix completion of files with dots in their names under most
3858 3871 profiles (pysh was OK because the completion order is different).
3859 3872
3860 3873 2004-07-27 Fernando Perez <fperez@colorado.edu>
3861 3874
3862 3875 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3863 3876 keywords manually, b/c the one in keyword.py was removed in python
3864 3877 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3865 3878 This is NOT a bug under python 2.3 and earlier.
3866 3879
3867 3880 2004-07-26 Fernando Perez <fperez@colorado.edu>
3868 3881
3869 3882 * IPython/ultraTB.py (VerboseTB.text): Add another
3870 3883 linecache.checkcache() call to try to prevent inspect.py from
3871 3884 crashing under python 2.3. I think this fixes
3872 3885 http://www.scipy.net/roundup/ipython/issue17.
3873 3886
3874 3887 2004-07-26 *** Released version 0.6.2
3875 3888
3876 3889 2004-07-26 Fernando Perez <fperez@colorado.edu>
3877 3890
3878 3891 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3879 3892 fail for any number.
3880 3893 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3881 3894 empty bookmarks.
3882 3895
3883 3896 2004-07-26 *** Released version 0.6.1
3884 3897
3885 3898 2004-07-26 Fernando Perez <fperez@colorado.edu>
3886 3899
3887 3900 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3888 3901
3889 3902 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3890 3903 escaping '()[]{}' in filenames.
3891 3904
3892 3905 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3893 3906 Python 2.2 users who lack a proper shlex.split.
3894 3907
3895 3908 2004-07-19 Fernando Perez <fperez@colorado.edu>
3896 3909
3897 3910 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3898 3911 for reading readline's init file. I follow the normal chain:
3899 3912 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3900 3913 report by Mike Heeter. This closes
3901 3914 http://www.scipy.net/roundup/ipython/issue16.
3902 3915
3903 3916 2004-07-18 Fernando Perez <fperez@colorado.edu>
3904 3917
3905 3918 * IPython/iplib.py (__init__): Add better handling of '\' under
3906 3919 Win32 for filenames. After a patch by Ville.
3907 3920
3908 3921 2004-07-17 Fernando Perez <fperez@colorado.edu>
3909 3922
3910 3923 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3911 3924 autocalling would be triggered for 'foo is bar' if foo is
3912 3925 callable. I also cleaned up the autocall detection code to use a
3913 3926 regexp, which is faster. Bug reported by Alexander Schmolck.
3914 3927
3915 3928 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3916 3929 '?' in them would confuse the help system. Reported by Alex
3917 3930 Schmolck.
3918 3931
3919 3932 2004-07-16 Fernando Perez <fperez@colorado.edu>
3920 3933
3921 3934 * IPython/GnuplotInteractive.py (__all__): added plot2.
3922 3935
3923 3936 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3924 3937 plotting dictionaries, lists or tuples of 1d arrays.
3925 3938
3926 3939 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3927 3940 optimizations.
3928 3941
3929 3942 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3930 3943 the information which was there from Janko's original IPP code:
3931 3944
3932 3945 03.05.99 20:53 porto.ifm.uni-kiel.de
3933 3946 --Started changelog.
3934 3947 --make clear do what it say it does
3935 3948 --added pretty output of lines from inputcache
3936 3949 --Made Logger a mixin class, simplifies handling of switches
3937 3950 --Added own completer class. .string<TAB> expands to last history
3938 3951 line which starts with string. The new expansion is also present
3939 3952 with Ctrl-r from the readline library. But this shows, who this
3940 3953 can be done for other cases.
3941 3954 --Added convention that all shell functions should accept a
3942 3955 parameter_string This opens the door for different behaviour for
3943 3956 each function. @cd is a good example of this.
3944 3957
3945 3958 04.05.99 12:12 porto.ifm.uni-kiel.de
3946 3959 --added logfile rotation
3947 3960 --added new mainloop method which freezes first the namespace
3948 3961
3949 3962 07.05.99 21:24 porto.ifm.uni-kiel.de
3950 3963 --added the docreader classes. Now there is a help system.
3951 3964 -This is only a first try. Currently it's not easy to put new
3952 3965 stuff in the indices. But this is the way to go. Info would be
3953 3966 better, but HTML is every where and not everybody has an info
3954 3967 system installed and it's not so easy to change html-docs to info.
3955 3968 --added global logfile option
3956 3969 --there is now a hook for object inspection method pinfo needs to
3957 3970 be provided for this. Can be reached by two '??'.
3958 3971
3959 3972 08.05.99 20:51 porto.ifm.uni-kiel.de
3960 3973 --added a README
3961 3974 --bug in rc file. Something has changed so functions in the rc
3962 3975 file need to reference the shell and not self. Not clear if it's a
3963 3976 bug or feature.
3964 3977 --changed rc file for new behavior
3965 3978
3966 3979 2004-07-15 Fernando Perez <fperez@colorado.edu>
3967 3980
3968 3981 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3969 3982 cache was falling out of sync in bizarre manners when multi-line
3970 3983 input was present. Minor optimizations and cleanup.
3971 3984
3972 3985 (Logger): Remove old Changelog info for cleanup. This is the
3973 3986 information which was there from Janko's original code:
3974 3987
3975 3988 Changes to Logger: - made the default log filename a parameter
3976 3989
3977 3990 - put a check for lines beginning with !@? in log(). Needed
3978 3991 (even if the handlers properly log their lines) for mid-session
3979 3992 logging activation to work properly. Without this, lines logged
3980 3993 in mid session, which get read from the cache, would end up
3981 3994 'bare' (with !@? in the open) in the log. Now they are caught
3982 3995 and prepended with a #.
3983 3996
3984 3997 * IPython/iplib.py (InteractiveShell.init_readline): added check
3985 3998 in case MagicCompleter fails to be defined, so we don't crash.
3986 3999
3987 4000 2004-07-13 Fernando Perez <fperez@colorado.edu>
3988 4001
3989 4002 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3990 4003 of EPS if the requested filename ends in '.eps'.
3991 4004
3992 4005 2004-07-04 Fernando Perez <fperez@colorado.edu>
3993 4006
3994 4007 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3995 4008 escaping of quotes when calling the shell.
3996 4009
3997 4010 2004-07-02 Fernando Perez <fperez@colorado.edu>
3998 4011
3999 4012 * IPython/Prompts.py (CachedOutput.update): Fix problem with
4000 4013 gettext not working because we were clobbering '_'. Fixes
4001 4014 http://www.scipy.net/roundup/ipython/issue6.
4002 4015
4003 4016 2004-07-01 Fernando Perez <fperez@colorado.edu>
4004 4017
4005 4018 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
4006 4019 into @cd. Patch by Ville.
4007 4020
4008 4021 * IPython/iplib.py (InteractiveShell.post_config_initialization):
4009 4022 new function to store things after ipmaker runs. Patch by Ville.
4010 4023 Eventually this will go away once ipmaker is removed and the class
4011 4024 gets cleaned up, but for now it's ok. Key functionality here is
4012 4025 the addition of the persistent storage mechanism, a dict for
4013 4026 keeping data across sessions (for now just bookmarks, but more can
4014 4027 be implemented later).
4015 4028
4016 4029 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
4017 4030 persistent across sections. Patch by Ville, I modified it
4018 4031 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
4019 4032 added a '-l' option to list all bookmarks.
4020 4033
4021 4034 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4022 4035 center for cleanup. Registered with atexit.register(). I moved
4023 4036 here the old exit_cleanup(). After a patch by Ville.
4024 4037
4025 4038 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4026 4039 characters in the hacked shlex_split for python 2.2.
4027 4040
4028 4041 * IPython/iplib.py (file_matches): more fixes to filenames with
4029 4042 whitespace in them. It's not perfect, but limitations in python's
4030 4043 readline make it impossible to go further.
4031 4044
4032 4045 2004-06-29 Fernando Perez <fperez@colorado.edu>
4033 4046
4034 4047 * IPython/iplib.py (file_matches): escape whitespace correctly in
4035 4048 filename completions. Bug reported by Ville.
4036 4049
4037 4050 2004-06-28 Fernando Perez <fperez@colorado.edu>
4038 4051
4039 4052 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4040 4053 the history file will be called 'history-PROFNAME' (or just
4041 4054 'history' if no profile is loaded). I was getting annoyed at
4042 4055 getting my Numerical work history clobbered by pysh sessions.
4043 4056
4044 4057 * IPython/iplib.py (InteractiveShell.__init__): Internal
4045 4058 getoutputerror() function so that we can honor the system_verbose
4046 4059 flag for _all_ system calls. I also added escaping of #
4047 4060 characters here to avoid confusing Itpl.
4048 4061
4049 4062 * IPython/Magic.py (shlex_split): removed call to shell in
4050 4063 parse_options and replaced it with shlex.split(). The annoying
4051 4064 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4052 4065 to backport it from 2.3, with several frail hacks (the shlex
4053 4066 module is rather limited in 2.2). Thanks to a suggestion by Ville
4054 4067 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4055 4068 problem.
4056 4069
4057 4070 (Magic.magic_system_verbose): new toggle to print the actual
4058 4071 system calls made by ipython. Mainly for debugging purposes.
4059 4072
4060 4073 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4061 4074 doesn't support persistence. Reported (and fix suggested) by
4062 4075 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4063 4076
4064 4077 2004-06-26 Fernando Perez <fperez@colorado.edu>
4065 4078
4066 4079 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4067 4080 continue prompts.
4068 4081
4069 4082 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4070 4083 function (basically a big docstring) and a few more things here to
4071 4084 speedup startup. pysh.py is now very lightweight. We want because
4072 4085 it gets execfile'd, while InterpreterExec gets imported, so
4073 4086 byte-compilation saves time.
4074 4087
4075 4088 2004-06-25 Fernando Perez <fperez@colorado.edu>
4076 4089
4077 4090 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4078 4091 -NUM', which was recently broken.
4079 4092
4080 4093 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4081 4094 in multi-line input (but not !!, which doesn't make sense there).
4082 4095
4083 4096 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4084 4097 It's just too useful, and people can turn it off in the less
4085 4098 common cases where it's a problem.
4086 4099
4087 4100 2004-06-24 Fernando Perez <fperez@colorado.edu>
4088 4101
4089 4102 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4090 4103 special syntaxes (like alias calling) is now allied in multi-line
4091 4104 input. This is still _very_ experimental, but it's necessary for
4092 4105 efficient shell usage combining python looping syntax with system
4093 4106 calls. For now it's restricted to aliases, I don't think it
4094 4107 really even makes sense to have this for magics.
4095 4108
4096 4109 2004-06-23 Fernando Perez <fperez@colorado.edu>
4097 4110
4098 4111 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4099 4112 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4100 4113
4101 4114 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4102 4115 extensions under Windows (after code sent by Gary Bishop). The
4103 4116 extensions considered 'executable' are stored in IPython's rc
4104 4117 structure as win_exec_ext.
4105 4118
4106 4119 * IPython/genutils.py (shell): new function, like system() but
4107 4120 without return value. Very useful for interactive shell work.
4108 4121
4109 4122 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4110 4123 delete aliases.
4111 4124
4112 4125 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4113 4126 sure that the alias table doesn't contain python keywords.
4114 4127
4115 4128 2004-06-21 Fernando Perez <fperez@colorado.edu>
4116 4129
4117 4130 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4118 4131 non-existent items are found in $PATH. Reported by Thorsten.
4119 4132
4120 4133 2004-06-20 Fernando Perez <fperez@colorado.edu>
4121 4134
4122 4135 * IPython/iplib.py (complete): modified the completer so that the
4123 4136 order of priorities can be easily changed at runtime.
4124 4137
4125 4138 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4126 4139 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4127 4140
4128 4141 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4129 4142 expand Python variables prepended with $ in all system calls. The
4130 4143 same was done to InteractiveShell.handle_shell_escape. Now all
4131 4144 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4132 4145 expansion of python variables and expressions according to the
4133 4146 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4134 4147
4135 4148 Though PEP-215 has been rejected, a similar (but simpler) one
4136 4149 seems like it will go into Python 2.4, PEP-292 -
4137 4150 http://www.python.org/peps/pep-0292.html.
4138 4151
4139 4152 I'll keep the full syntax of PEP-215, since IPython has since the
4140 4153 start used Ka-Ping Yee's reference implementation discussed there
4141 4154 (Itpl), and I actually like the powerful semantics it offers.
4142 4155
4143 4156 In order to access normal shell variables, the $ has to be escaped
4144 4157 via an extra $. For example:
4145 4158
4146 4159 In [7]: PATH='a python variable'
4147 4160
4148 4161 In [8]: !echo $PATH
4149 4162 a python variable
4150 4163
4151 4164 In [9]: !echo $$PATH
4152 4165 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4153 4166
4154 4167 (Magic.parse_options): escape $ so the shell doesn't evaluate
4155 4168 things prematurely.
4156 4169
4157 4170 * IPython/iplib.py (InteractiveShell.call_alias): added the
4158 4171 ability for aliases to expand python variables via $.
4159 4172
4160 4173 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4161 4174 system, now there's a @rehash/@rehashx pair of magics. These work
4162 4175 like the csh rehash command, and can be invoked at any time. They
4163 4176 build a table of aliases to everything in the user's $PATH
4164 4177 (@rehash uses everything, @rehashx is slower but only adds
4165 4178 executable files). With this, the pysh.py-based shell profile can
4166 4179 now simply call rehash upon startup, and full access to all
4167 4180 programs in the user's path is obtained.
4168 4181
4169 4182 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4170 4183 functionality is now fully in place. I removed the old dynamic
4171 4184 code generation based approach, in favor of a much lighter one
4172 4185 based on a simple dict. The advantage is that this allows me to
4173 4186 now have thousands of aliases with negligible cost (unthinkable
4174 4187 with the old system).
4175 4188
4176 4189 2004-06-19 Fernando Perez <fperez@colorado.edu>
4177 4190
4178 4191 * IPython/iplib.py (__init__): extended MagicCompleter class to
4179 4192 also complete (last in priority) on user aliases.
4180 4193
4181 4194 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4182 4195 call to eval.
4183 4196 (ItplNS.__init__): Added a new class which functions like Itpl,
4184 4197 but allows configuring the namespace for the evaluation to occur
4185 4198 in.
4186 4199
4187 4200 2004-06-18 Fernando Perez <fperez@colorado.edu>
4188 4201
4189 4202 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4190 4203 better message when 'exit' or 'quit' are typed (a common newbie
4191 4204 confusion).
4192 4205
4193 4206 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4194 4207 check for Windows users.
4195 4208
4196 4209 * IPython/iplib.py (InteractiveShell.user_setup): removed
4197 4210 disabling of colors for Windows. I'll test at runtime and issue a
4198 4211 warning if Gary's readline isn't found, as to nudge users to
4199 4212 download it.
4200 4213
4201 4214 2004-06-16 Fernando Perez <fperez@colorado.edu>
4202 4215
4203 4216 * IPython/genutils.py (Stream.__init__): changed to print errors
4204 4217 to sys.stderr. I had a circular dependency here. Now it's
4205 4218 possible to run ipython as IDLE's shell (consider this pre-alpha,
4206 4219 since true stdout things end up in the starting terminal instead
4207 4220 of IDLE's out).
4208 4221
4209 4222 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4210 4223 users who haven't # updated their prompt_in2 definitions. Remove
4211 4224 eventually.
4212 4225 (multiple_replace): added credit to original ASPN recipe.
4213 4226
4214 4227 2004-06-15 Fernando Perez <fperez@colorado.edu>
4215 4228
4216 4229 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4217 4230 list of auto-defined aliases.
4218 4231
4219 4232 2004-06-13 Fernando Perez <fperez@colorado.edu>
4220 4233
4221 4234 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4222 4235 install was really requested (so setup.py can be used for other
4223 4236 things under Windows).
4224 4237
4225 4238 2004-06-10 Fernando Perez <fperez@colorado.edu>
4226 4239
4227 4240 * IPython/Logger.py (Logger.create_log): Manually remove any old
4228 4241 backup, since os.remove may fail under Windows. Fixes bug
4229 4242 reported by Thorsten.
4230 4243
4231 4244 2004-06-09 Fernando Perez <fperez@colorado.edu>
4232 4245
4233 4246 * examples/example-embed.py: fixed all references to %n (replaced
4234 4247 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4235 4248 for all examples and the manual as well.
4236 4249
4237 4250 2004-06-08 Fernando Perez <fperez@colorado.edu>
4238 4251
4239 4252 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4240 4253 alignment and color management. All 3 prompt subsystems now
4241 4254 inherit from BasePrompt.
4242 4255
4243 4256 * tools/release: updates for windows installer build and tag rpms
4244 4257 with python version (since paths are fixed).
4245 4258
4246 4259 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4247 4260 which will become eventually obsolete. Also fixed the default
4248 4261 prompt_in2 to use \D, so at least new users start with the correct
4249 4262 defaults.
4250 4263 WARNING: Users with existing ipythonrc files will need to apply
4251 4264 this fix manually!
4252 4265
4253 4266 * setup.py: make windows installer (.exe). This is finally the
4254 4267 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4255 4268 which I hadn't included because it required Python 2.3 (or recent
4256 4269 distutils).
4257 4270
4258 4271 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4259 4272 usage of new '\D' escape.
4260 4273
4261 4274 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4262 4275 lacks os.getuid())
4263 4276 (CachedOutput.set_colors): Added the ability to turn coloring
4264 4277 on/off with @colors even for manually defined prompt colors. It
4265 4278 uses a nasty global, but it works safely and via the generic color
4266 4279 handling mechanism.
4267 4280 (Prompt2.__init__): Introduced new escape '\D' for continuation
4268 4281 prompts. It represents the counter ('\#') as dots.
4269 4282 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4270 4283 need to update their ipythonrc files and replace '%n' with '\D' in
4271 4284 their prompt_in2 settings everywhere. Sorry, but there's
4272 4285 otherwise no clean way to get all prompts to properly align. The
4273 4286 ipythonrc shipped with IPython has been updated.
4274 4287
4275 4288 2004-06-07 Fernando Perez <fperez@colorado.edu>
4276 4289
4277 4290 * setup.py (isfile): Pass local_icons option to latex2html, so the
4278 4291 resulting HTML file is self-contained. Thanks to
4279 4292 dryice-AT-liu.com.cn for the tip.
4280 4293
4281 4294 * pysh.py: I created a new profile 'shell', which implements a
4282 4295 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4283 4296 system shell, nor will it become one anytime soon. It's mainly
4284 4297 meant to illustrate the use of the new flexible bash-like prompts.
4285 4298 I guess it could be used by hardy souls for true shell management,
4286 4299 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4287 4300 profile. This uses the InterpreterExec extension provided by
4288 4301 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4289 4302
4290 4303 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4291 4304 auto-align itself with the length of the previous input prompt
4292 4305 (taking into account the invisible color escapes).
4293 4306 (CachedOutput.__init__): Large restructuring of this class. Now
4294 4307 all three prompts (primary1, primary2, output) are proper objects,
4295 4308 managed by the 'parent' CachedOutput class. The code is still a
4296 4309 bit hackish (all prompts share state via a pointer to the cache),
4297 4310 but it's overall far cleaner than before.
4298 4311
4299 4312 * IPython/genutils.py (getoutputerror): modified to add verbose,
4300 4313 debug and header options. This makes the interface of all getout*
4301 4314 functions uniform.
4302 4315 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4303 4316
4304 4317 * IPython/Magic.py (Magic.default_option): added a function to
4305 4318 allow registering default options for any magic command. This
4306 4319 makes it easy to have profiles which customize the magics globally
4307 4320 for a certain use. The values set through this function are
4308 4321 picked up by the parse_options() method, which all magics should
4309 4322 use to parse their options.
4310 4323
4311 4324 * IPython/genutils.py (warn): modified the warnings framework to
4312 4325 use the Term I/O class. I'm trying to slowly unify all of
4313 4326 IPython's I/O operations to pass through Term.
4314 4327
4315 4328 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4316 4329 the secondary prompt to correctly match the length of the primary
4317 4330 one for any prompt. Now multi-line code will properly line up
4318 4331 even for path dependent prompts, such as the new ones available
4319 4332 via the prompt_specials.
4320 4333
4321 4334 2004-06-06 Fernando Perez <fperez@colorado.edu>
4322 4335
4323 4336 * IPython/Prompts.py (prompt_specials): Added the ability to have
4324 4337 bash-like special sequences in the prompts, which get
4325 4338 automatically expanded. Things like hostname, current working
4326 4339 directory and username are implemented already, but it's easy to
4327 4340 add more in the future. Thanks to a patch by W.J. van der Laan
4328 4341 <gnufnork-AT-hetdigitalegat.nl>
4329 4342 (prompt_specials): Added color support for prompt strings, so
4330 4343 users can define arbitrary color setups for their prompts.
4331 4344
4332 4345 2004-06-05 Fernando Perez <fperez@colorado.edu>
4333 4346
4334 4347 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4335 4348 code to load Gary Bishop's readline and configure it
4336 4349 automatically. Thanks to Gary for help on this.
4337 4350
4338 4351 2004-06-01 Fernando Perez <fperez@colorado.edu>
4339 4352
4340 4353 * IPython/Logger.py (Logger.create_log): fix bug for logging
4341 4354 with no filename (previous fix was incomplete).
4342 4355
4343 4356 2004-05-25 Fernando Perez <fperez@colorado.edu>
4344 4357
4345 4358 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4346 4359 parens would get passed to the shell.
4347 4360
4348 4361 2004-05-20 Fernando Perez <fperez@colorado.edu>
4349 4362
4350 4363 * IPython/Magic.py (Magic.magic_prun): changed default profile
4351 4364 sort order to 'time' (the more common profiling need).
4352 4365
4353 4366 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4354 4367 so that source code shown is guaranteed in sync with the file on
4355 4368 disk (also changed in psource). Similar fix to the one for
4356 4369 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4357 4370 <yann.ledu-AT-noos.fr>.
4358 4371
4359 4372 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4360 4373 with a single option would not be correctly parsed. Closes
4361 4374 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4362 4375 introduced in 0.6.0 (on 2004-05-06).
4363 4376
4364 4377 2004-05-13 *** Released version 0.6.0
4365 4378
4366 4379 2004-05-13 Fernando Perez <fperez@colorado.edu>
4367 4380
4368 4381 * debian/: Added debian/ directory to CVS, so that debian support
4369 4382 is publicly accessible. The debian package is maintained by Jack
4370 4383 Moffit <jack-AT-xiph.org>.
4371 4384
4372 4385 * Documentation: included the notes about an ipython-based system
4373 4386 shell (the hypothetical 'pysh') into the new_design.pdf document,
4374 4387 so that these ideas get distributed to users along with the
4375 4388 official documentation.
4376 4389
4377 4390 2004-05-10 Fernando Perez <fperez@colorado.edu>
4378 4391
4379 4392 * IPython/Logger.py (Logger.create_log): fix recently introduced
4380 4393 bug (misindented line) where logstart would fail when not given an
4381 4394 explicit filename.
4382 4395
4383 4396 2004-05-09 Fernando Perez <fperez@colorado.edu>
4384 4397
4385 4398 * IPython/Magic.py (Magic.parse_options): skip system call when
4386 4399 there are no options to look for. Faster, cleaner for the common
4387 4400 case.
4388 4401
4389 4402 * Documentation: many updates to the manual: describing Windows
4390 4403 support better, Gnuplot updates, credits, misc small stuff. Also
4391 4404 updated the new_design doc a bit.
4392 4405
4393 4406 2004-05-06 *** Released version 0.6.0.rc1
4394 4407
4395 4408 2004-05-06 Fernando Perez <fperez@colorado.edu>
4396 4409
4397 4410 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4398 4411 operations to use the vastly more efficient list/''.join() method.
4399 4412 (FormattedTB.text): Fix
4400 4413 http://www.scipy.net/roundup/ipython/issue12 - exception source
4401 4414 extract not updated after reload. Thanks to Mike Salib
4402 4415 <msalib-AT-mit.edu> for pinning the source of the problem.
4403 4416 Fortunately, the solution works inside ipython and doesn't require
4404 4417 any changes to python proper.
4405 4418
4406 4419 * IPython/Magic.py (Magic.parse_options): Improved to process the
4407 4420 argument list as a true shell would (by actually using the
4408 4421 underlying system shell). This way, all @magics automatically get
4409 4422 shell expansion for variables. Thanks to a comment by Alex
4410 4423 Schmolck.
4411 4424
4412 4425 2004-04-04 Fernando Perez <fperez@colorado.edu>
4413 4426
4414 4427 * IPython/iplib.py (InteractiveShell.interact): Added a special
4415 4428 trap for a debugger quit exception, which is basically impossible
4416 4429 to handle by normal mechanisms, given what pdb does to the stack.
4417 4430 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4418 4431
4419 4432 2004-04-03 Fernando Perez <fperez@colorado.edu>
4420 4433
4421 4434 * IPython/genutils.py (Term): Standardized the names of the Term
4422 4435 class streams to cin/cout/cerr, following C++ naming conventions
4423 4436 (I can't use in/out/err because 'in' is not a valid attribute
4424 4437 name).
4425 4438
4426 4439 * IPython/iplib.py (InteractiveShell.interact): don't increment
4427 4440 the prompt if there's no user input. By Daniel 'Dang' Griffith
4428 4441 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4429 4442 Francois Pinard.
4430 4443
4431 4444 2004-04-02 Fernando Perez <fperez@colorado.edu>
4432 4445
4433 4446 * IPython/genutils.py (Stream.__init__): Modified to survive at
4434 4447 least importing in contexts where stdin/out/err aren't true file
4435 4448 objects, such as PyCrust (they lack fileno() and mode). However,
4436 4449 the recovery facilities which rely on these things existing will
4437 4450 not work.
4438 4451
4439 4452 2004-04-01 Fernando Perez <fperez@colorado.edu>
4440 4453
4441 4454 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4442 4455 use the new getoutputerror() function, so it properly
4443 4456 distinguishes stdout/err.
4444 4457
4445 4458 * IPython/genutils.py (getoutputerror): added a function to
4446 4459 capture separately the standard output and error of a command.
4447 4460 After a comment from dang on the mailing lists. This code is
4448 4461 basically a modified version of commands.getstatusoutput(), from
4449 4462 the standard library.
4450 4463
4451 4464 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4452 4465 '!!' as a special syntax (shorthand) to access @sx.
4453 4466
4454 4467 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4455 4468 command and return its output as a list split on '\n'.
4456 4469
4457 4470 2004-03-31 Fernando Perez <fperez@colorado.edu>
4458 4471
4459 4472 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4460 4473 method to dictionaries used as FakeModule instances if they lack
4461 4474 it. At least pydoc in python2.3 breaks for runtime-defined
4462 4475 functions without this hack. At some point I need to _really_
4463 4476 understand what FakeModule is doing, because it's a gross hack.
4464 4477 But it solves Arnd's problem for now...
4465 4478
4466 4479 2004-02-27 Fernando Perez <fperez@colorado.edu>
4467 4480
4468 4481 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4469 4482 mode would behave erratically. Also increased the number of
4470 4483 possible logs in rotate mod to 999. Thanks to Rod Holland
4471 4484 <rhh@StructureLABS.com> for the report and fixes.
4472 4485
4473 4486 2004-02-26 Fernando Perez <fperez@colorado.edu>
4474 4487
4475 4488 * IPython/genutils.py (page): Check that the curses module really
4476 4489 has the initscr attribute before trying to use it. For some
4477 4490 reason, the Solaris curses module is missing this. I think this
4478 4491 should be considered a Solaris python bug, but I'm not sure.
4479 4492
4480 4493 2004-01-17 Fernando Perez <fperez@colorado.edu>
4481 4494
4482 4495 * IPython/genutils.py (Stream.__init__): Changes to try to make
4483 4496 ipython robust against stdin/out/err being closed by the user.
4484 4497 This is 'user error' (and blocks a normal python session, at least
4485 4498 the stdout case). However, Ipython should be able to survive such
4486 4499 instances of abuse as gracefully as possible. To simplify the
4487 4500 coding and maintain compatibility with Gary Bishop's Term
4488 4501 contributions, I've made use of classmethods for this. I think
4489 4502 this introduces a dependency on python 2.2.
4490 4503
4491 4504 2004-01-13 Fernando Perez <fperez@colorado.edu>
4492 4505
4493 4506 * IPython/numutils.py (exp_safe): simplified the code a bit and
4494 4507 removed the need for importing the kinds module altogether.
4495 4508
4496 4509 2004-01-06 Fernando Perez <fperez@colorado.edu>
4497 4510
4498 4511 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4499 4512 a magic function instead, after some community feedback. No
4500 4513 special syntax will exist for it, but its name is deliberately
4501 4514 very short.
4502 4515
4503 4516 2003-12-20 Fernando Perez <fperez@colorado.edu>
4504 4517
4505 4518 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4506 4519 new functionality, to automagically assign the result of a shell
4507 4520 command to a variable. I'll solicit some community feedback on
4508 4521 this before making it permanent.
4509 4522
4510 4523 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4511 4524 requested about callables for which inspect couldn't obtain a
4512 4525 proper argspec. Thanks to a crash report sent by Etienne
4513 4526 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4514 4527
4515 4528 2003-12-09 Fernando Perez <fperez@colorado.edu>
4516 4529
4517 4530 * IPython/genutils.py (page): patch for the pager to work across
4518 4531 various versions of Windows. By Gary Bishop.
4519 4532
4520 4533 2003-12-04 Fernando Perez <fperez@colorado.edu>
4521 4534
4522 4535 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4523 4536 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4524 4537 While I tested this and it looks ok, there may still be corner
4525 4538 cases I've missed.
4526 4539
4527 4540 2003-12-01 Fernando Perez <fperez@colorado.edu>
4528 4541
4529 4542 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4530 4543 where a line like 'p,q=1,2' would fail because the automagic
4531 4544 system would be triggered for @p.
4532 4545
4533 4546 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4534 4547 cleanups, code unmodified.
4535 4548
4536 4549 * IPython/genutils.py (Term): added a class for IPython to handle
4537 4550 output. In most cases it will just be a proxy for stdout/err, but
4538 4551 having this allows modifications to be made for some platforms,
4539 4552 such as handling color escapes under Windows. All of this code
4540 4553 was contributed by Gary Bishop, with minor modifications by me.
4541 4554 The actual changes affect many files.
4542 4555
4543 4556 2003-11-30 Fernando Perez <fperez@colorado.edu>
4544 4557
4545 4558 * IPython/iplib.py (file_matches): new completion code, courtesy
4546 4559 of Jeff Collins. This enables filename completion again under
4547 4560 python 2.3, which disabled it at the C level.
4548 4561
4549 4562 2003-11-11 Fernando Perez <fperez@colorado.edu>
4550 4563
4551 4564 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4552 4565 for Numeric.array(map(...)), but often convenient.
4553 4566
4554 4567 2003-11-05 Fernando Perez <fperez@colorado.edu>
4555 4568
4556 4569 * IPython/numutils.py (frange): Changed a call from int() to
4557 4570 int(round()) to prevent a problem reported with arange() in the
4558 4571 numpy list.
4559 4572
4560 4573 2003-10-06 Fernando Perez <fperez@colorado.edu>
4561 4574
4562 4575 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4563 4576 prevent crashes if sys lacks an argv attribute (it happens with
4564 4577 embedded interpreters which build a bare-bones sys module).
4565 4578 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4566 4579
4567 4580 2003-09-24 Fernando Perez <fperez@colorado.edu>
4568 4581
4569 4582 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4570 4583 to protect against poorly written user objects where __getattr__
4571 4584 raises exceptions other than AttributeError. Thanks to a bug
4572 4585 report by Oliver Sander <osander-AT-gmx.de>.
4573 4586
4574 4587 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4575 4588 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4576 4589
4577 4590 2003-09-09 Fernando Perez <fperez@colorado.edu>
4578 4591
4579 4592 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4580 4593 unpacking a list whith a callable as first element would
4581 4594 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4582 4595 Collins.
4583 4596
4584 4597 2003-08-25 *** Released version 0.5.0
4585 4598
4586 4599 2003-08-22 Fernando Perez <fperez@colorado.edu>
4587 4600
4588 4601 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4589 4602 improperly defined user exceptions. Thanks to feedback from Mark
4590 4603 Russell <mrussell-AT-verio.net>.
4591 4604
4592 4605 2003-08-20 Fernando Perez <fperez@colorado.edu>
4593 4606
4594 4607 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4595 4608 printing so that it would print multi-line string forms starting
4596 4609 with a new line. This way the formatting is better respected for
4597 4610 objects which work hard to make nice string forms.
4598 4611
4599 4612 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4600 4613 autocall would overtake data access for objects with both
4601 4614 __getitem__ and __call__.
4602 4615
4603 4616 2003-08-19 *** Released version 0.5.0-rc1
4604 4617
4605 4618 2003-08-19 Fernando Perez <fperez@colorado.edu>
4606 4619
4607 4620 * IPython/deep_reload.py (load_tail): single tiny change here
4608 4621 seems to fix the long-standing bug of dreload() failing to work
4609 4622 for dotted names. But this module is pretty tricky, so I may have
4610 4623 missed some subtlety. Needs more testing!.
4611 4624
4612 4625 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4613 4626 exceptions which have badly implemented __str__ methods.
4614 4627 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4615 4628 which I've been getting reports about from Python 2.3 users. I
4616 4629 wish I had a simple test case to reproduce the problem, so I could
4617 4630 either write a cleaner workaround or file a bug report if
4618 4631 necessary.
4619 4632
4620 4633 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4621 4634 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4622 4635 a bug report by Tjabo Kloppenburg.
4623 4636
4624 4637 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4625 4638 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4626 4639 seems rather unstable. Thanks to a bug report by Tjabo
4627 4640 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4628 4641
4629 4642 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4630 4643 this out soon because of the critical fixes in the inner loop for
4631 4644 generators.
4632 4645
4633 4646 * IPython/Magic.py (Magic.getargspec): removed. This (and
4634 4647 _get_def) have been obsoleted by OInspect for a long time, I
4635 4648 hadn't noticed that they were dead code.
4636 4649 (Magic._ofind): restored _ofind functionality for a few literals
4637 4650 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4638 4651 for things like "hello".capitalize?, since that would require a
4639 4652 potentially dangerous eval() again.
4640 4653
4641 4654 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4642 4655 logic a bit more to clean up the escapes handling and minimize the
4643 4656 use of _ofind to only necessary cases. The interactive 'feel' of
4644 4657 IPython should have improved quite a bit with the changes in
4645 4658 _prefilter and _ofind (besides being far safer than before).
4646 4659
4647 4660 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4648 4661 obscure, never reported). Edit would fail to find the object to
4649 4662 edit under some circumstances.
4650 4663 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4651 4664 which were causing double-calling of generators. Those eval calls
4652 4665 were _very_ dangerous, since code with side effects could be
4653 4666 triggered. As they say, 'eval is evil'... These were the
4654 4667 nastiest evals in IPython. Besides, _ofind is now far simpler,
4655 4668 and it should also be quite a bit faster. Its use of inspect is
4656 4669 also safer, so perhaps some of the inspect-related crashes I've
4657 4670 seen lately with Python 2.3 might be taken care of. That will
4658 4671 need more testing.
4659 4672
4660 4673 2003-08-17 Fernando Perez <fperez@colorado.edu>
4661 4674
4662 4675 * IPython/iplib.py (InteractiveShell._prefilter): significant
4663 4676 simplifications to the logic for handling user escapes. Faster
4664 4677 and simpler code.
4665 4678
4666 4679 2003-08-14 Fernando Perez <fperez@colorado.edu>
4667 4680
4668 4681 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4669 4682 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4670 4683 but it should be quite a bit faster. And the recursive version
4671 4684 generated O(log N) intermediate storage for all rank>1 arrays,
4672 4685 even if they were contiguous.
4673 4686 (l1norm): Added this function.
4674 4687 (norm): Added this function for arbitrary norms (including
4675 4688 l-infinity). l1 and l2 are still special cases for convenience
4676 4689 and speed.
4677 4690
4678 4691 2003-08-03 Fernando Perez <fperez@colorado.edu>
4679 4692
4680 4693 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4681 4694 exceptions, which now raise PendingDeprecationWarnings in Python
4682 4695 2.3. There were some in Magic and some in Gnuplot2.
4683 4696
4684 4697 2003-06-30 Fernando Perez <fperez@colorado.edu>
4685 4698
4686 4699 * IPython/genutils.py (page): modified to call curses only for
4687 4700 terminals where TERM=='xterm'. After problems under many other
4688 4701 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4689 4702
4690 4703 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4691 4704 would be triggered when readline was absent. This was just an old
4692 4705 debugging statement I'd forgotten to take out.
4693 4706
4694 4707 2003-06-20 Fernando Perez <fperez@colorado.edu>
4695 4708
4696 4709 * IPython/genutils.py (clock): modified to return only user time
4697 4710 (not counting system time), after a discussion on scipy. While
4698 4711 system time may be a useful quantity occasionally, it may much
4699 4712 more easily be skewed by occasional swapping or other similar
4700 4713 activity.
4701 4714
4702 4715 2003-06-05 Fernando Perez <fperez@colorado.edu>
4703 4716
4704 4717 * IPython/numutils.py (identity): new function, for building
4705 4718 arbitrary rank Kronecker deltas (mostly backwards compatible with
4706 4719 Numeric.identity)
4707 4720
4708 4721 2003-06-03 Fernando Perez <fperez@colorado.edu>
4709 4722
4710 4723 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4711 4724 arguments passed to magics with spaces, to allow trailing '\' to
4712 4725 work normally (mainly for Windows users).
4713 4726
4714 4727 2003-05-29 Fernando Perez <fperez@colorado.edu>
4715 4728
4716 4729 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4717 4730 instead of pydoc.help. This fixes a bizarre behavior where
4718 4731 printing '%s' % locals() would trigger the help system. Now
4719 4732 ipython behaves like normal python does.
4720 4733
4721 4734 Note that if one does 'from pydoc import help', the bizarre
4722 4735 behavior returns, but this will also happen in normal python, so
4723 4736 it's not an ipython bug anymore (it has to do with how pydoc.help
4724 4737 is implemented).
4725 4738
4726 4739 2003-05-22 Fernando Perez <fperez@colorado.edu>
4727 4740
4728 4741 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4729 4742 return [] instead of None when nothing matches, also match to end
4730 4743 of line. Patch by Gary Bishop.
4731 4744
4732 4745 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4733 4746 protection as before, for files passed on the command line. This
4734 4747 prevents the CrashHandler from kicking in if user files call into
4735 4748 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4736 4749 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4737 4750
4738 4751 2003-05-20 *** Released version 0.4.0
4739 4752
4740 4753 2003-05-20 Fernando Perez <fperez@colorado.edu>
4741 4754
4742 4755 * setup.py: added support for manpages. It's a bit hackish b/c of
4743 4756 a bug in the way the bdist_rpm distutils target handles gzipped
4744 4757 manpages, but it works. After a patch by Jack.
4745 4758
4746 4759 2003-05-19 Fernando Perez <fperez@colorado.edu>
4747 4760
4748 4761 * IPython/numutils.py: added a mockup of the kinds module, since
4749 4762 it was recently removed from Numeric. This way, numutils will
4750 4763 work for all users even if they are missing kinds.
4751 4764
4752 4765 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4753 4766 failure, which can occur with SWIG-wrapped extensions. After a
4754 4767 crash report from Prabhu.
4755 4768
4756 4769 2003-05-16 Fernando Perez <fperez@colorado.edu>
4757 4770
4758 4771 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4759 4772 protect ipython from user code which may call directly
4760 4773 sys.excepthook (this looks like an ipython crash to the user, even
4761 4774 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4762 4775 This is especially important to help users of WxWindows, but may
4763 4776 also be useful in other cases.
4764 4777
4765 4778 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4766 4779 an optional tb_offset to be specified, and to preserve exception
4767 4780 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4768 4781
4769 4782 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4770 4783
4771 4784 2003-05-15 Fernando Perez <fperez@colorado.edu>
4772 4785
4773 4786 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4774 4787 installing for a new user under Windows.
4775 4788
4776 4789 2003-05-12 Fernando Perez <fperez@colorado.edu>
4777 4790
4778 4791 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4779 4792 handler for Emacs comint-based lines. Currently it doesn't do
4780 4793 much (but importantly, it doesn't update the history cache). In
4781 4794 the future it may be expanded if Alex needs more functionality
4782 4795 there.
4783 4796
4784 4797 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4785 4798 info to crash reports.
4786 4799
4787 4800 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4788 4801 just like Python's -c. Also fixed crash with invalid -color
4789 4802 option value at startup. Thanks to Will French
4790 4803 <wfrench-AT-bestweb.net> for the bug report.
4791 4804
4792 4805 2003-05-09 Fernando Perez <fperez@colorado.edu>
4793 4806
4794 4807 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4795 4808 to EvalDict (it's a mapping, after all) and simplified its code
4796 4809 quite a bit, after a nice discussion on c.l.py where Gustavo
4797 4810 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4798 4811
4799 4812 2003-04-30 Fernando Perez <fperez@colorado.edu>
4800 4813
4801 4814 * IPython/genutils.py (timings_out): modified it to reduce its
4802 4815 overhead in the common reps==1 case.
4803 4816
4804 4817 2003-04-29 Fernando Perez <fperez@colorado.edu>
4805 4818
4806 4819 * IPython/genutils.py (timings_out): Modified to use the resource
4807 4820 module, which avoids the wraparound problems of time.clock().
4808 4821
4809 4822 2003-04-17 *** Released version 0.2.15pre4
4810 4823
4811 4824 2003-04-17 Fernando Perez <fperez@colorado.edu>
4812 4825
4813 4826 * setup.py (scriptfiles): Split windows-specific stuff over to a
4814 4827 separate file, in an attempt to have a Windows GUI installer.
4815 4828 That didn't work, but part of the groundwork is done.
4816 4829
4817 4830 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4818 4831 indent/unindent with 4 spaces. Particularly useful in combination
4819 4832 with the new auto-indent option.
4820 4833
4821 4834 2003-04-16 Fernando Perez <fperez@colorado.edu>
4822 4835
4823 4836 * IPython/Magic.py: various replacements of self.rc for
4824 4837 self.shell.rc. A lot more remains to be done to fully disentangle
4825 4838 this class from the main Shell class.
4826 4839
4827 4840 * IPython/GnuplotRuntime.py: added checks for mouse support so
4828 4841 that we don't try to enable it if the current gnuplot doesn't
4829 4842 really support it. Also added checks so that we don't try to
4830 4843 enable persist under Windows (where Gnuplot doesn't recognize the
4831 4844 option).
4832 4845
4833 4846 * IPython/iplib.py (InteractiveShell.interact): Added optional
4834 4847 auto-indenting code, after a patch by King C. Shu
4835 4848 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4836 4849 get along well with pasting indented code. If I ever figure out
4837 4850 how to make that part go well, it will become on by default.
4838 4851
4839 4852 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4840 4853 crash ipython if there was an unmatched '%' in the user's prompt
4841 4854 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4842 4855
4843 4856 * IPython/iplib.py (InteractiveShell.interact): removed the
4844 4857 ability to ask the user whether he wants to crash or not at the
4845 4858 'last line' exception handler. Calling functions at that point
4846 4859 changes the stack, and the error reports would have incorrect
4847 4860 tracebacks.
4848 4861
4849 4862 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4850 4863 pass through a peger a pretty-printed form of any object. After a
4851 4864 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4852 4865
4853 4866 2003-04-14 Fernando Perez <fperez@colorado.edu>
4854 4867
4855 4868 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4856 4869 all files in ~ would be modified at first install (instead of
4857 4870 ~/.ipython). This could be potentially disastrous, as the
4858 4871 modification (make line-endings native) could damage binary files.
4859 4872
4860 4873 2003-04-10 Fernando Perez <fperez@colorado.edu>
4861 4874
4862 4875 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4863 4876 handle only lines which are invalid python. This now means that
4864 4877 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4865 4878 for the bug report.
4866 4879
4867 4880 2003-04-01 Fernando Perez <fperez@colorado.edu>
4868 4881
4869 4882 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4870 4883 where failing to set sys.last_traceback would crash pdb.pm().
4871 4884 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4872 4885 report.
4873 4886
4874 4887 2003-03-25 Fernando Perez <fperez@colorado.edu>
4875 4888
4876 4889 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4877 4890 before printing it (it had a lot of spurious blank lines at the
4878 4891 end).
4879 4892
4880 4893 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4881 4894 output would be sent 21 times! Obviously people don't use this
4882 4895 too often, or I would have heard about it.
4883 4896
4884 4897 2003-03-24 Fernando Perez <fperez@colorado.edu>
4885 4898
4886 4899 * setup.py (scriptfiles): renamed the data_files parameter from
4887 4900 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4888 4901 for the patch.
4889 4902
4890 4903 2003-03-20 Fernando Perez <fperez@colorado.edu>
4891 4904
4892 4905 * IPython/genutils.py (error): added error() and fatal()
4893 4906 functions.
4894 4907
4895 4908 2003-03-18 *** Released version 0.2.15pre3
4896 4909
4897 4910 2003-03-18 Fernando Perez <fperez@colorado.edu>
4898 4911
4899 4912 * setupext/install_data_ext.py
4900 4913 (install_data_ext.initialize_options): Class contributed by Jack
4901 4914 Moffit for fixing the old distutils hack. He is sending this to
4902 4915 the distutils folks so in the future we may not need it as a
4903 4916 private fix.
4904 4917
4905 4918 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4906 4919 changes for Debian packaging. See his patch for full details.
4907 4920 The old distutils hack of making the ipythonrc* files carry a
4908 4921 bogus .py extension is gone, at last. Examples were moved to a
4909 4922 separate subdir under doc/, and the separate executable scripts
4910 4923 now live in their own directory. Overall a great cleanup. The
4911 4924 manual was updated to use the new files, and setup.py has been
4912 4925 fixed for this setup.
4913 4926
4914 4927 * IPython/PyColorize.py (Parser.usage): made non-executable and
4915 4928 created a pycolor wrapper around it to be included as a script.
4916 4929
4917 4930 2003-03-12 *** Released version 0.2.15pre2
4918 4931
4919 4932 2003-03-12 Fernando Perez <fperez@colorado.edu>
4920 4933
4921 4934 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4922 4935 long-standing problem with garbage characters in some terminals.
4923 4936 The issue was really that the \001 and \002 escapes must _only_ be
4924 4937 passed to input prompts (which call readline), but _never_ to
4925 4938 normal text to be printed on screen. I changed ColorANSI to have
4926 4939 two classes: TermColors and InputTermColors, each with the
4927 4940 appropriate escapes for input prompts or normal text. The code in
4928 4941 Prompts.py got slightly more complicated, but this very old and
4929 4942 annoying bug is finally fixed.
4930 4943
4931 4944 All the credit for nailing down the real origin of this problem
4932 4945 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4933 4946 *Many* thanks to him for spending quite a bit of effort on this.
4934 4947
4935 4948 2003-03-05 *** Released version 0.2.15pre1
4936 4949
4937 4950 2003-03-03 Fernando Perez <fperez@colorado.edu>
4938 4951
4939 4952 * IPython/FakeModule.py: Moved the former _FakeModule to a
4940 4953 separate file, because it's also needed by Magic (to fix a similar
4941 4954 pickle-related issue in @run).
4942 4955
4943 4956 2003-03-02 Fernando Perez <fperez@colorado.edu>
4944 4957
4945 4958 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4946 4959 the autocall option at runtime.
4947 4960 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4948 4961 across Magic.py to start separating Magic from InteractiveShell.
4949 4962 (Magic._ofind): Fixed to return proper namespace for dotted
4950 4963 names. Before, a dotted name would always return 'not currently
4951 4964 defined', because it would find the 'parent'. s.x would be found,
4952 4965 but since 'x' isn't defined by itself, it would get confused.
4953 4966 (Magic.magic_run): Fixed pickling problems reported by Ralf
4954 4967 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4955 4968 that I'd used when Mike Heeter reported similar issues at the
4956 4969 top-level, but now for @run. It boils down to injecting the
4957 4970 namespace where code is being executed with something that looks
4958 4971 enough like a module to fool pickle.dump(). Since a pickle stores
4959 4972 a named reference to the importing module, we need this for
4960 4973 pickles to save something sensible.
4961 4974
4962 4975 * IPython/ipmaker.py (make_IPython): added an autocall option.
4963 4976
4964 4977 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4965 4978 the auto-eval code. Now autocalling is an option, and the code is
4966 4979 also vastly safer. There is no more eval() involved at all.
4967 4980
4968 4981 2003-03-01 Fernando Perez <fperez@colorado.edu>
4969 4982
4970 4983 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4971 4984 dict with named keys instead of a tuple.
4972 4985
4973 4986 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4974 4987
4975 4988 * setup.py (make_shortcut): Fixed message about directories
4976 4989 created during Windows installation (the directories were ok, just
4977 4990 the printed message was misleading). Thanks to Chris Liechti
4978 4991 <cliechti-AT-gmx.net> for the heads up.
4979 4992
4980 4993 2003-02-21 Fernando Perez <fperez@colorado.edu>
4981 4994
4982 4995 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4983 4996 of ValueError exception when checking for auto-execution. This
4984 4997 one is raised by things like Numeric arrays arr.flat when the
4985 4998 array is non-contiguous.
4986 4999
4987 5000 2003-01-31 Fernando Perez <fperez@colorado.edu>
4988 5001
4989 5002 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4990 5003 not return any value at all (even though the command would get
4991 5004 executed).
4992 5005 (xsys): Flush stdout right after printing the command to ensure
4993 5006 proper ordering of commands and command output in the total
4994 5007 output.
4995 5008 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4996 5009 system/getoutput as defaults. The old ones are kept for
4997 5010 compatibility reasons, so no code which uses this library needs
4998 5011 changing.
4999 5012
5000 5013 2003-01-27 *** Released version 0.2.14
5001 5014
5002 5015 2003-01-25 Fernando Perez <fperez@colorado.edu>
5003 5016
5004 5017 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
5005 5018 functions defined in previous edit sessions could not be re-edited
5006 5019 (because the temp files were immediately removed). Now temp files
5007 5020 are removed only at IPython's exit.
5008 5021 (Magic.magic_run): Improved @run to perform shell-like expansions
5009 5022 on its arguments (~users and $VARS). With this, @run becomes more
5010 5023 like a normal command-line.
5011 5024
5012 5025 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
5013 5026 bugs related to embedding and cleaned up that code. A fairly
5014 5027 important one was the impossibility to access the global namespace
5015 5028 through the embedded IPython (only local variables were visible).
5016 5029
5017 5030 2003-01-14 Fernando Perez <fperez@colorado.edu>
5018 5031
5019 5032 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
5020 5033 auto-calling to be a bit more conservative. Now it doesn't get
5021 5034 triggered if any of '!=()<>' are in the rest of the input line, to
5022 5035 allow comparing callables. Thanks to Alex for the heads up.
5023 5036
5024 5037 2003-01-07 Fernando Perez <fperez@colorado.edu>
5025 5038
5026 5039 * IPython/genutils.py (page): fixed estimation of the number of
5027 5040 lines in a string to be paged to simply count newlines. This
5028 5041 prevents over-guessing due to embedded escape sequences. A better
5029 5042 long-term solution would involve stripping out the control chars
5030 5043 for the count, but it's potentially so expensive I just don't
5031 5044 think it's worth doing.
5032 5045
5033 5046 2002-12-19 *** Released version 0.2.14pre50
5034 5047
5035 5048 2002-12-19 Fernando Perez <fperez@colorado.edu>
5036 5049
5037 5050 * tools/release (version): Changed release scripts to inform
5038 5051 Andrea and build a NEWS file with a list of recent changes.
5039 5052
5040 5053 * IPython/ColorANSI.py (__all__): changed terminal detection
5041 5054 code. Seems to work better for xterms without breaking
5042 5055 konsole. Will need more testing to determine if WinXP and Mac OSX
5043 5056 also work ok.
5044 5057
5045 5058 2002-12-18 *** Released version 0.2.14pre49
5046 5059
5047 5060 2002-12-18 Fernando Perez <fperez@colorado.edu>
5048 5061
5049 5062 * Docs: added new info about Mac OSX, from Andrea.
5050 5063
5051 5064 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5052 5065 allow direct plotting of python strings whose format is the same
5053 5066 of gnuplot data files.
5054 5067
5055 5068 2002-12-16 Fernando Perez <fperez@colorado.edu>
5056 5069
5057 5070 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5058 5071 value of exit question to be acknowledged.
5059 5072
5060 5073 2002-12-03 Fernando Perez <fperez@colorado.edu>
5061 5074
5062 5075 * IPython/ipmaker.py: removed generators, which had been added
5063 5076 by mistake in an earlier debugging run. This was causing trouble
5064 5077 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5065 5078 for pointing this out.
5066 5079
5067 5080 2002-11-17 Fernando Perez <fperez@colorado.edu>
5068 5081
5069 5082 * Manual: updated the Gnuplot section.
5070 5083
5071 5084 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5072 5085 a much better split of what goes in Runtime and what goes in
5073 5086 Interactive.
5074 5087
5075 5088 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5076 5089 being imported from iplib.
5077 5090
5078 5091 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5079 5092 for command-passing. Now the global Gnuplot instance is called
5080 5093 'gp' instead of 'g', which was really a far too fragile and
5081 5094 common name.
5082 5095
5083 5096 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5084 5097 bounding boxes generated by Gnuplot for square plots.
5085 5098
5086 5099 * IPython/genutils.py (popkey): new function added. I should
5087 5100 suggest this on c.l.py as a dict method, it seems useful.
5088 5101
5089 5102 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5090 5103 to transparently handle PostScript generation. MUCH better than
5091 5104 the previous plot_eps/replot_eps (which I removed now). The code
5092 5105 is also fairly clean and well documented now (including
5093 5106 docstrings).
5094 5107
5095 5108 2002-11-13 Fernando Perez <fperez@colorado.edu>
5096 5109
5097 5110 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5098 5111 (inconsistent with options).
5099 5112
5100 5113 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5101 5114 manually disabled, I don't know why. Fixed it.
5102 5115 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5103 5116 eps output.
5104 5117
5105 5118 2002-11-12 Fernando Perez <fperez@colorado.edu>
5106 5119
5107 5120 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5108 5121 don't propagate up to caller. Fixes crash reported by François
5109 5122 Pinard.
5110 5123
5111 5124 2002-11-09 Fernando Perez <fperez@colorado.edu>
5112 5125
5113 5126 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5114 5127 history file for new users.
5115 5128 (make_IPython): fixed bug where initial install would leave the
5116 5129 user running in the .ipython dir.
5117 5130 (make_IPython): fixed bug where config dir .ipython would be
5118 5131 created regardless of the given -ipythondir option. Thanks to Cory
5119 5132 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5120 5133
5121 5134 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5122 5135 type confirmations. Will need to use it in all of IPython's code
5123 5136 consistently.
5124 5137
5125 5138 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5126 5139 context to print 31 lines instead of the default 5. This will make
5127 5140 the crash reports extremely detailed in case the problem is in
5128 5141 libraries I don't have access to.
5129 5142
5130 5143 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5131 5144 line of defense' code to still crash, but giving users fair
5132 5145 warning. I don't want internal errors to go unreported: if there's
5133 5146 an internal problem, IPython should crash and generate a full
5134 5147 report.
5135 5148
5136 5149 2002-11-08 Fernando Perez <fperez@colorado.edu>
5137 5150
5138 5151 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5139 5152 otherwise uncaught exceptions which can appear if people set
5140 5153 sys.stdout to something badly broken. Thanks to a crash report
5141 5154 from henni-AT-mail.brainbot.com.
5142 5155
5143 5156 2002-11-04 Fernando Perez <fperez@colorado.edu>
5144 5157
5145 5158 * IPython/iplib.py (InteractiveShell.interact): added
5146 5159 __IPYTHON__active to the builtins. It's a flag which goes on when
5147 5160 the interaction starts and goes off again when it stops. This
5148 5161 allows embedding code to detect being inside IPython. Before this
5149 5162 was done via __IPYTHON__, but that only shows that an IPython
5150 5163 instance has been created.
5151 5164
5152 5165 * IPython/Magic.py (Magic.magic_env): I realized that in a
5153 5166 UserDict, instance.data holds the data as a normal dict. So I
5154 5167 modified @env to return os.environ.data instead of rebuilding a
5155 5168 dict by hand.
5156 5169
5157 5170 2002-11-02 Fernando Perez <fperez@colorado.edu>
5158 5171
5159 5172 * IPython/genutils.py (warn): changed so that level 1 prints no
5160 5173 header. Level 2 is now the default (with 'WARNING' header, as
5161 5174 before). I think I tracked all places where changes were needed in
5162 5175 IPython, but outside code using the old level numbering may have
5163 5176 broken.
5164 5177
5165 5178 * IPython/iplib.py (InteractiveShell.runcode): added this to
5166 5179 handle the tracebacks in SystemExit traps correctly. The previous
5167 5180 code (through interact) was printing more of the stack than
5168 5181 necessary, showing IPython internal code to the user.
5169 5182
5170 5183 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5171 5184 default. Now that the default at the confirmation prompt is yes,
5172 5185 it's not so intrusive. François' argument that ipython sessions
5173 5186 tend to be complex enough not to lose them from an accidental C-d,
5174 5187 is a valid one.
5175 5188
5176 5189 * IPython/iplib.py (InteractiveShell.interact): added a
5177 5190 showtraceback() call to the SystemExit trap, and modified the exit
5178 5191 confirmation to have yes as the default.
5179 5192
5180 5193 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5181 5194 this file. It's been gone from the code for a long time, this was
5182 5195 simply leftover junk.
5183 5196
5184 5197 2002-11-01 Fernando Perez <fperez@colorado.edu>
5185 5198
5186 5199 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5187 5200 added. If set, IPython now traps EOF and asks for
5188 5201 confirmation. After a request by François Pinard.
5189 5202
5190 5203 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5191 5204 of @abort, and with a new (better) mechanism for handling the
5192 5205 exceptions.
5193 5206
5194 5207 2002-10-27 Fernando Perez <fperez@colorado.edu>
5195 5208
5196 5209 * IPython/usage.py (__doc__): updated the --help information and
5197 5210 the ipythonrc file to indicate that -log generates
5198 5211 ./ipython.log. Also fixed the corresponding info in @logstart.
5199 5212 This and several other fixes in the manuals thanks to reports by
5200 5213 François Pinard <pinard-AT-iro.umontreal.ca>.
5201 5214
5202 5215 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5203 5216 refer to @logstart (instead of @log, which doesn't exist).
5204 5217
5205 5218 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5206 5219 AttributeError crash. Thanks to Christopher Armstrong
5207 5220 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5208 5221 introduced recently (in 0.2.14pre37) with the fix to the eval
5209 5222 problem mentioned below.
5210 5223
5211 5224 2002-10-17 Fernando Perez <fperez@colorado.edu>
5212 5225
5213 5226 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5214 5227 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5215 5228
5216 5229 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5217 5230 this function to fix a problem reported by Alex Schmolck. He saw
5218 5231 it with list comprehensions and generators, which were getting
5219 5232 called twice. The real problem was an 'eval' call in testing for
5220 5233 automagic which was evaluating the input line silently.
5221 5234
5222 5235 This is a potentially very nasty bug, if the input has side
5223 5236 effects which must not be repeated. The code is much cleaner now,
5224 5237 without any blanket 'except' left and with a regexp test for
5225 5238 actual function names.
5226 5239
5227 5240 But an eval remains, which I'm not fully comfortable with. I just
5228 5241 don't know how to find out if an expression could be a callable in
5229 5242 the user's namespace without doing an eval on the string. However
5230 5243 that string is now much more strictly checked so that no code
5231 5244 slips by, so the eval should only happen for things that can
5232 5245 really be only function/method names.
5233 5246
5234 5247 2002-10-15 Fernando Perez <fperez@colorado.edu>
5235 5248
5236 5249 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5237 5250 OSX information to main manual, removed README_Mac_OSX file from
5238 5251 distribution. Also updated credits for recent additions.
5239 5252
5240 5253 2002-10-10 Fernando Perez <fperez@colorado.edu>
5241 5254
5242 5255 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5243 5256 terminal-related issues. Many thanks to Andrea Riciputi
5244 5257 <andrea.riciputi-AT-libero.it> for writing it.
5245 5258
5246 5259 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5247 5260 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5248 5261
5249 5262 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5250 5263 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5251 5264 <syver-en-AT-online.no> who both submitted patches for this problem.
5252 5265
5253 5266 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5254 5267 global embedding to make sure that things don't overwrite user
5255 5268 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5256 5269
5257 5270 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5258 5271 compatibility. Thanks to Hayden Callow
5259 5272 <h.callow-AT-elec.canterbury.ac.nz>
5260 5273
5261 5274 2002-10-04 Fernando Perez <fperez@colorado.edu>
5262 5275
5263 5276 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5264 5277 Gnuplot.File objects.
5265 5278
5266 5279 2002-07-23 Fernando Perez <fperez@colorado.edu>
5267 5280
5268 5281 * IPython/genutils.py (timing): Added timings() and timing() for
5269 5282 quick access to the most commonly needed data, the execution
5270 5283 times. Old timing() renamed to timings_out().
5271 5284
5272 5285 2002-07-18 Fernando Perez <fperez@colorado.edu>
5273 5286
5274 5287 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5275 5288 bug with nested instances disrupting the parent's tab completion.
5276 5289
5277 5290 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5278 5291 all_completions code to begin the emacs integration.
5279 5292
5280 5293 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5281 5294 argument to allow titling individual arrays when plotting.
5282 5295
5283 5296 2002-07-15 Fernando Perez <fperez@colorado.edu>
5284 5297
5285 5298 * setup.py (make_shortcut): changed to retrieve the value of
5286 5299 'Program Files' directory from the registry (this value changes in
5287 5300 non-english versions of Windows). Thanks to Thomas Fanslau
5288 5301 <tfanslau-AT-gmx.de> for the report.
5289 5302
5290 5303 2002-07-10 Fernando Perez <fperez@colorado.edu>
5291 5304
5292 5305 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5293 5306 a bug in pdb, which crashes if a line with only whitespace is
5294 5307 entered. Bug report submitted to sourceforge.
5295 5308
5296 5309 2002-07-09 Fernando Perez <fperez@colorado.edu>
5297 5310
5298 5311 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5299 5312 reporting exceptions (it's a bug in inspect.py, I just set a
5300 5313 workaround).
5301 5314
5302 5315 2002-07-08 Fernando Perez <fperez@colorado.edu>
5303 5316
5304 5317 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5305 5318 __IPYTHON__ in __builtins__ to show up in user_ns.
5306 5319
5307 5320 2002-07-03 Fernando Perez <fperez@colorado.edu>
5308 5321
5309 5322 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5310 5323 name from @gp_set_instance to @gp_set_default.
5311 5324
5312 5325 * IPython/ipmaker.py (make_IPython): default editor value set to
5313 5326 '0' (a string), to match the rc file. Otherwise will crash when
5314 5327 .strip() is called on it.
5315 5328
5316 5329
5317 5330 2002-06-28 Fernando Perez <fperez@colorado.edu>
5318 5331
5319 5332 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5320 5333 of files in current directory when a file is executed via
5321 5334 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5322 5335
5323 5336 * setup.py (manfiles): fix for rpm builds, submitted by RA
5324 5337 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5325 5338
5326 5339 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5327 5340 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5328 5341 string!). A. Schmolck caught this one.
5329 5342
5330 5343 2002-06-27 Fernando Perez <fperez@colorado.edu>
5331 5344
5332 5345 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5333 5346 defined files at the cmd line. __name__ wasn't being set to
5334 5347 __main__.
5335 5348
5336 5349 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5337 5350 regular lists and tuples besides Numeric arrays.
5338 5351
5339 5352 * IPython/Prompts.py (CachedOutput.__call__): Added output
5340 5353 supression for input ending with ';'. Similar to Mathematica and
5341 5354 Matlab. The _* vars and Out[] list are still updated, just like
5342 5355 Mathematica behaves.
5343 5356
5344 5357 2002-06-25 Fernando Perez <fperez@colorado.edu>
5345 5358
5346 5359 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5347 5360 .ini extensions for profiels under Windows.
5348 5361
5349 5362 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5350 5363 string form. Fix contributed by Alexander Schmolck
5351 5364 <a.schmolck-AT-gmx.net>
5352 5365
5353 5366 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5354 5367 pre-configured Gnuplot instance.
5355 5368
5356 5369 2002-06-21 Fernando Perez <fperez@colorado.edu>
5357 5370
5358 5371 * IPython/numutils.py (exp_safe): new function, works around the
5359 5372 underflow problems in Numeric.
5360 5373 (log2): New fn. Safe log in base 2: returns exact integer answer
5361 5374 for exact integer powers of 2.
5362 5375
5363 5376 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5364 5377 properly.
5365 5378
5366 5379 2002-06-20 Fernando Perez <fperez@colorado.edu>
5367 5380
5368 5381 * IPython/genutils.py (timing): new function like
5369 5382 Mathematica's. Similar to time_test, but returns more info.
5370 5383
5371 5384 2002-06-18 Fernando Perez <fperez@colorado.edu>
5372 5385
5373 5386 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5374 5387 according to Mike Heeter's suggestions.
5375 5388
5376 5389 2002-06-16 Fernando Perez <fperez@colorado.edu>
5377 5390
5378 5391 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5379 5392 system. GnuplotMagic is gone as a user-directory option. New files
5380 5393 make it easier to use all the gnuplot stuff both from external
5381 5394 programs as well as from IPython. Had to rewrite part of
5382 5395 hardcopy() b/c of a strange bug: often the ps files simply don't
5383 5396 get created, and require a repeat of the command (often several
5384 5397 times).
5385 5398
5386 5399 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5387 5400 resolve output channel at call time, so that if sys.stderr has
5388 5401 been redirected by user this gets honored.
5389 5402
5390 5403 2002-06-13 Fernando Perez <fperez@colorado.edu>
5391 5404
5392 5405 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5393 5406 IPShell. Kept a copy with the old names to avoid breaking people's
5394 5407 embedded code.
5395 5408
5396 5409 * IPython/ipython: simplified it to the bare minimum after
5397 5410 Holger's suggestions. Added info about how to use it in
5398 5411 PYTHONSTARTUP.
5399 5412
5400 5413 * IPython/Shell.py (IPythonShell): changed the options passing
5401 5414 from a string with funky %s replacements to a straight list. Maybe
5402 5415 a bit more typing, but it follows sys.argv conventions, so there's
5403 5416 less special-casing to remember.
5404 5417
5405 5418 2002-06-12 Fernando Perez <fperez@colorado.edu>
5406 5419
5407 5420 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5408 5421 command. Thanks to a suggestion by Mike Heeter.
5409 5422 (Magic.magic_pfile): added behavior to look at filenames if given
5410 5423 arg is not a defined object.
5411 5424 (Magic.magic_save): New @save function to save code snippets. Also
5412 5425 a Mike Heeter idea.
5413 5426
5414 5427 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5415 5428 plot() and replot(). Much more convenient now, especially for
5416 5429 interactive use.
5417 5430
5418 5431 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5419 5432 filenames.
5420 5433
5421 5434 2002-06-02 Fernando Perez <fperez@colorado.edu>
5422 5435
5423 5436 * IPython/Struct.py (Struct.__init__): modified to admit
5424 5437 initialization via another struct.
5425 5438
5426 5439 * IPython/genutils.py (SystemExec.__init__): New stateful
5427 5440 interface to xsys and bq. Useful for writing system scripts.
5428 5441
5429 5442 2002-05-30 Fernando Perez <fperez@colorado.edu>
5430 5443
5431 5444 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5432 5445 documents. This will make the user download smaller (it's getting
5433 5446 too big).
5434 5447
5435 5448 2002-05-29 Fernando Perez <fperez@colorado.edu>
5436 5449
5437 5450 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5438 5451 fix problems with shelve and pickle. Seems to work, but I don't
5439 5452 know if corner cases break it. Thanks to Mike Heeter
5440 5453 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5441 5454
5442 5455 2002-05-24 Fernando Perez <fperez@colorado.edu>
5443 5456
5444 5457 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5445 5458 macros having broken.
5446 5459
5447 5460 2002-05-21 Fernando Perez <fperez@colorado.edu>
5448 5461
5449 5462 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5450 5463 introduced logging bug: all history before logging started was
5451 5464 being written one character per line! This came from the redesign
5452 5465 of the input history as a special list which slices to strings,
5453 5466 not to lists.
5454 5467
5455 5468 2002-05-20 Fernando Perez <fperez@colorado.edu>
5456 5469
5457 5470 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5458 5471 be an attribute of all classes in this module. The design of these
5459 5472 classes needs some serious overhauling.
5460 5473
5461 5474 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5462 5475 which was ignoring '_' in option names.
5463 5476
5464 5477 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5465 5478 'Verbose_novars' to 'Context' and made it the new default. It's a
5466 5479 bit more readable and also safer than verbose.
5467 5480
5468 5481 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5469 5482 triple-quoted strings.
5470 5483
5471 5484 * IPython/OInspect.py (__all__): new module exposing the object
5472 5485 introspection facilities. Now the corresponding magics are dummy
5473 5486 wrappers around this. Having this module will make it much easier
5474 5487 to put these functions into our modified pdb.
5475 5488 This new object inspector system uses the new colorizing module,
5476 5489 so source code and other things are nicely syntax highlighted.
5477 5490
5478 5491 2002-05-18 Fernando Perez <fperez@colorado.edu>
5479 5492
5480 5493 * IPython/ColorANSI.py: Split the coloring tools into a separate
5481 5494 module so I can use them in other code easier (they were part of
5482 5495 ultraTB).
5483 5496
5484 5497 2002-05-17 Fernando Perez <fperez@colorado.edu>
5485 5498
5486 5499 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5487 5500 fixed it to set the global 'g' also to the called instance, as
5488 5501 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5489 5502 user's 'g' variables).
5490 5503
5491 5504 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5492 5505 global variables (aliases to _ih,_oh) so that users which expect
5493 5506 In[5] or Out[7] to work aren't unpleasantly surprised.
5494 5507 (InputList.__getslice__): new class to allow executing slices of
5495 5508 input history directly. Very simple class, complements the use of
5496 5509 macros.
5497 5510
5498 5511 2002-05-16 Fernando Perez <fperez@colorado.edu>
5499 5512
5500 5513 * setup.py (docdirbase): make doc directory be just doc/IPython
5501 5514 without version numbers, it will reduce clutter for users.
5502 5515
5503 5516 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5504 5517 execfile call to prevent possible memory leak. See for details:
5505 5518 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5506 5519
5507 5520 2002-05-15 Fernando Perez <fperez@colorado.edu>
5508 5521
5509 5522 * IPython/Magic.py (Magic.magic_psource): made the object
5510 5523 introspection names be more standard: pdoc, pdef, pfile and
5511 5524 psource. They all print/page their output, and it makes
5512 5525 remembering them easier. Kept old names for compatibility as
5513 5526 aliases.
5514 5527
5515 5528 2002-05-14 Fernando Perez <fperez@colorado.edu>
5516 5529
5517 5530 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5518 5531 what the mouse problem was. The trick is to use gnuplot with temp
5519 5532 files and NOT with pipes (for data communication), because having
5520 5533 both pipes and the mouse on is bad news.
5521 5534
5522 5535 2002-05-13 Fernando Perez <fperez@colorado.edu>
5523 5536
5524 5537 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5525 5538 bug. Information would be reported about builtins even when
5526 5539 user-defined functions overrode them.
5527 5540
5528 5541 2002-05-11 Fernando Perez <fperez@colorado.edu>
5529 5542
5530 5543 * IPython/__init__.py (__all__): removed FlexCompleter from
5531 5544 __all__ so that things don't fail in platforms without readline.
5532 5545
5533 5546 2002-05-10 Fernando Perez <fperez@colorado.edu>
5534 5547
5535 5548 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5536 5549 it requires Numeric, effectively making Numeric a dependency for
5537 5550 IPython.
5538 5551
5539 5552 * Released 0.2.13
5540 5553
5541 5554 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5542 5555 profiler interface. Now all the major options from the profiler
5543 5556 module are directly supported in IPython, both for single
5544 5557 expressions (@prun) and for full programs (@run -p).
5545 5558
5546 5559 2002-05-09 Fernando Perez <fperez@colorado.edu>
5547 5560
5548 5561 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5549 5562 magic properly formatted for screen.
5550 5563
5551 5564 * setup.py (make_shortcut): Changed things to put pdf version in
5552 5565 doc/ instead of doc/manual (had to change lyxport a bit).
5553 5566
5554 5567 * IPython/Magic.py (Profile.string_stats): made profile runs go
5555 5568 through pager (they are long and a pager allows searching, saving,
5556 5569 etc.)
5557 5570
5558 5571 2002-05-08 Fernando Perez <fperez@colorado.edu>
5559 5572
5560 5573 * Released 0.2.12
5561 5574
5562 5575 2002-05-06 Fernando Perez <fperez@colorado.edu>
5563 5576
5564 5577 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5565 5578 introduced); 'hist n1 n2' was broken.
5566 5579 (Magic.magic_pdb): added optional on/off arguments to @pdb
5567 5580 (Magic.magic_run): added option -i to @run, which executes code in
5568 5581 the IPython namespace instead of a clean one. Also added @irun as
5569 5582 an alias to @run -i.
5570 5583
5571 5584 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5572 5585 fixed (it didn't really do anything, the namespaces were wrong).
5573 5586
5574 5587 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5575 5588
5576 5589 * IPython/__init__.py (__all__): Fixed package namespace, now
5577 5590 'import IPython' does give access to IPython.<all> as
5578 5591 expected. Also renamed __release__ to Release.
5579 5592
5580 5593 * IPython/Debugger.py (__license__): created new Pdb class which
5581 5594 functions like a drop-in for the normal pdb.Pdb but does NOT
5582 5595 import readline by default. This way it doesn't muck up IPython's
5583 5596 readline handling, and now tab-completion finally works in the
5584 5597 debugger -- sort of. It completes things globally visible, but the
5585 5598 completer doesn't track the stack as pdb walks it. That's a bit
5586 5599 tricky, and I'll have to implement it later.
5587 5600
5588 5601 2002-05-05 Fernando Perez <fperez@colorado.edu>
5589 5602
5590 5603 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5591 5604 magic docstrings when printed via ? (explicit \'s were being
5592 5605 printed).
5593 5606
5594 5607 * IPython/ipmaker.py (make_IPython): fixed namespace
5595 5608 identification bug. Now variables loaded via logs or command-line
5596 5609 files are recognized in the interactive namespace by @who.
5597 5610
5598 5611 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5599 5612 log replay system stemming from the string form of Structs.
5600 5613
5601 5614 * IPython/Magic.py (Macro.__init__): improved macros to properly
5602 5615 handle magic commands in them.
5603 5616 (Magic.magic_logstart): usernames are now expanded so 'logstart
5604 5617 ~/mylog' now works.
5605 5618
5606 5619 * IPython/iplib.py (complete): fixed bug where paths starting with
5607 5620 '/' would be completed as magic names.
5608 5621
5609 5622 2002-05-04 Fernando Perez <fperez@colorado.edu>
5610 5623
5611 5624 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5612 5625 allow running full programs under the profiler's control.
5613 5626
5614 5627 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5615 5628 mode to report exceptions verbosely but without formatting
5616 5629 variables. This addresses the issue of ipython 'freezing' (it's
5617 5630 not frozen, but caught in an expensive formatting loop) when huge
5618 5631 variables are in the context of an exception.
5619 5632 (VerboseTB.text): Added '--->' markers at line where exception was
5620 5633 triggered. Much clearer to read, especially in NoColor modes.
5621 5634
5622 5635 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5623 5636 implemented in reverse when changing to the new parse_options().
5624 5637
5625 5638 2002-05-03 Fernando Perez <fperez@colorado.edu>
5626 5639
5627 5640 * IPython/Magic.py (Magic.parse_options): new function so that
5628 5641 magics can parse options easier.
5629 5642 (Magic.magic_prun): new function similar to profile.run(),
5630 5643 suggested by Chris Hart.
5631 5644 (Magic.magic_cd): fixed behavior so that it only changes if
5632 5645 directory actually is in history.
5633 5646
5634 5647 * IPython/usage.py (__doc__): added information about potential
5635 5648 slowness of Verbose exception mode when there are huge data
5636 5649 structures to be formatted (thanks to Archie Paulson).
5637 5650
5638 5651 * IPython/ipmaker.py (make_IPython): Changed default logging
5639 5652 (when simply called with -log) to use curr_dir/ipython.log in
5640 5653 rotate mode. Fixed crash which was occuring with -log before
5641 5654 (thanks to Jim Boyle).
5642 5655
5643 5656 2002-05-01 Fernando Perez <fperez@colorado.edu>
5644 5657
5645 5658 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5646 5659 was nasty -- though somewhat of a corner case).
5647 5660
5648 5661 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5649 5662 text (was a bug).
5650 5663
5651 5664 2002-04-30 Fernando Perez <fperez@colorado.edu>
5652 5665
5653 5666 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5654 5667 a print after ^D or ^C from the user so that the In[] prompt
5655 5668 doesn't over-run the gnuplot one.
5656 5669
5657 5670 2002-04-29 Fernando Perez <fperez@colorado.edu>
5658 5671
5659 5672 * Released 0.2.10
5660 5673
5661 5674 * IPython/__release__.py (version): get date dynamically.
5662 5675
5663 5676 * Misc. documentation updates thanks to Arnd's comments. Also ran
5664 5677 a full spellcheck on the manual (hadn't been done in a while).
5665 5678
5666 5679 2002-04-27 Fernando Perez <fperez@colorado.edu>
5667 5680
5668 5681 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5669 5682 starting a log in mid-session would reset the input history list.
5670 5683
5671 5684 2002-04-26 Fernando Perez <fperez@colorado.edu>
5672 5685
5673 5686 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5674 5687 all files were being included in an update. Now anything in
5675 5688 UserConfig that matches [A-Za-z]*.py will go (this excludes
5676 5689 __init__.py)
5677 5690
5678 5691 2002-04-25 Fernando Perez <fperez@colorado.edu>
5679 5692
5680 5693 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5681 5694 to __builtins__ so that any form of embedded or imported code can
5682 5695 test for being inside IPython.
5683 5696
5684 5697 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5685 5698 changed to GnuplotMagic because it's now an importable module,
5686 5699 this makes the name follow that of the standard Gnuplot module.
5687 5700 GnuplotMagic can now be loaded at any time in mid-session.
5688 5701
5689 5702 2002-04-24 Fernando Perez <fperez@colorado.edu>
5690 5703
5691 5704 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5692 5705 the globals (IPython has its own namespace) and the
5693 5706 PhysicalQuantity stuff is much better anyway.
5694 5707
5695 5708 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5696 5709 embedding example to standard user directory for
5697 5710 distribution. Also put it in the manual.
5698 5711
5699 5712 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5700 5713 instance as first argument (so it doesn't rely on some obscure
5701 5714 hidden global).
5702 5715
5703 5716 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5704 5717 delimiters. While it prevents ().TAB from working, it allows
5705 5718 completions in open (... expressions. This is by far a more common
5706 5719 case.
5707 5720
5708 5721 2002-04-23 Fernando Perez <fperez@colorado.edu>
5709 5722
5710 5723 * IPython/Extensions/InterpreterPasteInput.py: new
5711 5724 syntax-processing module for pasting lines with >>> or ... at the
5712 5725 start.
5713 5726
5714 5727 * IPython/Extensions/PhysicalQ_Interactive.py
5715 5728 (PhysicalQuantityInteractive.__int__): fixed to work with either
5716 5729 Numeric or math.
5717 5730
5718 5731 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5719 5732 provided profiles. Now we have:
5720 5733 -math -> math module as * and cmath with its own namespace.
5721 5734 -numeric -> Numeric as *, plus gnuplot & grace
5722 5735 -physics -> same as before
5723 5736
5724 5737 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5725 5738 user-defined magics wouldn't be found by @magic if they were
5726 5739 defined as class methods. Also cleaned up the namespace search
5727 5740 logic and the string building (to use %s instead of many repeated
5728 5741 string adds).
5729 5742
5730 5743 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5731 5744 of user-defined magics to operate with class methods (cleaner, in
5732 5745 line with the gnuplot code).
5733 5746
5734 5747 2002-04-22 Fernando Perez <fperez@colorado.edu>
5735 5748
5736 5749 * setup.py: updated dependency list so that manual is updated when
5737 5750 all included files change.
5738 5751
5739 5752 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5740 5753 the delimiter removal option (the fix is ugly right now).
5741 5754
5742 5755 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5743 5756 all of the math profile (quicker loading, no conflict between
5744 5757 g-9.8 and g-gnuplot).
5745 5758
5746 5759 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5747 5760 name of post-mortem files to IPython_crash_report.txt.
5748 5761
5749 5762 * Cleanup/update of the docs. Added all the new readline info and
5750 5763 formatted all lists as 'real lists'.
5751 5764
5752 5765 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5753 5766 tab-completion options, since the full readline parse_and_bind is
5754 5767 now accessible.
5755 5768
5756 5769 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5757 5770 handling of readline options. Now users can specify any string to
5758 5771 be passed to parse_and_bind(), as well as the delimiters to be
5759 5772 removed.
5760 5773 (InteractiveShell.__init__): Added __name__ to the global
5761 5774 namespace so that things like Itpl which rely on its existence
5762 5775 don't crash.
5763 5776 (InteractiveShell._prefilter): Defined the default with a _ so
5764 5777 that prefilter() is easier to override, while the default one
5765 5778 remains available.
5766 5779
5767 5780 2002-04-18 Fernando Perez <fperez@colorado.edu>
5768 5781
5769 5782 * Added information about pdb in the docs.
5770 5783
5771 5784 2002-04-17 Fernando Perez <fperez@colorado.edu>
5772 5785
5773 5786 * IPython/ipmaker.py (make_IPython): added rc_override option to
5774 5787 allow passing config options at creation time which may override
5775 5788 anything set in the config files or command line. This is
5776 5789 particularly useful for configuring embedded instances.
5777 5790
5778 5791 2002-04-15 Fernando Perez <fperez@colorado.edu>
5779 5792
5780 5793 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5781 5794 crash embedded instances because of the input cache falling out of
5782 5795 sync with the output counter.
5783 5796
5784 5797 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5785 5798 mode which calls pdb after an uncaught exception in IPython itself.
5786 5799
5787 5800 2002-04-14 Fernando Perez <fperez@colorado.edu>
5788 5801
5789 5802 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5790 5803 readline, fix it back after each call.
5791 5804
5792 5805 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5793 5806 method to force all access via __call__(), which guarantees that
5794 5807 traceback references are properly deleted.
5795 5808
5796 5809 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5797 5810 improve printing when pprint is in use.
5798 5811
5799 5812 2002-04-13 Fernando Perez <fperez@colorado.edu>
5800 5813
5801 5814 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5802 5815 exceptions aren't caught anymore. If the user triggers one, he
5803 5816 should know why he's doing it and it should go all the way up,
5804 5817 just like any other exception. So now @abort will fully kill the
5805 5818 embedded interpreter and the embedding code (unless that happens
5806 5819 to catch SystemExit).
5807 5820
5808 5821 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5809 5822 and a debugger() method to invoke the interactive pdb debugger
5810 5823 after printing exception information. Also added the corresponding
5811 5824 -pdb option and @pdb magic to control this feature, and updated
5812 5825 the docs. After a suggestion from Christopher Hart
5813 5826 (hart-AT-caltech.edu).
5814 5827
5815 5828 2002-04-12 Fernando Perez <fperez@colorado.edu>
5816 5829
5817 5830 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5818 5831 the exception handlers defined by the user (not the CrashHandler)
5819 5832 so that user exceptions don't trigger an ipython bug report.
5820 5833
5821 5834 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5822 5835 configurable (it should have always been so).
5823 5836
5824 5837 2002-03-26 Fernando Perez <fperez@colorado.edu>
5825 5838
5826 5839 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5827 5840 and there to fix embedding namespace issues. This should all be
5828 5841 done in a more elegant way.
5829 5842
5830 5843 2002-03-25 Fernando Perez <fperez@colorado.edu>
5831 5844
5832 5845 * IPython/genutils.py (get_home_dir): Try to make it work under
5833 5846 win9x also.
5834 5847
5835 5848 2002-03-20 Fernando Perez <fperez@colorado.edu>
5836 5849
5837 5850 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5838 5851 sys.displayhook untouched upon __init__.
5839 5852
5840 5853 2002-03-19 Fernando Perez <fperez@colorado.edu>
5841 5854
5842 5855 * Released 0.2.9 (for embedding bug, basically).
5843 5856
5844 5857 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5845 5858 exceptions so that enclosing shell's state can be restored.
5846 5859
5847 5860 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5848 5861 naming conventions in the .ipython/ dir.
5849 5862
5850 5863 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5851 5864 from delimiters list so filenames with - in them get expanded.
5852 5865
5853 5866 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5854 5867 sys.displayhook not being properly restored after an embedded call.
5855 5868
5856 5869 2002-03-18 Fernando Perez <fperez@colorado.edu>
5857 5870
5858 5871 * Released 0.2.8
5859 5872
5860 5873 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5861 5874 some files weren't being included in a -upgrade.
5862 5875 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5863 5876 on' so that the first tab completes.
5864 5877 (InteractiveShell.handle_magic): fixed bug with spaces around
5865 5878 quotes breaking many magic commands.
5866 5879
5867 5880 * setup.py: added note about ignoring the syntax error messages at
5868 5881 installation.
5869 5882
5870 5883 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5871 5884 streamlining the gnuplot interface, now there's only one magic @gp.
5872 5885
5873 5886 2002-03-17 Fernando Perez <fperez@colorado.edu>
5874 5887
5875 5888 * IPython/UserConfig/magic_gnuplot.py: new name for the
5876 5889 example-magic_pm.py file. Much enhanced system, now with a shell
5877 5890 for communicating directly with gnuplot, one command at a time.
5878 5891
5879 5892 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5880 5893 setting __name__=='__main__'.
5881 5894
5882 5895 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5883 5896 mini-shell for accessing gnuplot from inside ipython. Should
5884 5897 extend it later for grace access too. Inspired by Arnd's
5885 5898 suggestion.
5886 5899
5887 5900 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5888 5901 calling magic functions with () in their arguments. Thanks to Arnd
5889 5902 Baecker for pointing this to me.
5890 5903
5891 5904 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5892 5905 infinitely for integer or complex arrays (only worked with floats).
5893 5906
5894 5907 2002-03-16 Fernando Perez <fperez@colorado.edu>
5895 5908
5896 5909 * setup.py: Merged setup and setup_windows into a single script
5897 5910 which properly handles things for windows users.
5898 5911
5899 5912 2002-03-15 Fernando Perez <fperez@colorado.edu>
5900 5913
5901 5914 * Big change to the manual: now the magics are all automatically
5902 5915 documented. This information is generated from their docstrings
5903 5916 and put in a latex file included by the manual lyx file. This way
5904 5917 we get always up to date information for the magics. The manual
5905 5918 now also has proper version information, also auto-synced.
5906 5919
5907 5920 For this to work, an undocumented --magic_docstrings option was added.
5908 5921
5909 5922 2002-03-13 Fernando Perez <fperez@colorado.edu>
5910 5923
5911 5924 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5912 5925 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5913 5926
5914 5927 2002-03-12 Fernando Perez <fperez@colorado.edu>
5915 5928
5916 5929 * IPython/ultraTB.py (TermColors): changed color escapes again to
5917 5930 fix the (old, reintroduced) line-wrapping bug. Basically, if
5918 5931 \001..\002 aren't given in the color escapes, lines get wrapped
5919 5932 weirdly. But giving those screws up old xterms and emacs terms. So
5920 5933 I added some logic for emacs terms to be ok, but I can't identify old
5921 5934 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5922 5935
5923 5936 2002-03-10 Fernando Perez <fperez@colorado.edu>
5924 5937
5925 5938 * IPython/usage.py (__doc__): Various documentation cleanups and
5926 5939 updates, both in usage docstrings and in the manual.
5927 5940
5928 5941 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5929 5942 handling of caching. Set minimum acceptabe value for having a
5930 5943 cache at 20 values.
5931 5944
5932 5945 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5933 5946 install_first_time function to a method, renamed it and added an
5934 5947 'upgrade' mode. Now people can update their config directory with
5935 5948 a simple command line switch (-upgrade, also new).
5936 5949
5937 5950 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5938 5951 @file (convenient for automagic users under Python >= 2.2).
5939 5952 Removed @files (it seemed more like a plural than an abbrev. of
5940 5953 'file show').
5941 5954
5942 5955 * IPython/iplib.py (install_first_time): Fixed crash if there were
5943 5956 backup files ('~') in .ipython/ install directory.
5944 5957
5945 5958 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5946 5959 system. Things look fine, but these changes are fairly
5947 5960 intrusive. Test them for a few days.
5948 5961
5949 5962 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5950 5963 the prompts system. Now all in/out prompt strings are user
5951 5964 controllable. This is particularly useful for embedding, as one
5952 5965 can tag embedded instances with particular prompts.
5953 5966
5954 5967 Also removed global use of sys.ps1/2, which now allows nested
5955 5968 embeddings without any problems. Added command-line options for
5956 5969 the prompt strings.
5957 5970
5958 5971 2002-03-08 Fernando Perez <fperez@colorado.edu>
5959 5972
5960 5973 * IPython/UserConfig/example-embed-short.py (ipshell): added
5961 5974 example file with the bare minimum code for embedding.
5962 5975
5963 5976 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5964 5977 functionality for the embeddable shell to be activated/deactivated
5965 5978 either globally or at each call.
5966 5979
5967 5980 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5968 5981 rewriting the prompt with '--->' for auto-inputs with proper
5969 5982 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5970 5983 this is handled by the prompts class itself, as it should.
5971 5984
5972 5985 2002-03-05 Fernando Perez <fperez@colorado.edu>
5973 5986
5974 5987 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5975 5988 @logstart to avoid name clashes with the math log function.
5976 5989
5977 5990 * Big updates to X/Emacs section of the manual.
5978 5991
5979 5992 * Removed ipython_emacs. Milan explained to me how to pass
5980 5993 arguments to ipython through Emacs. Some day I'm going to end up
5981 5994 learning some lisp...
5982 5995
5983 5996 2002-03-04 Fernando Perez <fperez@colorado.edu>
5984 5997
5985 5998 * IPython/ipython_emacs: Created script to be used as the
5986 5999 py-python-command Emacs variable so we can pass IPython
5987 6000 parameters. I can't figure out how to tell Emacs directly to pass
5988 6001 parameters to IPython, so a dummy shell script will do it.
5989 6002
5990 6003 Other enhancements made for things to work better under Emacs'
5991 6004 various types of terminals. Many thanks to Milan Zamazal
5992 6005 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5993 6006
5994 6007 2002-03-01 Fernando Perez <fperez@colorado.edu>
5995 6008
5996 6009 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5997 6010 that loading of readline is now optional. This gives better
5998 6011 control to emacs users.
5999 6012
6000 6013 * IPython/ultraTB.py (__date__): Modified color escape sequences
6001 6014 and now things work fine under xterm and in Emacs' term buffers
6002 6015 (though not shell ones). Well, in emacs you get colors, but all
6003 6016 seem to be 'light' colors (no difference between dark and light
6004 6017 ones). But the garbage chars are gone, and also in xterms. It
6005 6018 seems that now I'm using 'cleaner' ansi sequences.
6006 6019
6007 6020 2002-02-21 Fernando Perez <fperez@colorado.edu>
6008 6021
6009 6022 * Released 0.2.7 (mainly to publish the scoping fix).
6010 6023
6011 6024 * IPython/Logger.py (Logger.logstate): added. A corresponding
6012 6025 @logstate magic was created.
6013 6026
6014 6027 * IPython/Magic.py: fixed nested scoping problem under Python
6015 6028 2.1.x (automagic wasn't working).
6016 6029
6017 6030 2002-02-20 Fernando Perez <fperez@colorado.edu>
6018 6031
6019 6032 * Released 0.2.6.
6020 6033
6021 6034 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6022 6035 option so that logs can come out without any headers at all.
6023 6036
6024 6037 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6025 6038 SciPy.
6026 6039
6027 6040 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6028 6041 that embedded IPython calls don't require vars() to be explicitly
6029 6042 passed. Now they are extracted from the caller's frame (code
6030 6043 snatched from Eric Jones' weave). Added better documentation to
6031 6044 the section on embedding and the example file.
6032 6045
6033 6046 * IPython/genutils.py (page): Changed so that under emacs, it just
6034 6047 prints the string. You can then page up and down in the emacs
6035 6048 buffer itself. This is how the builtin help() works.
6036 6049
6037 6050 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6038 6051 macro scoping: macros need to be executed in the user's namespace
6039 6052 to work as if they had been typed by the user.
6040 6053
6041 6054 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6042 6055 execute automatically (no need to type 'exec...'). They then
6043 6056 behave like 'true macros'. The printing system was also modified
6044 6057 for this to work.
6045 6058
6046 6059 2002-02-19 Fernando Perez <fperez@colorado.edu>
6047 6060
6048 6061 * IPython/genutils.py (page_file): new function for paging files
6049 6062 in an OS-independent way. Also necessary for file viewing to work
6050 6063 well inside Emacs buffers.
6051 6064 (page): Added checks for being in an emacs buffer.
6052 6065 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6053 6066 same bug in iplib.
6054 6067
6055 6068 2002-02-18 Fernando Perez <fperez@colorado.edu>
6056 6069
6057 6070 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6058 6071 of readline so that IPython can work inside an Emacs buffer.
6059 6072
6060 6073 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6061 6074 method signatures (they weren't really bugs, but it looks cleaner
6062 6075 and keeps PyChecker happy).
6063 6076
6064 6077 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6065 6078 for implementing various user-defined hooks. Currently only
6066 6079 display is done.
6067 6080
6068 6081 * IPython/Prompts.py (CachedOutput._display): changed display
6069 6082 functions so that they can be dynamically changed by users easily.
6070 6083
6071 6084 * IPython/Extensions/numeric_formats.py (num_display): added an
6072 6085 extension for printing NumPy arrays in flexible manners. It
6073 6086 doesn't do anything yet, but all the structure is in
6074 6087 place. Ultimately the plan is to implement output format control
6075 6088 like in Octave.
6076 6089
6077 6090 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6078 6091 methods are found at run-time by all the automatic machinery.
6079 6092
6080 6093 2002-02-17 Fernando Perez <fperez@colorado.edu>
6081 6094
6082 6095 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6083 6096 whole file a little.
6084 6097
6085 6098 * ToDo: closed this document. Now there's a new_design.lyx
6086 6099 document for all new ideas. Added making a pdf of it for the
6087 6100 end-user distro.
6088 6101
6089 6102 * IPython/Logger.py (Logger.switch_log): Created this to replace
6090 6103 logon() and logoff(). It also fixes a nasty crash reported by
6091 6104 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6092 6105
6093 6106 * IPython/iplib.py (complete): got auto-completion to work with
6094 6107 automagic (I had wanted this for a long time).
6095 6108
6096 6109 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6097 6110 to @file, since file() is now a builtin and clashes with automagic
6098 6111 for @file.
6099 6112
6100 6113 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6101 6114 of this was previously in iplib, which had grown to more than 2000
6102 6115 lines, way too long. No new functionality, but it makes managing
6103 6116 the code a bit easier.
6104 6117
6105 6118 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6106 6119 information to crash reports.
6107 6120
6108 6121 2002-02-12 Fernando Perez <fperez@colorado.edu>
6109 6122
6110 6123 * Released 0.2.5.
6111 6124
6112 6125 2002-02-11 Fernando Perez <fperez@colorado.edu>
6113 6126
6114 6127 * Wrote a relatively complete Windows installer. It puts
6115 6128 everything in place, creates Start Menu entries and fixes the
6116 6129 color issues. Nothing fancy, but it works.
6117 6130
6118 6131 2002-02-10 Fernando Perez <fperez@colorado.edu>
6119 6132
6120 6133 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6121 6134 os.path.expanduser() call so that we can type @run ~/myfile.py and
6122 6135 have thigs work as expected.
6123 6136
6124 6137 * IPython/genutils.py (page): fixed exception handling so things
6125 6138 work both in Unix and Windows correctly. Quitting a pager triggers
6126 6139 an IOError/broken pipe in Unix, and in windows not finding a pager
6127 6140 is also an IOError, so I had to actually look at the return value
6128 6141 of the exception, not just the exception itself. Should be ok now.
6129 6142
6130 6143 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6131 6144 modified to allow case-insensitive color scheme changes.
6132 6145
6133 6146 2002-02-09 Fernando Perez <fperez@colorado.edu>
6134 6147
6135 6148 * IPython/genutils.py (native_line_ends): new function to leave
6136 6149 user config files with os-native line-endings.
6137 6150
6138 6151 * README and manual updates.
6139 6152
6140 6153 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6141 6154 instead of StringType to catch Unicode strings.
6142 6155
6143 6156 * IPython/genutils.py (filefind): fixed bug for paths with
6144 6157 embedded spaces (very common in Windows).
6145 6158
6146 6159 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6147 6160 files under Windows, so that they get automatically associated
6148 6161 with a text editor. Windows makes it a pain to handle
6149 6162 extension-less files.
6150 6163
6151 6164 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6152 6165 warning about readline only occur for Posix. In Windows there's no
6153 6166 way to get readline, so why bother with the warning.
6154 6167
6155 6168 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6156 6169 for __str__ instead of dir(self), since dir() changed in 2.2.
6157 6170
6158 6171 * Ported to Windows! Tested on XP, I suspect it should work fine
6159 6172 on NT/2000, but I don't think it will work on 98 et al. That
6160 6173 series of Windows is such a piece of junk anyway that I won't try
6161 6174 porting it there. The XP port was straightforward, showed a few
6162 6175 bugs here and there (fixed all), in particular some string
6163 6176 handling stuff which required considering Unicode strings (which
6164 6177 Windows uses). This is good, but hasn't been too tested :) No
6165 6178 fancy installer yet, I'll put a note in the manual so people at
6166 6179 least make manually a shortcut.
6167 6180
6168 6181 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6169 6182 into a single one, "colors". This now controls both prompt and
6170 6183 exception color schemes, and can be changed both at startup
6171 6184 (either via command-line switches or via ipythonrc files) and at
6172 6185 runtime, with @colors.
6173 6186 (Magic.magic_run): renamed @prun to @run and removed the old
6174 6187 @run. The two were too similar to warrant keeping both.
6175 6188
6176 6189 2002-02-03 Fernando Perez <fperez@colorado.edu>
6177 6190
6178 6191 * IPython/iplib.py (install_first_time): Added comment on how to
6179 6192 configure the color options for first-time users. Put a <return>
6180 6193 request at the end so that small-terminal users get a chance to
6181 6194 read the startup info.
6182 6195
6183 6196 2002-01-23 Fernando Perez <fperez@colorado.edu>
6184 6197
6185 6198 * IPython/iplib.py (CachedOutput.update): Changed output memory
6186 6199 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6187 6200 input history we still use _i. Did this b/c these variable are
6188 6201 very commonly used in interactive work, so the less we need to
6189 6202 type the better off we are.
6190 6203 (Magic.magic_prun): updated @prun to better handle the namespaces
6191 6204 the file will run in, including a fix for __name__ not being set
6192 6205 before.
6193 6206
6194 6207 2002-01-20 Fernando Perez <fperez@colorado.edu>
6195 6208
6196 6209 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6197 6210 extra garbage for Python 2.2. Need to look more carefully into
6198 6211 this later.
6199 6212
6200 6213 2002-01-19 Fernando Perez <fperez@colorado.edu>
6201 6214
6202 6215 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6203 6216 display SyntaxError exceptions properly formatted when they occur
6204 6217 (they can be triggered by imported code).
6205 6218
6206 6219 2002-01-18 Fernando Perez <fperez@colorado.edu>
6207 6220
6208 6221 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6209 6222 SyntaxError exceptions are reported nicely formatted, instead of
6210 6223 spitting out only offset information as before.
6211 6224 (Magic.magic_prun): Added the @prun function for executing
6212 6225 programs with command line args inside IPython.
6213 6226
6214 6227 2002-01-16 Fernando Perez <fperez@colorado.edu>
6215 6228
6216 6229 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6217 6230 to *not* include the last item given in a range. This brings their
6218 6231 behavior in line with Python's slicing:
6219 6232 a[n1:n2] -> a[n1]...a[n2-1]
6220 6233 It may be a bit less convenient, but I prefer to stick to Python's
6221 6234 conventions *everywhere*, so users never have to wonder.
6222 6235 (Magic.magic_macro): Added @macro function to ease the creation of
6223 6236 macros.
6224 6237
6225 6238 2002-01-05 Fernando Perez <fperez@colorado.edu>
6226 6239
6227 6240 * Released 0.2.4.
6228 6241
6229 6242 * IPython/iplib.py (Magic.magic_pdef):
6230 6243 (InteractiveShell.safe_execfile): report magic lines and error
6231 6244 lines without line numbers so one can easily copy/paste them for
6232 6245 re-execution.
6233 6246
6234 6247 * Updated manual with recent changes.
6235 6248
6236 6249 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6237 6250 docstring printing when class? is called. Very handy for knowing
6238 6251 how to create class instances (as long as __init__ is well
6239 6252 documented, of course :)
6240 6253 (Magic.magic_doc): print both class and constructor docstrings.
6241 6254 (Magic.magic_pdef): give constructor info if passed a class and
6242 6255 __call__ info for callable object instances.
6243 6256
6244 6257 2002-01-04 Fernando Perez <fperez@colorado.edu>
6245 6258
6246 6259 * Made deep_reload() off by default. It doesn't always work
6247 6260 exactly as intended, so it's probably safer to have it off. It's
6248 6261 still available as dreload() anyway, so nothing is lost.
6249 6262
6250 6263 2002-01-02 Fernando Perez <fperez@colorado.edu>
6251 6264
6252 6265 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6253 6266 so I wanted an updated release).
6254 6267
6255 6268 2001-12-27 Fernando Perez <fperez@colorado.edu>
6256 6269
6257 6270 * IPython/iplib.py (InteractiveShell.interact): Added the original
6258 6271 code from 'code.py' for this module in order to change the
6259 6272 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6260 6273 the history cache would break when the user hit Ctrl-C, and
6261 6274 interact() offers no way to add any hooks to it.
6262 6275
6263 6276 2001-12-23 Fernando Perez <fperez@colorado.edu>
6264 6277
6265 6278 * setup.py: added check for 'MANIFEST' before trying to remove
6266 6279 it. Thanks to Sean Reifschneider.
6267 6280
6268 6281 2001-12-22 Fernando Perez <fperez@colorado.edu>
6269 6282
6270 6283 * Released 0.2.2.
6271 6284
6272 6285 * Finished (reasonably) writing the manual. Later will add the
6273 6286 python-standard navigation stylesheets, but for the time being
6274 6287 it's fairly complete. Distribution will include html and pdf
6275 6288 versions.
6276 6289
6277 6290 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6278 6291 (MayaVi author).
6279 6292
6280 6293 2001-12-21 Fernando Perez <fperez@colorado.edu>
6281 6294
6282 6295 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6283 6296 good public release, I think (with the manual and the distutils
6284 6297 installer). The manual can use some work, but that can go
6285 6298 slowly. Otherwise I think it's quite nice for end users. Next
6286 6299 summer, rewrite the guts of it...
6287 6300
6288 6301 * Changed format of ipythonrc files to use whitespace as the
6289 6302 separator instead of an explicit '='. Cleaner.
6290 6303
6291 6304 2001-12-20 Fernando Perez <fperez@colorado.edu>
6292 6305
6293 6306 * Started a manual in LyX. For now it's just a quick merge of the
6294 6307 various internal docstrings and READMEs. Later it may grow into a
6295 6308 nice, full-blown manual.
6296 6309
6297 6310 * Set up a distutils based installer. Installation should now be
6298 6311 trivially simple for end-users.
6299 6312
6300 6313 2001-12-11 Fernando Perez <fperez@colorado.edu>
6301 6314
6302 6315 * Released 0.2.0. First public release, announced it at
6303 6316 comp.lang.python. From now on, just bugfixes...
6304 6317
6305 6318 * Went through all the files, set copyright/license notices and
6306 6319 cleaned up things. Ready for release.
6307 6320
6308 6321 2001-12-10 Fernando Perez <fperez@colorado.edu>
6309 6322
6310 6323 * Changed the first-time installer not to use tarfiles. It's more
6311 6324 robust now and less unix-dependent. Also makes it easier for
6312 6325 people to later upgrade versions.
6313 6326
6314 6327 * Changed @exit to @abort to reflect the fact that it's pretty
6315 6328 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6316 6329 becomes significant only when IPyhton is embedded: in that case,
6317 6330 C-D closes IPython only, but @abort kills the enclosing program
6318 6331 too (unless it had called IPython inside a try catching
6319 6332 SystemExit).
6320 6333
6321 6334 * Created Shell module which exposes the actuall IPython Shell
6322 6335 classes, currently the normal and the embeddable one. This at
6323 6336 least offers a stable interface we won't need to change when
6324 6337 (later) the internals are rewritten. That rewrite will be confined
6325 6338 to iplib and ipmaker, but the Shell interface should remain as is.
6326 6339
6327 6340 * Added embed module which offers an embeddable IPShell object,
6328 6341 useful to fire up IPython *inside* a running program. Great for
6329 6342 debugging or dynamical data analysis.
6330 6343
6331 6344 2001-12-08 Fernando Perez <fperez@colorado.edu>
6332 6345
6333 6346 * Fixed small bug preventing seeing info from methods of defined
6334 6347 objects (incorrect namespace in _ofind()).
6335 6348
6336 6349 * Documentation cleanup. Moved the main usage docstrings to a
6337 6350 separate file, usage.py (cleaner to maintain, and hopefully in the
6338 6351 future some perlpod-like way of producing interactive, man and
6339 6352 html docs out of it will be found).
6340 6353
6341 6354 * Added @profile to see your profile at any time.
6342 6355
6343 6356 * Added @p as an alias for 'print'. It's especially convenient if
6344 6357 using automagic ('p x' prints x).
6345 6358
6346 6359 * Small cleanups and fixes after a pychecker run.
6347 6360
6348 6361 * Changed the @cd command to handle @cd - and @cd -<n> for
6349 6362 visiting any directory in _dh.
6350 6363
6351 6364 * Introduced _dh, a history of visited directories. @dhist prints
6352 6365 it out with numbers.
6353 6366
6354 6367 2001-12-07 Fernando Perez <fperez@colorado.edu>
6355 6368
6356 6369 * Released 0.1.22
6357 6370
6358 6371 * Made initialization a bit more robust against invalid color
6359 6372 options in user input (exit, not traceback-crash).
6360 6373
6361 6374 * Changed the bug crash reporter to write the report only in the
6362 6375 user's .ipython directory. That way IPython won't litter people's
6363 6376 hard disks with crash files all over the place. Also print on
6364 6377 screen the necessary mail command.
6365 6378
6366 6379 * With the new ultraTB, implemented LightBG color scheme for light
6367 6380 background terminals. A lot of people like white backgrounds, so I
6368 6381 guess we should at least give them something readable.
6369 6382
6370 6383 2001-12-06 Fernando Perez <fperez@colorado.edu>
6371 6384
6372 6385 * Modified the structure of ultraTB. Now there's a proper class
6373 6386 for tables of color schemes which allow adding schemes easily and
6374 6387 switching the active scheme without creating a new instance every
6375 6388 time (which was ridiculous). The syntax for creating new schemes
6376 6389 is also cleaner. I think ultraTB is finally done, with a clean
6377 6390 class structure. Names are also much cleaner (now there's proper
6378 6391 color tables, no need for every variable to also have 'color' in
6379 6392 its name).
6380 6393
6381 6394 * Broke down genutils into separate files. Now genutils only
6382 6395 contains utility functions, and classes have been moved to their
6383 6396 own files (they had enough independent functionality to warrant
6384 6397 it): ConfigLoader, OutputTrap, Struct.
6385 6398
6386 6399 2001-12-05 Fernando Perez <fperez@colorado.edu>
6387 6400
6388 6401 * IPython turns 21! Released version 0.1.21, as a candidate for
6389 6402 public consumption. If all goes well, release in a few days.
6390 6403
6391 6404 * Fixed path bug (files in Extensions/ directory wouldn't be found
6392 6405 unless IPython/ was explicitly in sys.path).
6393 6406
6394 6407 * Extended the FlexCompleter class as MagicCompleter to allow
6395 6408 completion of @-starting lines.
6396 6409
6397 6410 * Created __release__.py file as a central repository for release
6398 6411 info that other files can read from.
6399 6412
6400 6413 * Fixed small bug in logging: when logging was turned on in
6401 6414 mid-session, old lines with special meanings (!@?) were being
6402 6415 logged without the prepended comment, which is necessary since
6403 6416 they are not truly valid python syntax. This should make session
6404 6417 restores produce less errors.
6405 6418
6406 6419 * The namespace cleanup forced me to make a FlexCompleter class
6407 6420 which is nothing but a ripoff of rlcompleter, but with selectable
6408 6421 namespace (rlcompleter only works in __main__.__dict__). I'll try
6409 6422 to submit a note to the authors to see if this change can be
6410 6423 incorporated in future rlcompleter releases (Dec.6: done)
6411 6424
6412 6425 * More fixes to namespace handling. It was a mess! Now all
6413 6426 explicit references to __main__.__dict__ are gone (except when
6414 6427 really needed) and everything is handled through the namespace
6415 6428 dicts in the IPython instance. We seem to be getting somewhere
6416 6429 with this, finally...
6417 6430
6418 6431 * Small documentation updates.
6419 6432
6420 6433 * Created the Extensions directory under IPython (with an
6421 6434 __init__.py). Put the PhysicalQ stuff there. This directory should
6422 6435 be used for all special-purpose extensions.
6423 6436
6424 6437 * File renaming:
6425 6438 ipythonlib --> ipmaker
6426 6439 ipplib --> iplib
6427 6440 This makes a bit more sense in terms of what these files actually do.
6428 6441
6429 6442 * Moved all the classes and functions in ipythonlib to ipplib, so
6430 6443 now ipythonlib only has make_IPython(). This will ease up its
6431 6444 splitting in smaller functional chunks later.
6432 6445
6433 6446 * Cleaned up (done, I think) output of @whos. Better column
6434 6447 formatting, and now shows str(var) for as much as it can, which is
6435 6448 typically what one gets with a 'print var'.
6436 6449
6437 6450 2001-12-04 Fernando Perez <fperez@colorado.edu>
6438 6451
6439 6452 * Fixed namespace problems. Now builtin/IPyhton/user names get
6440 6453 properly reported in their namespace. Internal namespace handling
6441 6454 is finally getting decent (not perfect yet, but much better than
6442 6455 the ad-hoc mess we had).
6443 6456
6444 6457 * Removed -exit option. If people just want to run a python
6445 6458 script, that's what the normal interpreter is for. Less
6446 6459 unnecessary options, less chances for bugs.
6447 6460
6448 6461 * Added a crash handler which generates a complete post-mortem if
6449 6462 IPython crashes. This will help a lot in tracking bugs down the
6450 6463 road.
6451 6464
6452 6465 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6453 6466 which were boud to functions being reassigned would bypass the
6454 6467 logger, breaking the sync of _il with the prompt counter. This
6455 6468 would then crash IPython later when a new line was logged.
6456 6469
6457 6470 2001-12-02 Fernando Perez <fperez@colorado.edu>
6458 6471
6459 6472 * Made IPython a package. This means people don't have to clutter
6460 6473 their sys.path with yet another directory. Changed the INSTALL
6461 6474 file accordingly.
6462 6475
6463 6476 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6464 6477 sorts its output (so @who shows it sorted) and @whos formats the
6465 6478 table according to the width of the first column. Nicer, easier to
6466 6479 read. Todo: write a generic table_format() which takes a list of
6467 6480 lists and prints it nicely formatted, with optional row/column
6468 6481 separators and proper padding and justification.
6469 6482
6470 6483 * Released 0.1.20
6471 6484
6472 6485 * Fixed bug in @log which would reverse the inputcache list (a
6473 6486 copy operation was missing).
6474 6487
6475 6488 * Code cleanup. @config was changed to use page(). Better, since
6476 6489 its output is always quite long.
6477 6490
6478 6491 * Itpl is back as a dependency. I was having too many problems
6479 6492 getting the parametric aliases to work reliably, and it's just
6480 6493 easier to code weird string operations with it than playing %()s
6481 6494 games. It's only ~6k, so I don't think it's too big a deal.
6482 6495
6483 6496 * Found (and fixed) a very nasty bug with history. !lines weren't
6484 6497 getting cached, and the out of sync caches would crash
6485 6498 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6486 6499 division of labor a bit better. Bug fixed, cleaner structure.
6487 6500
6488 6501 2001-12-01 Fernando Perez <fperez@colorado.edu>
6489 6502
6490 6503 * Released 0.1.19
6491 6504
6492 6505 * Added option -n to @hist to prevent line number printing. Much
6493 6506 easier to copy/paste code this way.
6494 6507
6495 6508 * Created global _il to hold the input list. Allows easy
6496 6509 re-execution of blocks of code by slicing it (inspired by Janko's
6497 6510 comment on 'macros').
6498 6511
6499 6512 * Small fixes and doc updates.
6500 6513
6501 6514 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6502 6515 much too fragile with automagic. Handles properly multi-line
6503 6516 statements and takes parameters.
6504 6517
6505 6518 2001-11-30 Fernando Perez <fperez@colorado.edu>
6506 6519
6507 6520 * Version 0.1.18 released.
6508 6521
6509 6522 * Fixed nasty namespace bug in initial module imports.
6510 6523
6511 6524 * Added copyright/license notes to all code files (except
6512 6525 DPyGetOpt). For the time being, LGPL. That could change.
6513 6526
6514 6527 * Rewrote a much nicer README, updated INSTALL, cleaned up
6515 6528 ipythonrc-* samples.
6516 6529
6517 6530 * Overall code/documentation cleanup. Basically ready for
6518 6531 release. Only remaining thing: licence decision (LGPL?).
6519 6532
6520 6533 * Converted load_config to a class, ConfigLoader. Now recursion
6521 6534 control is better organized. Doesn't include the same file twice.
6522 6535
6523 6536 2001-11-29 Fernando Perez <fperez@colorado.edu>
6524 6537
6525 6538 * Got input history working. Changed output history variables from
6526 6539 _p to _o so that _i is for input and _o for output. Just cleaner
6527 6540 convention.
6528 6541
6529 6542 * Implemented parametric aliases. This pretty much allows the
6530 6543 alias system to offer full-blown shell convenience, I think.
6531 6544
6532 6545 * Version 0.1.17 released, 0.1.18 opened.
6533 6546
6534 6547 * dot_ipython/ipythonrc (alias): added documentation.
6535 6548 (xcolor): Fixed small bug (xcolors -> xcolor)
6536 6549
6537 6550 * Changed the alias system. Now alias is a magic command to define
6538 6551 aliases just like the shell. Rationale: the builtin magics should
6539 6552 be there for things deeply connected to IPython's
6540 6553 architecture. And this is a much lighter system for what I think
6541 6554 is the really important feature: allowing users to define quickly
6542 6555 magics that will do shell things for them, so they can customize
6543 6556 IPython easily to match their work habits. If someone is really
6544 6557 desperate to have another name for a builtin alias, they can
6545 6558 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6546 6559 works.
6547 6560
6548 6561 2001-11-28 Fernando Perez <fperez@colorado.edu>
6549 6562
6550 6563 * Changed @file so that it opens the source file at the proper
6551 6564 line. Since it uses less, if your EDITOR environment is
6552 6565 configured, typing v will immediately open your editor of choice
6553 6566 right at the line where the object is defined. Not as quick as
6554 6567 having a direct @edit command, but for all intents and purposes it
6555 6568 works. And I don't have to worry about writing @edit to deal with
6556 6569 all the editors, less does that.
6557 6570
6558 6571 * Version 0.1.16 released, 0.1.17 opened.
6559 6572
6560 6573 * Fixed some nasty bugs in the page/page_dumb combo that could
6561 6574 crash IPython.
6562 6575
6563 6576 2001-11-27 Fernando Perez <fperez@colorado.edu>
6564 6577
6565 6578 * Version 0.1.15 released, 0.1.16 opened.
6566 6579
6567 6580 * Finally got ? and ?? to work for undefined things: now it's
6568 6581 possible to type {}.get? and get information about the get method
6569 6582 of dicts, or os.path? even if only os is defined (so technically
6570 6583 os.path isn't). Works at any level. For example, after import os,
6571 6584 os?, os.path?, os.path.abspath? all work. This is great, took some
6572 6585 work in _ofind.
6573 6586
6574 6587 * Fixed more bugs with logging. The sanest way to do it was to add
6575 6588 to @log a 'mode' parameter. Killed two in one shot (this mode
6576 6589 option was a request of Janko's). I think it's finally clean
6577 6590 (famous last words).
6578 6591
6579 6592 * Added a page_dumb() pager which does a decent job of paging on
6580 6593 screen, if better things (like less) aren't available. One less
6581 6594 unix dependency (someday maybe somebody will port this to
6582 6595 windows).
6583 6596
6584 6597 * Fixed problem in magic_log: would lock of logging out if log
6585 6598 creation failed (because it would still think it had succeeded).
6586 6599
6587 6600 * Improved the page() function using curses to auto-detect screen
6588 6601 size. Now it can make a much better decision on whether to print
6589 6602 or page a string. Option screen_length was modified: a value 0
6590 6603 means auto-detect, and that's the default now.
6591 6604
6592 6605 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6593 6606 go out. I'll test it for a few days, then talk to Janko about
6594 6607 licences and announce it.
6595 6608
6596 6609 * Fixed the length of the auto-generated ---> prompt which appears
6597 6610 for auto-parens and auto-quotes. Getting this right isn't trivial,
6598 6611 with all the color escapes, different prompt types and optional
6599 6612 separators. But it seems to be working in all the combinations.
6600 6613
6601 6614 2001-11-26 Fernando Perez <fperez@colorado.edu>
6602 6615
6603 6616 * Wrote a regexp filter to get option types from the option names
6604 6617 string. This eliminates the need to manually keep two duplicate
6605 6618 lists.
6606 6619
6607 6620 * Removed the unneeded check_option_names. Now options are handled
6608 6621 in a much saner manner and it's easy to visually check that things
6609 6622 are ok.
6610 6623
6611 6624 * Updated version numbers on all files I modified to carry a
6612 6625 notice so Janko and Nathan have clear version markers.
6613 6626
6614 6627 * Updated docstring for ultraTB with my changes. I should send
6615 6628 this to Nathan.
6616 6629
6617 6630 * Lots of small fixes. Ran everything through pychecker again.
6618 6631
6619 6632 * Made loading of deep_reload an cmd line option. If it's not too
6620 6633 kosher, now people can just disable it. With -nodeep_reload it's
6621 6634 still available as dreload(), it just won't overwrite reload().
6622 6635
6623 6636 * Moved many options to the no| form (-opt and -noopt
6624 6637 accepted). Cleaner.
6625 6638
6626 6639 * Changed magic_log so that if called with no parameters, it uses
6627 6640 'rotate' mode. That way auto-generated logs aren't automatically
6628 6641 over-written. For normal logs, now a backup is made if it exists
6629 6642 (only 1 level of backups). A new 'backup' mode was added to the
6630 6643 Logger class to support this. This was a request by Janko.
6631 6644
6632 6645 * Added @logoff/@logon to stop/restart an active log.
6633 6646
6634 6647 * Fixed a lot of bugs in log saving/replay. It was pretty
6635 6648 broken. Now special lines (!@,/) appear properly in the command
6636 6649 history after a log replay.
6637 6650
6638 6651 * Tried and failed to implement full session saving via pickle. My
6639 6652 idea was to pickle __main__.__dict__, but modules can't be
6640 6653 pickled. This would be a better alternative to replaying logs, but
6641 6654 seems quite tricky to get to work. Changed -session to be called
6642 6655 -logplay, which more accurately reflects what it does. And if we
6643 6656 ever get real session saving working, -session is now available.
6644 6657
6645 6658 * Implemented color schemes for prompts also. As for tracebacks,
6646 6659 currently only NoColor and Linux are supported. But now the
6647 6660 infrastructure is in place, based on a generic ColorScheme
6648 6661 class. So writing and activating new schemes both for the prompts
6649 6662 and the tracebacks should be straightforward.
6650 6663
6651 6664 * Version 0.1.13 released, 0.1.14 opened.
6652 6665
6653 6666 * Changed handling of options for output cache. Now counter is
6654 6667 hardwired starting at 1 and one specifies the maximum number of
6655 6668 entries *in the outcache* (not the max prompt counter). This is
6656 6669 much better, since many statements won't increase the cache
6657 6670 count. It also eliminated some confusing options, now there's only
6658 6671 one: cache_size.
6659 6672
6660 6673 * Added 'alias' magic function and magic_alias option in the
6661 6674 ipythonrc file. Now the user can easily define whatever names he
6662 6675 wants for the magic functions without having to play weird
6663 6676 namespace games. This gives IPython a real shell-like feel.
6664 6677
6665 6678 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6666 6679 @ or not).
6667 6680
6668 6681 This was one of the last remaining 'visible' bugs (that I know
6669 6682 of). I think if I can clean up the session loading so it works
6670 6683 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6671 6684 about licensing).
6672 6685
6673 6686 2001-11-25 Fernando Perez <fperez@colorado.edu>
6674 6687
6675 6688 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6676 6689 there's a cleaner distinction between what ? and ?? show.
6677 6690
6678 6691 * Added screen_length option. Now the user can define his own
6679 6692 screen size for page() operations.
6680 6693
6681 6694 * Implemented magic shell-like functions with automatic code
6682 6695 generation. Now adding another function is just a matter of adding
6683 6696 an entry to a dict, and the function is dynamically generated at
6684 6697 run-time. Python has some really cool features!
6685 6698
6686 6699 * Renamed many options to cleanup conventions a little. Now all
6687 6700 are lowercase, and only underscores where needed. Also in the code
6688 6701 option name tables are clearer.
6689 6702
6690 6703 * Changed prompts a little. Now input is 'In [n]:' instead of
6691 6704 'In[n]:='. This allows it the numbers to be aligned with the
6692 6705 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6693 6706 Python (it was a Mathematica thing). The '...' continuation prompt
6694 6707 was also changed a little to align better.
6695 6708
6696 6709 * Fixed bug when flushing output cache. Not all _p<n> variables
6697 6710 exist, so their deletion needs to be wrapped in a try:
6698 6711
6699 6712 * Figured out how to properly use inspect.formatargspec() (it
6700 6713 requires the args preceded by *). So I removed all the code from
6701 6714 _get_pdef in Magic, which was just replicating that.
6702 6715
6703 6716 * Added test to prefilter to allow redefining magic function names
6704 6717 as variables. This is ok, since the @ form is always available,
6705 6718 but whe should allow the user to define a variable called 'ls' if
6706 6719 he needs it.
6707 6720
6708 6721 * Moved the ToDo information from README into a separate ToDo.
6709 6722
6710 6723 * General code cleanup and small bugfixes. I think it's close to a
6711 6724 state where it can be released, obviously with a big 'beta'
6712 6725 warning on it.
6713 6726
6714 6727 * Got the magic function split to work. Now all magics are defined
6715 6728 in a separate class. It just organizes things a bit, and now
6716 6729 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6717 6730 was too long).
6718 6731
6719 6732 * Changed @clear to @reset to avoid potential confusions with
6720 6733 the shell command clear. Also renamed @cl to @clear, which does
6721 6734 exactly what people expect it to from their shell experience.
6722 6735
6723 6736 Added a check to the @reset command (since it's so
6724 6737 destructive, it's probably a good idea to ask for confirmation).
6725 6738 But now reset only works for full namespace resetting. Since the
6726 6739 del keyword is already there for deleting a few specific
6727 6740 variables, I don't see the point of having a redundant magic
6728 6741 function for the same task.
6729 6742
6730 6743 2001-11-24 Fernando Perez <fperez@colorado.edu>
6731 6744
6732 6745 * Updated the builtin docs (esp. the ? ones).
6733 6746
6734 6747 * Ran all the code through pychecker. Not terribly impressed with
6735 6748 it: lots of spurious warnings and didn't really find anything of
6736 6749 substance (just a few modules being imported and not used).
6737 6750
6738 6751 * Implemented the new ultraTB functionality into IPython. New
6739 6752 option: xcolors. This chooses color scheme. xmode now only selects
6740 6753 between Plain and Verbose. Better orthogonality.
6741 6754
6742 6755 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6743 6756 mode and color scheme for the exception handlers. Now it's
6744 6757 possible to have the verbose traceback with no coloring.
6745 6758
6746 6759 2001-11-23 Fernando Perez <fperez@colorado.edu>
6747 6760
6748 6761 * Version 0.1.12 released, 0.1.13 opened.
6749 6762
6750 6763 * Removed option to set auto-quote and auto-paren escapes by
6751 6764 user. The chances of breaking valid syntax are just too high. If
6752 6765 someone *really* wants, they can always dig into the code.
6753 6766
6754 6767 * Made prompt separators configurable.
6755 6768
6756 6769 2001-11-22 Fernando Perez <fperez@colorado.edu>
6757 6770
6758 6771 * Small bugfixes in many places.
6759 6772
6760 6773 * Removed the MyCompleter class from ipplib. It seemed redundant
6761 6774 with the C-p,C-n history search functionality. Less code to
6762 6775 maintain.
6763 6776
6764 6777 * Moved all the original ipython.py code into ipythonlib.py. Right
6765 6778 now it's just one big dump into a function called make_IPython, so
6766 6779 no real modularity has been gained. But at least it makes the
6767 6780 wrapper script tiny, and since ipythonlib is a module, it gets
6768 6781 compiled and startup is much faster.
6769 6782
6770 6783 This is a reasobably 'deep' change, so we should test it for a
6771 6784 while without messing too much more with the code.
6772 6785
6773 6786 2001-11-21 Fernando Perez <fperez@colorado.edu>
6774 6787
6775 6788 * Version 0.1.11 released, 0.1.12 opened for further work.
6776 6789
6777 6790 * Removed dependency on Itpl. It was only needed in one place. It
6778 6791 would be nice if this became part of python, though. It makes life
6779 6792 *a lot* easier in some cases.
6780 6793
6781 6794 * Simplified the prefilter code a bit. Now all handlers are
6782 6795 expected to explicitly return a value (at least a blank string).
6783 6796
6784 6797 * Heavy edits in ipplib. Removed the help system altogether. Now
6785 6798 obj?/?? is used for inspecting objects, a magic @doc prints
6786 6799 docstrings, and full-blown Python help is accessed via the 'help'
6787 6800 keyword. This cleans up a lot of code (less to maintain) and does
6788 6801 the job. Since 'help' is now a standard Python component, might as
6789 6802 well use it and remove duplicate functionality.
6790 6803
6791 6804 Also removed the option to use ipplib as a standalone program. By
6792 6805 now it's too dependent on other parts of IPython to function alone.
6793 6806
6794 6807 * Fixed bug in genutils.pager. It would crash if the pager was
6795 6808 exited immediately after opening (broken pipe).
6796 6809
6797 6810 * Trimmed down the VerboseTB reporting a little. The header is
6798 6811 much shorter now and the repeated exception arguments at the end
6799 6812 have been removed. For interactive use the old header seemed a bit
6800 6813 excessive.
6801 6814
6802 6815 * Fixed small bug in output of @whos for variables with multi-word
6803 6816 types (only first word was displayed).
6804 6817
6805 6818 2001-11-17 Fernando Perez <fperez@colorado.edu>
6806 6819
6807 6820 * Version 0.1.10 released, 0.1.11 opened for further work.
6808 6821
6809 6822 * Modified dirs and friends. dirs now *returns* the stack (not
6810 6823 prints), so one can manipulate it as a variable. Convenient to
6811 6824 travel along many directories.
6812 6825
6813 6826 * Fixed bug in magic_pdef: would only work with functions with
6814 6827 arguments with default values.
6815 6828
6816 6829 2001-11-14 Fernando Perez <fperez@colorado.edu>
6817 6830
6818 6831 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6819 6832 example with IPython. Various other minor fixes and cleanups.
6820 6833
6821 6834 * Version 0.1.9 released, 0.1.10 opened for further work.
6822 6835
6823 6836 * Added sys.path to the list of directories searched in the
6824 6837 execfile= option. It used to be the current directory and the
6825 6838 user's IPYTHONDIR only.
6826 6839
6827 6840 2001-11-13 Fernando Perez <fperez@colorado.edu>
6828 6841
6829 6842 * Reinstated the raw_input/prefilter separation that Janko had
6830 6843 initially. This gives a more convenient setup for extending the
6831 6844 pre-processor from the outside: raw_input always gets a string,
6832 6845 and prefilter has to process it. We can then redefine prefilter
6833 6846 from the outside and implement extensions for special
6834 6847 purposes.
6835 6848
6836 6849 Today I got one for inputting PhysicalQuantity objects
6837 6850 (from Scientific) without needing any function calls at
6838 6851 all. Extremely convenient, and it's all done as a user-level
6839 6852 extension (no IPython code was touched). Now instead of:
6840 6853 a = PhysicalQuantity(4.2,'m/s**2')
6841 6854 one can simply say
6842 6855 a = 4.2 m/s**2
6843 6856 or even
6844 6857 a = 4.2 m/s^2
6845 6858
6846 6859 I use this, but it's also a proof of concept: IPython really is
6847 6860 fully user-extensible, even at the level of the parsing of the
6848 6861 command line. It's not trivial, but it's perfectly doable.
6849 6862
6850 6863 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6851 6864 the problem of modules being loaded in the inverse order in which
6852 6865 they were defined in
6853 6866
6854 6867 * Version 0.1.8 released, 0.1.9 opened for further work.
6855 6868
6856 6869 * Added magics pdef, source and file. They respectively show the
6857 6870 definition line ('prototype' in C), source code and full python
6858 6871 file for any callable object. The object inspector oinfo uses
6859 6872 these to show the same information.
6860 6873
6861 6874 * Version 0.1.7 released, 0.1.8 opened for further work.
6862 6875
6863 6876 * Separated all the magic functions into a class called Magic. The
6864 6877 InteractiveShell class was becoming too big for Xemacs to handle
6865 6878 (de-indenting a line would lock it up for 10 seconds while it
6866 6879 backtracked on the whole class!)
6867 6880
6868 6881 FIXME: didn't work. It can be done, but right now namespaces are
6869 6882 all messed up. Do it later (reverted it for now, so at least
6870 6883 everything works as before).
6871 6884
6872 6885 * Got the object introspection system (magic_oinfo) working! I
6873 6886 think this is pretty much ready for release to Janko, so he can
6874 6887 test it for a while and then announce it. Pretty much 100% of what
6875 6888 I wanted for the 'phase 1' release is ready. Happy, tired.
6876 6889
6877 6890 2001-11-12 Fernando Perez <fperez@colorado.edu>
6878 6891
6879 6892 * Version 0.1.6 released, 0.1.7 opened for further work.
6880 6893
6881 6894 * Fixed bug in printing: it used to test for truth before
6882 6895 printing, so 0 wouldn't print. Now checks for None.
6883 6896
6884 6897 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6885 6898 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6886 6899 reaches by hand into the outputcache. Think of a better way to do
6887 6900 this later.
6888 6901
6889 6902 * Various small fixes thanks to Nathan's comments.
6890 6903
6891 6904 * Changed magic_pprint to magic_Pprint. This way it doesn't
6892 6905 collide with pprint() and the name is consistent with the command
6893 6906 line option.
6894 6907
6895 6908 * Changed prompt counter behavior to be fully like
6896 6909 Mathematica's. That is, even input that doesn't return a result
6897 6910 raises the prompt counter. The old behavior was kind of confusing
6898 6911 (getting the same prompt number several times if the operation
6899 6912 didn't return a result).
6900 6913
6901 6914 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6902 6915
6903 6916 * Fixed -Classic mode (wasn't working anymore).
6904 6917
6905 6918 * Added colored prompts using Nathan's new code. Colors are
6906 6919 currently hardwired, they can be user-configurable. For
6907 6920 developers, they can be chosen in file ipythonlib.py, at the
6908 6921 beginning of the CachedOutput class def.
6909 6922
6910 6923 2001-11-11 Fernando Perez <fperez@colorado.edu>
6911 6924
6912 6925 * Version 0.1.5 released, 0.1.6 opened for further work.
6913 6926
6914 6927 * Changed magic_env to *return* the environment as a dict (not to
6915 6928 print it). This way it prints, but it can also be processed.
6916 6929
6917 6930 * Added Verbose exception reporting to interactive
6918 6931 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6919 6932 traceback. Had to make some changes to the ultraTB file. This is
6920 6933 probably the last 'big' thing in my mental todo list. This ties
6921 6934 in with the next entry:
6922 6935
6923 6936 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6924 6937 has to specify is Plain, Color or Verbose for all exception
6925 6938 handling.
6926 6939
6927 6940 * Removed ShellServices option. All this can really be done via
6928 6941 the magic system. It's easier to extend, cleaner and has automatic
6929 6942 namespace protection and documentation.
6930 6943
6931 6944 2001-11-09 Fernando Perez <fperez@colorado.edu>
6932 6945
6933 6946 * Fixed bug in output cache flushing (missing parameter to
6934 6947 __init__). Other small bugs fixed (found using pychecker).
6935 6948
6936 6949 * Version 0.1.4 opened for bugfixing.
6937 6950
6938 6951 2001-11-07 Fernando Perez <fperez@colorado.edu>
6939 6952
6940 6953 * Version 0.1.3 released, mainly because of the raw_input bug.
6941 6954
6942 6955 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6943 6956 and when testing for whether things were callable, a call could
6944 6957 actually be made to certain functions. They would get called again
6945 6958 once 'really' executed, with a resulting double call. A disaster
6946 6959 in many cases (list.reverse() would never work!).
6947 6960
6948 6961 * Removed prefilter() function, moved its code to raw_input (which
6949 6962 after all was just a near-empty caller for prefilter). This saves
6950 6963 a function call on every prompt, and simplifies the class a tiny bit.
6951 6964
6952 6965 * Fix _ip to __ip name in magic example file.
6953 6966
6954 6967 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6955 6968 work with non-gnu versions of tar.
6956 6969
6957 6970 2001-11-06 Fernando Perez <fperez@colorado.edu>
6958 6971
6959 6972 * Version 0.1.2. Just to keep track of the recent changes.
6960 6973
6961 6974 * Fixed nasty bug in output prompt routine. It used to check 'if
6962 6975 arg != None...'. Problem is, this fails if arg implements a
6963 6976 special comparison (__cmp__) which disallows comparing to
6964 6977 None. Found it when trying to use the PhysicalQuantity module from
6965 6978 ScientificPython.
6966 6979
6967 6980 2001-11-05 Fernando Perez <fperez@colorado.edu>
6968 6981
6969 6982 * Also added dirs. Now the pushd/popd/dirs family functions
6970 6983 basically like the shell, with the added convenience of going home
6971 6984 when called with no args.
6972 6985
6973 6986 * pushd/popd slightly modified to mimic shell behavior more
6974 6987 closely.
6975 6988
6976 6989 * Added env,pushd,popd from ShellServices as magic functions. I
6977 6990 think the cleanest will be to port all desired functions from
6978 6991 ShellServices as magics and remove ShellServices altogether. This
6979 6992 will provide a single, clean way of adding functionality
6980 6993 (shell-type or otherwise) to IP.
6981 6994
6982 6995 2001-11-04 Fernando Perez <fperez@colorado.edu>
6983 6996
6984 6997 * Added .ipython/ directory to sys.path. This way users can keep
6985 6998 customizations there and access them via import.
6986 6999
6987 7000 2001-11-03 Fernando Perez <fperez@colorado.edu>
6988 7001
6989 7002 * Opened version 0.1.1 for new changes.
6990 7003
6991 7004 * Changed version number to 0.1.0: first 'public' release, sent to
6992 7005 Nathan and Janko.
6993 7006
6994 7007 * Lots of small fixes and tweaks.
6995 7008
6996 7009 * Minor changes to whos format. Now strings are shown, snipped if
6997 7010 too long.
6998 7011
6999 7012 * Changed ShellServices to work on __main__ so they show up in @who
7000 7013
7001 7014 * Help also works with ? at the end of a line:
7002 7015 ?sin and sin?
7003 7016 both produce the same effect. This is nice, as often I use the
7004 7017 tab-complete to find the name of a method, but I used to then have
7005 7018 to go to the beginning of the line to put a ? if I wanted more
7006 7019 info. Now I can just add the ? and hit return. Convenient.
7007 7020
7008 7021 2001-11-02 Fernando Perez <fperez@colorado.edu>
7009 7022
7010 7023 * Python version check (>=2.1) added.
7011 7024
7012 7025 * Added LazyPython documentation. At this point the docs are quite
7013 7026 a mess. A cleanup is in order.
7014 7027
7015 7028 * Auto-installer created. For some bizarre reason, the zipfiles
7016 7029 module isn't working on my system. So I made a tar version
7017 7030 (hopefully the command line options in various systems won't kill
7018 7031 me).
7019 7032
7020 7033 * Fixes to Struct in genutils. Now all dictionary-like methods are
7021 7034 protected (reasonably).
7022 7035
7023 7036 * Added pager function to genutils and changed ? to print usage
7024 7037 note through it (it was too long).
7025 7038
7026 7039 * Added the LazyPython functionality. Works great! I changed the
7027 7040 auto-quote escape to ';', it's on home row and next to '. But
7028 7041 both auto-quote and auto-paren (still /) escapes are command-line
7029 7042 parameters.
7030 7043
7031 7044
7032 7045 2001-11-01 Fernando Perez <fperez@colorado.edu>
7033 7046
7034 7047 * Version changed to 0.0.7. Fairly large change: configuration now
7035 7048 is all stored in a directory, by default .ipython. There, all
7036 7049 config files have normal looking names (not .names)
7037 7050
7038 7051 * Version 0.0.6 Released first to Lucas and Archie as a test
7039 7052 run. Since it's the first 'semi-public' release, change version to
7040 7053 > 0.0.6 for any changes now.
7041 7054
7042 7055 * Stuff I had put in the ipplib.py changelog:
7043 7056
7044 7057 Changes to InteractiveShell:
7045 7058
7046 7059 - Made the usage message a parameter.
7047 7060
7048 7061 - Require the name of the shell variable to be given. It's a bit
7049 7062 of a hack, but allows the name 'shell' not to be hardwired in the
7050 7063 magic (@) handler, which is problematic b/c it requires
7051 7064 polluting the global namespace with 'shell'. This in turn is
7052 7065 fragile: if a user redefines a variable called shell, things
7053 7066 break.
7054 7067
7055 7068 - magic @: all functions available through @ need to be defined
7056 7069 as magic_<name>, even though they can be called simply as
7057 7070 @<name>. This allows the special command @magic to gather
7058 7071 information automatically about all existing magic functions,
7059 7072 even if they are run-time user extensions, by parsing the shell
7060 7073 instance __dict__ looking for special magic_ names.
7061 7074
7062 7075 - mainloop: added *two* local namespace parameters. This allows
7063 7076 the class to differentiate between parameters which were there
7064 7077 before and after command line initialization was processed. This
7065 7078 way, later @who can show things loaded at startup by the
7066 7079 user. This trick was necessary to make session saving/reloading
7067 7080 really work: ideally after saving/exiting/reloading a session,
7068 7081 *everything* should look the same, including the output of @who. I
7069 7082 was only able to make this work with this double namespace
7070 7083 trick.
7071 7084
7072 7085 - added a header to the logfile which allows (almost) full
7073 7086 session restoring.
7074 7087
7075 7088 - prepend lines beginning with @ or !, with a and log
7076 7089 them. Why? !lines: may be useful to know what you did @lines:
7077 7090 they may affect session state. So when restoring a session, at
7078 7091 least inform the user of their presence. I couldn't quite get
7079 7092 them to properly re-execute, but at least the user is warned.
7080 7093
7081 7094 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now