##// 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 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """
2 """
3 IPython -- An enhanced Interactive Python
3 IPython -- An enhanced Interactive Python
4
4
5 Requires Python 2.3 or newer.
5 Requires Python 2.3 or newer.
6
6
7 This file contains all the classes and helper functions specific to IPython.
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 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
13 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
14 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
14 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
15 #
15 #
16 # Distributed under the terms of the BSD License. The full license is in
16 # Distributed under the terms of the BSD License. The full license is in
17 # the file COPYING, distributed as part of this software.
17 # the file COPYING, distributed as part of this software.
18 #
18 #
19 # Note: this code originally subclassed code.InteractiveConsole from the
19 # Note: this code originally subclassed code.InteractiveConsole from the
20 # Python standard library. Over time, all of that class has been copied
20 # Python standard library. Over time, all of that class has been copied
21 # verbatim here for modifications which could not be accomplished by
21 # verbatim here for modifications which could not be accomplished by
22 # subclassing. At this point, there are no dependencies at all on the code
22 # subclassing. At this point, there are no dependencies at all on the code
23 # module anymore (it is not even imported). The Python License (sec. 2)
23 # module anymore (it is not even imported). The Python License (sec. 2)
24 # allows for this, but it's always nice to acknowledge credit where credit is
24 # allows for this, but it's always nice to acknowledge credit where credit is
25 # due.
25 # due.
26 #*****************************************************************************
26 #*****************************************************************************
27
27
28 #****************************************************************************
28 #****************************************************************************
29 # Modules and globals
29 # Modules and globals
30
30
31 from IPython import Release
31 from IPython import Release
32 __author__ = '%s <%s>\n%s <%s>' % \
32 __author__ = '%s <%s>\n%s <%s>' % \
33 ( Release.authors['Janko'] + Release.authors['Fernando'] )
33 ( Release.authors['Janko'] + Release.authors['Fernando'] )
34 __license__ = Release.license
34 __license__ = Release.license
35 __version__ = Release.version
35 __version__ = Release.version
36
36
37 # Python standard modules
37 # Python standard modules
38 import __main__
38 import __main__
39 import __builtin__
39 import __builtin__
40 import StringIO
40 import StringIO
41 import bdb
41 import bdb
42 import cPickle as pickle
42 import cPickle as pickle
43 import codeop
43 import codeop
44 import doctest
44 import doctest
45 import exceptions
45 import exceptions
46 import glob
46 import glob
47 import inspect
47 import inspect
48 import keyword
48 import keyword
49 import new
49 import new
50 import os
50 import os
51 import pydoc
51 import pydoc
52 import re
52 import re
53 import shutil
53 import shutil
54 import string
54 import string
55 import sys
55 import sys
56 import tempfile
56 import tempfile
57 import traceback
57 import traceback
58 import types
58 import types
59 import pickleshare
59 import pickleshare
60 from sets import Set
60 from sets import Set
61 from pprint import pprint, pformat
61 from pprint import pprint, pformat
62
62
63 # IPython's own modules
63 # IPython's own modules
64 #import IPython
64 #import IPython
65 from IPython import Debugger,OInspect,PyColorize,ultraTB
65 from IPython import Debugger,OInspect,PyColorize,ultraTB
66 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
66 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
67 from IPython.FakeModule import FakeModule
67 from IPython.FakeModule import FakeModule
68 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
68 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
69 from IPython.Logger import Logger
69 from IPython.Logger import Logger
70 from IPython.Magic import Magic
70 from IPython.Magic import Magic
71 from IPython.Prompts import CachedOutput
71 from IPython.Prompts import CachedOutput
72 from IPython.ipstruct import Struct
72 from IPython.ipstruct import Struct
73 from IPython.background_jobs import BackgroundJobManager
73 from IPython.background_jobs import BackgroundJobManager
74 from IPython.usage import cmd_line_usage,interactive_usage
74 from IPython.usage import cmd_line_usage,interactive_usage
75 from IPython.genutils import *
75 from IPython.genutils import *
76 from IPython.strdispatch import StrDispatch
76 from IPython.strdispatch import StrDispatch
77 import IPython.ipapi
77 import IPython.ipapi
78 import IPython.history
78 import IPython.history
79 import IPython.prefilter as prefilter
79 import IPython.prefilter as prefilter
80 import IPython.shadowns
80 import IPython.shadowns
81 # Globals
81 # Globals
82
82
83 # store the builtin raw_input globally, and use this always, in case user code
83 # store the builtin raw_input globally, and use this always, in case user code
84 # overwrites it (like wx.py.PyShell does)
84 # overwrites it (like wx.py.PyShell does)
85 raw_input_original = raw_input
85 raw_input_original = raw_input
86
86
87 # compiled regexps for autoindent management
87 # compiled regexps for autoindent management
88 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
88 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
89
89
90
90
91 #****************************************************************************
91 #****************************************************************************
92 # Some utility function definitions
92 # Some utility function definitions
93
93
94 ini_spaces_re = re.compile(r'^(\s+)')
94 ini_spaces_re = re.compile(r'^(\s+)')
95
95
96 def num_ini_spaces(strng):
96 def num_ini_spaces(strng):
97 """Return the number of initial spaces in a string"""
97 """Return the number of initial spaces in a string"""
98
98
99 ini_spaces = ini_spaces_re.match(strng)
99 ini_spaces = ini_spaces_re.match(strng)
100 if ini_spaces:
100 if ini_spaces:
101 return ini_spaces.end()
101 return ini_spaces.end()
102 else:
102 else:
103 return 0
103 return 0
104
104
105 def softspace(file, newvalue):
105 def softspace(file, newvalue):
106 """Copied from code.py, to remove the dependency"""
106 """Copied from code.py, to remove the dependency"""
107
107
108 oldvalue = 0
108 oldvalue = 0
109 try:
109 try:
110 oldvalue = file.softspace
110 oldvalue = file.softspace
111 except AttributeError:
111 except AttributeError:
112 pass
112 pass
113 try:
113 try:
114 file.softspace = newvalue
114 file.softspace = newvalue
115 except (AttributeError, TypeError):
115 except (AttributeError, TypeError):
116 # "attribute-less object" or "read-only attributes"
116 # "attribute-less object" or "read-only attributes"
117 pass
117 pass
118 return oldvalue
118 return oldvalue
119
119
120
120
121 #****************************************************************************
121 #****************************************************************************
122 # Local use exceptions
122 # Local use exceptions
123 class SpaceInInput(exceptions.Exception): pass
123 class SpaceInInput(exceptions.Exception): pass
124
124
125
125
126 #****************************************************************************
126 #****************************************************************************
127 # Local use classes
127 # Local use classes
128 class Bunch: pass
128 class Bunch: pass
129
129
130 class Undefined: pass
130 class Undefined: pass
131
131
132 class Quitter(object):
132 class Quitter(object):
133 """Simple class to handle exit, similar to Python 2.5's.
133 """Simple class to handle exit, similar to Python 2.5's.
134
134
135 It handles exiting in an ipython-safe manner, which the one in Python 2.5
135 It handles exiting in an ipython-safe manner, which the one in Python 2.5
136 doesn't do (obviously, since it doesn't know about ipython)."""
136 doesn't do (obviously, since it doesn't know about ipython)."""
137
137
138 def __init__(self,shell,name):
138 def __init__(self,shell,name):
139 self.shell = shell
139 self.shell = shell
140 self.name = name
140 self.name = name
141
141
142 def __repr__(self):
142 def __repr__(self):
143 return 'Type %s() to exit.' % self.name
143 return 'Type %s() to exit.' % self.name
144 __str__ = __repr__
144 __str__ = __repr__
145
145
146 def __call__(self):
146 def __call__(self):
147 self.shell.exit()
147 self.shell.exit()
148
148
149 class InputList(list):
149 class InputList(list):
150 """Class to store user input.
150 """Class to store user input.
151
151
152 It's basically a list, but slices return a string instead of a list, thus
152 It's basically a list, but slices return a string instead of a list, thus
153 allowing things like (assuming 'In' is an instance):
153 allowing things like (assuming 'In' is an instance):
154
154
155 exec In[4:7]
155 exec In[4:7]
156
156
157 or
157 or
158
158
159 exec In[5:9] + In[14] + In[21:25]"""
159 exec In[5:9] + In[14] + In[21:25]"""
160
160
161 def __getslice__(self,i,j):
161 def __getslice__(self,i,j):
162 return ''.join(list.__getslice__(self,i,j))
162 return ''.join(list.__getslice__(self,i,j))
163
163
164 class SyntaxTB(ultraTB.ListTB):
164 class SyntaxTB(ultraTB.ListTB):
165 """Extension which holds some state: the last exception value"""
165 """Extension which holds some state: the last exception value"""
166
166
167 def __init__(self,color_scheme = 'NoColor'):
167 def __init__(self,color_scheme = 'NoColor'):
168 ultraTB.ListTB.__init__(self,color_scheme)
168 ultraTB.ListTB.__init__(self,color_scheme)
169 self.last_syntax_error = None
169 self.last_syntax_error = None
170
170
171 def __call__(self, etype, value, elist):
171 def __call__(self, etype, value, elist):
172 self.last_syntax_error = value
172 self.last_syntax_error = value
173 ultraTB.ListTB.__call__(self,etype,value,elist)
173 ultraTB.ListTB.__call__(self,etype,value,elist)
174
174
175 def clear_err_state(self):
175 def clear_err_state(self):
176 """Return the current error state and clear it"""
176 """Return the current error state and clear it"""
177 e = self.last_syntax_error
177 e = self.last_syntax_error
178 self.last_syntax_error = None
178 self.last_syntax_error = None
179 return e
179 return e
180
180
181 #****************************************************************************
181 #****************************************************************************
182 # Main IPython class
182 # Main IPython class
183
183
184 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
184 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
185 # until a full rewrite is made. I've cleaned all cross-class uses of
185 # until a full rewrite is made. I've cleaned all cross-class uses of
186 # attributes and methods, but too much user code out there relies on the
186 # attributes and methods, but too much user code out there relies on the
187 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
187 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
188 #
188 #
189 # But at least now, all the pieces have been separated and we could, in
189 # But at least now, all the pieces have been separated and we could, in
190 # principle, stop using the mixin. This will ease the transition to the
190 # principle, stop using the mixin. This will ease the transition to the
191 # chainsaw branch.
191 # chainsaw branch.
192
192
193 # For reference, the following is the list of 'self.foo' uses in the Magic
193 # For reference, the following is the list of 'self.foo' uses in the Magic
194 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
194 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
195 # class, to prevent clashes.
195 # class, to prevent clashes.
196
196
197 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
197 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
198 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
198 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
199 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
199 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
200 # 'self.value']
200 # 'self.value']
201
201
202 class InteractiveShell(object,Magic):
202 class InteractiveShell(object,Magic):
203 """An enhanced console for Python."""
203 """An enhanced console for Python."""
204
204
205 # class attribute to indicate whether the class supports threads or not.
205 # class attribute to indicate whether the class supports threads or not.
206 # Subclasses with thread support should override this as needed.
206 # Subclasses with thread support should override this as needed.
207 isthreaded = False
207 isthreaded = False
208
208
209 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
209 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
210 user_ns = None,user_global_ns=None,banner2='',
210 user_ns = None,user_global_ns=None,banner2='',
211 custom_exceptions=((),None),embedded=False):
211 custom_exceptions=((),None),embedded=False):
212
212
213 # log system
213 # log system
214 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
214 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
215
215
216 # some minimal strict typechecks. For some core data structures, I
216 # some minimal strict typechecks. For some core data structures, I
217 # want actual basic python types, not just anything that looks like
217 # want actual basic python types, not just anything that looks like
218 # one. This is especially true for namespaces.
218 # one. This is especially true for namespaces.
219 for ns in (user_ns,user_global_ns):
219 for ns in (user_ns,user_global_ns):
220 if ns is not None and type(ns) != types.DictType:
220 if ns is not None and type(ns) != types.DictType:
221 raise TypeError,'namespace must be a dictionary'
221 raise TypeError,'namespace must be a dictionary'
222
222
223 # Job manager (for jobs run as background threads)
223 # Job manager (for jobs run as background threads)
224 self.jobs = BackgroundJobManager()
224 self.jobs = BackgroundJobManager()
225
225
226 # Store the actual shell's name
226 # Store the actual shell's name
227 self.name = name
227 self.name = name
228
228
229 # We need to know whether the instance is meant for embedding, since
229 # We need to know whether the instance is meant for embedding, since
230 # global/local namespaces need to be handled differently in that case
230 # global/local namespaces need to be handled differently in that case
231 self.embedded = embedded
231 self.embedded = embedded
232 if embedded:
232 if embedded:
233 # Control variable so users can, from within the embedded instance,
233 # Control variable so users can, from within the embedded instance,
234 # permanently deactivate it.
234 # permanently deactivate it.
235 self.embedded_active = True
235 self.embedded_active = True
236
236
237 # command compiler
237 # command compiler
238 self.compile = codeop.CommandCompiler()
238 self.compile = codeop.CommandCompiler()
239
239
240 # User input buffer
240 # User input buffer
241 self.buffer = []
241 self.buffer = []
242
242
243 # Default name given in compilation of code
243 # Default name given in compilation of code
244 self.filename = '<ipython console>'
244 self.filename = '<ipython console>'
245
245
246 # Install our own quitter instead of the builtins. For python2.3-2.4,
246 # Install our own quitter instead of the builtins. For python2.3-2.4,
247 # this brings in behavior like 2.5, and for 2.5 it's identical.
247 # this brings in behavior like 2.5, and for 2.5 it's identical.
248 __builtin__.exit = Quitter(self,'exit')
248 __builtin__.exit = Quitter(self,'exit')
249 __builtin__.quit = Quitter(self,'quit')
249 __builtin__.quit = Quitter(self,'quit')
250
250
251 # Make an empty namespace, which extension writers can rely on both
251 # Make an empty namespace, which extension writers can rely on both
252 # existing and NEVER being used by ipython itself. This gives them a
252 # existing and NEVER being used by ipython itself. This gives them a
253 # convenient location for storing additional information and state
253 # convenient location for storing additional information and state
254 # their extensions may require, without fear of collisions with other
254 # their extensions may require, without fear of collisions with other
255 # ipython names that may develop later.
255 # ipython names that may develop later.
256 self.meta = Struct()
256 self.meta = Struct()
257
257
258 # Create the namespace where the user will operate. user_ns is
258 # Create the namespace where the user will operate. user_ns is
259 # normally the only one used, and it is passed to the exec calls as
259 # normally the only one used, and it is passed to the exec calls as
260 # the locals argument. But we do carry a user_global_ns namespace
260 # the locals argument. But we do carry a user_global_ns namespace
261 # given as the exec 'globals' argument, This is useful in embedding
261 # given as the exec 'globals' argument, This is useful in embedding
262 # situations where the ipython shell opens in a context where the
262 # situations where the ipython shell opens in a context where the
263 # distinction between locals and globals is meaningful.
263 # distinction between locals and globals is meaningful.
264
264
265 # FIXME. For some strange reason, __builtins__ is showing up at user
265 # FIXME. For some strange reason, __builtins__ is showing up at user
266 # level as a dict instead of a module. This is a manual fix, but I
266 # level as a dict instead of a module. This is a manual fix, but I
267 # should really track down where the problem is coming from. Alex
267 # should really track down where the problem is coming from. Alex
268 # Schmolck reported this problem first.
268 # Schmolck reported this problem first.
269
269
270 # A useful post by Alex Martelli on this topic:
270 # A useful post by Alex Martelli on this topic:
271 # Re: inconsistent value from __builtins__
271 # Re: inconsistent value from __builtins__
272 # Von: Alex Martelli <aleaxit@yahoo.com>
272 # Von: Alex Martelli <aleaxit@yahoo.com>
273 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
273 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
274 # Gruppen: comp.lang.python
274 # Gruppen: comp.lang.python
275
275
276 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
276 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
277 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
277 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
278 # > <type 'dict'>
278 # > <type 'dict'>
279 # > >>> print type(__builtins__)
279 # > >>> print type(__builtins__)
280 # > <type 'module'>
280 # > <type 'module'>
281 # > Is this difference in return value intentional?
281 # > Is this difference in return value intentional?
282
282
283 # Well, it's documented that '__builtins__' can be either a dictionary
283 # Well, it's documented that '__builtins__' can be either a dictionary
284 # or a module, and it's been that way for a long time. Whether it's
284 # or a module, and it's been that way for a long time. Whether it's
285 # intentional (or sensible), I don't know. In any case, the idea is
285 # intentional (or sensible), I don't know. In any case, the idea is
286 # that if you need to access the built-in namespace directly, you
286 # that if you need to access the built-in namespace directly, you
287 # should start with "import __builtin__" (note, no 's') which will
287 # should start with "import __builtin__" (note, no 's') which will
288 # definitely give you a module. Yeah, it's somewhat confusing:-(.
288 # definitely give you a module. Yeah, it's somewhat confusing:-(.
289
289
290 # These routines return properly built dicts as needed by the rest of
290 # These routines return properly built dicts as needed by the rest of
291 # the code, and can also be used by extension writers to generate
291 # the code, and can also be used by extension writers to generate
292 # properly initialized namespaces.
292 # properly initialized namespaces.
293 user_ns = IPython.ipapi.make_user_ns(user_ns)
293 user_ns = IPython.ipapi.make_user_ns(user_ns)
294 user_global_ns = IPython.ipapi.make_user_global_ns(user_global_ns)
294 user_global_ns = IPython.ipapi.make_user_global_ns(user_global_ns)
295
295
296 # Assign namespaces
296 # Assign namespaces
297 # This is the namespace where all normal user variables live
297 # This is the namespace where all normal user variables live
298 self.user_ns = user_ns
298 self.user_ns = user_ns
299 # Embedded instances require a separate namespace for globals.
299 # Embedded instances require a separate namespace for globals.
300 # Normally this one is unused by non-embedded instances.
300 # Normally this one is unused by non-embedded instances.
301 self.user_global_ns = user_global_ns
301 self.user_global_ns = user_global_ns
302 # A namespace to keep track of internal data structures to prevent
302 # A namespace to keep track of internal data structures to prevent
303 # them from cluttering user-visible stuff. Will be updated later
303 # them from cluttering user-visible stuff. Will be updated later
304 self.internal_ns = {}
304 self.internal_ns = {}
305
305
306 # Namespace of system aliases. Each entry in the alias
306 # Namespace of system aliases. Each entry in the alias
307 # table must be a 2-tuple of the form (N,name), where N is the number
307 # table must be a 2-tuple of the form (N,name), where N is the number
308 # of positional arguments of the alias.
308 # of positional arguments of the alias.
309 self.alias_table = {}
309 self.alias_table = {}
310
310
311 # A table holding all the namespaces IPython deals with, so that
311 # A table holding all the namespaces IPython deals with, so that
312 # introspection facilities can search easily.
312 # introspection facilities can search easily.
313 self.ns_table = {'user':user_ns,
313 self.ns_table = {'user':user_ns,
314 'user_global':user_global_ns,
314 'user_global':user_global_ns,
315 'alias':self.alias_table,
315 'alias':self.alias_table,
316 'internal':self.internal_ns,
316 'internal':self.internal_ns,
317 'builtin':__builtin__.__dict__
317 'builtin':__builtin__.__dict__
318 }
318 }
319
319
320 # The user namespace MUST have a pointer to the shell itself.
320 # The user namespace MUST have a pointer to the shell itself.
321 self.user_ns[name] = self
321 self.user_ns[name] = self
322
322
323 # We need to insert into sys.modules something that looks like a
323 # We need to insert into sys.modules something that looks like a
324 # module but which accesses the IPython namespace, for shelve and
324 # module but which accesses the IPython namespace, for shelve and
325 # pickle to work interactively. Normally they rely on getting
325 # pickle to work interactively. Normally they rely on getting
326 # everything out of __main__, but for embedding purposes each IPython
326 # everything out of __main__, but for embedding purposes each IPython
327 # instance has its own private namespace, so we can't go shoving
327 # instance has its own private namespace, so we can't go shoving
328 # everything into __main__.
328 # everything into __main__.
329
329
330 # note, however, that we should only do this for non-embedded
330 # note, however, that we should only do this for non-embedded
331 # ipythons, which really mimic the __main__.__dict__ with their own
331 # ipythons, which really mimic the __main__.__dict__ with their own
332 # namespace. Embedded instances, on the other hand, should not do
332 # namespace. Embedded instances, on the other hand, should not do
333 # this because they need to manage the user local/global namespaces
333 # this because they need to manage the user local/global namespaces
334 # only, but they live within a 'normal' __main__ (meaning, they
334 # only, but they live within a 'normal' __main__ (meaning, they
335 # shouldn't overtake the execution environment of the script they're
335 # shouldn't overtake the execution environment of the script they're
336 # embedded in).
336 # embedded in).
337
337
338 if not embedded:
338 if not embedded:
339 try:
339 try:
340 main_name = self.user_ns['__name__']
340 main_name = self.user_ns['__name__']
341 except KeyError:
341 except KeyError:
342 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
342 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
343 else:
343 else:
344 #print "pickle hack in place" # dbg
344 #print "pickle hack in place" # dbg
345 #print 'main_name:',main_name # dbg
345 #print 'main_name:',main_name # dbg
346 sys.modules[main_name] = FakeModule(self.user_ns)
346 sys.modules[main_name] = FakeModule(self.user_ns)
347
347
348 # List of input with multi-line handling.
348 # List of input with multi-line handling.
349 # Fill its zero entry, user counter starts at 1
349 # Fill its zero entry, user counter starts at 1
350 self.input_hist = InputList(['\n'])
350 self.input_hist = InputList(['\n'])
351 # This one will hold the 'raw' input history, without any
351 # This one will hold the 'raw' input history, without any
352 # pre-processing. This will allow users to retrieve the input just as
352 # pre-processing. This will allow users to retrieve the input just as
353 # it was exactly typed in by the user, with %hist -r.
353 # it was exactly typed in by the user, with %hist -r.
354 self.input_hist_raw = InputList(['\n'])
354 self.input_hist_raw = InputList(['\n'])
355
355
356 # list of visited directories
356 # list of visited directories
357 try:
357 try:
358 self.dir_hist = [os.getcwd()]
358 self.dir_hist = [os.getcwd()]
359 except OSError:
359 except OSError:
360 self.dir_hist = []
360 self.dir_hist = []
361
361
362 # dict of output history
362 # dict of output history
363 self.output_hist = {}
363 self.output_hist = {}
364
364
365 # Get system encoding at startup time. Certain terminals (like Emacs
365 # Get system encoding at startup time. Certain terminals (like Emacs
366 # under Win32 have it set to None, and we need to have a known valid
366 # under Win32 have it set to None, and we need to have a known valid
367 # encoding to use in the raw_input() method
367 # encoding to use in the raw_input() method
368 self.stdin_encoding = sys.stdin.encoding or 'ascii'
368 self.stdin_encoding = sys.stdin.encoding or 'ascii'
369
369
370 # dict of things NOT to alias (keywords, builtins and some magics)
370 # dict of things NOT to alias (keywords, builtins and some magics)
371 no_alias = {}
371 no_alias = {}
372 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
372 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
373 for key in keyword.kwlist + no_alias_magics:
373 for key in keyword.kwlist + no_alias_magics:
374 no_alias[key] = 1
374 no_alias[key] = 1
375 no_alias.update(__builtin__.__dict__)
375 no_alias.update(__builtin__.__dict__)
376 self.no_alias = no_alias
376 self.no_alias = no_alias
377
377
378 # make global variables for user access to these
378 # make global variables for user access to these
379 self.user_ns['_ih'] = self.input_hist
379 self.user_ns['_ih'] = self.input_hist
380 self.user_ns['_oh'] = self.output_hist
380 self.user_ns['_oh'] = self.output_hist
381 self.user_ns['_dh'] = self.dir_hist
381 self.user_ns['_dh'] = self.dir_hist
382
382
383 # user aliases to input and output histories
383 # user aliases to input and output histories
384 self.user_ns['In'] = self.input_hist
384 self.user_ns['In'] = self.input_hist
385 self.user_ns['Out'] = self.output_hist
385 self.user_ns['Out'] = self.output_hist
386
386
387 self.user_ns['_sh'] = IPython.shadowns
387 self.user_ns['_sh'] = IPython.shadowns
388 # Object variable to store code object waiting execution. This is
388 # Object variable to store code object waiting execution. This is
389 # used mainly by the multithreaded shells, but it can come in handy in
389 # used mainly by the multithreaded shells, but it can come in handy in
390 # other situations. No need to use a Queue here, since it's a single
390 # other situations. No need to use a Queue here, since it's a single
391 # item which gets cleared once run.
391 # item which gets cleared once run.
392 self.code_to_run = None
392 self.code_to_run = None
393
393
394 # escapes for automatic behavior on the command line
394 # escapes for automatic behavior on the command line
395 self.ESC_SHELL = '!'
395 self.ESC_SHELL = '!'
396 self.ESC_SH_CAP = '!!'
396 self.ESC_SH_CAP = '!!'
397 self.ESC_HELP = '?'
397 self.ESC_HELP = '?'
398 self.ESC_MAGIC = '%'
398 self.ESC_MAGIC = '%'
399 self.ESC_QUOTE = ','
399 self.ESC_QUOTE = ','
400 self.ESC_QUOTE2 = ';'
400 self.ESC_QUOTE2 = ';'
401 self.ESC_PAREN = '/'
401 self.ESC_PAREN = '/'
402
402
403 # And their associated handlers
403 # And their associated handlers
404 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
404 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
405 self.ESC_QUOTE : self.handle_auto,
405 self.ESC_QUOTE : self.handle_auto,
406 self.ESC_QUOTE2 : self.handle_auto,
406 self.ESC_QUOTE2 : self.handle_auto,
407 self.ESC_MAGIC : self.handle_magic,
407 self.ESC_MAGIC : self.handle_magic,
408 self.ESC_HELP : self.handle_help,
408 self.ESC_HELP : self.handle_help,
409 self.ESC_SHELL : self.handle_shell_escape,
409 self.ESC_SHELL : self.handle_shell_escape,
410 self.ESC_SH_CAP : self.handle_shell_escape,
410 self.ESC_SH_CAP : self.handle_shell_escape,
411 }
411 }
412
412
413 # class initializations
413 # class initializations
414 Magic.__init__(self,self)
414 Magic.__init__(self,self)
415
415
416 # Python source parser/formatter for syntax highlighting
416 # Python source parser/formatter for syntax highlighting
417 pyformat = PyColorize.Parser().format
417 pyformat = PyColorize.Parser().format
418 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
418 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
419
419
420 # hooks holds pointers used for user-side customizations
420 # hooks holds pointers used for user-side customizations
421 self.hooks = Struct()
421 self.hooks = Struct()
422
422
423 self.strdispatchers = {}
423 self.strdispatchers = {}
424
424
425 # Set all default hooks, defined in the IPython.hooks module.
425 # Set all default hooks, defined in the IPython.hooks module.
426 hooks = IPython.hooks
426 hooks = IPython.hooks
427 for hook_name in hooks.__all__:
427 for hook_name in hooks.__all__:
428 # default hooks have priority 100, i.e. low; user hooks should have
428 # default hooks have priority 100, i.e. low; user hooks should have
429 # 0-100 priority
429 # 0-100 priority
430 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
430 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
431 #print "bound hook",hook_name
431 #print "bound hook",hook_name
432
432
433 # Flag to mark unconditional exit
433 # Flag to mark unconditional exit
434 self.exit_now = False
434 self.exit_now = False
435
435
436 self.usage_min = """\
436 self.usage_min = """\
437 An enhanced console for Python.
437 An enhanced console for Python.
438 Some of its features are:
438 Some of its features are:
439 - Readline support if the readline library is present.
439 - Readline support if the readline library is present.
440 - Tab completion in the local namespace.
440 - Tab completion in the local namespace.
441 - Logging of input, see command-line options.
441 - Logging of input, see command-line options.
442 - System shell escape via ! , eg !ls.
442 - System shell escape via ! , eg !ls.
443 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
443 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
444 - Keeps track of locally defined variables via %who, %whos.
444 - Keeps track of locally defined variables via %who, %whos.
445 - Show object information with a ? eg ?x or x? (use ?? for more info).
445 - Show object information with a ? eg ?x or x? (use ?? for more info).
446 """
446 """
447 if usage: self.usage = usage
447 if usage: self.usage = usage
448 else: self.usage = self.usage_min
448 else: self.usage = self.usage_min
449
449
450 # Storage
450 # Storage
451 self.rc = rc # This will hold all configuration information
451 self.rc = rc # This will hold all configuration information
452 self.pager = 'less'
452 self.pager = 'less'
453 # temporary files used for various purposes. Deleted at exit.
453 # temporary files used for various purposes. Deleted at exit.
454 self.tempfiles = []
454 self.tempfiles = []
455
455
456 # Keep track of readline usage (later set by init_readline)
456 # Keep track of readline usage (later set by init_readline)
457 self.has_readline = False
457 self.has_readline = False
458
458
459 # template for logfile headers. It gets resolved at runtime by the
459 # template for logfile headers. It gets resolved at runtime by the
460 # logstart method.
460 # logstart method.
461 self.loghead_tpl = \
461 self.loghead_tpl = \
462 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
462 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
463 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
463 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
464 #log# opts = %s
464 #log# opts = %s
465 #log# args = %s
465 #log# args = %s
466 #log# It is safe to make manual edits below here.
466 #log# It is safe to make manual edits below here.
467 #log#-----------------------------------------------------------------------
467 #log#-----------------------------------------------------------------------
468 """
468 """
469 # for pushd/popd management
469 # for pushd/popd management
470 try:
470 try:
471 self.home_dir = get_home_dir()
471 self.home_dir = get_home_dir()
472 except HomeDirError,msg:
472 except HomeDirError,msg:
473 fatal(msg)
473 fatal(msg)
474
474
475 self.dir_stack = [os.getcwd().replace(self.home_dir,'~')]
475 self.dir_stack = [os.getcwd().replace(self.home_dir,'~')]
476
476
477 # Functions to call the underlying shell.
477 # Functions to call the underlying shell.
478
478
479 # The first is similar to os.system, but it doesn't return a value,
479 # The first is similar to os.system, but it doesn't return a value,
480 # and it allows interpolation of variables in the user's namespace.
480 # and it allows interpolation of variables in the user's namespace.
481 self.system = lambda cmd: \
481 self.system = lambda cmd: \
482 shell(self.var_expand(cmd,depth=2),
482 shell(self.var_expand(cmd,depth=2),
483 header=self.rc.system_header,
483 header=self.rc.system_header,
484 verbose=self.rc.system_verbose)
484 verbose=self.rc.system_verbose)
485
485
486 # These are for getoutput and getoutputerror:
486 # These are for getoutput and getoutputerror:
487 self.getoutput = lambda cmd: \
487 self.getoutput = lambda cmd: \
488 getoutput(self.var_expand(cmd,depth=2),
488 getoutput(self.var_expand(cmd,depth=2),
489 header=self.rc.system_header,
489 header=self.rc.system_header,
490 verbose=self.rc.system_verbose)
490 verbose=self.rc.system_verbose)
491
491
492 self.getoutputerror = lambda cmd: \
492 self.getoutputerror = lambda cmd: \
493 getoutputerror(self.var_expand(cmd,depth=2),
493 getoutputerror(self.var_expand(cmd,depth=2),
494 header=self.rc.system_header,
494 header=self.rc.system_header,
495 verbose=self.rc.system_verbose)
495 verbose=self.rc.system_verbose)
496
496
497
497
498 # keep track of where we started running (mainly for crash post-mortem)
498 # keep track of where we started running (mainly for crash post-mortem)
499 self.starting_dir = os.getcwd()
499 self.starting_dir = os.getcwd()
500
500
501 # Various switches which can be set
501 # Various switches which can be set
502 self.CACHELENGTH = 5000 # this is cheap, it's just text
502 self.CACHELENGTH = 5000 # this is cheap, it's just text
503 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
503 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
504 self.banner2 = banner2
504 self.banner2 = banner2
505
505
506 # TraceBack handlers:
506 # TraceBack handlers:
507
507
508 # Syntax error handler.
508 # Syntax error handler.
509 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
509 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
510
510
511 # The interactive one is initialized with an offset, meaning we always
511 # The interactive one is initialized with an offset, meaning we always
512 # want to remove the topmost item in the traceback, which is our own
512 # want to remove the topmost item in the traceback, which is our own
513 # internal code. Valid modes: ['Plain','Context','Verbose']
513 # internal code. Valid modes: ['Plain','Context','Verbose']
514 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
514 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
515 color_scheme='NoColor',
515 color_scheme='NoColor',
516 tb_offset = 1)
516 tb_offset = 1)
517
517
518 # IPython itself shouldn't crash. This will produce a detailed
518 # IPython itself shouldn't crash. This will produce a detailed
519 # post-mortem if it does. But we only install the crash handler for
519 # post-mortem if it does. But we only install the crash handler for
520 # non-threaded shells, the threaded ones use a normal verbose reporter
520 # non-threaded shells, the threaded ones use a normal verbose reporter
521 # and lose the crash handler. This is because exceptions in the main
521 # and lose the crash handler. This is because exceptions in the main
522 # thread (such as in GUI code) propagate directly to sys.excepthook,
522 # thread (such as in GUI code) propagate directly to sys.excepthook,
523 # and there's no point in printing crash dumps for every user exception.
523 # and there's no point in printing crash dumps for every user exception.
524 if self.isthreaded:
524 if self.isthreaded:
525 ipCrashHandler = ultraTB.FormattedTB()
525 ipCrashHandler = ultraTB.FormattedTB()
526 else:
526 else:
527 from IPython import CrashHandler
527 from IPython import CrashHandler
528 ipCrashHandler = CrashHandler.IPythonCrashHandler(self)
528 ipCrashHandler = CrashHandler.IPythonCrashHandler(self)
529 self.set_crash_handler(ipCrashHandler)
529 self.set_crash_handler(ipCrashHandler)
530
530
531 # and add any custom exception handlers the user may have specified
531 # and add any custom exception handlers the user may have specified
532 self.set_custom_exc(*custom_exceptions)
532 self.set_custom_exc(*custom_exceptions)
533
533
534 # indentation management
534 # indentation management
535 self.autoindent = False
535 self.autoindent = False
536 self.indent_current_nsp = 0
536 self.indent_current_nsp = 0
537
537
538 # Make some aliases automatically
538 # Make some aliases automatically
539 # Prepare list of shell aliases to auto-define
539 # Prepare list of shell aliases to auto-define
540 if os.name == 'posix':
540 if os.name == 'posix':
541 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
541 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
542 'mv mv -i','rm rm -i','cp cp -i',
542 'mv mv -i','rm rm -i','cp cp -i',
543 'cat cat','less less','clear clear',
543 'cat cat','less less','clear clear',
544 # a better ls
544 # a better ls
545 'ls ls -F',
545 'ls ls -F',
546 # long ls
546 # long ls
547 'll ls -lF')
547 'll ls -lF')
548 # Extra ls aliases with color, which need special treatment on BSD
548 # Extra ls aliases with color, which need special treatment on BSD
549 # variants
549 # variants
550 ls_extra = ( # color ls
550 ls_extra = ( # color ls
551 'lc ls -F -o --color',
551 'lc ls -F -o --color',
552 # ls normal files only
552 # ls normal files only
553 'lf ls -F -o --color %l | grep ^-',
553 'lf ls -F -o --color %l | grep ^-',
554 # ls symbolic links
554 # ls symbolic links
555 'lk ls -F -o --color %l | grep ^l',
555 'lk ls -F -o --color %l | grep ^l',
556 # directories or links to directories,
556 # directories or links to directories,
557 'ldir ls -F -o --color %l | grep /$',
557 'ldir ls -F -o --color %l | grep /$',
558 # things which are executable
558 # things which are executable
559 'lx ls -F -o --color %l | grep ^-..x',
559 'lx ls -F -o --color %l | grep ^-..x',
560 )
560 )
561 # The BSDs don't ship GNU ls, so they don't understand the
561 # The BSDs don't ship GNU ls, so they don't understand the
562 # --color switch out of the box
562 # --color switch out of the box
563 if 'bsd' in sys.platform:
563 if 'bsd' in sys.platform:
564 ls_extra = ( # ls normal files only
564 ls_extra = ( # ls normal files only
565 'lf ls -lF | grep ^-',
565 'lf ls -lF | grep ^-',
566 # ls symbolic links
566 # ls symbolic links
567 'lk ls -lF | grep ^l',
567 'lk ls -lF | grep ^l',
568 # directories or links to directories,
568 # directories or links to directories,
569 'ldir ls -lF | grep /$',
569 'ldir ls -lF | grep /$',
570 # things which are executable
570 # things which are executable
571 'lx ls -lF | grep ^-..x',
571 'lx ls -lF | grep ^-..x',
572 )
572 )
573 auto_alias = auto_alias + ls_extra
573 auto_alias = auto_alias + ls_extra
574 elif os.name in ['nt','dos']:
574 elif os.name in ['nt','dos']:
575 auto_alias = ('dir dir /on', 'ls dir /on',
575 auto_alias = ('dir dir /on', 'ls dir /on',
576 'ddir dir /ad /on', 'ldir dir /ad /on',
576 'ddir dir /ad /on', 'ldir dir /ad /on',
577 'mkdir mkdir','rmdir rmdir','echo echo',
577 'mkdir mkdir','rmdir rmdir','echo echo',
578 'ren ren','cls cls','copy copy')
578 'ren ren','cls cls','copy copy')
579 else:
579 else:
580 auto_alias = ()
580 auto_alias = ()
581 self.auto_alias = [s.split(None,1) for s in auto_alias]
581 self.auto_alias = [s.split(None,1) for s in auto_alias]
582
582
583 # Produce a public API instance
583 # Produce a public API instance
584 self.api = IPython.ipapi.IPApi(self)
584 self.api = IPython.ipapi.IPApi(self)
585
585
586 # Call the actual (public) initializer
586 # Call the actual (public) initializer
587 self.init_auto_alias()
587 self.init_auto_alias()
588
588
589 # track which builtins we add, so we can clean up later
589 # track which builtins we add, so we can clean up later
590 self.builtins_added = {}
590 self.builtins_added = {}
591 # This method will add the necessary builtins for operation, but
591 # This method will add the necessary builtins for operation, but
592 # tracking what it did via the builtins_added dict.
592 # tracking what it did via the builtins_added dict.
593 self.add_builtins()
593 self.add_builtins()
594
594
595 # end __init__
595 # end __init__
596
596
597 def var_expand(self,cmd,depth=0):
597 def var_expand(self,cmd,depth=0):
598 """Expand python variables in a string.
598 """Expand python variables in a string.
599
599
600 The depth argument indicates how many frames above the caller should
600 The depth argument indicates how many frames above the caller should
601 be walked to look for the local namespace where to expand variables.
601 be walked to look for the local namespace where to expand variables.
602
602
603 The global namespace for expansion is always the user's interactive
603 The global namespace for expansion is always the user's interactive
604 namespace.
604 namespace.
605 """
605 """
606
606
607 return str(ItplNS(cmd.replace('#','\#'),
607 return str(ItplNS(cmd.replace('#','\#'),
608 self.user_ns, # globals
608 self.user_ns, # globals
609 # Skip our own frame in searching for locals:
609 # Skip our own frame in searching for locals:
610 sys._getframe(depth+1).f_locals # locals
610 sys._getframe(depth+1).f_locals # locals
611 ))
611 ))
612
612
613 def pre_config_initialization(self):
613 def pre_config_initialization(self):
614 """Pre-configuration init method
614 """Pre-configuration init method
615
615
616 This is called before the configuration files are processed to
616 This is called before the configuration files are processed to
617 prepare the services the config files might need.
617 prepare the services the config files might need.
618
618
619 self.rc already has reasonable default values at this point.
619 self.rc already has reasonable default values at this point.
620 """
620 """
621 rc = self.rc
621 rc = self.rc
622 try:
622 try:
623 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
623 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
624 except exceptions.UnicodeDecodeError:
624 except exceptions.UnicodeDecodeError:
625 print "Your ipythondir can't be decoded to unicode!"
625 print "Your ipythondir can't be decoded to unicode!"
626 print "Please set HOME environment variable to something that"
626 print "Please set HOME environment variable to something that"
627 print r"only has ASCII characters, e.g. c:\home"
627 print r"only has ASCII characters, e.g. c:\home"
628 print "Now it is",rc.ipythondir
628 print "Now it is",rc.ipythondir
629 sys.exit()
629 sys.exit()
630 self.shadowhist = IPython.history.ShadowHist(self.db)
630 self.shadowhist = IPython.history.ShadowHist(self.db)
631
631
632
632
633 def post_config_initialization(self):
633 def post_config_initialization(self):
634 """Post configuration init method
634 """Post configuration init method
635
635
636 This is called after the configuration files have been processed to
636 This is called after the configuration files have been processed to
637 'finalize' the initialization."""
637 'finalize' the initialization."""
638
638
639 rc = self.rc
639 rc = self.rc
640
640
641 # Object inspector
641 # Object inspector
642 self.inspector = OInspect.Inspector(OInspect.InspectColors,
642 self.inspector = OInspect.Inspector(OInspect.InspectColors,
643 PyColorize.ANSICodeColors,
643 PyColorize.ANSICodeColors,
644 'NoColor',
644 'NoColor',
645 rc.object_info_string_level)
645 rc.object_info_string_level)
646
646
647 self.rl_next_input = None
647 self.rl_next_input = None
648 self.rl_do_indent = False
648 self.rl_do_indent = False
649 # Load readline proper
649 # Load readline proper
650 if rc.readline:
650 if rc.readline:
651 self.init_readline()
651 self.init_readline()
652
652
653
653
654 # local shortcut, this is used a LOT
654 # local shortcut, this is used a LOT
655 self.log = self.logger.log
655 self.log = self.logger.log
656
656
657 # Initialize cache, set in/out prompts and printing system
657 # Initialize cache, set in/out prompts and printing system
658 self.outputcache = CachedOutput(self,
658 self.outputcache = CachedOutput(self,
659 rc.cache_size,
659 rc.cache_size,
660 rc.pprint,
660 rc.pprint,
661 input_sep = rc.separate_in,
661 input_sep = rc.separate_in,
662 output_sep = rc.separate_out,
662 output_sep = rc.separate_out,
663 output_sep2 = rc.separate_out2,
663 output_sep2 = rc.separate_out2,
664 ps1 = rc.prompt_in1,
664 ps1 = rc.prompt_in1,
665 ps2 = rc.prompt_in2,
665 ps2 = rc.prompt_in2,
666 ps_out = rc.prompt_out,
666 ps_out = rc.prompt_out,
667 pad_left = rc.prompts_pad_left)
667 pad_left = rc.prompts_pad_left)
668
668
669 # user may have over-ridden the default print hook:
669 # user may have over-ridden the default print hook:
670 try:
670 try:
671 self.outputcache.__class__.display = self.hooks.display
671 self.outputcache.__class__.display = self.hooks.display
672 except AttributeError:
672 except AttributeError:
673 pass
673 pass
674
674
675 # I don't like assigning globally to sys, because it means when
675 # I don't like assigning globally to sys, because it means when
676 # embedding instances, each embedded instance overrides the previous
676 # embedding instances, each embedded instance overrides the previous
677 # choice. But sys.displayhook seems to be called internally by exec,
677 # choice. But sys.displayhook seems to be called internally by exec,
678 # so I don't see a way around it. We first save the original and then
678 # so I don't see a way around it. We first save the original and then
679 # overwrite it.
679 # overwrite it.
680 self.sys_displayhook = sys.displayhook
680 self.sys_displayhook = sys.displayhook
681 sys.displayhook = self.outputcache
681 sys.displayhook = self.outputcache
682
682
683 # Monkeypatch doctest so that its core test runner method is protected
683 # Monkeypatch doctest so that its core test runner method is protected
684 # from IPython's modified displayhook. Doctest expects the default
684 # from IPython's modified displayhook. Doctest expects the default
685 # displayhook behavior deep down, so our modification breaks it
685 # displayhook behavior deep down, so our modification breaks it
686 # completely. For this reason, a hard monkeypatch seems like a
686 # completely. For this reason, a hard monkeypatch seems like a
687 # reasonable solution rather than asking users to manually use a
687 # reasonable solution rather than asking users to manually use a
688 # different doctest runner when under IPython.
688 # different doctest runner when under IPython.
689 try:
689 try:
690 doctest.DocTestRunner
690 doctest.DocTestRunner
691 except AttributeError:
691 except AttributeError:
692 # This is only for python 2.3 compatibility, remove once we move to
692 # This is only for python 2.3 compatibility, remove once we move to
693 # 2.4 only.
693 # 2.4 only.
694 pass
694 pass
695 else:
695 else:
696 doctest.DocTestRunner.run = dhook_wrap(doctest.DocTestRunner.run)
696 doctest.DocTestRunner.run = dhook_wrap(doctest.DocTestRunner.run)
697
697
698 # Set user colors (don't do it in the constructor above so that it
698 # Set user colors (don't do it in the constructor above so that it
699 # doesn't crash if colors option is invalid)
699 # doesn't crash if colors option is invalid)
700 self.magic_colors(rc.colors)
700 self.magic_colors(rc.colors)
701
701
702 # Set calling of pdb on exceptions
702 # Set calling of pdb on exceptions
703 self.call_pdb = rc.pdb
703 self.call_pdb = rc.pdb
704
704
705 # Load user aliases
705 # Load user aliases
706 for alias in rc.alias:
706 for alias in rc.alias:
707 self.magic_alias(alias)
707 self.magic_alias(alias)
708
708
709 self.hooks.late_startup_hook()
709 self.hooks.late_startup_hook()
710
710
711 batchrun = False
711 batchrun = False
712 for batchfile in [path(arg) for arg in self.rc.args
712 for batchfile in [path(arg) for arg in self.rc.args
713 if arg.lower().endswith('.ipy')]:
713 if arg.lower().endswith('.ipy')]:
714 if not batchfile.isfile():
714 if not batchfile.isfile():
715 print "No such batch file:", batchfile
715 print "No such batch file:", batchfile
716 continue
716 continue
717 self.api.runlines(batchfile.text())
717 self.api.runlines(batchfile.text())
718 batchrun = True
718 batchrun = True
719 # without -i option, exit after running the batch file
719 # without -i option, exit after running the batch file
720 if batchrun and not self.rc.interact:
720 if batchrun and not self.rc.interact:
721 self.exit_now = True
721 self.exit_now = True
722
722
723 def add_builtins(self):
723 def add_builtins(self):
724 """Store ipython references into the builtin namespace.
724 """Store ipython references into the builtin namespace.
725
725
726 Some parts of ipython operate via builtins injected here, which hold a
726 Some parts of ipython operate via builtins injected here, which hold a
727 reference to IPython itself."""
727 reference to IPython itself."""
728
728
729 # TODO: deprecate all except _ip; 'jobs' should be installed
729 # TODO: deprecate all except _ip; 'jobs' should be installed
730 # by an extension and the rest are under _ip, ipalias is redundant
730 # by an extension and the rest are under _ip, ipalias is redundant
731 builtins_new = dict(__IPYTHON__ = self,
731 builtins_new = dict(__IPYTHON__ = self,
732 ip_set_hook = self.set_hook,
732 ip_set_hook = self.set_hook,
733 jobs = self.jobs,
733 jobs = self.jobs,
734 ipmagic = wrap_deprecated(self.ipmagic,'_ip.magic()'),
734 ipmagic = wrap_deprecated(self.ipmagic,'_ip.magic()'),
735 ipalias = wrap_deprecated(self.ipalias),
735 ipalias = wrap_deprecated(self.ipalias),
736 ipsystem = wrap_deprecated(self.ipsystem,'_ip.system()'),
736 ipsystem = wrap_deprecated(self.ipsystem,'_ip.system()'),
737 _ip = self.api
737 _ip = self.api
738 )
738 )
739 for biname,bival in builtins_new.items():
739 for biname,bival in builtins_new.items():
740 try:
740 try:
741 # store the orignal value so we can restore it
741 # store the orignal value so we can restore it
742 self.builtins_added[biname] = __builtin__.__dict__[biname]
742 self.builtins_added[biname] = __builtin__.__dict__[biname]
743 except KeyError:
743 except KeyError:
744 # or mark that it wasn't defined, and we'll just delete it at
744 # or mark that it wasn't defined, and we'll just delete it at
745 # cleanup
745 # cleanup
746 self.builtins_added[biname] = Undefined
746 self.builtins_added[biname] = Undefined
747 __builtin__.__dict__[biname] = bival
747 __builtin__.__dict__[biname] = bival
748
748
749 # Keep in the builtins a flag for when IPython is active. We set it
749 # Keep in the builtins a flag for when IPython is active. We set it
750 # with setdefault so that multiple nested IPythons don't clobber one
750 # with setdefault so that multiple nested IPythons don't clobber one
751 # another. Each will increase its value by one upon being activated,
751 # another. Each will increase its value by one upon being activated,
752 # which also gives us a way to determine the nesting level.
752 # which also gives us a way to determine the nesting level.
753 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
753 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
754
754
755 def clean_builtins(self):
755 def clean_builtins(self):
756 """Remove any builtins which might have been added by add_builtins, or
756 """Remove any builtins which might have been added by add_builtins, or
757 restore overwritten ones to their previous values."""
757 restore overwritten ones to their previous values."""
758 for biname,bival in self.builtins_added.items():
758 for biname,bival in self.builtins_added.items():
759 if bival is Undefined:
759 if bival is Undefined:
760 del __builtin__.__dict__[biname]
760 del __builtin__.__dict__[biname]
761 else:
761 else:
762 __builtin__.__dict__[biname] = bival
762 __builtin__.__dict__[biname] = bival
763 self.builtins_added.clear()
763 self.builtins_added.clear()
764
764
765 def set_hook(self,name,hook, priority = 50, str_key = None, re_key = None):
765 def set_hook(self,name,hook, priority = 50, str_key = None, re_key = None):
766 """set_hook(name,hook) -> sets an internal IPython hook.
766 """set_hook(name,hook) -> sets an internal IPython hook.
767
767
768 IPython exposes some of its internal API as user-modifiable hooks. By
768 IPython exposes some of its internal API as user-modifiable hooks. By
769 adding your function to one of these hooks, you can modify IPython's
769 adding your function to one of these hooks, you can modify IPython's
770 behavior to call at runtime your own routines."""
770 behavior to call at runtime your own routines."""
771
771
772 # At some point in the future, this should validate the hook before it
772 # At some point in the future, this should validate the hook before it
773 # accepts it. Probably at least check that the hook takes the number
773 # accepts it. Probably at least check that the hook takes the number
774 # of args it's supposed to.
774 # of args it's supposed to.
775
775
776 f = new.instancemethod(hook,self,self.__class__)
776 f = new.instancemethod(hook,self,self.__class__)
777
777
778 # check if the hook is for strdispatcher first
778 # check if the hook is for strdispatcher first
779 if str_key is not None:
779 if str_key is not None:
780 sdp = self.strdispatchers.get(name, StrDispatch())
780 sdp = self.strdispatchers.get(name, StrDispatch())
781 sdp.add_s(str_key, f, priority )
781 sdp.add_s(str_key, f, priority )
782 self.strdispatchers[name] = sdp
782 self.strdispatchers[name] = sdp
783 return
783 return
784 if re_key is not None:
784 if re_key is not None:
785 sdp = self.strdispatchers.get(name, StrDispatch())
785 sdp = self.strdispatchers.get(name, StrDispatch())
786 sdp.add_re(re.compile(re_key), f, priority )
786 sdp.add_re(re.compile(re_key), f, priority )
787 self.strdispatchers[name] = sdp
787 self.strdispatchers[name] = sdp
788 return
788 return
789
789
790 dp = getattr(self.hooks, name, None)
790 dp = getattr(self.hooks, name, None)
791 if name not in IPython.hooks.__all__:
791 if name not in IPython.hooks.__all__:
792 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
792 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
793 if not dp:
793 if not dp:
794 dp = IPython.hooks.CommandChainDispatcher()
794 dp = IPython.hooks.CommandChainDispatcher()
795
795
796 try:
796 try:
797 dp.add(f,priority)
797 dp.add(f,priority)
798 except AttributeError:
798 except AttributeError:
799 # it was not commandchain, plain old func - replace
799 # it was not commandchain, plain old func - replace
800 dp = f
800 dp = f
801
801
802 setattr(self.hooks,name, dp)
802 setattr(self.hooks,name, dp)
803
803
804
804
805 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
805 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
806
806
807 def set_crash_handler(self,crashHandler):
807 def set_crash_handler(self,crashHandler):
808 """Set the IPython crash handler.
808 """Set the IPython crash handler.
809
809
810 This must be a callable with a signature suitable for use as
810 This must be a callable with a signature suitable for use as
811 sys.excepthook."""
811 sys.excepthook."""
812
812
813 # Install the given crash handler as the Python exception hook
813 # Install the given crash handler as the Python exception hook
814 sys.excepthook = crashHandler
814 sys.excepthook = crashHandler
815
815
816 # The instance will store a pointer to this, so that runtime code
816 # The instance will store a pointer to this, so that runtime code
817 # (such as magics) can access it. This is because during the
817 # (such as magics) can access it. This is because during the
818 # read-eval loop, it gets temporarily overwritten (to deal with GUI
818 # read-eval loop, it gets temporarily overwritten (to deal with GUI
819 # frameworks).
819 # frameworks).
820 self.sys_excepthook = sys.excepthook
820 self.sys_excepthook = sys.excepthook
821
821
822
822
823 def set_custom_exc(self,exc_tuple,handler):
823 def set_custom_exc(self,exc_tuple,handler):
824 """set_custom_exc(exc_tuple,handler)
824 """set_custom_exc(exc_tuple,handler)
825
825
826 Set a custom exception handler, which will be called if any of the
826 Set a custom exception handler, which will be called if any of the
827 exceptions in exc_tuple occur in the mainloop (specifically, in the
827 exceptions in exc_tuple occur in the mainloop (specifically, in the
828 runcode() method.
828 runcode() method.
829
829
830 Inputs:
830 Inputs:
831
831
832 - exc_tuple: a *tuple* of valid exceptions to call the defined
832 - exc_tuple: a *tuple* of valid exceptions to call the defined
833 handler for. It is very important that you use a tuple, and NOT A
833 handler for. It is very important that you use a tuple, and NOT A
834 LIST here, because of the way Python's except statement works. If
834 LIST here, because of the way Python's except statement works. If
835 you only want to trap a single exception, use a singleton tuple:
835 you only want to trap a single exception, use a singleton tuple:
836
836
837 exc_tuple == (MyCustomException,)
837 exc_tuple == (MyCustomException,)
838
838
839 - handler: this must be defined as a function with the following
839 - handler: this must be defined as a function with the following
840 basic interface: def my_handler(self,etype,value,tb).
840 basic interface: def my_handler(self,etype,value,tb).
841
841
842 This will be made into an instance method (via new.instancemethod)
842 This will be made into an instance method (via new.instancemethod)
843 of IPython itself, and it will be called if any of the exceptions
843 of IPython itself, and it will be called if any of the exceptions
844 listed in the exc_tuple are caught. If the handler is None, an
844 listed in the exc_tuple are caught. If the handler is None, an
845 internal basic one is used, which just prints basic info.
845 internal basic one is used, which just prints basic info.
846
846
847 WARNING: by putting in your own exception handler into IPython's main
847 WARNING: by putting in your own exception handler into IPython's main
848 execution loop, you run a very good chance of nasty crashes. This
848 execution loop, you run a very good chance of nasty crashes. This
849 facility should only be used if you really know what you are doing."""
849 facility should only be used if you really know what you are doing."""
850
850
851 assert type(exc_tuple)==type(()) , \
851 assert type(exc_tuple)==type(()) , \
852 "The custom exceptions must be given AS A TUPLE."
852 "The custom exceptions must be given AS A TUPLE."
853
853
854 def dummy_handler(self,etype,value,tb):
854 def dummy_handler(self,etype,value,tb):
855 print '*** Simple custom exception handler ***'
855 print '*** Simple custom exception handler ***'
856 print 'Exception type :',etype
856 print 'Exception type :',etype
857 print 'Exception value:',value
857 print 'Exception value:',value
858 print 'Traceback :',tb
858 print 'Traceback :',tb
859 print 'Source code :','\n'.join(self.buffer)
859 print 'Source code :','\n'.join(self.buffer)
860
860
861 if handler is None: handler = dummy_handler
861 if handler is None: handler = dummy_handler
862
862
863 self.CustomTB = new.instancemethod(handler,self,self.__class__)
863 self.CustomTB = new.instancemethod(handler,self,self.__class__)
864 self.custom_exceptions = exc_tuple
864 self.custom_exceptions = exc_tuple
865
865
866 def set_custom_completer(self,completer,pos=0):
866 def set_custom_completer(self,completer,pos=0):
867 """set_custom_completer(completer,pos=0)
867 """set_custom_completer(completer,pos=0)
868
868
869 Adds a new custom completer function.
869 Adds a new custom completer function.
870
870
871 The position argument (defaults to 0) is the index in the completers
871 The position argument (defaults to 0) is the index in the completers
872 list where you want the completer to be inserted."""
872 list where you want the completer to be inserted."""
873
873
874 newcomp = new.instancemethod(completer,self.Completer,
874 newcomp = new.instancemethod(completer,self.Completer,
875 self.Completer.__class__)
875 self.Completer.__class__)
876 self.Completer.matchers.insert(pos,newcomp)
876 self.Completer.matchers.insert(pos,newcomp)
877
877
878 def set_completer(self):
878 def set_completer(self):
879 """reset readline's completer to be our own."""
879 """reset readline's completer to be our own."""
880 self.readline.set_completer(self.Completer.complete)
880 self.readline.set_completer(self.Completer.complete)
881
881
882 def _get_call_pdb(self):
882 def _get_call_pdb(self):
883 return self._call_pdb
883 return self._call_pdb
884
884
885 def _set_call_pdb(self,val):
885 def _set_call_pdb(self,val):
886
886
887 if val not in (0,1,False,True):
887 if val not in (0,1,False,True):
888 raise ValueError,'new call_pdb value must be boolean'
888 raise ValueError,'new call_pdb value must be boolean'
889
889
890 # store value in instance
890 # store value in instance
891 self._call_pdb = val
891 self._call_pdb = val
892
892
893 # notify the actual exception handlers
893 # notify the actual exception handlers
894 self.InteractiveTB.call_pdb = val
894 self.InteractiveTB.call_pdb = val
895 if self.isthreaded:
895 if self.isthreaded:
896 try:
896 try:
897 self.sys_excepthook.call_pdb = val
897 self.sys_excepthook.call_pdb = val
898 except:
898 except:
899 warn('Failed to activate pdb for threaded exception handler')
899 warn('Failed to activate pdb for threaded exception handler')
900
900
901 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
901 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
902 'Control auto-activation of pdb at exceptions')
902 'Control auto-activation of pdb at exceptions')
903
903
904
904
905 # These special functions get installed in the builtin namespace, to
905 # These special functions get installed in the builtin namespace, to
906 # provide programmatic (pure python) access to magics, aliases and system
906 # provide programmatic (pure python) access to magics, aliases and system
907 # calls. This is important for logging, user scripting, and more.
907 # calls. This is important for logging, user scripting, and more.
908
908
909 # We are basically exposing, via normal python functions, the three
909 # We are basically exposing, via normal python functions, the three
910 # mechanisms in which ipython offers special call modes (magics for
910 # mechanisms in which ipython offers special call modes (magics for
911 # internal control, aliases for direct system access via pre-selected
911 # internal control, aliases for direct system access via pre-selected
912 # names, and !cmd for calling arbitrary system commands).
912 # names, and !cmd for calling arbitrary system commands).
913
913
914 def ipmagic(self,arg_s):
914 def ipmagic(self,arg_s):
915 """Call a magic function by name.
915 """Call a magic function by name.
916
916
917 Input: a string containing the name of the magic function to call and any
917 Input: a string containing the name of the magic function to call and any
918 additional arguments to be passed to the magic.
918 additional arguments to be passed to the magic.
919
919
920 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
920 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
921 prompt:
921 prompt:
922
922
923 In[1]: %name -opt foo bar
923 In[1]: %name -opt foo bar
924
924
925 To call a magic without arguments, simply use ipmagic('name').
925 To call a magic without arguments, simply use ipmagic('name').
926
926
927 This provides a proper Python function to call IPython's magics in any
927 This provides a proper Python function to call IPython's magics in any
928 valid Python code you can type at the interpreter, including loops and
928 valid Python code you can type at the interpreter, including loops and
929 compound statements. It is added by IPython to the Python builtin
929 compound statements. It is added by IPython to the Python builtin
930 namespace upon initialization."""
930 namespace upon initialization."""
931
931
932 args = arg_s.split(' ',1)
932 args = arg_s.split(' ',1)
933 magic_name = args[0]
933 magic_name = args[0]
934 magic_name = magic_name.lstrip(self.ESC_MAGIC)
934 magic_name = magic_name.lstrip(self.ESC_MAGIC)
935
935
936 try:
936 try:
937 magic_args = args[1]
937 magic_args = args[1]
938 except IndexError:
938 except IndexError:
939 magic_args = ''
939 magic_args = ''
940 fn = getattr(self,'magic_'+magic_name,None)
940 fn = getattr(self,'magic_'+magic_name,None)
941 if fn is None:
941 if fn is None:
942 error("Magic function `%s` not found." % magic_name)
942 error("Magic function `%s` not found." % magic_name)
943 else:
943 else:
944 magic_args = self.var_expand(magic_args,1)
944 magic_args = self.var_expand(magic_args,1)
945 return fn(magic_args)
945 return fn(magic_args)
946
946
947 def ipalias(self,arg_s):
947 def ipalias(self,arg_s):
948 """Call an alias by name.
948 """Call an alias by name.
949
949
950 Input: a string containing the name of the alias to call and any
950 Input: a string containing the name of the alias to call and any
951 additional arguments to be passed to the magic.
951 additional arguments to be passed to the magic.
952
952
953 ipalias('name -opt foo bar') is equivalent to typing at the ipython
953 ipalias('name -opt foo bar') is equivalent to typing at the ipython
954 prompt:
954 prompt:
955
955
956 In[1]: name -opt foo bar
956 In[1]: name -opt foo bar
957
957
958 To call an alias without arguments, simply use ipalias('name').
958 To call an alias without arguments, simply use ipalias('name').
959
959
960 This provides a proper Python function to call IPython's aliases in any
960 This provides a proper Python function to call IPython's aliases in any
961 valid Python code you can type at the interpreter, including loops and
961 valid Python code you can type at the interpreter, including loops and
962 compound statements. It is added by IPython to the Python builtin
962 compound statements. It is added by IPython to the Python builtin
963 namespace upon initialization."""
963 namespace upon initialization."""
964
964
965 args = arg_s.split(' ',1)
965 args = arg_s.split(' ',1)
966 alias_name = args[0]
966 alias_name = args[0]
967 try:
967 try:
968 alias_args = args[1]
968 alias_args = args[1]
969 except IndexError:
969 except IndexError:
970 alias_args = ''
970 alias_args = ''
971 if alias_name in self.alias_table:
971 if alias_name in self.alias_table:
972 self.call_alias(alias_name,alias_args)
972 self.call_alias(alias_name,alias_args)
973 else:
973 else:
974 error("Alias `%s` not found." % alias_name)
974 error("Alias `%s` not found." % alias_name)
975
975
976 def ipsystem(self,arg_s):
976 def ipsystem(self,arg_s):
977 """Make a system call, using IPython."""
977 """Make a system call, using IPython."""
978
978
979 self.system(arg_s)
979 self.system(arg_s)
980
980
981 def complete(self,text):
981 def complete(self,text):
982 """Return a sorted list of all possible completions on text.
982 """Return a sorted list of all possible completions on text.
983
983
984 Inputs:
984 Inputs:
985
985
986 - text: a string of text to be completed on.
986 - text: a string of text to be completed on.
987
987
988 This is a wrapper around the completion mechanism, similar to what
988 This is a wrapper around the completion mechanism, similar to what
989 readline does at the command line when the TAB key is hit. By
989 readline does at the command line when the TAB key is hit. By
990 exposing it as a method, it can be used by other non-readline
990 exposing it as a method, it can be used by other non-readline
991 environments (such as GUIs) for text completion.
991 environments (such as GUIs) for text completion.
992
992
993 Simple usage example:
993 Simple usage example:
994
994
995 In [1]: x = 'hello'
995 In [1]: x = 'hello'
996
996
997 In [2]: __IP.complete('x.l')
997 In [2]: __IP.complete('x.l')
998 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
998 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
999
999
1000 complete = self.Completer.complete
1000 complete = self.Completer.complete
1001 state = 0
1001 state = 0
1002 # use a dict so we get unique keys, since ipyhton's multiple
1002 # use a dict so we get unique keys, since ipyhton's multiple
1003 # completers can return duplicates. When we make 2.4 a requirement,
1003 # completers can return duplicates. When we make 2.4 a requirement,
1004 # start using sets instead, which are faster.
1004 # start using sets instead, which are faster.
1005 comps = {}
1005 comps = {}
1006 while True:
1006 while True:
1007 newcomp = complete(text,state,line_buffer=text)
1007 newcomp = complete(text,state,line_buffer=text)
1008 if newcomp is None:
1008 if newcomp is None:
1009 break
1009 break
1010 comps[newcomp] = 1
1010 comps[newcomp] = 1
1011 state += 1
1011 state += 1
1012 outcomps = comps.keys()
1012 outcomps = comps.keys()
1013 outcomps.sort()
1013 outcomps.sort()
1014 return outcomps
1014 return outcomps
1015
1015
1016 def set_completer_frame(self, frame=None):
1016 def set_completer_frame(self, frame=None):
1017 if frame:
1017 if frame:
1018 self.Completer.namespace = frame.f_locals
1018 self.Completer.namespace = frame.f_locals
1019 self.Completer.global_namespace = frame.f_globals
1019 self.Completer.global_namespace = frame.f_globals
1020 else:
1020 else:
1021 self.Completer.namespace = self.user_ns
1021 self.Completer.namespace = self.user_ns
1022 self.Completer.global_namespace = self.user_global_ns
1022 self.Completer.global_namespace = self.user_global_ns
1023
1023
1024 def init_auto_alias(self):
1024 def init_auto_alias(self):
1025 """Define some aliases automatically.
1025 """Define some aliases automatically.
1026
1026
1027 These are ALL parameter-less aliases"""
1027 These are ALL parameter-less aliases"""
1028
1028
1029 for alias,cmd in self.auto_alias:
1029 for alias,cmd in self.auto_alias:
1030 self.getapi().defalias(alias,cmd)
1030 self.getapi().defalias(alias,cmd)
1031
1031
1032
1032
1033 def alias_table_validate(self,verbose=0):
1033 def alias_table_validate(self,verbose=0):
1034 """Update information about the alias table.
1034 """Update information about the alias table.
1035
1035
1036 In particular, make sure no Python keywords/builtins are in it."""
1036 In particular, make sure no Python keywords/builtins are in it."""
1037
1037
1038 no_alias = self.no_alias
1038 no_alias = self.no_alias
1039 for k in self.alias_table.keys():
1039 for k in self.alias_table.keys():
1040 if k in no_alias:
1040 if k in no_alias:
1041 del self.alias_table[k]
1041 del self.alias_table[k]
1042 if verbose:
1042 if verbose:
1043 print ("Deleting alias <%s>, it's a Python "
1043 print ("Deleting alias <%s>, it's a Python "
1044 "keyword or builtin." % k)
1044 "keyword or builtin." % k)
1045
1045
1046 def set_autoindent(self,value=None):
1046 def set_autoindent(self,value=None):
1047 """Set the autoindent flag, checking for readline support.
1047 """Set the autoindent flag, checking for readline support.
1048
1048
1049 If called with no arguments, it acts as a toggle."""
1049 If called with no arguments, it acts as a toggle."""
1050
1050
1051 if not self.has_readline:
1051 if not self.has_readline:
1052 if os.name == 'posix':
1052 if os.name == 'posix':
1053 warn("The auto-indent feature requires the readline library")
1053 warn("The auto-indent feature requires the readline library")
1054 self.autoindent = 0
1054 self.autoindent = 0
1055 return
1055 return
1056 if value is None:
1056 if value is None:
1057 self.autoindent = not self.autoindent
1057 self.autoindent = not self.autoindent
1058 else:
1058 else:
1059 self.autoindent = value
1059 self.autoindent = value
1060
1060
1061 def rc_set_toggle(self,rc_field,value=None):
1061 def rc_set_toggle(self,rc_field,value=None):
1062 """Set or toggle a field in IPython's rc config. structure.
1062 """Set or toggle a field in IPython's rc config. structure.
1063
1063
1064 If called with no arguments, it acts as a toggle.
1064 If called with no arguments, it acts as a toggle.
1065
1065
1066 If called with a non-existent field, the resulting AttributeError
1066 If called with a non-existent field, the resulting AttributeError
1067 exception will propagate out."""
1067 exception will propagate out."""
1068
1068
1069 rc_val = getattr(self.rc,rc_field)
1069 rc_val = getattr(self.rc,rc_field)
1070 if value is None:
1070 if value is None:
1071 value = not rc_val
1071 value = not rc_val
1072 setattr(self.rc,rc_field,value)
1072 setattr(self.rc,rc_field,value)
1073
1073
1074 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1074 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1075 """Install the user configuration directory.
1075 """Install the user configuration directory.
1076
1076
1077 Can be called when running for the first time or to upgrade the user's
1077 Can be called when running for the first time or to upgrade the user's
1078 .ipython/ directory with the mode parameter. Valid modes are 'install'
1078 .ipython/ directory with the mode parameter. Valid modes are 'install'
1079 and 'upgrade'."""
1079 and 'upgrade'."""
1080
1080
1081 def wait():
1081 def wait():
1082 try:
1082 try:
1083 raw_input("Please press <RETURN> to start IPython.")
1083 raw_input("Please press <RETURN> to start IPython.")
1084 except EOFError:
1084 except EOFError:
1085 print >> Term.cout
1085 print >> Term.cout
1086 print '*'*70
1086 print '*'*70
1087
1087
1088 cwd = os.getcwd() # remember where we started
1088 cwd = os.getcwd() # remember where we started
1089 glb = glob.glob
1089 glb = glob.glob
1090 print '*'*70
1090 print '*'*70
1091 if mode == 'install':
1091 if mode == 'install':
1092 print \
1092 print \
1093 """Welcome to IPython. I will try to create a personal configuration directory
1093 """Welcome to IPython. I will try to create a personal configuration directory
1094 where you can customize many aspects of IPython's functionality in:\n"""
1094 where you can customize many aspects of IPython's functionality in:\n"""
1095 else:
1095 else:
1096 print 'I am going to upgrade your configuration in:'
1096 print 'I am going to upgrade your configuration in:'
1097
1097
1098 print ipythondir
1098 print ipythondir
1099
1099
1100 rcdirend = os.path.join('IPython','UserConfig')
1100 rcdirend = os.path.join('IPython','UserConfig')
1101 cfg = lambda d: os.path.join(d,rcdirend)
1101 cfg = lambda d: os.path.join(d,rcdirend)
1102 try:
1102 try:
1103 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1103 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1104 except IOError:
1104 except IOError:
1105 warning = """
1105 warning = """
1106 Installation error. IPython's directory was not found.
1106 Installation error. IPython's directory was not found.
1107
1107
1108 Check the following:
1108 Check the following:
1109
1109
1110 The ipython/IPython directory should be in a directory belonging to your
1110 The ipython/IPython directory should be in a directory belonging to your
1111 PYTHONPATH environment variable (that is, it should be in a directory
1111 PYTHONPATH environment variable (that is, it should be in a directory
1112 belonging to sys.path). You can copy it explicitly there or just link to it.
1112 belonging to sys.path). You can copy it explicitly there or just link to it.
1113
1113
1114 IPython will proceed with builtin defaults.
1114 IPython will proceed with builtin defaults.
1115 """
1115 """
1116 warn(warning)
1116 warn(warning)
1117 wait()
1117 wait()
1118 return
1118 return
1119
1119
1120 if mode == 'install':
1120 if mode == 'install':
1121 try:
1121 try:
1122 shutil.copytree(rcdir,ipythondir)
1122 shutil.copytree(rcdir,ipythondir)
1123 os.chdir(ipythondir)
1123 os.chdir(ipythondir)
1124 rc_files = glb("ipythonrc*")
1124 rc_files = glb("ipythonrc*")
1125 for rc_file in rc_files:
1125 for rc_file in rc_files:
1126 os.rename(rc_file,rc_file+rc_suffix)
1126 os.rename(rc_file,rc_file+rc_suffix)
1127 except:
1127 except:
1128 warning = """
1128 warning = """
1129
1129
1130 There was a problem with the installation:
1130 There was a problem with the installation:
1131 %s
1131 %s
1132 Try to correct it or contact the developers if you think it's a bug.
1132 Try to correct it or contact the developers if you think it's a bug.
1133 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1133 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1134 warn(warning)
1134 warn(warning)
1135 wait()
1135 wait()
1136 return
1136 return
1137
1137
1138 elif mode == 'upgrade':
1138 elif mode == 'upgrade':
1139 try:
1139 try:
1140 os.chdir(ipythondir)
1140 os.chdir(ipythondir)
1141 except:
1141 except:
1142 print """
1142 print """
1143 Can not upgrade: changing to directory %s failed. Details:
1143 Can not upgrade: changing to directory %s failed. Details:
1144 %s
1144 %s
1145 """ % (ipythondir,sys.exc_info()[1])
1145 """ % (ipythondir,sys.exc_info()[1])
1146 wait()
1146 wait()
1147 return
1147 return
1148 else:
1148 else:
1149 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1149 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1150 for new_full_path in sources:
1150 for new_full_path in sources:
1151 new_filename = os.path.basename(new_full_path)
1151 new_filename = os.path.basename(new_full_path)
1152 if new_filename.startswith('ipythonrc'):
1152 if new_filename.startswith('ipythonrc'):
1153 new_filename = new_filename + rc_suffix
1153 new_filename = new_filename + rc_suffix
1154 # The config directory should only contain files, skip any
1154 # The config directory should only contain files, skip any
1155 # directories which may be there (like CVS)
1155 # directories which may be there (like CVS)
1156 if os.path.isdir(new_full_path):
1156 if os.path.isdir(new_full_path):
1157 continue
1157 continue
1158 if os.path.exists(new_filename):
1158 if os.path.exists(new_filename):
1159 old_file = new_filename+'.old'
1159 old_file = new_filename+'.old'
1160 if os.path.exists(old_file):
1160 if os.path.exists(old_file):
1161 os.remove(old_file)
1161 os.remove(old_file)
1162 os.rename(new_filename,old_file)
1162 os.rename(new_filename,old_file)
1163 shutil.copy(new_full_path,new_filename)
1163 shutil.copy(new_full_path,new_filename)
1164 else:
1164 else:
1165 raise ValueError,'unrecognized mode for install:',`mode`
1165 raise ValueError,'unrecognized mode for install:',`mode`
1166
1166
1167 # Fix line-endings to those native to each platform in the config
1167 # Fix line-endings to those native to each platform in the config
1168 # directory.
1168 # directory.
1169 try:
1169 try:
1170 os.chdir(ipythondir)
1170 os.chdir(ipythondir)
1171 except:
1171 except:
1172 print """
1172 print """
1173 Problem: changing to directory %s failed.
1173 Problem: changing to directory %s failed.
1174 Details:
1174 Details:
1175 %s
1175 %s
1176
1176
1177 Some configuration files may have incorrect line endings. This should not
1177 Some configuration files may have incorrect line endings. This should not
1178 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1178 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1179 wait()
1179 wait()
1180 else:
1180 else:
1181 for fname in glb('ipythonrc*'):
1181 for fname in glb('ipythonrc*'):
1182 try:
1182 try:
1183 native_line_ends(fname,backup=0)
1183 native_line_ends(fname,backup=0)
1184 except IOError:
1184 except IOError:
1185 pass
1185 pass
1186
1186
1187 if mode == 'install':
1187 if mode == 'install':
1188 print """
1188 print """
1189 Successful installation!
1189 Successful installation!
1190
1190
1191 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1191 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1192 IPython manual (there are both HTML and PDF versions supplied with the
1192 IPython manual (there are both HTML and PDF versions supplied with the
1193 distribution) to make sure that your system environment is properly configured
1193 distribution) to make sure that your system environment is properly configured
1194 to take advantage of IPython's features.
1194 to take advantage of IPython's features.
1195
1195
1196 Important note: the configuration system has changed! The old system is
1196 Important note: the configuration system has changed! The old system is
1197 still in place, but its setting may be partly overridden by the settings in
1197 still in place, but its setting may be partly overridden by the settings in
1198 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1198 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1199 if some of the new settings bother you.
1199 if some of the new settings bother you.
1200
1200
1201 """
1201 """
1202 else:
1202 else:
1203 print """
1203 print """
1204 Successful upgrade!
1204 Successful upgrade!
1205
1205
1206 All files in your directory:
1206 All files in your directory:
1207 %(ipythondir)s
1207 %(ipythondir)s
1208 which would have been overwritten by the upgrade were backed up with a .old
1208 which would have been overwritten by the upgrade were backed up with a .old
1209 extension. If you had made particular customizations in those files you may
1209 extension. If you had made particular customizations in those files you may
1210 want to merge them back into the new files.""" % locals()
1210 want to merge them back into the new files.""" % locals()
1211 wait()
1211 wait()
1212 os.chdir(cwd)
1212 os.chdir(cwd)
1213 # end user_setup()
1213 # end user_setup()
1214
1214
1215 def atexit_operations(self):
1215 def atexit_operations(self):
1216 """This will be executed at the time of exit.
1216 """This will be executed at the time of exit.
1217
1217
1218 Saving of persistent data should be performed here. """
1218 Saving of persistent data should be performed here. """
1219
1219
1220 #print '*** IPython exit cleanup ***' # dbg
1220 #print '*** IPython exit cleanup ***' # dbg
1221 # input history
1221 # input history
1222 self.savehist()
1222 self.savehist()
1223
1223
1224 # Cleanup all tempfiles left around
1224 # Cleanup all tempfiles left around
1225 for tfile in self.tempfiles:
1225 for tfile in self.tempfiles:
1226 try:
1226 try:
1227 os.unlink(tfile)
1227 os.unlink(tfile)
1228 except OSError:
1228 except OSError:
1229 pass
1229 pass
1230
1230
1231 self.hooks.shutdown_hook()
1231 self.hooks.shutdown_hook()
1232
1232
1233 def savehist(self):
1233 def savehist(self):
1234 """Save input history to a file (via readline library)."""
1234 """Save input history to a file (via readline library)."""
1235 try:
1235 try:
1236 self.readline.write_history_file(self.histfile)
1236 self.readline.write_history_file(self.histfile)
1237 except:
1237 except:
1238 print 'Unable to save IPython command history to file: ' + \
1238 print 'Unable to save IPython command history to file: ' + \
1239 `self.histfile`
1239 `self.histfile`
1240
1240
1241 def reloadhist(self):
1241 def reloadhist(self):
1242 """Reload the input history from disk file."""
1242 """Reload the input history from disk file."""
1243
1243
1244 if self.has_readline:
1244 if self.has_readline:
1245 self.readline.clear_history()
1245 self.readline.clear_history()
1246 self.readline.read_history_file(self.shell.histfile)
1246 self.readline.read_history_file(self.shell.histfile)
1247
1247
1248 def history_saving_wrapper(self, func):
1248 def history_saving_wrapper(self, func):
1249 """ Wrap func for readline history saving
1249 """ Wrap func for readline history saving
1250
1250
1251 Convert func into callable that saves & restores
1251 Convert func into callable that saves & restores
1252 history around the call """
1252 history around the call """
1253
1253
1254 if not self.has_readline:
1254 if not self.has_readline:
1255 return func
1255 return func
1256
1256
1257 def wrapper():
1257 def wrapper():
1258 self.savehist()
1258 self.savehist()
1259 try:
1259 try:
1260 func()
1260 func()
1261 finally:
1261 finally:
1262 readline.read_history_file(self.histfile)
1262 readline.read_history_file(self.histfile)
1263 return wrapper
1263 return wrapper
1264
1264
1265
1265
1266 def pre_readline(self):
1266 def pre_readline(self):
1267 """readline hook to be used at the start of each line.
1267 """readline hook to be used at the start of each line.
1268
1268
1269 Currently it handles auto-indent only."""
1269 Currently it handles auto-indent only."""
1270
1270
1271 #debugx('self.indent_current_nsp','pre_readline:')
1271 #debugx('self.indent_current_nsp','pre_readline:')
1272
1272
1273 if self.rl_do_indent:
1273 if self.rl_do_indent:
1274 self.readline.insert_text(self.indent_current_str())
1274 self.readline.insert_text(self.indent_current_str())
1275 if self.rl_next_input is not None:
1275 if self.rl_next_input is not None:
1276 self.readline.insert_text(self.rl_next_input)
1276 self.readline.insert_text(self.rl_next_input)
1277 self.rl_next_input = None
1277 self.rl_next_input = None
1278
1278
1279 def init_readline(self):
1279 def init_readline(self):
1280 """Command history completion/saving/reloading."""
1280 """Command history completion/saving/reloading."""
1281
1281
1282
1282
1283 import IPython.rlineimpl as readline
1283 import IPython.rlineimpl as readline
1284
1284
1285 if not readline.have_readline:
1285 if not readline.have_readline:
1286 self.has_readline = 0
1286 self.has_readline = 0
1287 self.readline = None
1287 self.readline = None
1288 # no point in bugging windows users with this every time:
1288 # no point in bugging windows users with this every time:
1289 warn('Readline services not available on this platform.')
1289 warn('Readline services not available on this platform.')
1290 else:
1290 else:
1291 sys.modules['readline'] = readline
1291 sys.modules['readline'] = readline
1292 import atexit
1292 import atexit
1293 from IPython.completer import IPCompleter
1293 from IPython.completer import IPCompleter
1294 self.Completer = IPCompleter(self,
1294 self.Completer = IPCompleter(self,
1295 self.user_ns,
1295 self.user_ns,
1296 self.user_global_ns,
1296 self.user_global_ns,
1297 self.rc.readline_omit__names,
1297 self.rc.readline_omit__names,
1298 self.alias_table)
1298 self.alias_table)
1299 sdisp = self.strdispatchers.get('complete_command', StrDispatch())
1299 sdisp = self.strdispatchers.get('complete_command', StrDispatch())
1300 self.strdispatchers['complete_command'] = sdisp
1300 self.strdispatchers['complete_command'] = sdisp
1301 self.Completer.custom_completers = sdisp
1301 self.Completer.custom_completers = sdisp
1302 # Platform-specific configuration
1302 # Platform-specific configuration
1303 if os.name == 'nt':
1303 if os.name == 'nt':
1304 self.readline_startup_hook = readline.set_pre_input_hook
1304 self.readline_startup_hook = readline.set_pre_input_hook
1305 else:
1305 else:
1306 self.readline_startup_hook = readline.set_startup_hook
1306 self.readline_startup_hook = readline.set_startup_hook
1307
1307
1308 # Load user's initrc file (readline config)
1308 # Load user's initrc file (readline config)
1309 inputrc_name = os.environ.get('INPUTRC')
1309 inputrc_name = os.environ.get('INPUTRC')
1310 if inputrc_name is None:
1310 if inputrc_name is None:
1311 home_dir = get_home_dir()
1311 home_dir = get_home_dir()
1312 if home_dir is not None:
1312 if home_dir is not None:
1313 inputrc_name = os.path.join(home_dir,'.inputrc')
1313 inputrc_name = os.path.join(home_dir,'.inputrc')
1314 if os.path.isfile(inputrc_name):
1314 if os.path.isfile(inputrc_name):
1315 try:
1315 try:
1316 readline.read_init_file(inputrc_name)
1316 readline.read_init_file(inputrc_name)
1317 except:
1317 except:
1318 warn('Problems reading readline initialization file <%s>'
1318 warn('Problems reading readline initialization file <%s>'
1319 % inputrc_name)
1319 % inputrc_name)
1320
1320
1321 self.has_readline = 1
1321 self.has_readline = 1
1322 self.readline = readline
1322 self.readline = readline
1323 # save this in sys so embedded copies can restore it properly
1323 # save this in sys so embedded copies can restore it properly
1324 sys.ipcompleter = self.Completer.complete
1324 sys.ipcompleter = self.Completer.complete
1325 self.set_completer()
1325 self.set_completer()
1326
1326
1327 # Configure readline according to user's prefs
1327 # Configure readline according to user's prefs
1328 for rlcommand in self.rc.readline_parse_and_bind:
1328 for rlcommand in self.rc.readline_parse_and_bind:
1329 readline.parse_and_bind(rlcommand)
1329 readline.parse_and_bind(rlcommand)
1330
1330
1331 # remove some chars from the delimiters list
1331 # remove some chars from the delimiters list
1332 delims = readline.get_completer_delims()
1332 delims = readline.get_completer_delims()
1333 delims = delims.translate(string._idmap,
1333 delims = delims.translate(string._idmap,
1334 self.rc.readline_remove_delims)
1334 self.rc.readline_remove_delims)
1335 readline.set_completer_delims(delims)
1335 readline.set_completer_delims(delims)
1336 # otherwise we end up with a monster history after a while:
1336 # otherwise we end up with a monster history after a while:
1337 readline.set_history_length(1000)
1337 readline.set_history_length(1000)
1338 try:
1338 try:
1339 #print '*** Reading readline history' # dbg
1339 #print '*** Reading readline history' # dbg
1340 readline.read_history_file(self.histfile)
1340 readline.read_history_file(self.histfile)
1341 except IOError:
1341 except IOError:
1342 pass # It doesn't exist yet.
1342 pass # It doesn't exist yet.
1343
1343
1344 atexit.register(self.atexit_operations)
1344 atexit.register(self.atexit_operations)
1345 del atexit
1345 del atexit
1346
1346
1347 # Configure auto-indent for all platforms
1347 # Configure auto-indent for all platforms
1348 self.set_autoindent(self.rc.autoindent)
1348 self.set_autoindent(self.rc.autoindent)
1349
1349
1350 def ask_yes_no(self,prompt,default=True):
1350 def ask_yes_no(self,prompt,default=True):
1351 if self.rc.quiet:
1351 if self.rc.quiet:
1352 return True
1352 return True
1353 return ask_yes_no(prompt,default)
1353 return ask_yes_no(prompt,default)
1354
1354
1355 def _should_recompile(self,e):
1355 def _should_recompile(self,e):
1356 """Utility routine for edit_syntax_error"""
1356 """Utility routine for edit_syntax_error"""
1357
1357
1358 if e.filename in ('<ipython console>','<input>','<string>',
1358 if e.filename in ('<ipython console>','<input>','<string>',
1359 '<console>','<BackgroundJob compilation>',
1359 '<console>','<BackgroundJob compilation>',
1360 None):
1360 None):
1361
1361
1362 return False
1362 return False
1363 try:
1363 try:
1364 if (self.rc.autoedit_syntax and
1364 if (self.rc.autoedit_syntax and
1365 not self.ask_yes_no('Return to editor to correct syntax error? '
1365 not self.ask_yes_no('Return to editor to correct syntax error? '
1366 '[Y/n] ','y')):
1366 '[Y/n] ','y')):
1367 return False
1367 return False
1368 except EOFError:
1368 except EOFError:
1369 return False
1369 return False
1370
1370
1371 def int0(x):
1371 def int0(x):
1372 try:
1372 try:
1373 return int(x)
1373 return int(x)
1374 except TypeError:
1374 except TypeError:
1375 return 0
1375 return 0
1376 # always pass integer line and offset values to editor hook
1376 # always pass integer line and offset values to editor hook
1377 self.hooks.fix_error_editor(e.filename,
1377 self.hooks.fix_error_editor(e.filename,
1378 int0(e.lineno),int0(e.offset),e.msg)
1378 int0(e.lineno),int0(e.offset),e.msg)
1379 return True
1379 return True
1380
1380
1381 def edit_syntax_error(self):
1381 def edit_syntax_error(self):
1382 """The bottom half of the syntax error handler called in the main loop.
1382 """The bottom half of the syntax error handler called in the main loop.
1383
1383
1384 Loop until syntax error is fixed or user cancels.
1384 Loop until syntax error is fixed or user cancels.
1385 """
1385 """
1386
1386
1387 while self.SyntaxTB.last_syntax_error:
1387 while self.SyntaxTB.last_syntax_error:
1388 # copy and clear last_syntax_error
1388 # copy and clear last_syntax_error
1389 err = self.SyntaxTB.clear_err_state()
1389 err = self.SyntaxTB.clear_err_state()
1390 if not self._should_recompile(err):
1390 if not self._should_recompile(err):
1391 return
1391 return
1392 try:
1392 try:
1393 # may set last_syntax_error again if a SyntaxError is raised
1393 # may set last_syntax_error again if a SyntaxError is raised
1394 self.safe_execfile(err.filename,self.user_ns)
1394 self.safe_execfile(err.filename,self.user_ns)
1395 except:
1395 except:
1396 self.showtraceback()
1396 self.showtraceback()
1397 else:
1397 else:
1398 try:
1398 try:
1399 f = file(err.filename)
1399 f = file(err.filename)
1400 try:
1400 try:
1401 sys.displayhook(f.read())
1401 sys.displayhook(f.read())
1402 finally:
1402 finally:
1403 f.close()
1403 f.close()
1404 except:
1404 except:
1405 self.showtraceback()
1405 self.showtraceback()
1406
1406
1407 def showsyntaxerror(self, filename=None):
1407 def showsyntaxerror(self, filename=None):
1408 """Display the syntax error that just occurred.
1408 """Display the syntax error that just occurred.
1409
1409
1410 This doesn't display a stack trace because there isn't one.
1410 This doesn't display a stack trace because there isn't one.
1411
1411
1412 If a filename is given, it is stuffed in the exception instead
1412 If a filename is given, it is stuffed in the exception instead
1413 of what was there before (because Python's parser always uses
1413 of what was there before (because Python's parser always uses
1414 "<string>" when reading from a string).
1414 "<string>" when reading from a string).
1415 """
1415 """
1416 etype, value, last_traceback = sys.exc_info()
1416 etype, value, last_traceback = sys.exc_info()
1417
1417
1418 # See note about these variables in showtraceback() below
1418 # See note about these variables in showtraceback() below
1419 sys.last_type = etype
1419 sys.last_type = etype
1420 sys.last_value = value
1420 sys.last_value = value
1421 sys.last_traceback = last_traceback
1421 sys.last_traceback = last_traceback
1422
1422
1423 if filename and etype is SyntaxError:
1423 if filename and etype is SyntaxError:
1424 # Work hard to stuff the correct filename in the exception
1424 # Work hard to stuff the correct filename in the exception
1425 try:
1425 try:
1426 msg, (dummy_filename, lineno, offset, line) = value
1426 msg, (dummy_filename, lineno, offset, line) = value
1427 except:
1427 except:
1428 # Not the format we expect; leave it alone
1428 # Not the format we expect; leave it alone
1429 pass
1429 pass
1430 else:
1430 else:
1431 # Stuff in the right filename
1431 # Stuff in the right filename
1432 try:
1432 try:
1433 # Assume SyntaxError is a class exception
1433 # Assume SyntaxError is a class exception
1434 value = SyntaxError(msg, (filename, lineno, offset, line))
1434 value = SyntaxError(msg, (filename, lineno, offset, line))
1435 except:
1435 except:
1436 # If that failed, assume SyntaxError is a string
1436 # If that failed, assume SyntaxError is a string
1437 value = msg, (filename, lineno, offset, line)
1437 value = msg, (filename, lineno, offset, line)
1438 self.SyntaxTB(etype,value,[])
1438 self.SyntaxTB(etype,value,[])
1439
1439
1440 def debugger(self,force=False):
1440 def debugger(self,force=False):
1441 """Call the pydb/pdb debugger.
1441 """Call the pydb/pdb debugger.
1442
1442
1443 Keywords:
1443 Keywords:
1444
1444
1445 - force(False): by default, this routine checks the instance call_pdb
1445 - force(False): by default, this routine checks the instance call_pdb
1446 flag and does not actually invoke the debugger if the flag is false.
1446 flag and does not actually invoke the debugger if the flag is false.
1447 The 'force' option forces the debugger to activate even if the flag
1447 The 'force' option forces the debugger to activate even if the flag
1448 is false.
1448 is false.
1449 """
1449 """
1450
1450
1451 if not (force or self.call_pdb):
1451 if not (force or self.call_pdb):
1452 return
1452 return
1453
1453
1454 if not hasattr(sys,'last_traceback'):
1454 if not hasattr(sys,'last_traceback'):
1455 error('No traceback has been produced, nothing to debug.')
1455 error('No traceback has been produced, nothing to debug.')
1456 return
1456 return
1457
1457
1458 # use pydb if available
1458 # use pydb if available
1459 if Debugger.has_pydb:
1459 if Debugger.has_pydb:
1460 from pydb import pm
1460 from pydb import pm
1461 else:
1461 else:
1462 # fallback to our internal debugger
1462 # fallback to our internal debugger
1463 pm = lambda : self.InteractiveTB.debugger(force=True)
1463 pm = lambda : self.InteractiveTB.debugger(force=True)
1464 self.history_saving_wrapper(pm)()
1464 self.history_saving_wrapper(pm)()
1465
1465
1466 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1466 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1467 """Display the exception that just occurred.
1467 """Display the exception that just occurred.
1468
1468
1469 If nothing is known about the exception, this is the method which
1469 If nothing is known about the exception, this is the method which
1470 should be used throughout the code for presenting user tracebacks,
1470 should be used throughout the code for presenting user tracebacks,
1471 rather than directly invoking the InteractiveTB object.
1471 rather than directly invoking the InteractiveTB object.
1472
1472
1473 A specific showsyntaxerror() also exists, but this method can take
1473 A specific showsyntaxerror() also exists, but this method can take
1474 care of calling it if needed, so unless you are explicitly catching a
1474 care of calling it if needed, so unless you are explicitly catching a
1475 SyntaxError exception, don't try to analyze the stack manually and
1475 SyntaxError exception, don't try to analyze the stack manually and
1476 simply call this method."""
1476 simply call this method."""
1477
1477
1478
1478
1479 # Though this won't be called by syntax errors in the input line,
1479 # Though this won't be called by syntax errors in the input line,
1480 # there may be SyntaxError cases whith imported code.
1480 # there may be SyntaxError cases whith imported code.
1481
1481
1482
1482
1483 if exc_tuple is None:
1483 if exc_tuple is None:
1484 etype, value, tb = sys.exc_info()
1484 etype, value, tb = sys.exc_info()
1485 else:
1485 else:
1486 etype, value, tb = exc_tuple
1486 etype, value, tb = exc_tuple
1487
1487
1488 if etype is SyntaxError:
1488 if etype is SyntaxError:
1489 self.showsyntaxerror(filename)
1489 self.showsyntaxerror(filename)
1490 else:
1490 else:
1491 # WARNING: these variables are somewhat deprecated and not
1491 # WARNING: these variables are somewhat deprecated and not
1492 # necessarily safe to use in a threaded environment, but tools
1492 # necessarily safe to use in a threaded environment, but tools
1493 # like pdb depend on their existence, so let's set them. If we
1493 # like pdb depend on their existence, so let's set them. If we
1494 # find problems in the field, we'll need to revisit their use.
1494 # find problems in the field, we'll need to revisit their use.
1495 sys.last_type = etype
1495 sys.last_type = etype
1496 sys.last_value = value
1496 sys.last_value = value
1497 sys.last_traceback = tb
1497 sys.last_traceback = tb
1498
1498
1499 if etype in self.custom_exceptions:
1499 if etype in self.custom_exceptions:
1500 self.CustomTB(etype,value,tb)
1500 self.CustomTB(etype,value,tb)
1501 else:
1501 else:
1502 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1502 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1503 if self.InteractiveTB.call_pdb and self.has_readline:
1503 if self.InteractiveTB.call_pdb and self.has_readline:
1504 # pdb mucks up readline, fix it back
1504 # pdb mucks up readline, fix it back
1505 self.set_completer()
1505 self.set_completer()
1506
1506
1507
1507
1508 def mainloop(self,banner=None):
1508 def mainloop(self,banner=None):
1509 """Creates the local namespace and starts the mainloop.
1509 """Creates the local namespace and starts the mainloop.
1510
1510
1511 If an optional banner argument is given, it will override the
1511 If an optional banner argument is given, it will override the
1512 internally created default banner."""
1512 internally created default banner."""
1513
1513
1514 if self.rc.c: # Emulate Python's -c option
1514 if self.rc.c: # Emulate Python's -c option
1515 self.exec_init_cmd()
1515 self.exec_init_cmd()
1516 if banner is None:
1516 if banner is None:
1517 if not self.rc.banner:
1517 if not self.rc.banner:
1518 banner = ''
1518 banner = ''
1519 # banner is string? Use it directly!
1519 # banner is string? Use it directly!
1520 elif isinstance(self.rc.banner,basestring):
1520 elif isinstance(self.rc.banner,basestring):
1521 banner = self.rc.banner
1521 banner = self.rc.banner
1522 else:
1522 else:
1523 banner = self.BANNER+self.banner2
1523 banner = self.BANNER+self.banner2
1524
1524
1525 self.interact(banner)
1525 self.interact(banner)
1526
1526
1527 def exec_init_cmd(self):
1527 def exec_init_cmd(self):
1528 """Execute a command given at the command line.
1528 """Execute a command given at the command line.
1529
1529
1530 This emulates Python's -c option."""
1530 This emulates Python's -c option."""
1531
1531
1532 #sys.argv = ['-c']
1532 #sys.argv = ['-c']
1533 self.push(self.prefilter(self.rc.c, False))
1533 self.push(self.prefilter(self.rc.c, False))
1534 if not self.rc.interact:
1534 if not self.rc.interact:
1535 self.exit_now = True
1535 self.exit_now = True
1536
1536
1537 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1537 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1538 """Embeds IPython into a running python program.
1538 """Embeds IPython into a running python program.
1539
1539
1540 Input:
1540 Input:
1541
1541
1542 - header: An optional header message can be specified.
1542 - header: An optional header message can be specified.
1543
1543
1544 - local_ns, global_ns: working namespaces. If given as None, the
1544 - local_ns, global_ns: working namespaces. If given as None, the
1545 IPython-initialized one is updated with __main__.__dict__, so that
1545 IPython-initialized one is updated with __main__.__dict__, so that
1546 program variables become visible but user-specific configuration
1546 program variables become visible but user-specific configuration
1547 remains possible.
1547 remains possible.
1548
1548
1549 - stack_depth: specifies how many levels in the stack to go to
1549 - stack_depth: specifies how many levels in the stack to go to
1550 looking for namespaces (when local_ns and global_ns are None). This
1550 looking for namespaces (when local_ns and global_ns are None). This
1551 allows an intermediate caller to make sure that this function gets
1551 allows an intermediate caller to make sure that this function gets
1552 the namespace from the intended level in the stack. By default (0)
1552 the namespace from the intended level in the stack. By default (0)
1553 it will get its locals and globals from the immediate caller.
1553 it will get its locals and globals from the immediate caller.
1554
1554
1555 Warning: it's possible to use this in a program which is being run by
1555 Warning: it's possible to use this in a program which is being run by
1556 IPython itself (via %run), but some funny things will happen (a few
1556 IPython itself (via %run), but some funny things will happen (a few
1557 globals get overwritten). In the future this will be cleaned up, as
1557 globals get overwritten). In the future this will be cleaned up, as
1558 there is no fundamental reason why it can't work perfectly."""
1558 there is no fundamental reason why it can't work perfectly."""
1559
1559
1560 # Get locals and globals from caller
1560 # Get locals and globals from caller
1561 if local_ns is None or global_ns is None:
1561 if local_ns is None or global_ns is None:
1562 call_frame = sys._getframe(stack_depth).f_back
1562 call_frame = sys._getframe(stack_depth).f_back
1563
1563
1564 if local_ns is None:
1564 if local_ns is None:
1565 local_ns = call_frame.f_locals
1565 local_ns = call_frame.f_locals
1566 if global_ns is None:
1566 if global_ns is None:
1567 global_ns = call_frame.f_globals
1567 global_ns = call_frame.f_globals
1568
1568
1569 # Update namespaces and fire up interpreter
1569 # Update namespaces and fire up interpreter
1570
1570
1571 # The global one is easy, we can just throw it in
1571 # The global one is easy, we can just throw it in
1572 self.user_global_ns = global_ns
1572 self.user_global_ns = global_ns
1573
1573
1574 # but the user/local one is tricky: ipython needs it to store internal
1574 # but the user/local one is tricky: ipython needs it to store internal
1575 # data, but we also need the locals. We'll copy locals in the user
1575 # data, but we also need the locals. We'll copy locals in the user
1576 # one, but will track what got copied so we can delete them at exit.
1576 # one, but will track what got copied so we can delete them at exit.
1577 # This is so that a later embedded call doesn't see locals from a
1577 # This is so that a later embedded call doesn't see locals from a
1578 # previous call (which most likely existed in a separate scope).
1578 # previous call (which most likely existed in a separate scope).
1579 local_varnames = local_ns.keys()
1579 local_varnames = local_ns.keys()
1580 self.user_ns.update(local_ns)
1580 self.user_ns.update(local_ns)
1581
1581
1582 # Patch for global embedding to make sure that things don't overwrite
1582 # Patch for global embedding to make sure that things don't overwrite
1583 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1583 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1584 # FIXME. Test this a bit more carefully (the if.. is new)
1584 # FIXME. Test this a bit more carefully (the if.. is new)
1585 if local_ns is None and global_ns is None:
1585 if local_ns is None and global_ns is None:
1586 self.user_global_ns.update(__main__.__dict__)
1586 self.user_global_ns.update(__main__.__dict__)
1587
1587
1588 # make sure the tab-completer has the correct frame information, so it
1588 # make sure the tab-completer has the correct frame information, so it
1589 # actually completes using the frame's locals/globals
1589 # actually completes using the frame's locals/globals
1590 self.set_completer_frame()
1590 self.set_completer_frame()
1591
1591
1592 # before activating the interactive mode, we need to make sure that
1592 # before activating the interactive mode, we need to make sure that
1593 # all names in the builtin namespace needed by ipython point to
1593 # all names in the builtin namespace needed by ipython point to
1594 # ourselves, and not to other instances.
1594 # ourselves, and not to other instances.
1595 self.add_builtins()
1595 self.add_builtins()
1596
1596
1597 self.interact(header)
1597 self.interact(header)
1598
1598
1599 # now, purge out the user namespace from anything we might have added
1599 # now, purge out the user namespace from anything we might have added
1600 # from the caller's local namespace
1600 # from the caller's local namespace
1601 delvar = self.user_ns.pop
1601 delvar = self.user_ns.pop
1602 for var in local_varnames:
1602 for var in local_varnames:
1603 delvar(var,None)
1603 delvar(var,None)
1604 # and clean builtins we may have overridden
1604 # and clean builtins we may have overridden
1605 self.clean_builtins()
1605 self.clean_builtins()
1606
1606
1607 def interact(self, banner=None):
1607 def interact(self, banner=None):
1608 """Closely emulate the interactive Python console.
1608 """Closely emulate the interactive Python console.
1609
1609
1610 The optional banner argument specify the banner to print
1610 The optional banner argument specify the banner to print
1611 before the first interaction; by default it prints a banner
1611 before the first interaction; by default it prints a banner
1612 similar to the one printed by the real Python interpreter,
1612 similar to the one printed by the real Python interpreter,
1613 followed by the current class name in parentheses (so as not
1613 followed by the current class name in parentheses (so as not
1614 to confuse this with the real interpreter -- since it's so
1614 to confuse this with the real interpreter -- since it's so
1615 close!).
1615 close!).
1616
1616
1617 """
1617 """
1618
1618
1619 if self.exit_now:
1619 if self.exit_now:
1620 # batch run -> do not interact
1620 # batch run -> do not interact
1621 return
1621 return
1622 cprt = 'Type "copyright", "credits" or "license" for more information.'
1622 cprt = 'Type "copyright", "credits" or "license" for more information.'
1623 if banner is None:
1623 if banner is None:
1624 self.write("Python %s on %s\n%s\n(%s)\n" %
1624 self.write("Python %s on %s\n%s\n(%s)\n" %
1625 (sys.version, sys.platform, cprt,
1625 (sys.version, sys.platform, cprt,
1626 self.__class__.__name__))
1626 self.__class__.__name__))
1627 else:
1627 else:
1628 self.write(banner)
1628 self.write(banner)
1629
1629
1630 more = 0
1630 more = 0
1631
1631
1632 # Mark activity in the builtins
1632 # Mark activity in the builtins
1633 __builtin__.__dict__['__IPYTHON__active'] += 1
1633 __builtin__.__dict__['__IPYTHON__active'] += 1
1634
1634
1635 if self.has_readline:
1635 if self.has_readline:
1636 self.readline_startup_hook(self.pre_readline)
1636 self.readline_startup_hook(self.pre_readline)
1637 # exit_now is set by a call to %Exit or %Quit
1637 # exit_now is set by a call to %Exit or %Quit
1638
1638
1639 while not self.exit_now:
1639 while not self.exit_now:
1640 if more:
1640 if more:
1641 prompt = self.hooks.generate_prompt(True)
1641 prompt = self.hooks.generate_prompt(True)
1642 if self.autoindent:
1642 if self.autoindent:
1643 self.rl_do_indent = True
1643 self.rl_do_indent = True
1644
1644
1645 else:
1645 else:
1646 prompt = self.hooks.generate_prompt(False)
1646 prompt = self.hooks.generate_prompt(False)
1647 try:
1647 try:
1648 line = self.raw_input(prompt,more)
1648 line = self.raw_input(prompt,more)
1649 if self.exit_now:
1649 if self.exit_now:
1650 # quick exit on sys.std[in|out] close
1650 # quick exit on sys.std[in|out] close
1651 break
1651 break
1652 if self.autoindent:
1652 if self.autoindent:
1653 self.rl_do_indent = False
1653 self.rl_do_indent = False
1654
1654
1655 except KeyboardInterrupt:
1655 except KeyboardInterrupt:
1656 self.write('\nKeyboardInterrupt\n')
1656 self.write('\nKeyboardInterrupt\n')
1657 self.resetbuffer()
1657 self.resetbuffer()
1658 # keep cache in sync with the prompt counter:
1658 # keep cache in sync with the prompt counter:
1659 self.outputcache.prompt_count -= 1
1659 self.outputcache.prompt_count -= 1
1660
1660
1661 if self.autoindent:
1661 if self.autoindent:
1662 self.indent_current_nsp = 0
1662 self.indent_current_nsp = 0
1663 more = 0
1663 more = 0
1664 except EOFError:
1664 except EOFError:
1665 if self.autoindent:
1665 if self.autoindent:
1666 self.rl_do_indent = False
1666 self.rl_do_indent = False
1667 self.readline_startup_hook(None)
1667 self.readline_startup_hook(None)
1668 self.write('\n')
1668 self.write('\n')
1669 self.exit()
1669 self.exit()
1670 except bdb.BdbQuit:
1670 except bdb.BdbQuit:
1671 warn('The Python debugger has exited with a BdbQuit exception.\n'
1671 warn('The Python debugger has exited with a BdbQuit exception.\n'
1672 'Because of how pdb handles the stack, it is impossible\n'
1672 'Because of how pdb handles the stack, it is impossible\n'
1673 'for IPython to properly format this particular exception.\n'
1673 'for IPython to properly format this particular exception.\n'
1674 'IPython will resume normal operation.')
1674 'IPython will resume normal operation.')
1675 except:
1675 except:
1676 # exceptions here are VERY RARE, but they can be triggered
1676 # exceptions here are VERY RARE, but they can be triggered
1677 # asynchronously by signal handlers, for example.
1677 # asynchronously by signal handlers, for example.
1678 self.showtraceback()
1678 self.showtraceback()
1679 else:
1679 else:
1680 more = self.push(line)
1680 more = self.push(line)
1681 if (self.SyntaxTB.last_syntax_error and
1681 if (self.SyntaxTB.last_syntax_error and
1682 self.rc.autoedit_syntax):
1682 self.rc.autoedit_syntax):
1683 self.edit_syntax_error()
1683 self.edit_syntax_error()
1684
1684
1685 # We are off again...
1685 # We are off again...
1686 __builtin__.__dict__['__IPYTHON__active'] -= 1
1686 __builtin__.__dict__['__IPYTHON__active'] -= 1
1687
1687
1688 def excepthook(self, etype, value, tb):
1688 def excepthook(self, etype, value, tb):
1689 """One more defense for GUI apps that call sys.excepthook.
1689 """One more defense for GUI apps that call sys.excepthook.
1690
1690
1691 GUI frameworks like wxPython trap exceptions and call
1691 GUI frameworks like wxPython trap exceptions and call
1692 sys.excepthook themselves. I guess this is a feature that
1692 sys.excepthook themselves. I guess this is a feature that
1693 enables them to keep running after exceptions that would
1693 enables them to keep running after exceptions that would
1694 otherwise kill their mainloop. This is a bother for IPython
1694 otherwise kill their mainloop. This is a bother for IPython
1695 which excepts to catch all of the program exceptions with a try:
1695 which excepts to catch all of the program exceptions with a try:
1696 except: statement.
1696 except: statement.
1697
1697
1698 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1698 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1699 any app directly invokes sys.excepthook, it will look to the user like
1699 any app directly invokes sys.excepthook, it will look to the user like
1700 IPython crashed. In order to work around this, we can disable the
1700 IPython crashed. In order to work around this, we can disable the
1701 CrashHandler and replace it with this excepthook instead, which prints a
1701 CrashHandler and replace it with this excepthook instead, which prints a
1702 regular traceback using our InteractiveTB. In this fashion, apps which
1702 regular traceback using our InteractiveTB. In this fashion, apps which
1703 call sys.excepthook will generate a regular-looking exception from
1703 call sys.excepthook will generate a regular-looking exception from
1704 IPython, and the CrashHandler will only be triggered by real IPython
1704 IPython, and the CrashHandler will only be triggered by real IPython
1705 crashes.
1705 crashes.
1706
1706
1707 This hook should be used sparingly, only in places which are not likely
1707 This hook should be used sparingly, only in places which are not likely
1708 to be true IPython errors.
1708 to be true IPython errors.
1709 """
1709 """
1710 self.showtraceback((etype,value,tb),tb_offset=0)
1710 self.showtraceback((etype,value,tb),tb_offset=0)
1711
1711
1712 def expand_aliases(self,fn,rest):
1712 def expand_aliases(self,fn,rest):
1713 """ Expand multiple levels of aliases:
1713 """ Expand multiple levels of aliases:
1714
1714
1715 if:
1715 if:
1716
1716
1717 alias foo bar /tmp
1717 alias foo bar /tmp
1718 alias baz foo
1718 alias baz foo
1719
1719
1720 then:
1720 then:
1721
1721
1722 baz huhhahhei -> bar /tmp huhhahhei
1722 baz huhhahhei -> bar /tmp huhhahhei
1723
1723
1724 """
1724 """
1725 line = fn + " " + rest
1725 line = fn + " " + rest
1726
1726
1727 done = Set()
1727 done = Set()
1728 while 1:
1728 while 1:
1729 pre,fn,rest = prefilter.splitUserInput(line,
1729 pre,fn,rest = prefilter.splitUserInput(line,
1730 prefilter.shell_line_split)
1730 prefilter.shell_line_split)
1731 if fn in self.alias_table:
1731 if fn in self.alias_table:
1732 if fn in done:
1732 if fn in done:
1733 warn("Cyclic alias definition, repeated '%s'" % fn)
1733 warn("Cyclic alias definition, repeated '%s'" % fn)
1734 return ""
1734 return ""
1735 done.add(fn)
1735 done.add(fn)
1736
1736
1737 l2 = self.transform_alias(fn,rest)
1737 l2 = self.transform_alias(fn,rest)
1738 # dir -> dir
1738 # dir -> dir
1739 # print "alias",line, "->",l2 #dbg
1739 # print "alias",line, "->",l2 #dbg
1740 if l2 == line:
1740 if l2 == line:
1741 break
1741 break
1742 # ls -> ls -F should not recurse forever
1742 # ls -> ls -F should not recurse forever
1743 if l2.split(None,1)[0] == line.split(None,1)[0]:
1743 if l2.split(None,1)[0] == line.split(None,1)[0]:
1744 line = l2
1744 line = l2
1745 break
1745 break
1746
1746
1747 line=l2
1747 line=l2
1748
1748
1749
1749
1750 # print "al expand to",line #dbg
1750 # print "al expand to",line #dbg
1751 else:
1751 else:
1752 break
1752 break
1753
1753
1754 return line
1754 return line
1755
1755
1756 def transform_alias(self, alias,rest=''):
1756 def transform_alias(self, alias,rest=''):
1757 """ Transform alias to system command string.
1757 """ Transform alias to system command string.
1758 """
1758 """
1759 trg = self.alias_table[alias]
1759 trg = self.alias_table[alias]
1760
1760
1761 nargs,cmd = trg
1761 nargs,cmd = trg
1762 # print trg #dbg
1762 # print trg #dbg
1763 if ' ' in cmd and os.path.isfile(cmd):
1763 if ' ' in cmd and os.path.isfile(cmd):
1764 cmd = '"%s"' % cmd
1764 cmd = '"%s"' % cmd
1765
1765
1766 # Expand the %l special to be the user's input line
1766 # Expand the %l special to be the user's input line
1767 if cmd.find('%l') >= 0:
1767 if cmd.find('%l') >= 0:
1768 cmd = cmd.replace('%l',rest)
1768 cmd = cmd.replace('%l',rest)
1769 rest = ''
1769 rest = ''
1770 if nargs==0:
1770 if nargs==0:
1771 # Simple, argument-less aliases
1771 # Simple, argument-less aliases
1772 cmd = '%s %s' % (cmd,rest)
1772 cmd = '%s %s' % (cmd,rest)
1773 else:
1773 else:
1774 # Handle aliases with positional arguments
1774 # Handle aliases with positional arguments
1775 args = rest.split(None,nargs)
1775 args = rest.split(None,nargs)
1776 if len(args)< nargs:
1776 if len(args)< nargs:
1777 error('Alias <%s> requires %s arguments, %s given.' %
1777 error('Alias <%s> requires %s arguments, %s given.' %
1778 (alias,nargs,len(args)))
1778 (alias,nargs,len(args)))
1779 return None
1779 return None
1780 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1780 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1781 # Now call the macro, evaluating in the user's namespace
1781 # Now call the macro, evaluating in the user's namespace
1782 #print 'new command: <%r>' % cmd # dbg
1782 #print 'new command: <%r>' % cmd # dbg
1783 return cmd
1783 return cmd
1784
1784
1785 def call_alias(self,alias,rest=''):
1785 def call_alias(self,alias,rest=''):
1786 """Call an alias given its name and the rest of the line.
1786 """Call an alias given its name and the rest of the line.
1787
1787
1788 This is only used to provide backwards compatibility for users of
1788 This is only used to provide backwards compatibility for users of
1789 ipalias(), use of which is not recommended for anymore."""
1789 ipalias(), use of which is not recommended for anymore."""
1790
1790
1791 # Now call the macro, evaluating in the user's namespace
1791 # Now call the macro, evaluating in the user's namespace
1792 cmd = self.transform_alias(alias, rest)
1792 cmd = self.transform_alias(alias, rest)
1793 try:
1793 try:
1794 self.system(cmd)
1794 self.system(cmd)
1795 except:
1795 except:
1796 self.showtraceback()
1796 self.showtraceback()
1797
1797
1798 def indent_current_str(self):
1798 def indent_current_str(self):
1799 """return the current level of indentation as a string"""
1799 """return the current level of indentation as a string"""
1800 return self.indent_current_nsp * ' '
1800 return self.indent_current_nsp * ' '
1801
1801
1802 def autoindent_update(self,line):
1802 def autoindent_update(self,line):
1803 """Keep track of the indent level."""
1803 """Keep track of the indent level."""
1804
1804
1805 #debugx('line')
1805 #debugx('line')
1806 #debugx('self.indent_current_nsp')
1806 #debugx('self.indent_current_nsp')
1807 if self.autoindent:
1807 if self.autoindent:
1808 if line:
1808 if line:
1809 inisp = num_ini_spaces(line)
1809 inisp = num_ini_spaces(line)
1810 if inisp < self.indent_current_nsp:
1810 if inisp < self.indent_current_nsp:
1811 self.indent_current_nsp = inisp
1811 self.indent_current_nsp = inisp
1812
1812
1813 if line[-1] == ':':
1813 if line[-1] == ':':
1814 self.indent_current_nsp += 4
1814 self.indent_current_nsp += 4
1815 elif dedent_re.match(line):
1815 elif dedent_re.match(line):
1816 self.indent_current_nsp -= 4
1816 self.indent_current_nsp -= 4
1817 else:
1817 else:
1818 self.indent_current_nsp = 0
1818 self.indent_current_nsp = 0
1819 def runlines(self,lines):
1819 def runlines(self,lines):
1820 """Run a string of one or more lines of source.
1820 """Run a string of one or more lines of source.
1821
1821
1822 This method is capable of running a string containing multiple source
1822 This method is capable of running a string containing multiple source
1823 lines, as if they had been entered at the IPython prompt. Since it
1823 lines, as if they had been entered at the IPython prompt. Since it
1824 exposes IPython's processing machinery, the given strings can contain
1824 exposes IPython's processing machinery, the given strings can contain
1825 magic calls (%magic), special shell access (!cmd), etc."""
1825 magic calls (%magic), special shell access (!cmd), etc."""
1826
1826
1827 # We must start with a clean buffer, in case this is run from an
1827 # We must start with a clean buffer, in case this is run from an
1828 # interactive IPython session (via a magic, for example).
1828 # interactive IPython session (via a magic, for example).
1829 self.resetbuffer()
1829 self.resetbuffer()
1830 lines = lines.split('\n')
1830 lines = lines.split('\n')
1831 more = 0
1831 more = 0
1832
1832
1833 for line in lines:
1833 for line in lines:
1834 # skip blank lines so we don't mess up the prompt counter, but do
1834 # skip blank lines so we don't mess up the prompt counter, but do
1835 # NOT skip even a blank line if we are in a code block (more is
1835 # NOT skip even a blank line if we are in a code block (more is
1836 # true)
1836 # true)
1837
1837
1838
1838
1839 if line or more:
1839 if line or more:
1840 # push to raw history, so hist line numbers stay in sync
1840 # push to raw history, so hist line numbers stay in sync
1841 self.input_hist_raw.append("# " + line + "\n")
1841 self.input_hist_raw.append("# " + line + "\n")
1842 more = self.push(self.prefilter(line,more))
1842 more = self.push(self.prefilter(line,more))
1843 # IPython's runsource returns None if there was an error
1843 # IPython's runsource returns None if there was an error
1844 # compiling the code. This allows us to stop processing right
1844 # compiling the code. This allows us to stop processing right
1845 # away, so the user gets the error message at the right place.
1845 # away, so the user gets the error message at the right place.
1846 if more is None:
1846 if more is None:
1847 break
1847 break
1848 else:
1848 else:
1849 self.input_hist_raw.append("\n")
1849 self.input_hist_raw.append("\n")
1850 # final newline in case the input didn't have it, so that the code
1850 # final newline in case the input didn't have it, so that the code
1851 # actually does get executed
1851 # actually does get executed
1852 if more:
1852 if more:
1853 self.push('\n')
1853 self.push('\n')
1854
1854
1855 def runsource(self, source, filename='<input>', symbol='single'):
1855 def runsource(self, source, filename='<input>', symbol='single'):
1856 """Compile and run some source in the interpreter.
1856 """Compile and run some source in the interpreter.
1857
1857
1858 Arguments are as for compile_command().
1858 Arguments are as for compile_command().
1859
1859
1860 One several things can happen:
1860 One several things can happen:
1861
1861
1862 1) The input is incorrect; compile_command() raised an
1862 1) The input is incorrect; compile_command() raised an
1863 exception (SyntaxError or OverflowError). A syntax traceback
1863 exception (SyntaxError or OverflowError). A syntax traceback
1864 will be printed by calling the showsyntaxerror() method.
1864 will be printed by calling the showsyntaxerror() method.
1865
1865
1866 2) The input is incomplete, and more input is required;
1866 2) The input is incomplete, and more input is required;
1867 compile_command() returned None. Nothing happens.
1867 compile_command() returned None. Nothing happens.
1868
1868
1869 3) The input is complete; compile_command() returned a code
1869 3) The input is complete; compile_command() returned a code
1870 object. The code is executed by calling self.runcode() (which
1870 object. The code is executed by calling self.runcode() (which
1871 also handles run-time exceptions, except for SystemExit).
1871 also handles run-time exceptions, except for SystemExit).
1872
1872
1873 The return value is:
1873 The return value is:
1874
1874
1875 - True in case 2
1875 - True in case 2
1876
1876
1877 - False in the other cases, unless an exception is raised, where
1877 - False in the other cases, unless an exception is raised, where
1878 None is returned instead. This can be used by external callers to
1878 None is returned instead. This can be used by external callers to
1879 know whether to continue feeding input or not.
1879 know whether to continue feeding input or not.
1880
1880
1881 The return value can be used to decide whether to use sys.ps1 or
1881 The return value can be used to decide whether to use sys.ps1 or
1882 sys.ps2 to prompt the next line."""
1882 sys.ps2 to prompt the next line."""
1883
1883
1884 # if the source code has leading blanks, add 'if 1:\n' to it
1884 # if the source code has leading blanks, add 'if 1:\n' to it
1885 # this allows execution of indented pasted code. It is tempting
1885 # this allows execution of indented pasted code. It is tempting
1886 # to add '\n' at the end of source to run commands like ' a=1'
1886 # to add '\n' at the end of source to run commands like ' a=1'
1887 # directly, but this fails for more complicated scenarios
1887 # directly, but this fails for more complicated scenarios
1888 if source[:1] in [' ', '\t']:
1888 if source[:1] in [' ', '\t']:
1889 source = 'if 1:\n%s' % source
1889 source = 'if 1:\n%s' % source
1890
1890
1891 try:
1891 try:
1892 code = self.compile(source,filename,symbol)
1892 code = self.compile(source,filename,symbol)
1893 except (OverflowError, SyntaxError, ValueError):
1893 except (OverflowError, SyntaxError, ValueError):
1894 # Case 1
1894 # Case 1
1895 self.showsyntaxerror(filename)
1895 self.showsyntaxerror(filename)
1896 return None
1896 return None
1897
1897
1898 if code is None:
1898 if code is None:
1899 # Case 2
1899 # Case 2
1900 return True
1900 return True
1901
1901
1902 # Case 3
1902 # Case 3
1903 # We store the code object so that threaded shells and
1903 # We store the code object so that threaded shells and
1904 # custom exception handlers can access all this info if needed.
1904 # custom exception handlers can access all this info if needed.
1905 # The source corresponding to this can be obtained from the
1905 # The source corresponding to this can be obtained from the
1906 # buffer attribute as '\n'.join(self.buffer).
1906 # buffer attribute as '\n'.join(self.buffer).
1907 self.code_to_run = code
1907 self.code_to_run = code
1908 # now actually execute the code object
1908 # now actually execute the code object
1909 if self.runcode(code) == 0:
1909 if self.runcode(code) == 0:
1910 return False
1910 return False
1911 else:
1911 else:
1912 return None
1912 return None
1913
1913
1914 def runcode(self,code_obj):
1914 def runcode(self,code_obj):
1915 """Execute a code object.
1915 """Execute a code object.
1916
1916
1917 When an exception occurs, self.showtraceback() is called to display a
1917 When an exception occurs, self.showtraceback() is called to display a
1918 traceback.
1918 traceback.
1919
1919
1920 Return value: a flag indicating whether the code to be run completed
1920 Return value: a flag indicating whether the code to be run completed
1921 successfully:
1921 successfully:
1922
1922
1923 - 0: successful execution.
1923 - 0: successful execution.
1924 - 1: an error occurred.
1924 - 1: an error occurred.
1925 """
1925 """
1926
1926
1927 # Set our own excepthook in case the user code tries to call it
1927 # Set our own excepthook in case the user code tries to call it
1928 # directly, so that the IPython crash handler doesn't get triggered
1928 # directly, so that the IPython crash handler doesn't get triggered
1929 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1929 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1930
1930
1931 # we save the original sys.excepthook in the instance, in case config
1931 # we save the original sys.excepthook in the instance, in case config
1932 # code (such as magics) needs access to it.
1932 # code (such as magics) needs access to it.
1933 self.sys_excepthook = old_excepthook
1933 self.sys_excepthook = old_excepthook
1934 outflag = 1 # happens in more places, so it's easier as default
1934 outflag = 1 # happens in more places, so it's easier as default
1935 try:
1935 try:
1936 try:
1936 try:
1937 # Embedded instances require separate global/local namespaces
1937 # Embedded instances require separate global/local namespaces
1938 # so they can see both the surrounding (local) namespace and
1938 # so they can see both the surrounding (local) namespace and
1939 # the module-level globals when called inside another function.
1939 # the module-level globals when called inside another function.
1940 if self.embedded:
1940 if self.embedded:
1941 exec code_obj in self.user_global_ns, self.user_ns
1941 exec code_obj in self.user_global_ns, self.user_ns
1942 # Normal (non-embedded) instances should only have a single
1942 # Normal (non-embedded) instances should only have a single
1943 # namespace for user code execution, otherwise functions won't
1943 # namespace for user code execution, otherwise functions won't
1944 # see interactive top-level globals.
1944 # see interactive top-level globals.
1945 else:
1945 else:
1946 exec code_obj in self.user_ns
1946 exec code_obj in self.user_ns
1947 finally:
1947 finally:
1948 # Reset our crash handler in place
1948 # Reset our crash handler in place
1949 sys.excepthook = old_excepthook
1949 sys.excepthook = old_excepthook
1950 except SystemExit:
1950 except SystemExit:
1951 self.resetbuffer()
1951 self.resetbuffer()
1952 self.showtraceback()
1952 self.showtraceback()
1953 warn("Type %exit or %quit to exit IPython "
1953 warn("Type %exit or %quit to exit IPython "
1954 "(%Exit or %Quit do so unconditionally).",level=1)
1954 "(%Exit or %Quit do so unconditionally).",level=1)
1955 except self.custom_exceptions:
1955 except self.custom_exceptions:
1956 etype,value,tb = sys.exc_info()
1956 etype,value,tb = sys.exc_info()
1957 self.CustomTB(etype,value,tb)
1957 self.CustomTB(etype,value,tb)
1958 except:
1958 except:
1959 self.showtraceback()
1959 self.showtraceback()
1960 else:
1960 else:
1961 outflag = 0
1961 outflag = 0
1962 if softspace(sys.stdout, 0):
1962 if softspace(sys.stdout, 0):
1963 print
1963 print
1964 # Flush out code object which has been run (and source)
1964 # Flush out code object which has been run (and source)
1965 self.code_to_run = None
1965 self.code_to_run = None
1966 return outflag
1966 return outflag
1967
1967
1968 def push(self, line):
1968 def push(self, line):
1969 """Push a line to the interpreter.
1969 """Push a line to the interpreter.
1970
1970
1971 The line should not have a trailing newline; it may have
1971 The line should not have a trailing newline; it may have
1972 internal newlines. The line is appended to a buffer and the
1972 internal newlines. The line is appended to a buffer and the
1973 interpreter's runsource() method is called with the
1973 interpreter's runsource() method is called with the
1974 concatenated contents of the buffer as source. If this
1974 concatenated contents of the buffer as source. If this
1975 indicates that the command was executed or invalid, the buffer
1975 indicates that the command was executed or invalid, the buffer
1976 is reset; otherwise, the command is incomplete, and the buffer
1976 is reset; otherwise, the command is incomplete, and the buffer
1977 is left as it was after the line was appended. The return
1977 is left as it was after the line was appended. The return
1978 value is 1 if more input is required, 0 if the line was dealt
1978 value is 1 if more input is required, 0 if the line was dealt
1979 with in some way (this is the same as runsource()).
1979 with in some way (this is the same as runsource()).
1980 """
1980 """
1981
1981
1982 # autoindent management should be done here, and not in the
1982 # autoindent management should be done here, and not in the
1983 # interactive loop, since that one is only seen by keyboard input. We
1983 # interactive loop, since that one is only seen by keyboard input. We
1984 # need this done correctly even for code run via runlines (which uses
1984 # need this done correctly even for code run via runlines (which uses
1985 # push).
1985 # push).
1986
1986
1987 #print 'push line: <%s>' % line # dbg
1987 #print 'push line: <%s>' % line # dbg
1988 for subline in line.splitlines():
1988 for subline in line.splitlines():
1989 self.autoindent_update(subline)
1989 self.autoindent_update(subline)
1990 self.buffer.append(line)
1990 self.buffer.append(line)
1991 more = self.runsource('\n'.join(self.buffer), self.filename)
1991 more = self.runsource('\n'.join(self.buffer), self.filename)
1992 if not more:
1992 if not more:
1993 self.resetbuffer()
1993 self.resetbuffer()
1994 return more
1994 return more
1995
1995
1996 def split_user_input(self, line):
1996 def split_user_input(self, line):
1997 # This is really a hold-over to support ipapi and some extensions
1997 # This is really a hold-over to support ipapi and some extensions
1998 return prefilter.splitUserInput(line)
1998 return prefilter.splitUserInput(line)
1999
1999
2000 def resetbuffer(self):
2000 def resetbuffer(self):
2001 """Reset the input buffer."""
2001 """Reset the input buffer."""
2002 self.buffer[:] = []
2002 self.buffer[:] = []
2003
2003
2004 def raw_input(self,prompt='',continue_prompt=False):
2004 def raw_input(self,prompt='',continue_prompt=False):
2005 """Write a prompt and read a line.
2005 """Write a prompt and read a line.
2006
2006
2007 The returned line does not include the trailing newline.
2007 The returned line does not include the trailing newline.
2008 When the user enters the EOF key sequence, EOFError is raised.
2008 When the user enters the EOF key sequence, EOFError is raised.
2009
2009
2010 Optional inputs:
2010 Optional inputs:
2011
2011
2012 - prompt(''): a string to be printed to prompt the user.
2012 - prompt(''): a string to be printed to prompt the user.
2013
2013
2014 - continue_prompt(False): whether this line is the first one or a
2014 - continue_prompt(False): whether this line is the first one or a
2015 continuation in a sequence of inputs.
2015 continuation in a sequence of inputs.
2016 """
2016 """
2017
2017
2018 # Code run by the user may have modified the readline completer state.
2018 # Code run by the user may have modified the readline completer state.
2019 # We must ensure that our completer is back in place.
2019 # We must ensure that our completer is back in place.
2020 if self.has_readline:
2020 if self.has_readline:
2021 self.set_completer()
2021 self.set_completer()
2022
2022
2023 try:
2023 try:
2024 line = raw_input_original(prompt).decode(self.stdin_encoding)
2024 line = raw_input_original(prompt).decode(self.stdin_encoding)
2025 except ValueError:
2025 except ValueError:
2026 warn("\n********\nYou or a %run:ed script called sys.stdin.close()"
2026 warn("\n********\nYou or a %run:ed script called sys.stdin.close()"
2027 " or sys.stdout.close()!\nExiting IPython!")
2027 " or sys.stdout.close()!\nExiting IPython!")
2028 self.exit_now = True
2028 self.exit_now = True
2029 return ""
2029 return ""
2030
2030
2031 # Try to be reasonably smart about not re-indenting pasted input more
2031 # Try to be reasonably smart about not re-indenting pasted input more
2032 # than necessary. We do this by trimming out the auto-indent initial
2032 # than necessary. We do this by trimming out the auto-indent initial
2033 # spaces, if the user's actual input started itself with whitespace.
2033 # spaces, if the user's actual input started itself with whitespace.
2034 #debugx('self.buffer[-1]')
2034 #debugx('self.buffer[-1]')
2035
2035
2036 if self.autoindent:
2036 if self.autoindent:
2037 if num_ini_spaces(line) > self.indent_current_nsp:
2037 if num_ini_spaces(line) > self.indent_current_nsp:
2038 line = line[self.indent_current_nsp:]
2038 line = line[self.indent_current_nsp:]
2039 self.indent_current_nsp = 0
2039 self.indent_current_nsp = 0
2040
2040
2041 # store the unfiltered input before the user has any chance to modify
2041 # store the unfiltered input before the user has any chance to modify
2042 # it.
2042 # it.
2043 if line.strip():
2043 if line.strip():
2044 if continue_prompt:
2044 if continue_prompt:
2045 self.input_hist_raw[-1] += '%s\n' % line
2045 self.input_hist_raw[-1] += '%s\n' % line
2046 if self.has_readline: # and some config option is set?
2046 if self.has_readline: # and some config option is set?
2047 try:
2047 try:
2048 histlen = self.readline.get_current_history_length()
2048 histlen = self.readline.get_current_history_length()
2049 newhist = self.input_hist_raw[-1].rstrip()
2049 newhist = self.input_hist_raw[-1].rstrip()
2050 self.readline.remove_history_item(histlen-1)
2050 self.readline.remove_history_item(histlen-1)
2051 self.readline.replace_history_item(histlen-2,newhist)
2051 self.readline.replace_history_item(histlen-2,newhist)
2052 except AttributeError:
2052 except AttributeError:
2053 pass # re{move,place}_history_item are new in 2.4.
2053 pass # re{move,place}_history_item are new in 2.4.
2054 else:
2054 else:
2055 self.input_hist_raw.append('%s\n' % line)
2055 self.input_hist_raw.append('%s\n' % line)
2056 # only entries starting at first column go to shadow history
2056 # only entries starting at first column go to shadow history
2057 if line.lstrip() == line:
2057 if line.lstrip() == line:
2058 self.shadowhist.add(line.strip())
2058 self.shadowhist.add(line.strip())
2059 elif not continue_prompt:
2059 elif not continue_prompt:
2060 self.input_hist_raw.append('\n')
2060 self.input_hist_raw.append('\n')
2061 try:
2061 try:
2062 lineout = self.prefilter(line,continue_prompt)
2062 lineout = self.prefilter(line,continue_prompt)
2063 except:
2063 except:
2064 # blanket except, in case a user-defined prefilter crashes, so it
2064 # blanket except, in case a user-defined prefilter crashes, so it
2065 # can't take all of ipython with it.
2065 # can't take all of ipython with it.
2066 self.showtraceback()
2066 self.showtraceback()
2067 return ''
2067 return ''
2068 else:
2068 else:
2069 return lineout
2069 return lineout
2070
2070
2071 def _prefilter(self, line, continue_prompt):
2071 def _prefilter(self, line, continue_prompt):
2072 """Calls different preprocessors, depending on the form of line."""
2072 """Calls different preprocessors, depending on the form of line."""
2073
2073
2074 # All handlers *must* return a value, even if it's blank ('').
2074 # All handlers *must* return a value, even if it's blank ('').
2075
2075
2076 # Lines are NOT logged here. Handlers should process the line as
2076 # Lines are NOT logged here. Handlers should process the line as
2077 # needed, update the cache AND log it (so that the input cache array
2077 # needed, update the cache AND log it (so that the input cache array
2078 # stays synced).
2078 # stays synced).
2079
2079
2080 #.....................................................................
2080 #.....................................................................
2081 # Code begins
2081 # Code begins
2082
2082
2083 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
2083 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
2084
2084
2085 # save the line away in case we crash, so the post-mortem handler can
2085 # save the line away in case we crash, so the post-mortem handler can
2086 # record it
2086 # record it
2087 self._last_input_line = line
2087 self._last_input_line = line
2088
2088
2089 #print '***line: <%s>' % line # dbg
2089 #print '***line: <%s>' % line # dbg
2090
2090
2091 if not line:
2091 if not line:
2092 # Return immediately on purely empty lines, so that if the user
2092 # Return immediately on purely empty lines, so that if the user
2093 # previously typed some whitespace that started a continuation
2093 # previously typed some whitespace that started a continuation
2094 # prompt, he can break out of that loop with just an empty line.
2094 # prompt, he can break out of that loop with just an empty line.
2095 # This is how the default python prompt works.
2095 # This is how the default python prompt works.
2096
2096
2097 # Only return if the accumulated input buffer was just whitespace!
2097 # Only return if the accumulated input buffer was just whitespace!
2098 if ''.join(self.buffer).isspace():
2098 if ''.join(self.buffer).isspace():
2099 self.buffer[:] = []
2099 self.buffer[:] = []
2100 return ''
2100 return ''
2101
2101
2102 line_info = prefilter.LineInfo(line, continue_prompt)
2102 line_info = prefilter.LineInfo(line, continue_prompt)
2103
2103
2104 # the input history needs to track even empty lines
2104 # the input history needs to track even empty lines
2105 stripped = line.strip()
2105 stripped = line.strip()
2106
2106
2107 if not stripped:
2107 if not stripped:
2108 if not continue_prompt:
2108 if not continue_prompt:
2109 self.outputcache.prompt_count -= 1
2109 self.outputcache.prompt_count -= 1
2110 return self.handle_normal(line_info)
2110 return self.handle_normal(line_info)
2111
2111
2112 # print '***cont',continue_prompt # dbg
2112 # print '***cont',continue_prompt # dbg
2113 # special handlers are only allowed for single line statements
2113 # special handlers are only allowed for single line statements
2114 if continue_prompt and not self.rc.multi_line_specials:
2114 if continue_prompt and not self.rc.multi_line_specials:
2115 return self.handle_normal(line_info)
2115 return self.handle_normal(line_info)
2116
2116
2117
2117
2118 # See whether any pre-existing handler can take care of it
2118 # See whether any pre-existing handler can take care of it
2119 rewritten = self.hooks.input_prefilter(stripped)
2119 rewritten = self.hooks.input_prefilter(stripped)
2120 if rewritten != stripped: # ok, some prefilter did something
2120 if rewritten != stripped: # ok, some prefilter did something
2121 rewritten = line_info.pre + rewritten # add indentation
2121 rewritten = line_info.pre + rewritten # add indentation
2122 return self.handle_normal(prefilter.LineInfo(rewritten,
2122 return self.handle_normal(prefilter.LineInfo(rewritten,
2123 continue_prompt))
2123 continue_prompt))
2124
2124
2125 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2125 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2126
2126
2127 return prefilter.prefilter(line_info, self)
2127 return prefilter.prefilter(line_info, self)
2128
2128
2129
2129
2130 def _prefilter_dumb(self, line, continue_prompt):
2130 def _prefilter_dumb(self, line, continue_prompt):
2131 """simple prefilter function, for debugging"""
2131 """simple prefilter function, for debugging"""
2132 return self.handle_normal(line,continue_prompt)
2132 return self.handle_normal(line,continue_prompt)
2133
2133
2134
2134
2135 def multiline_prefilter(self, line, continue_prompt):
2135 def multiline_prefilter(self, line, continue_prompt):
2136 """ Run _prefilter for each line of input
2136 """ Run _prefilter for each line of input
2137
2137
2138 Covers cases where there are multiple lines in the user entry,
2138 Covers cases where there are multiple lines in the user entry,
2139 which is the case when the user goes back to a multiline history
2139 which is the case when the user goes back to a multiline history
2140 entry and presses enter.
2140 entry and presses enter.
2141
2141
2142 """
2142 """
2143 out = []
2143 out = []
2144 for l in line.rstrip('\n').split('\n'):
2144 for l in line.rstrip('\n').split('\n'):
2145 out.append(self._prefilter(l, continue_prompt))
2145 out.append(self._prefilter(l, continue_prompt))
2146 return '\n'.join(out)
2146 return '\n'.join(out)
2147
2147
2148 # Set the default prefilter() function (this can be user-overridden)
2148 # Set the default prefilter() function (this can be user-overridden)
2149 prefilter = multiline_prefilter
2149 prefilter = multiline_prefilter
2150
2150
2151 def handle_normal(self,line_info):
2151 def handle_normal(self,line_info):
2152 """Handle normal input lines. Use as a template for handlers."""
2152 """Handle normal input lines. Use as a template for handlers."""
2153
2153
2154 # With autoindent on, we need some way to exit the input loop, and I
2154 # With autoindent on, we need some way to exit the input loop, and I
2155 # don't want to force the user to have to backspace all the way to
2155 # don't want to force the user to have to backspace all the way to
2156 # clear the line. The rule will be in this case, that either two
2156 # clear the line. The rule will be in this case, that either two
2157 # lines of pure whitespace in a row, or a line of pure whitespace but
2157 # lines of pure whitespace in a row, or a line of pure whitespace but
2158 # of a size different to the indent level, will exit the input loop.
2158 # of a size different to the indent level, will exit the input loop.
2159 line = line_info.line
2159 line = line_info.line
2160 continue_prompt = line_info.continue_prompt
2160 continue_prompt = line_info.continue_prompt
2161
2161
2162 if (continue_prompt and self.autoindent and line.isspace() and
2162 if (continue_prompt and self.autoindent and line.isspace() and
2163 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2163 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2164 (self.buffer[-1]).isspace() )):
2164 (self.buffer[-1]).isspace() )):
2165 line = ''
2165 line = ''
2166
2166
2167 self.log(line,line,continue_prompt)
2167 self.log(line,line,continue_prompt)
2168 return line
2168 return line
2169
2169
2170 def handle_alias(self,line_info):
2170 def handle_alias(self,line_info):
2171 """Handle alias input lines. """
2171 """Handle alias input lines. """
2172 tgt = self.alias_table[line_info.iFun]
2172 tgt = self.alias_table[line_info.iFun]
2173 # print "=>",tgt #dbg
2173 # print "=>",tgt #dbg
2174 if callable(tgt):
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 else:
2177 else:
2177 transformed = self.expand_aliases(line_info.iFun,line_info.theRest)
2178 transformed = self.expand_aliases(line_info.iFun,line_info.theRest)
2178
2179
2179 # pre is needed, because it carries the leading whitespace. Otherwise
2180 # pre is needed, because it carries the leading whitespace. Otherwise
2180 # aliases won't work in indented sections.
2181 # aliases won't work in indented sections.
2181 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2182 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2182 make_quoted_expr( transformed ))
2183 make_quoted_expr( transformed ))
2183
2184
2184 self.log(line_info.line,line_out,line_info.continue_prompt)
2185 self.log(line_info.line,line_out,line_info.continue_prompt)
2185 #print 'line out:',line_out # dbg
2186 #print 'line out:',line_out # dbg
2186 return line_out
2187 return line_out
2187
2188
2188 def handle_shell_escape(self, line_info):
2189 def handle_shell_escape(self, line_info):
2189 """Execute the line in a shell, empty return value"""
2190 """Execute the line in a shell, empty return value"""
2190 #print 'line in :', `line` # dbg
2191 #print 'line in :', `line` # dbg
2191 line = line_info.line
2192 line = line_info.line
2192 if line.lstrip().startswith('!!'):
2193 if line.lstrip().startswith('!!'):
2193 # rewrite LineInfo's line, iFun and theRest to properly hold the
2194 # rewrite LineInfo's line, iFun and theRest to properly hold the
2194 # call to %sx and the actual command to be executed, so
2195 # call to %sx and the actual command to be executed, so
2195 # handle_magic can work correctly. Note that this works even if
2196 # handle_magic can work correctly. Note that this works even if
2196 # the line is indented, so it handles multi_line_specials
2197 # the line is indented, so it handles multi_line_specials
2197 # properly.
2198 # properly.
2198 new_rest = line.lstrip()[2:]
2199 new_rest = line.lstrip()[2:]
2199 line_info.line = '%ssx %s' % (self.ESC_MAGIC,new_rest)
2200 line_info.line = '%ssx %s' % (self.ESC_MAGIC,new_rest)
2200 line_info.iFun = 'sx'
2201 line_info.iFun = 'sx'
2201 line_info.theRest = new_rest
2202 line_info.theRest = new_rest
2202 return self.handle_magic(line_info)
2203 return self.handle_magic(line_info)
2203 else:
2204 else:
2204 cmd = line.lstrip().lstrip('!')
2205 cmd = line.lstrip().lstrip('!')
2205 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2206 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2206 make_quoted_expr(cmd))
2207 make_quoted_expr(cmd))
2207 # update cache/log and return
2208 # update cache/log and return
2208 self.log(line,line_out,line_info.continue_prompt)
2209 self.log(line,line_out,line_info.continue_prompt)
2209 return line_out
2210 return line_out
2210
2211
2211 def handle_magic(self, line_info):
2212 def handle_magic(self, line_info):
2212 """Execute magic functions."""
2213 """Execute magic functions."""
2213 iFun = line_info.iFun
2214 iFun = line_info.iFun
2214 theRest = line_info.theRest
2215 theRest = line_info.theRest
2215 cmd = '%s_ip.magic(%s)' % (line_info.preWhitespace,
2216 cmd = '%s_ip.magic(%s)' % (line_info.preWhitespace,
2216 make_quoted_expr(iFun + " " + theRest))
2217 make_quoted_expr(iFun + " " + theRest))
2217 self.log(line_info.line,cmd,line_info.continue_prompt)
2218 self.log(line_info.line,cmd,line_info.continue_prompt)
2218 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2219 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2219 return cmd
2220 return cmd
2220
2221
2221 def handle_auto(self, line_info):
2222 def handle_auto(self, line_info):
2222 """Hande lines which can be auto-executed, quoting if requested."""
2223 """Hande lines which can be auto-executed, quoting if requested."""
2223
2224
2224 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2225 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2225 line = line_info.line
2226 line = line_info.line
2226 iFun = line_info.iFun
2227 iFun = line_info.iFun
2227 theRest = line_info.theRest
2228 theRest = line_info.theRest
2228 pre = line_info.pre
2229 pre = line_info.pre
2229 continue_prompt = line_info.continue_prompt
2230 continue_prompt = line_info.continue_prompt
2230 obj = line_info.ofind(self)['obj']
2231 obj = line_info.ofind(self)['obj']
2231
2232
2232 # This should only be active for single-line input!
2233 # This should only be active for single-line input!
2233 if continue_prompt:
2234 if continue_prompt:
2234 self.log(line,line,continue_prompt)
2235 self.log(line,line,continue_prompt)
2235 return line
2236 return line
2236
2237
2237 force_auto = isinstance(obj, IPython.ipapi.IPyAutocall)
2238 force_auto = isinstance(obj, IPython.ipapi.IPyAutocall)
2238 auto_rewrite = True
2239 auto_rewrite = True
2239
2240
2240 if pre == self.ESC_QUOTE:
2241 if pre == self.ESC_QUOTE:
2241 # Auto-quote splitting on whitespace
2242 # Auto-quote splitting on whitespace
2242 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2243 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2243 elif pre == self.ESC_QUOTE2:
2244 elif pre == self.ESC_QUOTE2:
2244 # Auto-quote whole string
2245 # Auto-quote whole string
2245 newcmd = '%s("%s")' % (iFun,theRest)
2246 newcmd = '%s("%s")' % (iFun,theRest)
2246 elif pre == self.ESC_PAREN:
2247 elif pre == self.ESC_PAREN:
2247 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2248 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2248 else:
2249 else:
2249 # Auto-paren.
2250 # Auto-paren.
2250 # We only apply it to argument-less calls if the autocall
2251 # We only apply it to argument-less calls if the autocall
2251 # parameter is set to 2. We only need to check that autocall is <
2252 # parameter is set to 2. We only need to check that autocall is <
2252 # 2, since this function isn't called unless it's at least 1.
2253 # 2, since this function isn't called unless it's at least 1.
2253 if not theRest and (self.rc.autocall < 2) and not force_auto:
2254 if not theRest and (self.rc.autocall < 2) and not force_auto:
2254 newcmd = '%s %s' % (iFun,theRest)
2255 newcmd = '%s %s' % (iFun,theRest)
2255 auto_rewrite = False
2256 auto_rewrite = False
2256 else:
2257 else:
2257 if not force_auto and theRest.startswith('['):
2258 if not force_auto and theRest.startswith('['):
2258 if hasattr(obj,'__getitem__'):
2259 if hasattr(obj,'__getitem__'):
2259 # Don't autocall in this case: item access for an object
2260 # Don't autocall in this case: item access for an object
2260 # which is BOTH callable and implements __getitem__.
2261 # which is BOTH callable and implements __getitem__.
2261 newcmd = '%s %s' % (iFun,theRest)
2262 newcmd = '%s %s' % (iFun,theRest)
2262 auto_rewrite = False
2263 auto_rewrite = False
2263 else:
2264 else:
2264 # if the object doesn't support [] access, go ahead and
2265 # if the object doesn't support [] access, go ahead and
2265 # autocall
2266 # autocall
2266 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2267 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2267 elif theRest.endswith(';'):
2268 elif theRest.endswith(';'):
2268 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2269 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2269 else:
2270 else:
2270 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2271 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2271
2272
2272 if auto_rewrite:
2273 if auto_rewrite:
2273 rw = self.outputcache.prompt1.auto_rewrite() + newcmd
2274 rw = self.outputcache.prompt1.auto_rewrite() + newcmd
2274
2275
2275 try:
2276 try:
2276 # plain ascii works better w/ pyreadline, on some machines, so
2277 # plain ascii works better w/ pyreadline, on some machines, so
2277 # we use it and only print uncolored rewrite if we have unicode
2278 # we use it and only print uncolored rewrite if we have unicode
2278 rw = str(rw)
2279 rw = str(rw)
2279 print >>Term.cout, rw
2280 print >>Term.cout, rw
2280 except UnicodeEncodeError:
2281 except UnicodeEncodeError:
2281 print "-------------->" + newcmd
2282 print "-------------->" + newcmd
2282
2283
2283 # log what is now valid Python, not the actual user input (without the
2284 # log what is now valid Python, not the actual user input (without the
2284 # final newline)
2285 # final newline)
2285 self.log(line,newcmd,continue_prompt)
2286 self.log(line,newcmd,continue_prompt)
2286 return newcmd
2287 return newcmd
2287
2288
2288 def handle_help(self, line_info):
2289 def handle_help(self, line_info):
2289 """Try to get some help for the object.
2290 """Try to get some help for the object.
2290
2291
2291 obj? or ?obj -> basic information.
2292 obj? or ?obj -> basic information.
2292 obj?? or ??obj -> more details.
2293 obj?? or ??obj -> more details.
2293 """
2294 """
2294
2295
2295 line = line_info.line
2296 line = line_info.line
2296 # We need to make sure that we don't process lines which would be
2297 # We need to make sure that we don't process lines which would be
2297 # otherwise valid python, such as "x=1 # what?"
2298 # otherwise valid python, such as "x=1 # what?"
2298 try:
2299 try:
2299 codeop.compile_command(line)
2300 codeop.compile_command(line)
2300 except SyntaxError:
2301 except SyntaxError:
2301 # We should only handle as help stuff which is NOT valid syntax
2302 # We should only handle as help stuff which is NOT valid syntax
2302 if line[0]==self.ESC_HELP:
2303 if line[0]==self.ESC_HELP:
2303 line = line[1:]
2304 line = line[1:]
2304 elif line[-1]==self.ESC_HELP:
2305 elif line[-1]==self.ESC_HELP:
2305 line = line[:-1]
2306 line = line[:-1]
2306 self.log(line,'#?'+line,line_info.continue_prompt)
2307 self.log(line,'#?'+line,line_info.continue_prompt)
2307 if line:
2308 if line:
2308 #print 'line:<%r>' % line # dbg
2309 #print 'line:<%r>' % line # dbg
2309 self.magic_pinfo(line)
2310 self.magic_pinfo(line)
2310 else:
2311 else:
2311 page(self.usage,screen_lines=self.rc.screen_length)
2312 page(self.usage,screen_lines=self.rc.screen_length)
2312 return '' # Empty string is needed here!
2313 return '' # Empty string is needed here!
2313 except:
2314 except:
2314 # Pass any other exceptions through to the normal handler
2315 # Pass any other exceptions through to the normal handler
2315 return self.handle_normal(line_info)
2316 return self.handle_normal(line_info)
2316 else:
2317 else:
2317 # If the code compiles ok, we should handle it normally
2318 # If the code compiles ok, we should handle it normally
2318 return self.handle_normal(line_info)
2319 return self.handle_normal(line_info)
2319
2320
2320 def getapi(self):
2321 def getapi(self):
2321 """ Get an IPApi object for this shell instance
2322 """ Get an IPApi object for this shell instance
2322
2323
2323 Getting an IPApi object is always preferable to accessing the shell
2324 Getting an IPApi object is always preferable to accessing the shell
2324 directly, but this holds true especially for extensions.
2325 directly, but this holds true especially for extensions.
2325
2326
2326 It should always be possible to implement an extension with IPApi
2327 It should always be possible to implement an extension with IPApi
2327 alone. If not, contact maintainer to request an addition.
2328 alone. If not, contact maintainer to request an addition.
2328
2329
2329 """
2330 """
2330 return self.api
2331 return self.api
2331
2332
2332 def handle_emacs(self, line_info):
2333 def handle_emacs(self, line_info):
2333 """Handle input lines marked by python-mode."""
2334 """Handle input lines marked by python-mode."""
2334
2335
2335 # Currently, nothing is done. Later more functionality can be added
2336 # Currently, nothing is done. Later more functionality can be added
2336 # here if needed.
2337 # here if needed.
2337
2338
2338 # The input cache shouldn't be updated
2339 # The input cache shouldn't be updated
2339 return line_info.line
2340 return line_info.line
2340
2341
2341
2342
2342 def mktempfile(self,data=None):
2343 def mktempfile(self,data=None):
2343 """Make a new tempfile and return its filename.
2344 """Make a new tempfile and return its filename.
2344
2345
2345 This makes a call to tempfile.mktemp, but it registers the created
2346 This makes a call to tempfile.mktemp, but it registers the created
2346 filename internally so ipython cleans it up at exit time.
2347 filename internally so ipython cleans it up at exit time.
2347
2348
2348 Optional inputs:
2349 Optional inputs:
2349
2350
2350 - data(None): if data is given, it gets written out to the temp file
2351 - data(None): if data is given, it gets written out to the temp file
2351 immediately, and the file is closed again."""
2352 immediately, and the file is closed again."""
2352
2353
2353 filename = tempfile.mktemp('.py','ipython_edit_')
2354 filename = tempfile.mktemp('.py','ipython_edit_')
2354 self.tempfiles.append(filename)
2355 self.tempfiles.append(filename)
2355
2356
2356 if data:
2357 if data:
2357 tmp_file = open(filename,'w')
2358 tmp_file = open(filename,'w')
2358 tmp_file.write(data)
2359 tmp_file.write(data)
2359 tmp_file.close()
2360 tmp_file.close()
2360 return filename
2361 return filename
2361
2362
2362 def write(self,data):
2363 def write(self,data):
2363 """Write a string to the default output"""
2364 """Write a string to the default output"""
2364 Term.cout.write(data)
2365 Term.cout.write(data)
2365
2366
2366 def write_err(self,data):
2367 def write_err(self,data):
2367 """Write a string to the default error output"""
2368 """Write a string to the default error output"""
2368 Term.cerr.write(data)
2369 Term.cerr.write(data)
2369
2370
2370 def exit(self):
2371 def exit(self):
2371 """Handle interactive exit.
2372 """Handle interactive exit.
2372
2373
2373 This method sets the exit_now attribute."""
2374 This method sets the exit_now attribute."""
2374
2375
2375 if self.rc.confirm_exit:
2376 if self.rc.confirm_exit:
2376 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2377 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2377 self.exit_now = True
2378 self.exit_now = True
2378 else:
2379 else:
2379 self.exit_now = True
2380 self.exit_now = True
2380
2381
2381 def safe_execfile(self,fname,*where,**kw):
2382 def safe_execfile(self,fname,*where,**kw):
2382 """A safe version of the builtin execfile().
2383 """A safe version of the builtin execfile().
2383
2384
2384 This version will never throw an exception, and knows how to handle
2385 This version will never throw an exception, and knows how to handle
2385 ipython logs as well."""
2386 ipython logs as well."""
2386
2387
2387 def syspath_cleanup():
2388 def syspath_cleanup():
2388 """Internal cleanup routine for sys.path."""
2389 """Internal cleanup routine for sys.path."""
2389 if add_dname:
2390 if add_dname:
2390 try:
2391 try:
2391 sys.path.remove(dname)
2392 sys.path.remove(dname)
2392 except ValueError:
2393 except ValueError:
2393 # For some reason the user has already removed it, ignore.
2394 # For some reason the user has already removed it, ignore.
2394 pass
2395 pass
2395
2396
2396 fname = os.path.expanduser(fname)
2397 fname = os.path.expanduser(fname)
2397
2398
2398 # Find things also in current directory. This is needed to mimic the
2399 # Find things also in current directory. This is needed to mimic the
2399 # behavior of running a script from the system command line, where
2400 # behavior of running a script from the system command line, where
2400 # Python inserts the script's directory into sys.path
2401 # Python inserts the script's directory into sys.path
2401 dname = os.path.dirname(os.path.abspath(fname))
2402 dname = os.path.dirname(os.path.abspath(fname))
2402 add_dname = False
2403 add_dname = False
2403 if dname not in sys.path:
2404 if dname not in sys.path:
2404 sys.path.insert(0,dname)
2405 sys.path.insert(0,dname)
2405 add_dname = True
2406 add_dname = True
2406
2407
2407 try:
2408 try:
2408 xfile = open(fname)
2409 xfile = open(fname)
2409 except:
2410 except:
2410 print >> Term.cerr, \
2411 print >> Term.cerr, \
2411 'Could not open file <%s> for safe execution.' % fname
2412 'Could not open file <%s> for safe execution.' % fname
2412 syspath_cleanup()
2413 syspath_cleanup()
2413 return None
2414 return None
2414
2415
2415 kw.setdefault('islog',0)
2416 kw.setdefault('islog',0)
2416 kw.setdefault('quiet',1)
2417 kw.setdefault('quiet',1)
2417 kw.setdefault('exit_ignore',0)
2418 kw.setdefault('exit_ignore',0)
2418 first = xfile.readline()
2419 first = xfile.readline()
2419 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2420 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2420 xfile.close()
2421 xfile.close()
2421 # line by line execution
2422 # line by line execution
2422 if first.startswith(loghead) or kw['islog']:
2423 if first.startswith(loghead) or kw['islog']:
2423 print 'Loading log file <%s> one line at a time...' % fname
2424 print 'Loading log file <%s> one line at a time...' % fname
2424 if kw['quiet']:
2425 if kw['quiet']:
2425 stdout_save = sys.stdout
2426 stdout_save = sys.stdout
2426 sys.stdout = StringIO.StringIO()
2427 sys.stdout = StringIO.StringIO()
2427 try:
2428 try:
2428 globs,locs = where[0:2]
2429 globs,locs = where[0:2]
2429 except:
2430 except:
2430 try:
2431 try:
2431 globs = locs = where[0]
2432 globs = locs = where[0]
2432 except:
2433 except:
2433 globs = locs = globals()
2434 globs = locs = globals()
2434 badblocks = []
2435 badblocks = []
2435
2436
2436 # we also need to identify indented blocks of code when replaying
2437 # we also need to identify indented blocks of code when replaying
2437 # logs and put them together before passing them to an exec
2438 # logs and put them together before passing them to an exec
2438 # statement. This takes a bit of regexp and look-ahead work in the
2439 # statement. This takes a bit of regexp and look-ahead work in the
2439 # file. It's easiest if we swallow the whole thing in memory
2440 # file. It's easiest if we swallow the whole thing in memory
2440 # first, and manually walk through the lines list moving the
2441 # first, and manually walk through the lines list moving the
2441 # counter ourselves.
2442 # counter ourselves.
2442 indent_re = re.compile('\s+\S')
2443 indent_re = re.compile('\s+\S')
2443 xfile = open(fname)
2444 xfile = open(fname)
2444 filelines = xfile.readlines()
2445 filelines = xfile.readlines()
2445 xfile.close()
2446 xfile.close()
2446 nlines = len(filelines)
2447 nlines = len(filelines)
2447 lnum = 0
2448 lnum = 0
2448 while lnum < nlines:
2449 while lnum < nlines:
2449 line = filelines[lnum]
2450 line = filelines[lnum]
2450 lnum += 1
2451 lnum += 1
2451 # don't re-insert logger status info into cache
2452 # don't re-insert logger status info into cache
2452 if line.startswith('#log#'):
2453 if line.startswith('#log#'):
2453 continue
2454 continue
2454 else:
2455 else:
2455 # build a block of code (maybe a single line) for execution
2456 # build a block of code (maybe a single line) for execution
2456 block = line
2457 block = line
2457 try:
2458 try:
2458 next = filelines[lnum] # lnum has already incremented
2459 next = filelines[lnum] # lnum has already incremented
2459 except:
2460 except:
2460 next = None
2461 next = None
2461 while next and indent_re.match(next):
2462 while next and indent_re.match(next):
2462 block += next
2463 block += next
2463 lnum += 1
2464 lnum += 1
2464 try:
2465 try:
2465 next = filelines[lnum]
2466 next = filelines[lnum]
2466 except:
2467 except:
2467 next = None
2468 next = None
2468 # now execute the block of one or more lines
2469 # now execute the block of one or more lines
2469 try:
2470 try:
2470 exec block in globs,locs
2471 exec block in globs,locs
2471 except SystemExit:
2472 except SystemExit:
2472 pass
2473 pass
2473 except:
2474 except:
2474 badblocks.append(block.rstrip())
2475 badblocks.append(block.rstrip())
2475 if kw['quiet']: # restore stdout
2476 if kw['quiet']: # restore stdout
2476 sys.stdout.close()
2477 sys.stdout.close()
2477 sys.stdout = stdout_save
2478 sys.stdout = stdout_save
2478 print 'Finished replaying log file <%s>' % fname
2479 print 'Finished replaying log file <%s>' % fname
2479 if badblocks:
2480 if badblocks:
2480 print >> sys.stderr, ('\nThe following lines/blocks in file '
2481 print >> sys.stderr, ('\nThe following lines/blocks in file '
2481 '<%s> reported errors:' % fname)
2482 '<%s> reported errors:' % fname)
2482
2483
2483 for badline in badblocks:
2484 for badline in badblocks:
2484 print >> sys.stderr, badline
2485 print >> sys.stderr, badline
2485 else: # regular file execution
2486 else: # regular file execution
2486 try:
2487 try:
2487 if sys.platform == 'win32' and sys.version_info < (2,5,1):
2488 if sys.platform == 'win32' and sys.version_info < (2,5,1):
2488 # Work around a bug in Python for Windows. The bug was
2489 # Work around a bug in Python for Windows. The bug was
2489 # fixed in in Python 2.5 r54159 and 54158, but that's still
2490 # fixed in in Python 2.5 r54159 and 54158, but that's still
2490 # SVN Python as of March/07. For details, see:
2491 # SVN Python as of March/07. For details, see:
2491 # http://projects.scipy.org/ipython/ipython/ticket/123
2492 # http://projects.scipy.org/ipython/ipython/ticket/123
2492 try:
2493 try:
2493 globs,locs = where[0:2]
2494 globs,locs = where[0:2]
2494 except:
2495 except:
2495 try:
2496 try:
2496 globs = locs = where[0]
2497 globs = locs = where[0]
2497 except:
2498 except:
2498 globs = locs = globals()
2499 globs = locs = globals()
2499 exec file(fname) in globs,locs
2500 exec file(fname) in globs,locs
2500 else:
2501 else:
2501 execfile(fname,*where)
2502 execfile(fname,*where)
2502 except SyntaxError:
2503 except SyntaxError:
2503 self.showsyntaxerror()
2504 self.showsyntaxerror()
2504 warn('Failure executing file: <%s>' % fname)
2505 warn('Failure executing file: <%s>' % fname)
2505 except SystemExit,status:
2506 except SystemExit,status:
2506 # Code that correctly sets the exit status flag to success (0)
2507 # Code that correctly sets the exit status flag to success (0)
2507 # shouldn't be bothered with a traceback. Note that a plain
2508 # shouldn't be bothered with a traceback. Note that a plain
2508 # sys.exit() does NOT set the message to 0 (it's empty) so that
2509 # sys.exit() does NOT set the message to 0 (it's empty) so that
2509 # will still get a traceback. Note that the structure of the
2510 # will still get a traceback. Note that the structure of the
2510 # SystemExit exception changed between Python 2.4 and 2.5, so
2511 # SystemExit exception changed between Python 2.4 and 2.5, so
2511 # the checks must be done in a version-dependent way.
2512 # the checks must be done in a version-dependent way.
2512 show = False
2513 show = False
2513
2514
2514 if sys.version_info[:2] > (2,5):
2515 if sys.version_info[:2] > (2,5):
2515 if status.message!=0 and not kw['exit_ignore']:
2516 if status.message!=0 and not kw['exit_ignore']:
2516 show = True
2517 show = True
2517 else:
2518 else:
2518 if status.code and not kw['exit_ignore']:
2519 if status.code and not kw['exit_ignore']:
2519 show = True
2520 show = True
2520 if show:
2521 if show:
2521 self.showtraceback()
2522 self.showtraceback()
2522 warn('Failure executing file: <%s>' % fname)
2523 warn('Failure executing file: <%s>' % fname)
2523 except:
2524 except:
2524 self.showtraceback()
2525 self.showtraceback()
2525 warn('Failure executing file: <%s>' % fname)
2526 warn('Failure executing file: <%s>' % fname)
2526
2527
2527 syspath_cleanup()
2528 syspath_cleanup()
2528
2529
2529 #************************* end of file <iplib.py> *****************************
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 2007-09-04 Ville Vainio <vivainio@gmail.com>
14 2007-09-04 Ville Vainio <vivainio@gmail.com>
2
15
3 * ipy_profile_zope.py: add zope profile, by Stefan Eletzhofer.
16 * ipy_profile_zope.py: add zope profile, by Stefan Eletzhofer.
4 Relicensed under BSD with the authors approval.
17 Relicensed under BSD with the authors approval.
5
18
6 * ipmaker.py, usage.py: Remove %magic from default banner, improve
19 * ipmaker.py, usage.py: Remove %magic from default banner, improve
7 %quickref
20 %quickref
8
21
9 2007-09-03 Ville Vainio <vivainio@gmail.com>
22 2007-09-03 Ville Vainio <vivainio@gmail.com>
10
23
11 * Magic.py: %time now passes expression through prefilter,
24 * Magic.py: %time now passes expression through prefilter,
12 allowing IPython syntax.
25 allowing IPython syntax.
13
26
14 2007-09-01 Ville Vainio <vivainio@gmail.com>
27 2007-09-01 Ville Vainio <vivainio@gmail.com>
15
28
16 * ipmaker.py: Always show full traceback when newstyle config fails
29 * ipmaker.py: Always show full traceback when newstyle config fails
17
30
18 2007-08-27 Ville Vainio <vivainio@gmail.com>
31 2007-08-27 Ville Vainio <vivainio@gmail.com>
19
32
20 * Magic.py: fix %cd for nonexistent dir when dhist is empty, close #180
33 * Magic.py: fix %cd for nonexistent dir when dhist is empty, close #180
21
34
22 2007-08-26 Ville Vainio <vivainio@gmail.com>
35 2007-08-26 Ville Vainio <vivainio@gmail.com>
23
36
24 * ipmaker.py: Command line args have the highest priority again
37 * ipmaker.py: Command line args have the highest priority again
25
38
26 * iplib.py, ipmaker.py: -i command line argument now behaves as in
39 * iplib.py, ipmaker.py: -i command line argument now behaves as in
27 normal python, i.e. leaves the IPython session running after -c
40 normal python, i.e. leaves the IPython session running after -c
28 command or running a batch file from command line.
41 command or running a batch file from command line.
29
42
30 2007-08-22 Ville Vainio <vivainio@gmail.com>
43 2007-08-22 Ville Vainio <vivainio@gmail.com>
31
44
32 * iplib.py: no extra empty (last) line in raw hist w/ multiline
45 * iplib.py: no extra empty (last) line in raw hist w/ multiline
33 statements
46 statements
34
47
35 * logger.py: Fix bug where blank lines in history were not
48 * logger.py: Fix bug where blank lines in history were not
36 added until AFTER adding the current line; translated and raw
49 added until AFTER adding the current line; translated and raw
37 history should finally be in sync with prompt now.
50 history should finally be in sync with prompt now.
38
51
39 * ipy_completers.py: quick_completer now makes it easy to create
52 * ipy_completers.py: quick_completer now makes it easy to create
40 trivial custom completers
53 trivial custom completers
41
54
42 * clearcmd.py: shadow history compression & erasing, fixed input hist
55 * clearcmd.py: shadow history compression & erasing, fixed input hist
43 clearing.
56 clearing.
44
57
45 * envpersist.py, history.py: %env (sh profile only), %hist completers
58 * envpersist.py, history.py: %env (sh profile only), %hist completers
46
59
47 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
60 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
48 term title now include the drive letter, and always use / instead of
61 term title now include the drive letter, and always use / instead of
49 os.sep (as per recommended approach for win32 ipython in general).
62 os.sep (as per recommended approach for win32 ipython in general).
50
63
51 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
64 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
52 plain python scripts from ipykit command line by running
65 plain python scripts from ipykit command line by running
53 "py myscript.py", even w/o installed python.
66 "py myscript.py", even w/o installed python.
54
67
55 2007-08-21 Ville Vainio <vivainio@gmail.com>
68 2007-08-21 Ville Vainio <vivainio@gmail.com>
56
69
57 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
70 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
58 (for backwards compatibility)
71 (for backwards compatibility)
59
72
60 * history.py: switch back to %hist -t from %hist -r as default.
73 * history.py: switch back to %hist -t from %hist -r as default.
61 At least until raw history is fixed for good.
74 At least until raw history is fixed for good.
62
75
63 2007-08-20 Ville Vainio <vivainio@gmail.com>
76 2007-08-20 Ville Vainio <vivainio@gmail.com>
64
77
65 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
78 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
66 locate alias redeclarations etc. Also, avoid handling
79 locate alias redeclarations etc. Also, avoid handling
67 _ip.IP.alias_table directly, prefer using _ip.defalias.
80 _ip.IP.alias_table directly, prefer using _ip.defalias.
68
81
69
82
70 2007-08-15 Ville Vainio <vivainio@gmail.com>
83 2007-08-15 Ville Vainio <vivainio@gmail.com>
71
84
72 * prefilter.py: ! is now always served first
85 * prefilter.py: ! is now always served first
73
86
74 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
87 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
75
88
76 * IPython/iplib.py (safe_execfile): fix the SystemExit
89 * IPython/iplib.py (safe_execfile): fix the SystemExit
77 auto-suppression code to work in Python2.4 (the internal structure
90 auto-suppression code to work in Python2.4 (the internal structure
78 of that exception changed and I'd only tested the code with 2.5).
91 of that exception changed and I'd only tested the code with 2.5).
79 Bug reported by a SciPy attendee.
92 Bug reported by a SciPy attendee.
80
93
81 2007-08-13 Ville Vainio <vivainio@gmail.com>
94 2007-08-13 Ville Vainio <vivainio@gmail.com>
82
95
83 * prefilter.py: reverted !c:/bin/foo fix, made % in
96 * prefilter.py: reverted !c:/bin/foo fix, made % in
84 multiline specials work again
97 multiline specials work again
85
98
86 2007-08-13 Ville Vainio <vivainio@gmail.com>
99 2007-08-13 Ville Vainio <vivainio@gmail.com>
87
100
88 * prefilter.py: Take more care to special-case !, so that
101 * prefilter.py: Take more care to special-case !, so that
89 !c:/bin/foo.exe works.
102 !c:/bin/foo.exe works.
90
103
91 * setup.py: if we are building eggs, strip all docs and
104 * setup.py: if we are building eggs, strip all docs and
92 examples (it doesn't make sense to bytecompile examples,
105 examples (it doesn't make sense to bytecompile examples,
93 and docs would be in an awkward place anyway).
106 and docs would be in an awkward place anyway).
94
107
95 * Ryan Krauss' patch fixes start menu shortcuts when IPython
108 * Ryan Krauss' patch fixes start menu shortcuts when IPython
96 is installed into a directory that has spaces in the name.
109 is installed into a directory that has spaces in the name.
97
110
98 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
111 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
99
112
100 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
113 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
101 doctest profile and %doctest_mode, so they actually generate the
114 doctest profile and %doctest_mode, so they actually generate the
102 blank lines needed by doctest to separate individual tests.
115 blank lines needed by doctest to separate individual tests.
103
116
104 * IPython/iplib.py (safe_execfile): modify so that running code
117 * IPython/iplib.py (safe_execfile): modify so that running code
105 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
118 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
106 doesn't get a printed traceback. Any other value in sys.exit(),
119 doesn't get a printed traceback. Any other value in sys.exit(),
107 including the empty call, still generates a traceback. This
120 including the empty call, still generates a traceback. This
108 enables use of %run without having to pass '-e' for codes that
121 enables use of %run without having to pass '-e' for codes that
109 correctly set the exit status flag.
122 correctly set the exit status flag.
110
123
111 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
124 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
112
125
113 * IPython/iplib.py (InteractiveShell.post_config_initialization):
126 * IPython/iplib.py (InteractiveShell.post_config_initialization):
114 fix problems with doctests failing when run inside IPython due to
127 fix problems with doctests failing when run inside IPython due to
115 IPython's modifications of sys.displayhook.
128 IPython's modifications of sys.displayhook.
116
129
117 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
130 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
118
131
119 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
132 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
120 a string with names.
133 a string with names.
121
134
122 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
135 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
123
136
124 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
137 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
125 magic to toggle on/off the doctest pasting support without having
138 magic to toggle on/off the doctest pasting support without having
126 to leave a session to switch to a separate profile.
139 to leave a session to switch to a separate profile.
127
140
128 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
141 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
129
142
130 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
143 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
131 introduce a blank line between inputs, to conform to doctest
144 introduce a blank line between inputs, to conform to doctest
132 requirements.
145 requirements.
133
146
134 * IPython/OInspect.py (Inspector.pinfo): fix another part where
147 * IPython/OInspect.py (Inspector.pinfo): fix another part where
135 auto-generated docstrings for new-style classes were showing up.
148 auto-generated docstrings for new-style classes were showing up.
136
149
137 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
150 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
138
151
139 * api_changes: Add new file to track backward-incompatible
152 * api_changes: Add new file to track backward-incompatible
140 user-visible changes.
153 user-visible changes.
141
154
142 2007-08-06 Ville Vainio <vivainio@gmail.com>
155 2007-08-06 Ville Vainio <vivainio@gmail.com>
143
156
144 * ipmaker.py: fix bug where user_config_ns didn't exist at all
157 * ipmaker.py: fix bug where user_config_ns didn't exist at all
145 before all the config files were handled.
158 before all the config files were handled.
146
159
147 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
160 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
148
161
149 * IPython/irunner.py (RunnerFactory): Add new factory class for
162 * IPython/irunner.py (RunnerFactory): Add new factory class for
150 creating reusable runners based on filenames.
163 creating reusable runners based on filenames.
151
164
152 * IPython/Extensions/ipy_profile_doctest.py: New profile for
165 * IPython/Extensions/ipy_profile_doctest.py: New profile for
153 doctest support. It sets prompts/exceptions as similar to
166 doctest support. It sets prompts/exceptions as similar to
154 standard Python as possible, so that ipython sessions in this
167 standard Python as possible, so that ipython sessions in this
155 profile can be easily pasted as doctests with minimal
168 profile can be easily pasted as doctests with minimal
156 modifications. It also enables pasting of doctests from external
169 modifications. It also enables pasting of doctests from external
157 sources (even if they have leading whitespace), so that you can
170 sources (even if they have leading whitespace), so that you can
158 rerun doctests from existing sources.
171 rerun doctests from existing sources.
159
172
160 * IPython/iplib.py (_prefilter): fix a buglet where after entering
173 * IPython/iplib.py (_prefilter): fix a buglet where after entering
161 some whitespace, the prompt would become a continuation prompt
174 some whitespace, the prompt would become a continuation prompt
162 with no way of exiting it other than Ctrl-C. This fix brings us
175 with no way of exiting it other than Ctrl-C. This fix brings us
163 into conformity with how the default python prompt works.
176 into conformity with how the default python prompt works.
164
177
165 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
178 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
166 Add support for pasting not only lines that start with '>>>', but
179 Add support for pasting not only lines that start with '>>>', but
167 also with ' >>>'. That is, arbitrary whitespace can now precede
180 also with ' >>>'. That is, arbitrary whitespace can now precede
168 the prompts. This makes the system useful for pasting doctests
181 the prompts. This makes the system useful for pasting doctests
169 from docstrings back into a normal session.
182 from docstrings back into a normal session.
170
183
171 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
184 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
172
185
173 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
186 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
174 r1357, which had killed multiple invocations of an embedded
187 r1357, which had killed multiple invocations of an embedded
175 ipython (this means that example-embed has been broken for over 1
188 ipython (this means that example-embed has been broken for over 1
176 year!!!). Rather than possibly breaking the batch stuff for which
189 year!!!). Rather than possibly breaking the batch stuff for which
177 the code in iplib.py/interact was introduced, I worked around the
190 the code in iplib.py/interact was introduced, I worked around the
178 problem in the embedding class in Shell.py. We really need a
191 problem in the embedding class in Shell.py. We really need a
179 bloody test suite for this code, I'm sick of finding stuff that
192 bloody test suite for this code, I'm sick of finding stuff that
180 used to work breaking left and right every time I use an old
193 used to work breaking left and right every time I use an old
181 feature I hadn't touched in a few months.
194 feature I hadn't touched in a few months.
182 (kill_embedded): Add a new magic that only shows up in embedded
195 (kill_embedded): Add a new magic that only shows up in embedded
183 mode, to allow users to permanently deactivate an embedded instance.
196 mode, to allow users to permanently deactivate an embedded instance.
184
197
185 2007-08-01 Ville Vainio <vivainio@gmail.com>
198 2007-08-01 Ville Vainio <vivainio@gmail.com>
186
199
187 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
200 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
188 history gets out of sync on runlines (e.g. when running macros).
201 history gets out of sync on runlines (e.g. when running macros).
189
202
190 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
203 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
191
204
192 * IPython/Magic.py (magic_colors): fix win32-related error message
205 * IPython/Magic.py (magic_colors): fix win32-related error message
193 that could appear under *nix when readline was missing. Patch by
206 that could appear under *nix when readline was missing. Patch by
194 Scott Jackson, closes #175.
207 Scott Jackson, closes #175.
195
208
196 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
209 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
197
210
198 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
211 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
199 completer that it traits-aware, so that traits objects don't show
212 completer that it traits-aware, so that traits objects don't show
200 all of their internal attributes all the time.
213 all of their internal attributes all the time.
201
214
202 * IPython/genutils.py (dir2): moved this code from inside
215 * IPython/genutils.py (dir2): moved this code from inside
203 completer.py to expose it publicly, so I could use it in the
216 completer.py to expose it publicly, so I could use it in the
204 wildcards bugfix.
217 wildcards bugfix.
205
218
206 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
219 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
207 Stefan with Traits.
220 Stefan with Traits.
208
221
209 * IPython/completer.py (Completer.attr_matches): change internal
222 * IPython/completer.py (Completer.attr_matches): change internal
210 var name from 'object' to 'obj', since 'object' is now a builtin
223 var name from 'object' to 'obj', since 'object' is now a builtin
211 and this can lead to weird bugs if reusing this code elsewhere.
224 and this can lead to weird bugs if reusing this code elsewhere.
212
225
213 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
226 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
214
227
215 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
228 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
216 'foo?' and update the code to prevent printing of default
229 'foo?' and update the code to prevent printing of default
217 docstrings that started appearing after I added support for
230 docstrings that started appearing after I added support for
218 new-style classes. The approach I'm using isn't ideal (I just
231 new-style classes. The approach I'm using isn't ideal (I just
219 special-case those strings) but I'm not sure how to more robustly
232 special-case those strings) but I'm not sure how to more robustly
220 differentiate between truly user-written strings and Python's
233 differentiate between truly user-written strings and Python's
221 automatic ones.
234 automatic ones.
222
235
223 2007-07-09 Ville Vainio <vivainio@gmail.com>
236 2007-07-09 Ville Vainio <vivainio@gmail.com>
224
237
225 * completer.py: Applied Matthew Neeley's patch:
238 * completer.py: Applied Matthew Neeley's patch:
226 Dynamic attributes from trait_names and _getAttributeNames are added
239 Dynamic attributes from trait_names and _getAttributeNames are added
227 to the list of tab completions, but when this happens, the attribute
240 to the list of tab completions, but when this happens, the attribute
228 list is turned into a set, so the attributes are unordered when
241 list is turned into a set, so the attributes are unordered when
229 printed, which makes it hard to find the right completion. This patch
242 printed, which makes it hard to find the right completion. This patch
230 turns this set back into a list and sort it.
243 turns this set back into a list and sort it.
231
244
232 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
245 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
233
246
234 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
247 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
235 classes in various inspector functions.
248 classes in various inspector functions.
236
249
237 2007-06-28 Ville Vainio <vivainio@gmail.com>
250 2007-06-28 Ville Vainio <vivainio@gmail.com>
238
251
239 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
252 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
240 Implement "shadow" namespace, and callable aliases that reside there.
253 Implement "shadow" namespace, and callable aliases that reside there.
241 Use them by:
254 Use them by:
242
255
243 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
256 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
244
257
245 foo hello world
258 foo hello world
246 (gets translated to:)
259 (gets translated to:)
247 _sh.foo(r"""hello world""")
260 _sh.foo(r"""hello world""")
248
261
249 In practice, this kind of alias can take the role of a magic function
262 In practice, this kind of alias can take the role of a magic function
250
263
251 * New generic inspect_object, called on obj? and obj??
264 * New generic inspect_object, called on obj? and obj??
252
265
253 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
266 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
254
267
255 * IPython/ultraTB.py (findsource): fix a problem with
268 * IPython/ultraTB.py (findsource): fix a problem with
256 inspect.getfile that can cause crashes during traceback construction.
269 inspect.getfile that can cause crashes during traceback construction.
257
270
258 2007-06-14 Ville Vainio <vivainio@gmail.com>
271 2007-06-14 Ville Vainio <vivainio@gmail.com>
259
272
260 * iplib.py (handle_auto): Try to use ascii for printing "--->"
273 * iplib.py (handle_auto): Try to use ascii for printing "--->"
261 autocall rewrite indication, becausesometimes unicode fails to print
274 autocall rewrite indication, becausesometimes unicode fails to print
262 properly (and you get ' - - - '). Use plain uncoloured ---> for
275 properly (and you get ' - - - '). Use plain uncoloured ---> for
263 unicode.
276 unicode.
264
277
265 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
278 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
266
279
267 . pickleshare 'hash' commands (hget, hset, hcompress,
280 . pickleshare 'hash' commands (hget, hset, hcompress,
268 hdict) for efficient shadow history storage.
281 hdict) for efficient shadow history storage.
269
282
270 2007-06-13 Ville Vainio <vivainio@gmail.com>
283 2007-06-13 Ville Vainio <vivainio@gmail.com>
271
284
272 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
285 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
273 Added kw arg 'interactive', tell whether vars should be visible
286 Added kw arg 'interactive', tell whether vars should be visible
274 with %whos.
287 with %whos.
275
288
276 2007-06-11 Ville Vainio <vivainio@gmail.com>
289 2007-06-11 Ville Vainio <vivainio@gmail.com>
277
290
278 * pspersistence.py, Magic.py, iplib.py: directory history now saved
291 * pspersistence.py, Magic.py, iplib.py: directory history now saved
279 to db
292 to db
280
293
281 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
294 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
282 Also, it exits IPython immediately after evaluating the command (just like
295 Also, it exits IPython immediately after evaluating the command (just like
283 std python)
296 std python)
284
297
285 2007-06-05 Walter Doerwald <walter@livinglogic.de>
298 2007-06-05 Walter Doerwald <walter@livinglogic.de>
286
299
287 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
300 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
288 Python string and captures the output. (Idea and original patch by
301 Python string and captures the output. (Idea and original patch by
289 StοΏ½fan van der Walt)
302 StοΏ½fan van der Walt)
290
303
291 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
304 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
292
305
293 * IPython/ultraTB.py (VerboseTB.text): update printing of
306 * IPython/ultraTB.py (VerboseTB.text): update printing of
294 exception types for Python 2.5 (now all exceptions in the stdlib
307 exception types for Python 2.5 (now all exceptions in the stdlib
295 are new-style classes).
308 are new-style classes).
296
309
297 2007-05-31 Walter Doerwald <walter@livinglogic.de>
310 2007-05-31 Walter Doerwald <walter@livinglogic.de>
298
311
299 * IPython/Extensions/igrid.py: Add new commands refresh and
312 * IPython/Extensions/igrid.py: Add new commands refresh and
300 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
313 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
301 the iterator once (refresh) or after every x seconds (refresh_timer).
314 the iterator once (refresh) or after every x seconds (refresh_timer).
302 Add a working implementation of "searchexpression", where the text
315 Add a working implementation of "searchexpression", where the text
303 entered is not the text to search for, but an expression that must
316 entered is not the text to search for, but an expression that must
304 be true. Added display of shortcuts to the menu. Added commands "pickinput"
317 be true. Added display of shortcuts to the menu. Added commands "pickinput"
305 and "pickinputattr" that put the object or attribute under the cursor
318 and "pickinputattr" that put the object or attribute under the cursor
306 in the input line. Split the statusbar to be able to display the currently
319 in the input line. Split the statusbar to be able to display the currently
307 active refresh interval. (Patch by Nik Tautenhahn)
320 active refresh interval. (Patch by Nik Tautenhahn)
308
321
309 2007-05-29 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
322 2007-05-29 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
310
323
311 * fixing set_term_title to use ctypes as default
324 * fixing set_term_title to use ctypes as default
312
325
313 * fixing set_term_title fallback to work when curent dir
326 * fixing set_term_title fallback to work when curent dir
314 is on a windows network share
327 is on a windows network share
315
328
316 2007-05-28 Ville Vainio <vivainio@gmail.com>
329 2007-05-28 Ville Vainio <vivainio@gmail.com>
317
330
318 * %cpaste: strip + with > from left (diffs).
331 * %cpaste: strip + with > from left (diffs).
319
332
320 * iplib.py: Fix crash when readline not installed
333 * iplib.py: Fix crash when readline not installed
321
334
322 2007-05-26 Ville Vainio <vivainio@gmail.com>
335 2007-05-26 Ville Vainio <vivainio@gmail.com>
323
336
324 * generics.py: intruduce easy to extend result_display generic
337 * generics.py: intruduce easy to extend result_display generic
325 function (using simplegeneric.py).
338 function (using simplegeneric.py).
326
339
327 * Fixed the append functionality of %set.
340 * Fixed the append functionality of %set.
328
341
329 2007-05-25 Ville Vainio <vivainio@gmail.com>
342 2007-05-25 Ville Vainio <vivainio@gmail.com>
330
343
331 * New magic: %rep (fetch / run old commands from history)
344 * New magic: %rep (fetch / run old commands from history)
332
345
333 * New extension: mglob (%mglob magic), for powerful glob / find /filter
346 * New extension: mglob (%mglob magic), for powerful glob / find /filter
334 like functionality
347 like functionality
335
348
336 % maghistory.py: %hist -g PATTERM greps the history for pattern
349 % maghistory.py: %hist -g PATTERM greps the history for pattern
337
350
338 2007-05-24 Walter Doerwald <walter@livinglogic.de>
351 2007-05-24 Walter Doerwald <walter@livinglogic.de>
339
352
340 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
353 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
341 browse the IPython input history
354 browse the IPython input history
342
355
343 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
356 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
344 (mapped to "i") can be used to put the object under the curser in the input
357 (mapped to "i") can be used to put the object under the curser in the input
345 line. pickinputattr (mapped to "I") does the same for the attribute under
358 line. pickinputattr (mapped to "I") does the same for the attribute under
346 the cursor.
359 the cursor.
347
360
348 2007-05-24 Ville Vainio <vivainio@gmail.com>
361 2007-05-24 Ville Vainio <vivainio@gmail.com>
349
362
350 * Grand magic cleansing (changeset [2380]):
363 * Grand magic cleansing (changeset [2380]):
351
364
352 * Introduce ipy_legacy.py where the following magics were
365 * Introduce ipy_legacy.py where the following magics were
353 moved:
366 moved:
354
367
355 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
368 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
356
369
357 If you need them, either use default profile or "import ipy_legacy"
370 If you need them, either use default profile or "import ipy_legacy"
358 in your ipy_user_conf.py
371 in your ipy_user_conf.py
359
372
360 * Move sh and scipy profile to Extensions from UserConfig. this implies
373 * Move sh and scipy profile to Extensions from UserConfig. this implies
361 you should not edit them, but you don't need to run %upgrade when
374 you should not edit them, but you don't need to run %upgrade when
362 upgrading IPython anymore.
375 upgrading IPython anymore.
363
376
364 * %hist/%history now operates in "raw" mode by default. To get the old
377 * %hist/%history now operates in "raw" mode by default. To get the old
365 behaviour, run '%hist -n' (native mode).
378 behaviour, run '%hist -n' (native mode).
366
379
367 * split ipy_stock_completers.py to ipy_stock_completers.py and
380 * split ipy_stock_completers.py to ipy_stock_completers.py and
368 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
381 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
369 installed as default.
382 installed as default.
370
383
371 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
384 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
372 handling.
385 handling.
373
386
374 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
387 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
375 input if readline is available.
388 input if readline is available.
376
389
377 2007-05-23 Ville Vainio <vivainio@gmail.com>
390 2007-05-23 Ville Vainio <vivainio@gmail.com>
378
391
379 * macro.py: %store uses __getstate__ properly
392 * macro.py: %store uses __getstate__ properly
380
393
381 * exesetup.py: added new setup script for creating
394 * exesetup.py: added new setup script for creating
382 standalone IPython executables with py2exe (i.e.
395 standalone IPython executables with py2exe (i.e.
383 no python installation required).
396 no python installation required).
384
397
385 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
398 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
386 its place.
399 its place.
387
400
388 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
401 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
389
402
390 2007-05-21 Ville Vainio <vivainio@gmail.com>
403 2007-05-21 Ville Vainio <vivainio@gmail.com>
391
404
392 * platutil_win32.py (set_term_title): handle
405 * platutil_win32.py (set_term_title): handle
393 failure of 'title' system call properly.
406 failure of 'title' system call properly.
394
407
395 2007-05-17 Walter Doerwald <walter@livinglogic.de>
408 2007-05-17 Walter Doerwald <walter@livinglogic.de>
396
409
397 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
410 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
398 (Bug detected by Paul Mueller).
411 (Bug detected by Paul Mueller).
399
412
400 2007-05-16 Ville Vainio <vivainio@gmail.com>
413 2007-05-16 Ville Vainio <vivainio@gmail.com>
401
414
402 * ipy_profile_sci.py, ipython_win_post_install.py: Create
415 * ipy_profile_sci.py, ipython_win_post_install.py: Create
403 new "sci" profile, effectively a modern version of the old
416 new "sci" profile, effectively a modern version of the old
404 "scipy" profile (which is now slated for deprecation).
417 "scipy" profile (which is now slated for deprecation).
405
418
406 2007-05-15 Ville Vainio <vivainio@gmail.com>
419 2007-05-15 Ville Vainio <vivainio@gmail.com>
407
420
408 * pycolorize.py, pycolor.1: Paul Mueller's patches that
421 * pycolorize.py, pycolor.1: Paul Mueller's patches that
409 make pycolorize read input from stdin when run without arguments.
422 make pycolorize read input from stdin when run without arguments.
410
423
411 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
424 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
412
425
413 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
426 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
414 it in sh profile (instead of ipy_system_conf.py).
427 it in sh profile (instead of ipy_system_conf.py).
415
428
416 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
429 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
417 aliases are now lower case on windows (MyCommand.exe => mycommand).
430 aliases are now lower case on windows (MyCommand.exe => mycommand).
418
431
419 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
432 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
420 Macros are now callable objects that inherit from ipapi.IPyAutocall,
433 Macros are now callable objects that inherit from ipapi.IPyAutocall,
421 i.e. get autocalled regardless of system autocall setting.
434 i.e. get autocalled regardless of system autocall setting.
422
435
423 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
436 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
424
437
425 * IPython/rlineimpl.py: check for clear_history in readline and
438 * IPython/rlineimpl.py: check for clear_history in readline and
426 make it a dummy no-op if not available. This function isn't
439 make it a dummy no-op if not available. This function isn't
427 guaranteed to be in the API and appeared in Python 2.4, so we need
440 guaranteed to be in the API and appeared in Python 2.4, so we need
428 to check it ourselves. Also, clean up this file quite a bit.
441 to check it ourselves. Also, clean up this file quite a bit.
429
442
430 * ipython.1: update man page and full manual with information
443 * ipython.1: update man page and full manual with information
431 about threads (remove outdated warning). Closes #151.
444 about threads (remove outdated warning). Closes #151.
432
445
433 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
446 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
434
447
435 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
448 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
436 in trunk (note that this made it into the 0.8.1 release already,
449 in trunk (note that this made it into the 0.8.1 release already,
437 but the changelogs didn't get coordinated). Many thanks to Gael
450 but the changelogs didn't get coordinated). Many thanks to Gael
438 Varoquaux <gael.varoquaux-AT-normalesup.org>
451 Varoquaux <gael.varoquaux-AT-normalesup.org>
439
452
440 2007-05-09 *** Released version 0.8.1
453 2007-05-09 *** Released version 0.8.1
441
454
442 2007-05-10 Walter Doerwald <walter@livinglogic.de>
455 2007-05-10 Walter Doerwald <walter@livinglogic.de>
443
456
444 * IPython/Extensions/igrid.py: Incorporate html help into
457 * IPython/Extensions/igrid.py: Incorporate html help into
445 the module, so we don't have to search for the file.
458 the module, so we don't have to search for the file.
446
459
447 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
460 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
448
461
449 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
462 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
450
463
451 2007-04-30 Ville Vainio <vivainio@gmail.com>
464 2007-04-30 Ville Vainio <vivainio@gmail.com>
452
465
453 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
466 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
454 user has illegal (non-ascii) home directory name
467 user has illegal (non-ascii) home directory name
455
468
456 2007-04-27 Ville Vainio <vivainio@gmail.com>
469 2007-04-27 Ville Vainio <vivainio@gmail.com>
457
470
458 * platutils_win32.py: implement set_term_title for windows
471 * platutils_win32.py: implement set_term_title for windows
459
472
460 * Update version number
473 * Update version number
461
474
462 * ipy_profile_sh.py: more informative prompt (2 dir levels)
475 * ipy_profile_sh.py: more informative prompt (2 dir levels)
463
476
464 2007-04-26 Walter Doerwald <walter@livinglogic.de>
477 2007-04-26 Walter Doerwald <walter@livinglogic.de>
465
478
466 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
479 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
467 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
480 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
468 bug discovered by Ville).
481 bug discovered by Ville).
469
482
470 2007-04-26 Ville Vainio <vivainio@gmail.com>
483 2007-04-26 Ville Vainio <vivainio@gmail.com>
471
484
472 * Extensions/ipy_completers.py: Olivier's module completer now
485 * Extensions/ipy_completers.py: Olivier's module completer now
473 saves the list of root modules if it takes > 4 secs on the first run.
486 saves the list of root modules if it takes > 4 secs on the first run.
474
487
475 * Magic.py (%rehashx): %rehashx now clears the completer cache
488 * Magic.py (%rehashx): %rehashx now clears the completer cache
476
489
477
490
478 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
491 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
479
492
480 * ipython.el: fix incorrect color scheme, reported by Stefan.
493 * ipython.el: fix incorrect color scheme, reported by Stefan.
481 Closes #149.
494 Closes #149.
482
495
483 * IPython/PyColorize.py (Parser.format2): fix state-handling
496 * IPython/PyColorize.py (Parser.format2): fix state-handling
484 logic. I still don't like how that code handles state, but at
497 logic. I still don't like how that code handles state, but at
485 least now it should be correct, if inelegant. Closes #146.
498 least now it should be correct, if inelegant. Closes #146.
486
499
487 2007-04-25 Ville Vainio <vivainio@gmail.com>
500 2007-04-25 Ville Vainio <vivainio@gmail.com>
488
501
489 * Extensions/ipy_which.py: added extension for %which magic, works
502 * Extensions/ipy_which.py: added extension for %which magic, works
490 a lot like unix 'which' but also finds and expands aliases, and
503 a lot like unix 'which' but also finds and expands aliases, and
491 allows wildcards.
504 allows wildcards.
492
505
493 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
506 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
494 as opposed to returning nothing.
507 as opposed to returning nothing.
495
508
496 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
509 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
497 ipy_stock_completers on default profile, do import on sh profile.
510 ipy_stock_completers on default profile, do import on sh profile.
498
511
499 2007-04-22 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
512 2007-04-22 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
500
513
501 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
514 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
502 like ipython.py foo.py which raised a IndexError.
515 like ipython.py foo.py which raised a IndexError.
503
516
504 2007-04-21 Ville Vainio <vivainio@gmail.com>
517 2007-04-21 Ville Vainio <vivainio@gmail.com>
505
518
506 * Extensions/ipy_extutil.py: added extension to manage other ipython
519 * Extensions/ipy_extutil.py: added extension to manage other ipython
507 extensions. Now only supports 'ls' == list extensions.
520 extensions. Now only supports 'ls' == list extensions.
508
521
509 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
522 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
510
523
511 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
524 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
512 would prevent use of the exception system outside of a running
525 would prevent use of the exception system outside of a running
513 IPython instance.
526 IPython instance.
514
527
515 2007-04-20 Ville Vainio <vivainio@gmail.com>
528 2007-04-20 Ville Vainio <vivainio@gmail.com>
516
529
517 * Extensions/ipy_render.py: added extension for easy
530 * Extensions/ipy_render.py: added extension for easy
518 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
531 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
519 'Iptl' template notation,
532 'Iptl' template notation,
520
533
521 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
534 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
522 safer & faster 'import' completer.
535 safer & faster 'import' completer.
523
536
524 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
537 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
525 and _ip.defalias(name, command).
538 and _ip.defalias(name, command).
526
539
527 * Extensions/ipy_exportdb.py: New extension for exporting all the
540 * Extensions/ipy_exportdb.py: New extension for exporting all the
528 %store'd data in a portable format (normal ipapi calls like
541 %store'd data in a portable format (normal ipapi calls like
529 defmacro() etc.)
542 defmacro() etc.)
530
543
531 2007-04-19 Ville Vainio <vivainio@gmail.com>
544 2007-04-19 Ville Vainio <vivainio@gmail.com>
532
545
533 * upgrade_dir.py: skip junk files like *.pyc
546 * upgrade_dir.py: skip junk files like *.pyc
534
547
535 * Release.py: version number to 0.8.1
548 * Release.py: version number to 0.8.1
536
549
537 2007-04-18 Ville Vainio <vivainio@gmail.com>
550 2007-04-18 Ville Vainio <vivainio@gmail.com>
538
551
539 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
552 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
540 and later on win32.
553 and later on win32.
541
554
542 2007-04-16 Ville Vainio <vivainio@gmail.com>
555 2007-04-16 Ville Vainio <vivainio@gmail.com>
543
556
544 * iplib.py (showtraceback): Do not crash when running w/o readline.
557 * iplib.py (showtraceback): Do not crash when running w/o readline.
545
558
546 2007-04-12 Walter Doerwald <walter@livinglogic.de>
559 2007-04-12 Walter Doerwald <walter@livinglogic.de>
547
560
548 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
561 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
549 sorted (case sensitive with files and dirs mixed).
562 sorted (case sensitive with files and dirs mixed).
550
563
551 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
564 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
552
565
553 * IPython/Release.py (version): Open trunk for 0.8.1 development.
566 * IPython/Release.py (version): Open trunk for 0.8.1 development.
554
567
555 2007-04-10 *** Released version 0.8.0
568 2007-04-10 *** Released version 0.8.0
556
569
557 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
570 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
558
571
559 * Tag 0.8.0 for release.
572 * Tag 0.8.0 for release.
560
573
561 * IPython/iplib.py (reloadhist): add API function to cleanly
574 * IPython/iplib.py (reloadhist): add API function to cleanly
562 reload the readline history, which was growing inappropriately on
575 reload the readline history, which was growing inappropriately on
563 every %run call.
576 every %run call.
564
577
565 * win32_manual_post_install.py (run): apply last part of Nicolas
578 * win32_manual_post_install.py (run): apply last part of Nicolas
566 Pernetty's patch (I'd accidentally applied it in a different
579 Pernetty's patch (I'd accidentally applied it in a different
567 directory and this particular file didn't get patched).
580 directory and this particular file didn't get patched).
568
581
569 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
582 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
570
583
571 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
584 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
572 find the main thread id and use the proper API call. Thanks to
585 find the main thread id and use the proper API call. Thanks to
573 Stefan for the fix.
586 Stefan for the fix.
574
587
575 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
588 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
576 unit tests to reflect fixed ticket #52, and add more tests sent by
589 unit tests to reflect fixed ticket #52, and add more tests sent by
577 him.
590 him.
578
591
579 * IPython/iplib.py (raw_input): restore the readline completer
592 * IPython/iplib.py (raw_input): restore the readline completer
580 state on every input, in case third-party code messed it up.
593 state on every input, in case third-party code messed it up.
581 (_prefilter): revert recent addition of early-escape checks which
594 (_prefilter): revert recent addition of early-escape checks which
582 prevent many valid alias calls from working.
595 prevent many valid alias calls from working.
583
596
584 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
597 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
585 flag for sigint handler so we don't run a full signal() call on
598 flag for sigint handler so we don't run a full signal() call on
586 each runcode access.
599 each runcode access.
587
600
588 * IPython/Magic.py (magic_whos): small improvement to diagnostic
601 * IPython/Magic.py (magic_whos): small improvement to diagnostic
589 message.
602 message.
590
603
591 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
604 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
592
605
593 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
606 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
594 asynchronous exceptions working, i.e., Ctrl-C can actually
607 asynchronous exceptions working, i.e., Ctrl-C can actually
595 interrupt long-running code in the multithreaded shells.
608 interrupt long-running code in the multithreaded shells.
596
609
597 This is using Tomer Filiba's great ctypes-based trick:
610 This is using Tomer Filiba's great ctypes-based trick:
598 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
611 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
599 this in the past, but hadn't been able to make it work before. So
612 this in the past, but hadn't been able to make it work before. So
600 far it looks like it's actually running, but this needs more
613 far it looks like it's actually running, but this needs more
601 testing. If it really works, I'll be *very* happy, and we'll owe
614 testing. If it really works, I'll be *very* happy, and we'll owe
602 a huge thank you to Tomer. My current implementation is ugly,
615 a huge thank you to Tomer. My current implementation is ugly,
603 hackish and uses nasty globals, but I don't want to try and clean
616 hackish and uses nasty globals, but I don't want to try and clean
604 anything up until we know if it actually works.
617 anything up until we know if it actually works.
605
618
606 NOTE: this feature needs ctypes to work. ctypes is included in
619 NOTE: this feature needs ctypes to work. ctypes is included in
607 Python2.5, but 2.4 users will need to manually install it. This
620 Python2.5, but 2.4 users will need to manually install it. This
608 feature makes multi-threaded shells so much more usable that it's
621 feature makes multi-threaded shells so much more usable that it's
609 a minor price to pay (ctypes is very easy to install, already a
622 a minor price to pay (ctypes is very easy to install, already a
610 requirement for win32 and available in major linux distros).
623 requirement for win32 and available in major linux distros).
611
624
612 2007-04-04 Ville Vainio <vivainio@gmail.com>
625 2007-04-04 Ville Vainio <vivainio@gmail.com>
613
626
614 * Extensions/ipy_completers.py, ipy_stock_completers.py:
627 * Extensions/ipy_completers.py, ipy_stock_completers.py:
615 Moved implementations of 'bundled' completers to ipy_completers.py,
628 Moved implementations of 'bundled' completers to ipy_completers.py,
616 they are only enabled in ipy_stock_completers.py.
629 they are only enabled in ipy_stock_completers.py.
617
630
618 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
631 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
619
632
620 * IPython/PyColorize.py (Parser.format2): Fix identation of
633 * IPython/PyColorize.py (Parser.format2): Fix identation of
621 colorzied output and return early if color scheme is NoColor, to
634 colorzied output and return early if color scheme is NoColor, to
622 avoid unnecessary and expensive tokenization. Closes #131.
635 avoid unnecessary and expensive tokenization. Closes #131.
623
636
624 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
637 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
625
638
626 * IPython/Debugger.py: disable the use of pydb version 1.17. It
639 * IPython/Debugger.py: disable the use of pydb version 1.17. It
627 has a critical bug (a missing import that makes post-mortem not
640 has a critical bug (a missing import that makes post-mortem not
628 work at all). Unfortunately as of this time, this is the version
641 work at all). Unfortunately as of this time, this is the version
629 shipped with Ubuntu Edgy, so quite a few people have this one. I
642 shipped with Ubuntu Edgy, so quite a few people have this one. I
630 hope Edgy will update to a more recent package.
643 hope Edgy will update to a more recent package.
631
644
632 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
645 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
633
646
634 * IPython/iplib.py (_prefilter): close #52, second part of a patch
647 * IPython/iplib.py (_prefilter): close #52, second part of a patch
635 set by Stefan (only the first part had been applied before).
648 set by Stefan (only the first part had been applied before).
636
649
637 * IPython/Extensions/ipy_stock_completers.py (module_completer):
650 * IPython/Extensions/ipy_stock_completers.py (module_completer):
638 remove usage of the dangerous pkgutil.walk_packages(). See
651 remove usage of the dangerous pkgutil.walk_packages(). See
639 details in comments left in the code.
652 details in comments left in the code.
640
653
641 * IPython/Magic.py (magic_whos): add support for numpy arrays
654 * IPython/Magic.py (magic_whos): add support for numpy arrays
642 similar to what we had for Numeric.
655 similar to what we had for Numeric.
643
656
644 * IPython/completer.py (IPCompleter.complete): extend the
657 * IPython/completer.py (IPCompleter.complete): extend the
645 complete() call API to support completions by other mechanisms
658 complete() call API to support completions by other mechanisms
646 than readline. Closes #109.
659 than readline. Closes #109.
647
660
648 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
661 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
649 protect against a bug in Python's execfile(). Closes #123.
662 protect against a bug in Python's execfile(). Closes #123.
650
663
651 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
664 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
652
665
653 * IPython/iplib.py (split_user_input): ensure that when splitting
666 * IPython/iplib.py (split_user_input): ensure that when splitting
654 user input, the part that can be treated as a python name is pure
667 user input, the part that can be treated as a python name is pure
655 ascii (Python identifiers MUST be pure ascii). Part of the
668 ascii (Python identifiers MUST be pure ascii). Part of the
656 ongoing Unicode support work.
669 ongoing Unicode support work.
657
670
658 * IPython/Prompts.py (prompt_specials_color): Add \N for the
671 * IPython/Prompts.py (prompt_specials_color): Add \N for the
659 actual prompt number, without any coloring. This allows users to
672 actual prompt number, without any coloring. This allows users to
660 produce numbered prompts with their own colors. Added after a
673 produce numbered prompts with their own colors. Added after a
661 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
674 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
662
675
663 2007-03-31 Walter Doerwald <walter@livinglogic.de>
676 2007-03-31 Walter Doerwald <walter@livinglogic.de>
664
677
665 * IPython/Extensions/igrid.py: Map the return key
678 * IPython/Extensions/igrid.py: Map the return key
666 to enter() and shift-return to enterattr().
679 to enter() and shift-return to enterattr().
667
680
668 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
681 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
669
682
670 * IPython/Magic.py (magic_psearch): add unicode support by
683 * IPython/Magic.py (magic_psearch): add unicode support by
671 encoding to ascii the input, since this routine also only deals
684 encoding to ascii the input, since this routine also only deals
672 with valid Python names. Fixes a bug reported by Stefan.
685 with valid Python names. Fixes a bug reported by Stefan.
673
686
674 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
687 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
675
688
676 * IPython/Magic.py (_inspect): convert unicode input into ascii
689 * IPython/Magic.py (_inspect): convert unicode input into ascii
677 before trying to evaluate it as a Python identifier. This fixes a
690 before trying to evaluate it as a Python identifier. This fixes a
678 problem that the new unicode support had introduced when analyzing
691 problem that the new unicode support had introduced when analyzing
679 long definition lines for functions.
692 long definition lines for functions.
680
693
681 2007-03-24 Walter Doerwald <walter@livinglogic.de>
694 2007-03-24 Walter Doerwald <walter@livinglogic.de>
682
695
683 * IPython/Extensions/igrid.py: Fix picking. Using
696 * IPython/Extensions/igrid.py: Fix picking. Using
684 igrid with wxPython 2.6 and -wthread should work now.
697 igrid with wxPython 2.6 and -wthread should work now.
685 igrid.display() simply tries to create a frame without
698 igrid.display() simply tries to create a frame without
686 an application. Only if this fails an application is created.
699 an application. Only if this fails an application is created.
687
700
688 2007-03-23 Walter Doerwald <walter@livinglogic.de>
701 2007-03-23 Walter Doerwald <walter@livinglogic.de>
689
702
690 * IPython/Extensions/path.py: Updated to version 2.2.
703 * IPython/Extensions/path.py: Updated to version 2.2.
691
704
692 2007-03-23 Ville Vainio <vivainio@gmail.com>
705 2007-03-23 Ville Vainio <vivainio@gmail.com>
693
706
694 * iplib.py: recursive alias expansion now works better, so that
707 * iplib.py: recursive alias expansion now works better, so that
695 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
708 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
696 doesn't trip up the process, if 'd' has been aliased to 'ls'.
709 doesn't trip up the process, if 'd' has been aliased to 'ls'.
697
710
698 * Extensions/ipy_gnuglobal.py added, provides %global magic
711 * Extensions/ipy_gnuglobal.py added, provides %global magic
699 for users of http://www.gnu.org/software/global
712 for users of http://www.gnu.org/software/global
700
713
701 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
714 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
702 Closes #52. Patch by Stefan van der Walt.
715 Closes #52. Patch by Stefan van der Walt.
703
716
704 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
717 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
705
718
706 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
719 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
707 respect the __file__ attribute when using %run. Thanks to a bug
720 respect the __file__ attribute when using %run. Thanks to a bug
708 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
721 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
709
722
710 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
723 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
711
724
712 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
725 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
713 input. Patch sent by Stefan.
726 input. Patch sent by Stefan.
714
727
715 2007-03-20 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
728 2007-03-20 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
716 * IPython/Extensions/ipy_stock_completer.py
729 * IPython/Extensions/ipy_stock_completer.py
717 shlex_split, fix bug in shlex_split. len function
730 shlex_split, fix bug in shlex_split. len function
718 call was missing an if statement. Caused shlex_split to
731 call was missing an if statement. Caused shlex_split to
719 sometimes return "" as last element.
732 sometimes return "" as last element.
720
733
721 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
734 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
722
735
723 * IPython/completer.py
736 * IPython/completer.py
724 (IPCompleter.file_matches.single_dir_expand): fix a problem
737 (IPCompleter.file_matches.single_dir_expand): fix a problem
725 reported by Stefan, where directories containign a single subdir
738 reported by Stefan, where directories containign a single subdir
726 would be completed too early.
739 would be completed too early.
727
740
728 * IPython/Shell.py (_load_pylab): Make the execution of 'from
741 * IPython/Shell.py (_load_pylab): Make the execution of 'from
729 pylab import *' when -pylab is given be optional. A new flag,
742 pylab import *' when -pylab is given be optional. A new flag,
730 pylab_import_all controls this behavior, the default is True for
743 pylab_import_all controls this behavior, the default is True for
731 backwards compatibility.
744 backwards compatibility.
732
745
733 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
746 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
734 modified) R. Bernstein's patch for fully syntax highlighted
747 modified) R. Bernstein's patch for fully syntax highlighted
735 tracebacks. The functionality is also available under ultraTB for
748 tracebacks. The functionality is also available under ultraTB for
736 non-ipython users (someone using ultraTB but outside an ipython
749 non-ipython users (someone using ultraTB but outside an ipython
737 session). They can select the color scheme by setting the
750 session). They can select the color scheme by setting the
738 module-level global DEFAULT_SCHEME. The highlight functionality
751 module-level global DEFAULT_SCHEME. The highlight functionality
739 also works when debugging.
752 also works when debugging.
740
753
741 * IPython/genutils.py (IOStream.close): small patch by
754 * IPython/genutils.py (IOStream.close): small patch by
742 R. Bernstein for improved pydb support.
755 R. Bernstein for improved pydb support.
743
756
744 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
757 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
745 DaveS <davls@telus.net> to improve support of debugging under
758 DaveS <davls@telus.net> to improve support of debugging under
746 NTEmacs, including improved pydb behavior.
759 NTEmacs, including improved pydb behavior.
747
760
748 * IPython/Magic.py (magic_prun): Fix saving of profile info for
761 * IPython/Magic.py (magic_prun): Fix saving of profile info for
749 Python 2.5, where the stats object API changed a little. Thanks
762 Python 2.5, where the stats object API changed a little. Thanks
750 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
763 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
751
764
752 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
765 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
753 Pernetty's patch to improve support for (X)Emacs under Win32.
766 Pernetty's patch to improve support for (X)Emacs under Win32.
754
767
755 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
768 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
756
769
757 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
770 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
758 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
771 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
759 a report by Nik Tautenhahn.
772 a report by Nik Tautenhahn.
760
773
761 2007-03-16 Walter Doerwald <walter@livinglogic.de>
774 2007-03-16 Walter Doerwald <walter@livinglogic.de>
762
775
763 * setup.py: Add the igrid help files to the list of data files
776 * setup.py: Add the igrid help files to the list of data files
764 to be installed alongside igrid.
777 to be installed alongside igrid.
765 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
778 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
766 Show the input object of the igrid browser as the window tile.
779 Show the input object of the igrid browser as the window tile.
767 Show the object the cursor is on in the statusbar.
780 Show the object the cursor is on in the statusbar.
768
781
769 2007-03-15 Ville Vainio <vivainio@gmail.com>
782 2007-03-15 Ville Vainio <vivainio@gmail.com>
770
783
771 * Extensions/ipy_stock_completers.py: Fixed exception
784 * Extensions/ipy_stock_completers.py: Fixed exception
772 on mismatching quotes in %run completer. Patch by
785 on mismatching quotes in %run completer. Patch by
773 JοΏ½rgen Stenarson. Closes #127.
786 JοΏ½rgen Stenarson. Closes #127.
774
787
775 2007-03-14 Ville Vainio <vivainio@gmail.com>
788 2007-03-14 Ville Vainio <vivainio@gmail.com>
776
789
777 * Extensions/ext_rehashdir.py: Do not do auto_alias
790 * Extensions/ext_rehashdir.py: Do not do auto_alias
778 in %rehashdir, it clobbers %store'd aliases.
791 in %rehashdir, it clobbers %store'd aliases.
779
792
780 * UserConfig/ipy_profile_sh.py: envpersist.py extension
793 * UserConfig/ipy_profile_sh.py: envpersist.py extension
781 (beefed up %env) imported for sh profile.
794 (beefed up %env) imported for sh profile.
782
795
783 2007-03-10 Walter Doerwald <walter@livinglogic.de>
796 2007-03-10 Walter Doerwald <walter@livinglogic.de>
784
797
785 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
798 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
786 as the default browser.
799 as the default browser.
787 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
800 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
788 As igrid displays all attributes it ever encounters, fetch() (which has
801 As igrid displays all attributes it ever encounters, fetch() (which has
789 been renamed to _fetch()) doesn't have to recalculate the display attributes
802 been renamed to _fetch()) doesn't have to recalculate the display attributes
790 every time a new item is fetched. This should speed up scrolling.
803 every time a new item is fetched. This should speed up scrolling.
791
804
792 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
805 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
793
806
794 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
807 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
795 Schmolck's recently reported tab-completion bug (my previous one
808 Schmolck's recently reported tab-completion bug (my previous one
796 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
809 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
797
810
798 2007-03-09 Walter Doerwald <walter@livinglogic.de>
811 2007-03-09 Walter Doerwald <walter@livinglogic.de>
799
812
800 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
813 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
801 Close help window if exiting igrid.
814 Close help window if exiting igrid.
802
815
803 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
816 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
804
817
805 * IPython/Extensions/ipy_defaults.py: Check if readline is available
818 * IPython/Extensions/ipy_defaults.py: Check if readline is available
806 before calling functions from readline.
819 before calling functions from readline.
807
820
808 2007-03-02 Walter Doerwald <walter@livinglogic.de>
821 2007-03-02 Walter Doerwald <walter@livinglogic.de>
809
822
810 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
823 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
811 igrid is a wxPython-based display object for ipipe. If your system has
824 igrid is a wxPython-based display object for ipipe. If your system has
812 wx installed igrid will be the default display. Without wx ipipe falls
825 wx installed igrid will be the default display. Without wx ipipe falls
813 back to ibrowse (which needs curses). If no curses is installed ipipe
826 back to ibrowse (which needs curses). If no curses is installed ipipe
814 falls back to idump.
827 falls back to idump.
815
828
816 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
829 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
817
830
818 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
831 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
819 my changes from yesterday, they introduced bugs. Will reactivate
832 my changes from yesterday, they introduced bugs. Will reactivate
820 once I get a correct solution, which will be much easier thanks to
833 once I get a correct solution, which will be much easier thanks to
821 Dan Milstein's new prefilter test suite.
834 Dan Milstein's new prefilter test suite.
822
835
823 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
836 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
824
837
825 * IPython/iplib.py (split_user_input): fix input splitting so we
838 * IPython/iplib.py (split_user_input): fix input splitting so we
826 don't attempt attribute accesses on things that can't possibly be
839 don't attempt attribute accesses on things that can't possibly be
827 valid Python attributes. After a bug report by Alex Schmolck.
840 valid Python attributes. After a bug report by Alex Schmolck.
828 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
841 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
829 %magic with explicit % prefix.
842 %magic with explicit % prefix.
830
843
831 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
844 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
832
845
833 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
846 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
834 avoid a DeprecationWarning from GTK.
847 avoid a DeprecationWarning from GTK.
835
848
836 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
849 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
837
850
838 * IPython/genutils.py (clock): I modified clock() to return total
851 * IPython/genutils.py (clock): I modified clock() to return total
839 time, user+system. This is a more commonly needed metric. I also
852 time, user+system. This is a more commonly needed metric. I also
840 introduced the new clocku/clocks to get only user/system time if
853 introduced the new clocku/clocks to get only user/system time if
841 one wants those instead.
854 one wants those instead.
842
855
843 ***WARNING: API CHANGE*** clock() used to return only user time,
856 ***WARNING: API CHANGE*** clock() used to return only user time,
844 so if you want exactly the same results as before, use clocku
857 so if you want exactly the same results as before, use clocku
845 instead.
858 instead.
846
859
847 2007-02-22 Ville Vainio <vivainio@gmail.com>
860 2007-02-22 Ville Vainio <vivainio@gmail.com>
848
861
849 * IPython/Extensions/ipy_p4.py: Extension for improved
862 * IPython/Extensions/ipy_p4.py: Extension for improved
850 p4 (perforce version control system) experience.
863 p4 (perforce version control system) experience.
851 Adds %p4 magic with p4 command completion and
864 Adds %p4 magic with p4 command completion and
852 automatic -G argument (marshall output as python dict)
865 automatic -G argument (marshall output as python dict)
853
866
854 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
867 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
855
868
856 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
869 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
857 stop marks.
870 stop marks.
858 (ClearingMixin): a simple mixin to easily make a Demo class clear
871 (ClearingMixin): a simple mixin to easily make a Demo class clear
859 the screen in between blocks and have empty marquees. The
872 the screen in between blocks and have empty marquees. The
860 ClearDemo and ClearIPDemo classes that use it are included.
873 ClearDemo and ClearIPDemo classes that use it are included.
861
874
862 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
875 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
863
876
864 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
877 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
865 protect against exceptions at Python shutdown time. Patch
878 protect against exceptions at Python shutdown time. Patch
866 sumbmitted to upstream.
879 sumbmitted to upstream.
867
880
868 2007-02-14 Walter Doerwald <walter@livinglogic.de>
881 2007-02-14 Walter Doerwald <walter@livinglogic.de>
869
882
870 * IPython/Extensions/ibrowse.py: If entering the first object level
883 * IPython/Extensions/ibrowse.py: If entering the first object level
871 (i.e. the object for which the browser has been started) fails,
884 (i.e. the object for which the browser has been started) fails,
872 now the error is raised directly (aborting the browser) instead of
885 now the error is raised directly (aborting the browser) instead of
873 running into an empty levels list later.
886 running into an empty levels list later.
874
887
875 2007-02-03 Walter Doerwald <walter@livinglogic.de>
888 2007-02-03 Walter Doerwald <walter@livinglogic.de>
876
889
877 * IPython/Extensions/ipipe.py: Add an xrepr implementation
890 * IPython/Extensions/ipipe.py: Add an xrepr implementation
878 for the noitem object.
891 for the noitem object.
879
892
880 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
893 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
881
894
882 * IPython/completer.py (Completer.attr_matches): Fix small
895 * IPython/completer.py (Completer.attr_matches): Fix small
883 tab-completion bug with Enthought Traits objects with units.
896 tab-completion bug with Enthought Traits objects with units.
884 Thanks to a bug report by Tom Denniston
897 Thanks to a bug report by Tom Denniston
885 <tom.denniston-AT-alum.dartmouth.org>.
898 <tom.denniston-AT-alum.dartmouth.org>.
886
899
887 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
900 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
888
901
889 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
902 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
890 bug where only .ipy or .py would be completed. Once the first
903 bug where only .ipy or .py would be completed. Once the first
891 argument to %run has been given, all completions are valid because
904 argument to %run has been given, all completions are valid because
892 they are the arguments to the script, which may well be non-python
905 they are the arguments to the script, which may well be non-python
893 filenames.
906 filenames.
894
907
895 * IPython/irunner.py (InteractiveRunner.run_source): major updates
908 * IPython/irunner.py (InteractiveRunner.run_source): major updates
896 to irunner to allow it to correctly support real doctesting of
909 to irunner to allow it to correctly support real doctesting of
897 out-of-process ipython code.
910 out-of-process ipython code.
898
911
899 * IPython/Magic.py (magic_cd): Make the setting of the terminal
912 * IPython/Magic.py (magic_cd): Make the setting of the terminal
900 title an option (-noterm_title) because it completely breaks
913 title an option (-noterm_title) because it completely breaks
901 doctesting.
914 doctesting.
902
915
903 * IPython/demo.py: fix IPythonDemo class that was not actually working.
916 * IPython/demo.py: fix IPythonDemo class that was not actually working.
904
917
905 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
918 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
906
919
907 * IPython/irunner.py (main): fix small bug where extensions were
920 * IPython/irunner.py (main): fix small bug where extensions were
908 not being correctly recognized.
921 not being correctly recognized.
909
922
910 2007-01-23 Walter Doerwald <walter@livinglogic.de>
923 2007-01-23 Walter Doerwald <walter@livinglogic.de>
911
924
912 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
925 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
913 a string containing a single line yields the string itself as the
926 a string containing a single line yields the string itself as the
914 only item.
927 only item.
915
928
916 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
929 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
917 object if it's the same as the one on the last level (This avoids
930 object if it's the same as the one on the last level (This avoids
918 infinite recursion for one line strings).
931 infinite recursion for one line strings).
919
932
920 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
933 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
921
934
922 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
935 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
923 all output streams before printing tracebacks. This ensures that
936 all output streams before printing tracebacks. This ensures that
924 user output doesn't end up interleaved with traceback output.
937 user output doesn't end up interleaved with traceback output.
925
938
926 2007-01-10 Ville Vainio <vivainio@gmail.com>
939 2007-01-10 Ville Vainio <vivainio@gmail.com>
927
940
928 * Extensions/envpersist.py: Turbocharged %env that remembers
941 * Extensions/envpersist.py: Turbocharged %env that remembers
929 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
942 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
930 "%env VISUAL=jed".
943 "%env VISUAL=jed".
931
944
932 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
945 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
933
946
934 * IPython/iplib.py (showtraceback): ensure that we correctly call
947 * IPython/iplib.py (showtraceback): ensure that we correctly call
935 custom handlers in all cases (some with pdb were slipping through,
948 custom handlers in all cases (some with pdb were slipping through,
936 but I'm not exactly sure why).
949 but I'm not exactly sure why).
937
950
938 * IPython/Debugger.py (Tracer.__init__): added new class to
951 * IPython/Debugger.py (Tracer.__init__): added new class to
939 support set_trace-like usage of IPython's enhanced debugger.
952 support set_trace-like usage of IPython's enhanced debugger.
940
953
941 2006-12-24 Ville Vainio <vivainio@gmail.com>
954 2006-12-24 Ville Vainio <vivainio@gmail.com>
942
955
943 * ipmaker.py: more informative message when ipy_user_conf
956 * ipmaker.py: more informative message when ipy_user_conf
944 import fails (suggest running %upgrade).
957 import fails (suggest running %upgrade).
945
958
946 * tools/run_ipy_in_profiler.py: Utility to see where
959 * tools/run_ipy_in_profiler.py: Utility to see where
947 the time during IPython startup is spent.
960 the time during IPython startup is spent.
948
961
949 2006-12-20 Ville Vainio <vivainio@gmail.com>
962 2006-12-20 Ville Vainio <vivainio@gmail.com>
950
963
951 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
964 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
952
965
953 * ipapi.py: Add new ipapi method, expand_alias.
966 * ipapi.py: Add new ipapi method, expand_alias.
954
967
955 * Release.py: Bump up version to 0.7.4.svn
968 * Release.py: Bump up version to 0.7.4.svn
956
969
957 2006-12-17 Ville Vainio <vivainio@gmail.com>
970 2006-12-17 Ville Vainio <vivainio@gmail.com>
958
971
959 * Extensions/jobctrl.py: Fixed &cmd arg arg...
972 * Extensions/jobctrl.py: Fixed &cmd arg arg...
960 to work properly on posix too
973 to work properly on posix too
961
974
962 * Release.py: Update revnum (version is still just 0.7.3).
975 * Release.py: Update revnum (version is still just 0.7.3).
963
976
964 2006-12-15 Ville Vainio <vivainio@gmail.com>
977 2006-12-15 Ville Vainio <vivainio@gmail.com>
965
978
966 * scripts/ipython_win_post_install: create ipython.py in
979 * scripts/ipython_win_post_install: create ipython.py in
967 prefix + "/scripts".
980 prefix + "/scripts".
968
981
969 * Release.py: Update version to 0.7.3.
982 * Release.py: Update version to 0.7.3.
970
983
971 2006-12-14 Ville Vainio <vivainio@gmail.com>
984 2006-12-14 Ville Vainio <vivainio@gmail.com>
972
985
973 * scripts/ipython_win_post_install: Overwrite old shortcuts
986 * scripts/ipython_win_post_install: Overwrite old shortcuts
974 if they already exist
987 if they already exist
975
988
976 * Release.py: release 0.7.3rc2
989 * Release.py: release 0.7.3rc2
977
990
978 2006-12-13 Ville Vainio <vivainio@gmail.com>
991 2006-12-13 Ville Vainio <vivainio@gmail.com>
979
992
980 * Branch and update Release.py for 0.7.3rc1
993 * Branch and update Release.py for 0.7.3rc1
981
994
982 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
995 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
983
996
984 * IPython/Shell.py (IPShellWX): update for current WX naming
997 * IPython/Shell.py (IPShellWX): update for current WX naming
985 conventions, to avoid a deprecation warning with current WX
998 conventions, to avoid a deprecation warning with current WX
986 versions. Thanks to a report by Danny Shevitz.
999 versions. Thanks to a report by Danny Shevitz.
987
1000
988 2006-12-12 Ville Vainio <vivainio@gmail.com>
1001 2006-12-12 Ville Vainio <vivainio@gmail.com>
989
1002
990 * ipmaker.py: apply david cournapeau's patch to make
1003 * ipmaker.py: apply david cournapeau's patch to make
991 import_some work properly even when ipythonrc does
1004 import_some work properly even when ipythonrc does
992 import_some on empty list (it was an old bug!).
1005 import_some on empty list (it was an old bug!).
993
1006
994 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
1007 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
995 Add deprecation note to ipythonrc and a url to wiki
1008 Add deprecation note to ipythonrc and a url to wiki
996 in ipy_user_conf.py
1009 in ipy_user_conf.py
997
1010
998
1011
999 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
1012 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
1000 as if it was typed on IPython command prompt, i.e.
1013 as if it was typed on IPython command prompt, i.e.
1001 as IPython script.
1014 as IPython script.
1002
1015
1003 * example-magic.py, magic_grepl.py: remove outdated examples
1016 * example-magic.py, magic_grepl.py: remove outdated examples
1004
1017
1005 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
1018 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
1006
1019
1007 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
1020 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
1008 is called before any exception has occurred.
1021 is called before any exception has occurred.
1009
1022
1010 2006-12-08 Ville Vainio <vivainio@gmail.com>
1023 2006-12-08 Ville Vainio <vivainio@gmail.com>
1011
1024
1012 * Extensions/ipy_stock_completers.py: fix cd completer
1025 * Extensions/ipy_stock_completers.py: fix cd completer
1013 to translate /'s to \'s again.
1026 to translate /'s to \'s again.
1014
1027
1015 * completer.py: prevent traceback on file completions w/
1028 * completer.py: prevent traceback on file completions w/
1016 backslash.
1029 backslash.
1017
1030
1018 * Release.py: Update release number to 0.7.3b3 for release
1031 * Release.py: Update release number to 0.7.3b3 for release
1019
1032
1020 2006-12-07 Ville Vainio <vivainio@gmail.com>
1033 2006-12-07 Ville Vainio <vivainio@gmail.com>
1021
1034
1022 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1035 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1023 while executing external code. Provides more shell-like behaviour
1036 while executing external code. Provides more shell-like behaviour
1024 and overall better response to ctrl + C / ctrl + break.
1037 and overall better response to ctrl + C / ctrl + break.
1025
1038
1026 * tools/make_tarball.py: new script to create tarball straight from svn
1039 * tools/make_tarball.py: new script to create tarball straight from svn
1027 (setup.py sdist doesn't work on win32).
1040 (setup.py sdist doesn't work on win32).
1028
1041
1029 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1042 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1030 on dirnames with spaces and use the default completer instead.
1043 on dirnames with spaces and use the default completer instead.
1031
1044
1032 * Revision.py: Change version to 0.7.3b2 for release.
1045 * Revision.py: Change version to 0.7.3b2 for release.
1033
1046
1034 2006-12-05 Ville Vainio <vivainio@gmail.com>
1047 2006-12-05 Ville Vainio <vivainio@gmail.com>
1035
1048
1036 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1049 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1037 pydb patch 4 (rm debug printing, py 2.5 checking)
1050 pydb patch 4 (rm debug printing, py 2.5 checking)
1038
1051
1039 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1052 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1040 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1053 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1041 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1054 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1042 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1055 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1043 object the cursor was on before the refresh. The command "markrange" is
1056 object the cursor was on before the refresh. The command "markrange" is
1044 mapped to "%" now.
1057 mapped to "%" now.
1045 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1058 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1046
1059
1047 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1060 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1048
1061
1049 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1062 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1050 interactive debugger on the last traceback, without having to call
1063 interactive debugger on the last traceback, without having to call
1051 %pdb and rerun your code. Made minor changes in various modules,
1064 %pdb and rerun your code. Made minor changes in various modules,
1052 should automatically recognize pydb if available.
1065 should automatically recognize pydb if available.
1053
1066
1054 2006-11-28 Ville Vainio <vivainio@gmail.com>
1067 2006-11-28 Ville Vainio <vivainio@gmail.com>
1055
1068
1056 * completer.py: If the text start with !, show file completions
1069 * completer.py: If the text start with !, show file completions
1057 properly. This helps when trying to complete command name
1070 properly. This helps when trying to complete command name
1058 for shell escapes.
1071 for shell escapes.
1059
1072
1060 2006-11-27 Ville Vainio <vivainio@gmail.com>
1073 2006-11-27 Ville Vainio <vivainio@gmail.com>
1061
1074
1062 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1075 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1063 der Walt. Clean up svn and hg completers by using a common
1076 der Walt. Clean up svn and hg completers by using a common
1064 vcs_completer.
1077 vcs_completer.
1065
1078
1066 2006-11-26 Ville Vainio <vivainio@gmail.com>
1079 2006-11-26 Ville Vainio <vivainio@gmail.com>
1067
1080
1068 * Remove ipconfig and %config; you should use _ip.options structure
1081 * Remove ipconfig and %config; you should use _ip.options structure
1069 directly instead!
1082 directly instead!
1070
1083
1071 * genutils.py: add wrap_deprecated function for deprecating callables
1084 * genutils.py: add wrap_deprecated function for deprecating callables
1072
1085
1073 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1086 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1074 _ip.system instead. ipalias is redundant.
1087 _ip.system instead. ipalias is redundant.
1075
1088
1076 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1089 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1077 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1090 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1078 explicit.
1091 explicit.
1079
1092
1080 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1093 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1081 completer. Try it by entering 'hg ' and pressing tab.
1094 completer. Try it by entering 'hg ' and pressing tab.
1082
1095
1083 * macro.py: Give Macro a useful __repr__ method
1096 * macro.py: Give Macro a useful __repr__ method
1084
1097
1085 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1098 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1086
1099
1087 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1100 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1088 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1101 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1089 we don't get a duplicate ipipe module, where registration of the xrepr
1102 we don't get a duplicate ipipe module, where registration of the xrepr
1090 implementation for Text is useless.
1103 implementation for Text is useless.
1091
1104
1092 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1105 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1093
1106
1094 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1107 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1095
1108
1096 2006-11-24 Ville Vainio <vivainio@gmail.com>
1109 2006-11-24 Ville Vainio <vivainio@gmail.com>
1097
1110
1098 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1111 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1099 try to use "cProfile" instead of the slower pure python
1112 try to use "cProfile" instead of the slower pure python
1100 "profile"
1113 "profile"
1101
1114
1102 2006-11-23 Ville Vainio <vivainio@gmail.com>
1115 2006-11-23 Ville Vainio <vivainio@gmail.com>
1103
1116
1104 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1117 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1105 Qt+IPython+Designer link in documentation.
1118 Qt+IPython+Designer link in documentation.
1106
1119
1107 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1120 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1108 correct Pdb object to %pydb.
1121 correct Pdb object to %pydb.
1109
1122
1110
1123
1111 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1124 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1112 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1125 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1113 generic xrepr(), otherwise the list implementation would kick in.
1126 generic xrepr(), otherwise the list implementation would kick in.
1114
1127
1115 2006-11-21 Ville Vainio <vivainio@gmail.com>
1128 2006-11-21 Ville Vainio <vivainio@gmail.com>
1116
1129
1117 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1130 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1118 with one from UserConfig.
1131 with one from UserConfig.
1119
1132
1120 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1133 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1121 it was missing which broke the sh profile.
1134 it was missing which broke the sh profile.
1122
1135
1123 * completer.py: file completer now uses explicit '/' instead
1136 * completer.py: file completer now uses explicit '/' instead
1124 of os.path.join, expansion of 'foo' was broken on win32
1137 of os.path.join, expansion of 'foo' was broken on win32
1125 if there was one directory with name 'foobar'.
1138 if there was one directory with name 'foobar'.
1126
1139
1127 * A bunch of patches from Kirill Smelkov:
1140 * A bunch of patches from Kirill Smelkov:
1128
1141
1129 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1142 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1130
1143
1131 * [patch 7/9] Implement %page -r (page in raw mode) -
1144 * [patch 7/9] Implement %page -r (page in raw mode) -
1132
1145
1133 * [patch 5/9] ScientificPython webpage has moved
1146 * [patch 5/9] ScientificPython webpage has moved
1134
1147
1135 * [patch 4/9] The manual mentions %ds, should be %dhist
1148 * [patch 4/9] The manual mentions %ds, should be %dhist
1136
1149
1137 * [patch 3/9] Kill old bits from %prun doc.
1150 * [patch 3/9] Kill old bits from %prun doc.
1138
1151
1139 * [patch 1/9] Fix typos here and there.
1152 * [patch 1/9] Fix typos here and there.
1140
1153
1141 2006-11-08 Ville Vainio <vivainio@gmail.com>
1154 2006-11-08 Ville Vainio <vivainio@gmail.com>
1142
1155
1143 * completer.py (attr_matches): catch all exceptions raised
1156 * completer.py (attr_matches): catch all exceptions raised
1144 by eval of expr with dots.
1157 by eval of expr with dots.
1145
1158
1146 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1159 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1147
1160
1148 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1161 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1149 input if it starts with whitespace. This allows you to paste
1162 input if it starts with whitespace. This allows you to paste
1150 indented input from any editor without manually having to type in
1163 indented input from any editor without manually having to type in
1151 the 'if 1:', which is convenient when working interactively.
1164 the 'if 1:', which is convenient when working interactively.
1152 Slightly modifed version of a patch by Bo Peng
1165 Slightly modifed version of a patch by Bo Peng
1153 <bpeng-AT-rice.edu>.
1166 <bpeng-AT-rice.edu>.
1154
1167
1155 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1168 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1156
1169
1157 * IPython/irunner.py (main): modified irunner so it automatically
1170 * IPython/irunner.py (main): modified irunner so it automatically
1158 recognizes the right runner to use based on the extension (.py for
1171 recognizes the right runner to use based on the extension (.py for
1159 python, .ipy for ipython and .sage for sage).
1172 python, .ipy for ipython and .sage for sage).
1160
1173
1161 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1174 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1162 visible in ipapi as ip.config(), to programatically control the
1175 visible in ipapi as ip.config(), to programatically control the
1163 internal rc object. There's an accompanying %config magic for
1176 internal rc object. There's an accompanying %config magic for
1164 interactive use, which has been enhanced to match the
1177 interactive use, which has been enhanced to match the
1165 funtionality in ipconfig.
1178 funtionality in ipconfig.
1166
1179
1167 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1180 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1168 so it's not just a toggle, it now takes an argument. Add support
1181 so it's not just a toggle, it now takes an argument. Add support
1169 for a customizable header when making system calls, as the new
1182 for a customizable header when making system calls, as the new
1170 system_header variable in the ipythonrc file.
1183 system_header variable in the ipythonrc file.
1171
1184
1172 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1185 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1173
1186
1174 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1187 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1175 generic functions (using Philip J. Eby's simplegeneric package).
1188 generic functions (using Philip J. Eby's simplegeneric package).
1176 This makes it possible to customize the display of third-party classes
1189 This makes it possible to customize the display of third-party classes
1177 without having to monkeypatch them. xiter() no longer supports a mode
1190 without having to monkeypatch them. xiter() no longer supports a mode
1178 argument and the XMode class has been removed. The same functionality can
1191 argument and the XMode class has been removed. The same functionality can
1179 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1192 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1180 One consequence of the switch to generic functions is that xrepr() and
1193 One consequence of the switch to generic functions is that xrepr() and
1181 xattrs() implementation must define the default value for the mode
1194 xattrs() implementation must define the default value for the mode
1182 argument themselves and xattrs() implementations must return real
1195 argument themselves and xattrs() implementations must return real
1183 descriptors.
1196 descriptors.
1184
1197
1185 * IPython/external: This new subpackage will contain all third-party
1198 * IPython/external: This new subpackage will contain all third-party
1186 packages that are bundled with IPython. (The first one is simplegeneric).
1199 packages that are bundled with IPython. (The first one is simplegeneric).
1187
1200
1188 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1201 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1189 directory which as been dropped in r1703.
1202 directory which as been dropped in r1703.
1190
1203
1191 * IPython/Extensions/ipipe.py (iless): Fixed.
1204 * IPython/Extensions/ipipe.py (iless): Fixed.
1192
1205
1193 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1206 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1194
1207
1195 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1208 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1196
1209
1197 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1210 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1198 handling in variable expansion so that shells and magics recognize
1211 handling in variable expansion so that shells and magics recognize
1199 function local scopes correctly. Bug reported by Brian.
1212 function local scopes correctly. Bug reported by Brian.
1200
1213
1201 * scripts/ipython: remove the very first entry in sys.path which
1214 * scripts/ipython: remove the very first entry in sys.path which
1202 Python auto-inserts for scripts, so that sys.path under IPython is
1215 Python auto-inserts for scripts, so that sys.path under IPython is
1203 as similar as possible to that under plain Python.
1216 as similar as possible to that under plain Python.
1204
1217
1205 * IPython/completer.py (IPCompleter.file_matches): Fix
1218 * IPython/completer.py (IPCompleter.file_matches): Fix
1206 tab-completion so that quotes are not closed unless the completion
1219 tab-completion so that quotes are not closed unless the completion
1207 is unambiguous. After a request by Stefan. Minor cleanups in
1220 is unambiguous. After a request by Stefan. Minor cleanups in
1208 ipy_stock_completers.
1221 ipy_stock_completers.
1209
1222
1210 2006-11-02 Ville Vainio <vivainio@gmail.com>
1223 2006-11-02 Ville Vainio <vivainio@gmail.com>
1211
1224
1212 * ipy_stock_completers.py: Add %run and %cd completers.
1225 * ipy_stock_completers.py: Add %run and %cd completers.
1213
1226
1214 * completer.py: Try running custom completer for both
1227 * completer.py: Try running custom completer for both
1215 "foo" and "%foo" if the command is just "foo". Ignore case
1228 "foo" and "%foo" if the command is just "foo". Ignore case
1216 when filtering possible completions.
1229 when filtering possible completions.
1217
1230
1218 * UserConfig/ipy_user_conf.py: install stock completers as default
1231 * UserConfig/ipy_user_conf.py: install stock completers as default
1219
1232
1220 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1233 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1221 simplified readline history save / restore through a wrapper
1234 simplified readline history save / restore through a wrapper
1222 function
1235 function
1223
1236
1224
1237
1225 2006-10-31 Ville Vainio <vivainio@gmail.com>
1238 2006-10-31 Ville Vainio <vivainio@gmail.com>
1226
1239
1227 * strdispatch.py, completer.py, ipy_stock_completers.py:
1240 * strdispatch.py, completer.py, ipy_stock_completers.py:
1228 Allow str_key ("command") in completer hooks. Implement
1241 Allow str_key ("command") in completer hooks. Implement
1229 trivial completer for 'import' (stdlib modules only). Rename
1242 trivial completer for 'import' (stdlib modules only). Rename
1230 ipy_linux_package_managers.py to ipy_stock_completers.py.
1243 ipy_linux_package_managers.py to ipy_stock_completers.py.
1231 SVN completer.
1244 SVN completer.
1232
1245
1233 * Extensions/ledit.py: %magic line editor for easily and
1246 * Extensions/ledit.py: %magic line editor for easily and
1234 incrementally manipulating lists of strings. The magic command
1247 incrementally manipulating lists of strings. The magic command
1235 name is %led.
1248 name is %led.
1236
1249
1237 2006-10-30 Ville Vainio <vivainio@gmail.com>
1250 2006-10-30 Ville Vainio <vivainio@gmail.com>
1238
1251
1239 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1252 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1240 Bernsteins's patches for pydb integration.
1253 Bernsteins's patches for pydb integration.
1241 http://bashdb.sourceforge.net/pydb/
1254 http://bashdb.sourceforge.net/pydb/
1242
1255
1243 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1256 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1244 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1257 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1245 custom completer hook to allow the users to implement their own
1258 custom completer hook to allow the users to implement their own
1246 completers. See ipy_linux_package_managers.py for example. The
1259 completers. See ipy_linux_package_managers.py for example. The
1247 hook name is 'complete_command'.
1260 hook name is 'complete_command'.
1248
1261
1249 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1262 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1250
1263
1251 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1264 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1252 Numeric leftovers.
1265 Numeric leftovers.
1253
1266
1254 * ipython.el (py-execute-region): apply Stefan's patch to fix
1267 * ipython.el (py-execute-region): apply Stefan's patch to fix
1255 garbled results if the python shell hasn't been previously started.
1268 garbled results if the python shell hasn't been previously started.
1256
1269
1257 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1270 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1258 pretty generic function and useful for other things.
1271 pretty generic function and useful for other things.
1259
1272
1260 * IPython/OInspect.py (getsource): Add customizable source
1273 * IPython/OInspect.py (getsource): Add customizable source
1261 extractor. After a request/patch form W. Stein (SAGE).
1274 extractor. After a request/patch form W. Stein (SAGE).
1262
1275
1263 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1276 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1264 window size to a more reasonable value from what pexpect does,
1277 window size to a more reasonable value from what pexpect does,
1265 since their choice causes wrapping bugs with long input lines.
1278 since their choice causes wrapping bugs with long input lines.
1266
1279
1267 2006-10-28 Ville Vainio <vivainio@gmail.com>
1280 2006-10-28 Ville Vainio <vivainio@gmail.com>
1268
1281
1269 * Magic.py (%run): Save and restore the readline history from
1282 * Magic.py (%run): Save and restore the readline history from
1270 file around %run commands to prevent side effects from
1283 file around %run commands to prevent side effects from
1271 %runned programs that might use readline (e.g. pydb).
1284 %runned programs that might use readline (e.g. pydb).
1272
1285
1273 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1286 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1274 invoking the pydb enhanced debugger.
1287 invoking the pydb enhanced debugger.
1275
1288
1276 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1289 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1277
1290
1278 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1291 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1279 call the base class method and propagate the return value to
1292 call the base class method and propagate the return value to
1280 ifile. This is now done by path itself.
1293 ifile. This is now done by path itself.
1281
1294
1282 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1295 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1283
1296
1284 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1297 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1285 api: set_crash_handler(), to expose the ability to change the
1298 api: set_crash_handler(), to expose the ability to change the
1286 internal crash handler.
1299 internal crash handler.
1287
1300
1288 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1301 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1289 the various parameters of the crash handler so that apps using
1302 the various parameters of the crash handler so that apps using
1290 IPython as their engine can customize crash handling. Ipmlemented
1303 IPython as their engine can customize crash handling. Ipmlemented
1291 at the request of SAGE.
1304 at the request of SAGE.
1292
1305
1293 2006-10-14 Ville Vainio <vivainio@gmail.com>
1306 2006-10-14 Ville Vainio <vivainio@gmail.com>
1294
1307
1295 * Magic.py, ipython.el: applied first "safe" part of Rocky
1308 * Magic.py, ipython.el: applied first "safe" part of Rocky
1296 Bernstein's patch set for pydb integration.
1309 Bernstein's patch set for pydb integration.
1297
1310
1298 * Magic.py (%unalias, %alias): %store'd aliases can now be
1311 * Magic.py (%unalias, %alias): %store'd aliases can now be
1299 removed with '%unalias'. %alias w/o args now shows most
1312 removed with '%unalias'. %alias w/o args now shows most
1300 interesting (stored / manually defined) aliases last
1313 interesting (stored / manually defined) aliases last
1301 where they catch the eye w/o scrolling.
1314 where they catch the eye w/o scrolling.
1302
1315
1303 * Magic.py (%rehashx), ext_rehashdir.py: files with
1316 * Magic.py (%rehashx), ext_rehashdir.py: files with
1304 'py' extension are always considered executable, even
1317 'py' extension are always considered executable, even
1305 when not in PATHEXT environment variable.
1318 when not in PATHEXT environment variable.
1306
1319
1307 2006-10-12 Ville Vainio <vivainio@gmail.com>
1320 2006-10-12 Ville Vainio <vivainio@gmail.com>
1308
1321
1309 * jobctrl.py: Add new "jobctrl" extension for spawning background
1322 * jobctrl.py: Add new "jobctrl" extension for spawning background
1310 processes with "&find /". 'import jobctrl' to try it out. Requires
1323 processes with "&find /". 'import jobctrl' to try it out. Requires
1311 'subprocess' module, standard in python 2.4+.
1324 'subprocess' module, standard in python 2.4+.
1312
1325
1313 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1326 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1314 so if foo -> bar and bar -> baz, then foo -> baz.
1327 so if foo -> bar and bar -> baz, then foo -> baz.
1315
1328
1316 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1329 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1317
1330
1318 * IPython/Magic.py (Magic.parse_options): add a new posix option
1331 * IPython/Magic.py (Magic.parse_options): add a new posix option
1319 to allow parsing of input args in magics that doesn't strip quotes
1332 to allow parsing of input args in magics that doesn't strip quotes
1320 (if posix=False). This also closes %timeit bug reported by
1333 (if posix=False). This also closes %timeit bug reported by
1321 Stefan.
1334 Stefan.
1322
1335
1323 2006-10-03 Ville Vainio <vivainio@gmail.com>
1336 2006-10-03 Ville Vainio <vivainio@gmail.com>
1324
1337
1325 * iplib.py (raw_input, interact): Return ValueError catching for
1338 * iplib.py (raw_input, interact): Return ValueError catching for
1326 raw_input. Fixes infinite loop for sys.stdin.close() or
1339 raw_input. Fixes infinite loop for sys.stdin.close() or
1327 sys.stdout.close().
1340 sys.stdout.close().
1328
1341
1329 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1342 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1330
1343
1331 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1344 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1332 to help in handling doctests. irunner is now pretty useful for
1345 to help in handling doctests. irunner is now pretty useful for
1333 running standalone scripts and simulate a full interactive session
1346 running standalone scripts and simulate a full interactive session
1334 in a format that can be then pasted as a doctest.
1347 in a format that can be then pasted as a doctest.
1335
1348
1336 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1349 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1337 on top of the default (useless) ones. This also fixes the nasty
1350 on top of the default (useless) ones. This also fixes the nasty
1338 way in which 2.5's Quitter() exits (reverted [1785]).
1351 way in which 2.5's Quitter() exits (reverted [1785]).
1339
1352
1340 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1353 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1341 2.5.
1354 2.5.
1342
1355
1343 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1356 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1344 color scheme is updated as well when color scheme is changed
1357 color scheme is updated as well when color scheme is changed
1345 interactively.
1358 interactively.
1346
1359
1347 2006-09-27 Ville Vainio <vivainio@gmail.com>
1360 2006-09-27 Ville Vainio <vivainio@gmail.com>
1348
1361
1349 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1362 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1350 infinite loop and just exit. It's a hack, but will do for a while.
1363 infinite loop and just exit. It's a hack, but will do for a while.
1351
1364
1352 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1365 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1353
1366
1354 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1367 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1355 the constructor, this makes it possible to get a list of only directories
1368 the constructor, this makes it possible to get a list of only directories
1356 or only files.
1369 or only files.
1357
1370
1358 2006-08-12 Ville Vainio <vivainio@gmail.com>
1371 2006-08-12 Ville Vainio <vivainio@gmail.com>
1359
1372
1360 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1373 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1361 they broke unittest
1374 they broke unittest
1362
1375
1363 2006-08-11 Ville Vainio <vivainio@gmail.com>
1376 2006-08-11 Ville Vainio <vivainio@gmail.com>
1364
1377
1365 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1378 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1366 by resolving issue properly, i.e. by inheriting FakeModule
1379 by resolving issue properly, i.e. by inheriting FakeModule
1367 from types.ModuleType. Pickling ipython interactive data
1380 from types.ModuleType. Pickling ipython interactive data
1368 should still work as usual (testing appreciated).
1381 should still work as usual (testing appreciated).
1369
1382
1370 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1383 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1371
1384
1372 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1385 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1373 running under python 2.3 with code from 2.4 to fix a bug with
1386 running under python 2.3 with code from 2.4 to fix a bug with
1374 help(). Reported by the Debian maintainers, Norbert Tretkowski
1387 help(). Reported by the Debian maintainers, Norbert Tretkowski
1375 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1388 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1376 <afayolle-AT-debian.org>.
1389 <afayolle-AT-debian.org>.
1377
1390
1378 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1391 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1379
1392
1380 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1393 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1381 (which was displaying "quit" twice).
1394 (which was displaying "quit" twice).
1382
1395
1383 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1396 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1384
1397
1385 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1398 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1386 the mode argument).
1399 the mode argument).
1387
1400
1388 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1401 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1389
1402
1390 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1403 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1391 not running under IPython.
1404 not running under IPython.
1392
1405
1393 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1406 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1394 and make it iterable (iterating over the attribute itself). Add two new
1407 and make it iterable (iterating over the attribute itself). Add two new
1395 magic strings for __xattrs__(): If the string starts with "-", the attribute
1408 magic strings for __xattrs__(): If the string starts with "-", the attribute
1396 will not be displayed in ibrowse's detail view (but it can still be
1409 will not be displayed in ibrowse's detail view (but it can still be
1397 iterated over). This makes it possible to add attributes that are large
1410 iterated over). This makes it possible to add attributes that are large
1398 lists or generator methods to the detail view. Replace magic attribute names
1411 lists or generator methods to the detail view. Replace magic attribute names
1399 and _attrname() and _getattr() with "descriptors": For each type of magic
1412 and _attrname() and _getattr() with "descriptors": For each type of magic
1400 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1413 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1401 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1414 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1402 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1415 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1403 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1416 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1404 are still supported.
1417 are still supported.
1405
1418
1406 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1419 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1407 fails in ibrowse.fetch(), the exception object is added as the last item
1420 fails in ibrowse.fetch(), the exception object is added as the last item
1408 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1421 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1409 a generator throws an exception midway through execution.
1422 a generator throws an exception midway through execution.
1410
1423
1411 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1424 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1412 encoding into methods.
1425 encoding into methods.
1413
1426
1414 2006-07-26 Ville Vainio <vivainio@gmail.com>
1427 2006-07-26 Ville Vainio <vivainio@gmail.com>
1415
1428
1416 * iplib.py: history now stores multiline input as single
1429 * iplib.py: history now stores multiline input as single
1417 history entries. Patch by Jorgen Cederlof.
1430 history entries. Patch by Jorgen Cederlof.
1418
1431
1419 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1432 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1420
1433
1421 * IPython/Extensions/ibrowse.py: Make cursor visible over
1434 * IPython/Extensions/ibrowse.py: Make cursor visible over
1422 non existing attributes.
1435 non existing attributes.
1423
1436
1424 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1437 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1425
1438
1426 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1439 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1427 error output of the running command doesn't mess up the screen.
1440 error output of the running command doesn't mess up the screen.
1428
1441
1429 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1442 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1430
1443
1431 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1444 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1432 argument. This sorts the items themselves.
1445 argument. This sorts the items themselves.
1433
1446
1434 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1447 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1435
1448
1436 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1449 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1437 Compile expression strings into code objects. This should speed
1450 Compile expression strings into code objects. This should speed
1438 up ifilter and friends somewhat.
1451 up ifilter and friends somewhat.
1439
1452
1440 2006-07-08 Ville Vainio <vivainio@gmail.com>
1453 2006-07-08 Ville Vainio <vivainio@gmail.com>
1441
1454
1442 * Magic.py: %cpaste now strips > from the beginning of lines
1455 * Magic.py: %cpaste now strips > from the beginning of lines
1443 to ease pasting quoted code from emails. Contributed by
1456 to ease pasting quoted code from emails. Contributed by
1444 Stefan van der Walt.
1457 Stefan van der Walt.
1445
1458
1446 2006-06-29 Ville Vainio <vivainio@gmail.com>
1459 2006-06-29 Ville Vainio <vivainio@gmail.com>
1447
1460
1448 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1461 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1449 mode, patch contributed by Darren Dale. NEEDS TESTING!
1462 mode, patch contributed by Darren Dale. NEEDS TESTING!
1450
1463
1451 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1464 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1452
1465
1453 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1466 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1454 a blue background. Fix fetching new display rows when the browser
1467 a blue background. Fix fetching new display rows when the browser
1455 scrolls more than a screenful (e.g. by using the goto command).
1468 scrolls more than a screenful (e.g. by using the goto command).
1456
1469
1457 2006-06-27 Ville Vainio <vivainio@gmail.com>
1470 2006-06-27 Ville Vainio <vivainio@gmail.com>
1458
1471
1459 * Magic.py (_inspect, _ofind) Apply David Huard's
1472 * Magic.py (_inspect, _ofind) Apply David Huard's
1460 patch for displaying the correct docstring for 'property'
1473 patch for displaying the correct docstring for 'property'
1461 attributes.
1474 attributes.
1462
1475
1463 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1476 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1464
1477
1465 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1478 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1466 commands into the methods implementing them.
1479 commands into the methods implementing them.
1467
1480
1468 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1481 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1469
1482
1470 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1483 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1471 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1484 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1472 autoindent support was authored by Jin Liu.
1485 autoindent support was authored by Jin Liu.
1473
1486
1474 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1487 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1475
1488
1476 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1489 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1477 for keymaps with a custom class that simplifies handling.
1490 for keymaps with a custom class that simplifies handling.
1478
1491
1479 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1492 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1480
1493
1481 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1494 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1482 resizing. This requires Python 2.5 to work.
1495 resizing. This requires Python 2.5 to work.
1483
1496
1484 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1497 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1485
1498
1486 * IPython/Extensions/ibrowse.py: Add two new commands to
1499 * IPython/Extensions/ibrowse.py: Add two new commands to
1487 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1500 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1488 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1501 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1489 attributes again. Remapped the help command to "?". Display
1502 attributes again. Remapped the help command to "?". Display
1490 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1503 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1491 as keys for the "home" and "end" commands. Add three new commands
1504 as keys for the "home" and "end" commands. Add three new commands
1492 to the input mode for "find" and friends: "delend" (CTRL-K)
1505 to the input mode for "find" and friends: "delend" (CTRL-K)
1493 deletes to the end of line. "incsearchup" searches upwards in the
1506 deletes to the end of line. "incsearchup" searches upwards in the
1494 command history for an input that starts with the text before the cursor.
1507 command history for an input that starts with the text before the cursor.
1495 "incsearchdown" does the same downwards. Removed a bogus mapping of
1508 "incsearchdown" does the same downwards. Removed a bogus mapping of
1496 the x key to "delete".
1509 the x key to "delete".
1497
1510
1498 2006-06-15 Ville Vainio <vivainio@gmail.com>
1511 2006-06-15 Ville Vainio <vivainio@gmail.com>
1499
1512
1500 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1513 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1501 used to create prompts dynamically, instead of the "old" way of
1514 used to create prompts dynamically, instead of the "old" way of
1502 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1515 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1503 way still works (it's invoked by the default hook), of course.
1516 way still works (it's invoked by the default hook), of course.
1504
1517
1505 * Prompts.py: added generate_output_prompt hook for altering output
1518 * Prompts.py: added generate_output_prompt hook for altering output
1506 prompt
1519 prompt
1507
1520
1508 * Release.py: Changed version string to 0.7.3.svn.
1521 * Release.py: Changed version string to 0.7.3.svn.
1509
1522
1510 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1523 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1511
1524
1512 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1525 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1513 the call to fetch() always tries to fetch enough data for at least one
1526 the call to fetch() always tries to fetch enough data for at least one
1514 full screen. This makes it possible to simply call moveto(0,0,True) in
1527 full screen. This makes it possible to simply call moveto(0,0,True) in
1515 the constructor. Fix typos and removed the obsolete goto attribute.
1528 the constructor. Fix typos and removed the obsolete goto attribute.
1516
1529
1517 2006-06-12 Ville Vainio <vivainio@gmail.com>
1530 2006-06-12 Ville Vainio <vivainio@gmail.com>
1518
1531
1519 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1532 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1520 allowing $variable interpolation within multiline statements,
1533 allowing $variable interpolation within multiline statements,
1521 though so far only with "sh" profile for a testing period.
1534 though so far only with "sh" profile for a testing period.
1522 The patch also enables splitting long commands with \ but it
1535 The patch also enables splitting long commands with \ but it
1523 doesn't work properly yet.
1536 doesn't work properly yet.
1524
1537
1525 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1538 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1526
1539
1527 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1540 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1528 input history and the position of the cursor in the input history for
1541 input history and the position of the cursor in the input history for
1529 the find, findbackwards and goto command.
1542 the find, findbackwards and goto command.
1530
1543
1531 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1544 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1532
1545
1533 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1546 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1534 implements the basic functionality of browser commands that require
1547 implements the basic functionality of browser commands that require
1535 input. Reimplement the goto, find and findbackwards commands as
1548 input. Reimplement the goto, find and findbackwards commands as
1536 subclasses of _CommandInput. Add an input history and keymaps to those
1549 subclasses of _CommandInput. Add an input history and keymaps to those
1537 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1550 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1538 execute commands.
1551 execute commands.
1539
1552
1540 2006-06-07 Ville Vainio <vivainio@gmail.com>
1553 2006-06-07 Ville Vainio <vivainio@gmail.com>
1541
1554
1542 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1555 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1543 running the batch files instead of leaving the session open.
1556 running the batch files instead of leaving the session open.
1544
1557
1545 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1558 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1546
1559
1547 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1560 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1548 the original fix was incomplete. Patch submitted by W. Maier.
1561 the original fix was incomplete. Patch submitted by W. Maier.
1549
1562
1550 2006-06-07 Ville Vainio <vivainio@gmail.com>
1563 2006-06-07 Ville Vainio <vivainio@gmail.com>
1551
1564
1552 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1565 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1553 Confirmation prompts can be supressed by 'quiet' option.
1566 Confirmation prompts can be supressed by 'quiet' option.
1554 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1567 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1555
1568
1556 2006-06-06 *** Released version 0.7.2
1569 2006-06-06 *** Released version 0.7.2
1557
1570
1558 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1571 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1559
1572
1560 * IPython/Release.py (version): Made 0.7.2 final for release.
1573 * IPython/Release.py (version): Made 0.7.2 final for release.
1561 Repo tagged and release cut.
1574 Repo tagged and release cut.
1562
1575
1563 2006-06-05 Ville Vainio <vivainio@gmail.com>
1576 2006-06-05 Ville Vainio <vivainio@gmail.com>
1564
1577
1565 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1578 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1566 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1579 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1567
1580
1568 * upgrade_dir.py: try import 'path' module a bit harder
1581 * upgrade_dir.py: try import 'path' module a bit harder
1569 (for %upgrade)
1582 (for %upgrade)
1570
1583
1571 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1584 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1572
1585
1573 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1586 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1574 instead of looping 20 times.
1587 instead of looping 20 times.
1575
1588
1576 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1589 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1577 correctly at initialization time. Bug reported by Krishna Mohan
1590 correctly at initialization time. Bug reported by Krishna Mohan
1578 Gundu <gkmohan-AT-gmail.com> on the user list.
1591 Gundu <gkmohan-AT-gmail.com> on the user list.
1579
1592
1580 * IPython/Release.py (version): Mark 0.7.2 version to start
1593 * IPython/Release.py (version): Mark 0.7.2 version to start
1581 testing for release on 06/06.
1594 testing for release on 06/06.
1582
1595
1583 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1596 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1584
1597
1585 * scripts/irunner: thin script interface so users don't have to
1598 * scripts/irunner: thin script interface so users don't have to
1586 find the module and call it as an executable, since modules rarely
1599 find the module and call it as an executable, since modules rarely
1587 live in people's PATH.
1600 live in people's PATH.
1588
1601
1589 * IPython/irunner.py (InteractiveRunner.__init__): added
1602 * IPython/irunner.py (InteractiveRunner.__init__): added
1590 delaybeforesend attribute to control delays with newer versions of
1603 delaybeforesend attribute to control delays with newer versions of
1591 pexpect. Thanks to detailed help from pexpect's author, Noah
1604 pexpect. Thanks to detailed help from pexpect's author, Noah
1592 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1605 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1593 correctly (it works in NoColor mode).
1606 correctly (it works in NoColor mode).
1594
1607
1595 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1608 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1596 SAGE list, from improper log() calls.
1609 SAGE list, from improper log() calls.
1597
1610
1598 2006-05-31 Ville Vainio <vivainio@gmail.com>
1611 2006-05-31 Ville Vainio <vivainio@gmail.com>
1599
1612
1600 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1613 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1601 with args in parens to work correctly with dirs that have spaces.
1614 with args in parens to work correctly with dirs that have spaces.
1602
1615
1603 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1616 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1604
1617
1605 * IPython/Logger.py (Logger.logstart): add option to log raw input
1618 * IPython/Logger.py (Logger.logstart): add option to log raw input
1606 instead of the processed one. A -r flag was added to the
1619 instead of the processed one. A -r flag was added to the
1607 %logstart magic used for controlling logging.
1620 %logstart magic used for controlling logging.
1608
1621
1609 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1622 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1610
1623
1611 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1624 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1612 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1625 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1613 recognize the option. After a bug report by Will Maier. This
1626 recognize the option. After a bug report by Will Maier. This
1614 closes #64 (will do it after confirmation from W. Maier).
1627 closes #64 (will do it after confirmation from W. Maier).
1615
1628
1616 * IPython/irunner.py: New module to run scripts as if manually
1629 * IPython/irunner.py: New module to run scripts as if manually
1617 typed into an interactive environment, based on pexpect. After a
1630 typed into an interactive environment, based on pexpect. After a
1618 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1631 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1619 ipython-user list. Simple unittests in the tests/ directory.
1632 ipython-user list. Simple unittests in the tests/ directory.
1620
1633
1621 * tools/release: add Will Maier, OpenBSD port maintainer, to
1634 * tools/release: add Will Maier, OpenBSD port maintainer, to
1622 recepients list. We are now officially part of the OpenBSD ports:
1635 recepients list. We are now officially part of the OpenBSD ports:
1623 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1636 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1624 work.
1637 work.
1625
1638
1626 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1639 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1627
1640
1628 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1641 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1629 so that it doesn't break tkinter apps.
1642 so that it doesn't break tkinter apps.
1630
1643
1631 * IPython/iplib.py (_prefilter): fix bug where aliases would
1644 * IPython/iplib.py (_prefilter): fix bug where aliases would
1632 shadow variables when autocall was fully off. Reported by SAGE
1645 shadow variables when autocall was fully off. Reported by SAGE
1633 author William Stein.
1646 author William Stein.
1634
1647
1635 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1648 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1636 at what detail level strings are computed when foo? is requested.
1649 at what detail level strings are computed when foo? is requested.
1637 This allows users to ask for example that the string form of an
1650 This allows users to ask for example that the string form of an
1638 object is only computed when foo?? is called, or even never, by
1651 object is only computed when foo?? is called, or even never, by
1639 setting the object_info_string_level >= 2 in the configuration
1652 setting the object_info_string_level >= 2 in the configuration
1640 file. This new option has been added and documented. After a
1653 file. This new option has been added and documented. After a
1641 request by SAGE to be able to control the printing of very large
1654 request by SAGE to be able to control the printing of very large
1642 objects more easily.
1655 objects more easily.
1643
1656
1644 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1657 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1645
1658
1646 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1659 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1647 from sys.argv, to be 100% consistent with how Python itself works
1660 from sys.argv, to be 100% consistent with how Python itself works
1648 (as seen for example with python -i file.py). After a bug report
1661 (as seen for example with python -i file.py). After a bug report
1649 by Jeffrey Collins.
1662 by Jeffrey Collins.
1650
1663
1651 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1664 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1652 nasty bug which was preventing custom namespaces with -pylab,
1665 nasty bug which was preventing custom namespaces with -pylab,
1653 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1666 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1654 compatibility (long gone from mpl).
1667 compatibility (long gone from mpl).
1655
1668
1656 * IPython/ipapi.py (make_session): name change: create->make. We
1669 * IPython/ipapi.py (make_session): name change: create->make. We
1657 use make in other places (ipmaker,...), it's shorter and easier to
1670 use make in other places (ipmaker,...), it's shorter and easier to
1658 type and say, etc. I'm trying to clean things before 0.7.2 so
1671 type and say, etc. I'm trying to clean things before 0.7.2 so
1659 that I can keep things stable wrt to ipapi in the chainsaw branch.
1672 that I can keep things stable wrt to ipapi in the chainsaw branch.
1660
1673
1661 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1674 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1662 python-mode recognizes our debugger mode. Add support for
1675 python-mode recognizes our debugger mode. Add support for
1663 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1676 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1664 <m.liu.jin-AT-gmail.com> originally written by
1677 <m.liu.jin-AT-gmail.com> originally written by
1665 doxgen-AT-newsmth.net (with minor modifications for xemacs
1678 doxgen-AT-newsmth.net (with minor modifications for xemacs
1666 compatibility)
1679 compatibility)
1667
1680
1668 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1681 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1669 tracebacks when walking the stack so that the stack tracking system
1682 tracebacks when walking the stack so that the stack tracking system
1670 in emacs' python-mode can identify the frames correctly.
1683 in emacs' python-mode can identify the frames correctly.
1671
1684
1672 * IPython/ipmaker.py (make_IPython): make the internal (and
1685 * IPython/ipmaker.py (make_IPython): make the internal (and
1673 default config) autoedit_syntax value false by default. Too many
1686 default config) autoedit_syntax value false by default. Too many
1674 users have complained to me (both on and off-list) about problems
1687 users have complained to me (both on and off-list) about problems
1675 with this option being on by default, so I'm making it default to
1688 with this option being on by default, so I'm making it default to
1676 off. It can still be enabled by anyone via the usual mechanisms.
1689 off. It can still be enabled by anyone via the usual mechanisms.
1677
1690
1678 * IPython/completer.py (Completer.attr_matches): add support for
1691 * IPython/completer.py (Completer.attr_matches): add support for
1679 PyCrust-style _getAttributeNames magic method. Patch contributed
1692 PyCrust-style _getAttributeNames magic method. Patch contributed
1680 by <mscott-AT-goldenspud.com>. Closes #50.
1693 by <mscott-AT-goldenspud.com>. Closes #50.
1681
1694
1682 * IPython/iplib.py (InteractiveShell.__init__): remove the
1695 * IPython/iplib.py (InteractiveShell.__init__): remove the
1683 deletion of exit/quit from __builtin__, which can break
1696 deletion of exit/quit from __builtin__, which can break
1684 third-party tools like the Zope debugging console. The
1697 third-party tools like the Zope debugging console. The
1685 %exit/%quit magics remain. In general, it's probably a good idea
1698 %exit/%quit magics remain. In general, it's probably a good idea
1686 not to delete anything from __builtin__, since we never know what
1699 not to delete anything from __builtin__, since we never know what
1687 that will break. In any case, python now (for 2.5) will support
1700 that will break. In any case, python now (for 2.5) will support
1688 'real' exit/quit, so this issue is moot. Closes #55.
1701 'real' exit/quit, so this issue is moot. Closes #55.
1689
1702
1690 * IPython/genutils.py (with_obj): rename the 'with' function to
1703 * IPython/genutils.py (with_obj): rename the 'with' function to
1691 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1704 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1692 becomes a language keyword. Closes #53.
1705 becomes a language keyword. Closes #53.
1693
1706
1694 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1707 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1695 __file__ attribute to this so it fools more things into thinking
1708 __file__ attribute to this so it fools more things into thinking
1696 it is a real module. Closes #59.
1709 it is a real module. Closes #59.
1697
1710
1698 * IPython/Magic.py (magic_edit): add -n option to open the editor
1711 * IPython/Magic.py (magic_edit): add -n option to open the editor
1699 at a specific line number. After a patch by Stefan van der Walt.
1712 at a specific line number. After a patch by Stefan van der Walt.
1700
1713
1701 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1714 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1702
1715
1703 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1716 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1704 reason the file could not be opened. After automatic crash
1717 reason the file could not be opened. After automatic crash
1705 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1718 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1706 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1719 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1707 (_should_recompile): Don't fire editor if using %bg, since there
1720 (_should_recompile): Don't fire editor if using %bg, since there
1708 is no file in the first place. From the same report as above.
1721 is no file in the first place. From the same report as above.
1709 (raw_input): protect against faulty third-party prefilters. After
1722 (raw_input): protect against faulty third-party prefilters. After
1710 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1723 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1711 while running under SAGE.
1724 while running under SAGE.
1712
1725
1713 2006-05-23 Ville Vainio <vivainio@gmail.com>
1726 2006-05-23 Ville Vainio <vivainio@gmail.com>
1714
1727
1715 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1728 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1716 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1729 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1717 now returns None (again), unless dummy is specifically allowed by
1730 now returns None (again), unless dummy is specifically allowed by
1718 ipapi.get(allow_dummy=True).
1731 ipapi.get(allow_dummy=True).
1719
1732
1720 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1733 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1721
1734
1722 * IPython: remove all 2.2-compatibility objects and hacks from
1735 * IPython: remove all 2.2-compatibility objects and hacks from
1723 everywhere, since we only support 2.3 at this point. Docs
1736 everywhere, since we only support 2.3 at this point. Docs
1724 updated.
1737 updated.
1725
1738
1726 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1739 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1727 Anything requiring extra validation can be turned into a Python
1740 Anything requiring extra validation can be turned into a Python
1728 property in the future. I used a property for the db one b/c
1741 property in the future. I used a property for the db one b/c
1729 there was a nasty circularity problem with the initialization
1742 there was a nasty circularity problem with the initialization
1730 order, which right now I don't have time to clean up.
1743 order, which right now I don't have time to clean up.
1731
1744
1732 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1745 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1733 another locking bug reported by Jorgen. I'm not 100% sure though,
1746 another locking bug reported by Jorgen. I'm not 100% sure though,
1734 so more testing is needed...
1747 so more testing is needed...
1735
1748
1736 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1749 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1737
1750
1738 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1751 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1739 local variables from any routine in user code (typically executed
1752 local variables from any routine in user code (typically executed
1740 with %run) directly into the interactive namespace. Very useful
1753 with %run) directly into the interactive namespace. Very useful
1741 when doing complex debugging.
1754 when doing complex debugging.
1742 (IPythonNotRunning): Changed the default None object to a dummy
1755 (IPythonNotRunning): Changed the default None object to a dummy
1743 whose attributes can be queried as well as called without
1756 whose attributes can be queried as well as called without
1744 exploding, to ease writing code which works transparently both in
1757 exploding, to ease writing code which works transparently both in
1745 and out of ipython and uses some of this API.
1758 and out of ipython and uses some of this API.
1746
1759
1747 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1760 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1748
1761
1749 * IPython/hooks.py (result_display): Fix the fact that our display
1762 * IPython/hooks.py (result_display): Fix the fact that our display
1750 hook was using str() instead of repr(), as the default python
1763 hook was using str() instead of repr(), as the default python
1751 console does. This had gone unnoticed b/c it only happened if
1764 console does. This had gone unnoticed b/c it only happened if
1752 %Pprint was off, but the inconsistency was there.
1765 %Pprint was off, but the inconsistency was there.
1753
1766
1754 2006-05-15 Ville Vainio <vivainio@gmail.com>
1767 2006-05-15 Ville Vainio <vivainio@gmail.com>
1755
1768
1756 * Oinspect.py: Only show docstring for nonexisting/binary files
1769 * Oinspect.py: Only show docstring for nonexisting/binary files
1757 when doing object??, closing ticket #62
1770 when doing object??, closing ticket #62
1758
1771
1759 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1772 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1760
1773
1761 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1774 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1762 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1775 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1763 was being released in a routine which hadn't checked if it had
1776 was being released in a routine which hadn't checked if it had
1764 been the one to acquire it.
1777 been the one to acquire it.
1765
1778
1766 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1779 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1767
1780
1768 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1781 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1769
1782
1770 2006-04-11 Ville Vainio <vivainio@gmail.com>
1783 2006-04-11 Ville Vainio <vivainio@gmail.com>
1771
1784
1772 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1785 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1773 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1786 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1774 prefilters, allowing stuff like magics and aliases in the file.
1787 prefilters, allowing stuff like magics and aliases in the file.
1775
1788
1776 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1789 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1777 added. Supported now are "%clear in" and "%clear out" (clear input and
1790 added. Supported now are "%clear in" and "%clear out" (clear input and
1778 output history, respectively). Also fixed CachedOutput.flush to
1791 output history, respectively). Also fixed CachedOutput.flush to
1779 properly flush the output cache.
1792 properly flush the output cache.
1780
1793
1781 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1794 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1782 half-success (and fail explicitly).
1795 half-success (and fail explicitly).
1783
1796
1784 2006-03-28 Ville Vainio <vivainio@gmail.com>
1797 2006-03-28 Ville Vainio <vivainio@gmail.com>
1785
1798
1786 * iplib.py: Fix quoting of aliases so that only argless ones
1799 * iplib.py: Fix quoting of aliases so that only argless ones
1787 are quoted
1800 are quoted
1788
1801
1789 2006-03-28 Ville Vainio <vivainio@gmail.com>
1802 2006-03-28 Ville Vainio <vivainio@gmail.com>
1790
1803
1791 * iplib.py: Quote aliases with spaces in the name.
1804 * iplib.py: Quote aliases with spaces in the name.
1792 "c:\program files\blah\bin" is now legal alias target.
1805 "c:\program files\blah\bin" is now legal alias target.
1793
1806
1794 * ext_rehashdir.py: Space no longer allowed as arg
1807 * ext_rehashdir.py: Space no longer allowed as arg
1795 separator, since space is legal in path names.
1808 separator, since space is legal in path names.
1796
1809
1797 2006-03-16 Ville Vainio <vivainio@gmail.com>
1810 2006-03-16 Ville Vainio <vivainio@gmail.com>
1798
1811
1799 * upgrade_dir.py: Take path.py from Extensions, correcting
1812 * upgrade_dir.py: Take path.py from Extensions, correcting
1800 %upgrade magic
1813 %upgrade magic
1801
1814
1802 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1815 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1803
1816
1804 * hooks.py: Only enclose editor binary in quotes if legal and
1817 * hooks.py: Only enclose editor binary in quotes if legal and
1805 necessary (space in the name, and is an existing file). Fixes a bug
1818 necessary (space in the name, and is an existing file). Fixes a bug
1806 reported by Zachary Pincus.
1819 reported by Zachary Pincus.
1807
1820
1808 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1821 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1809
1822
1810 * Manual: thanks to a tip on proper color handling for Emacs, by
1823 * Manual: thanks to a tip on proper color handling for Emacs, by
1811 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1824 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1812
1825
1813 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1826 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1814 by applying the provided patch. Thanks to Liu Jin
1827 by applying the provided patch. Thanks to Liu Jin
1815 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1828 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1816 XEmacs/Linux, I'm trusting the submitter that it actually helps
1829 XEmacs/Linux, I'm trusting the submitter that it actually helps
1817 under win32/GNU Emacs. Will revisit if any problems are reported.
1830 under win32/GNU Emacs. Will revisit if any problems are reported.
1818
1831
1819 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1832 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1820
1833
1821 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1834 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1822 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1835 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1823
1836
1824 2006-03-12 Ville Vainio <vivainio@gmail.com>
1837 2006-03-12 Ville Vainio <vivainio@gmail.com>
1825
1838
1826 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1839 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1827 Torsten Marek.
1840 Torsten Marek.
1828
1841
1829 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1842 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1830
1843
1831 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1844 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1832 line ranges works again.
1845 line ranges works again.
1833
1846
1834 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1847 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1835
1848
1836 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1849 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1837 and friends, after a discussion with Zach Pincus on ipython-user.
1850 and friends, after a discussion with Zach Pincus on ipython-user.
1838 I'm not 100% sure, but after thinking about it quite a bit, it may
1851 I'm not 100% sure, but after thinking about it quite a bit, it may
1839 be OK. Testing with the multithreaded shells didn't reveal any
1852 be OK. Testing with the multithreaded shells didn't reveal any
1840 problems, but let's keep an eye out.
1853 problems, but let's keep an eye out.
1841
1854
1842 In the process, I fixed a few things which were calling
1855 In the process, I fixed a few things which were calling
1843 self.InteractiveTB() directly (like safe_execfile), which is a
1856 self.InteractiveTB() directly (like safe_execfile), which is a
1844 mistake: ALL exception reporting should be done by calling
1857 mistake: ALL exception reporting should be done by calling
1845 self.showtraceback(), which handles state and tab-completion and
1858 self.showtraceback(), which handles state and tab-completion and
1846 more.
1859 more.
1847
1860
1848 2006-03-01 Ville Vainio <vivainio@gmail.com>
1861 2006-03-01 Ville Vainio <vivainio@gmail.com>
1849
1862
1850 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1863 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1851 To use, do "from ipipe import *".
1864 To use, do "from ipipe import *".
1852
1865
1853 2006-02-24 Ville Vainio <vivainio@gmail.com>
1866 2006-02-24 Ville Vainio <vivainio@gmail.com>
1854
1867
1855 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1868 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1856 "cleanly" and safely than the older upgrade mechanism.
1869 "cleanly" and safely than the older upgrade mechanism.
1857
1870
1858 2006-02-21 Ville Vainio <vivainio@gmail.com>
1871 2006-02-21 Ville Vainio <vivainio@gmail.com>
1859
1872
1860 * Magic.py: %save works again.
1873 * Magic.py: %save works again.
1861
1874
1862 2006-02-15 Ville Vainio <vivainio@gmail.com>
1875 2006-02-15 Ville Vainio <vivainio@gmail.com>
1863
1876
1864 * Magic.py: %Pprint works again
1877 * Magic.py: %Pprint works again
1865
1878
1866 * Extensions/ipy_sane_defaults.py: Provide everything provided
1879 * Extensions/ipy_sane_defaults.py: Provide everything provided
1867 in default ipythonrc, to make it possible to have a completely empty
1880 in default ipythonrc, to make it possible to have a completely empty
1868 ipythonrc (and thus completely rc-file free configuration)
1881 ipythonrc (and thus completely rc-file free configuration)
1869
1882
1870 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1883 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1871
1884
1872 * IPython/hooks.py (editor): quote the call to the editor command,
1885 * IPython/hooks.py (editor): quote the call to the editor command,
1873 to allow commands with spaces in them. Problem noted by watching
1886 to allow commands with spaces in them. Problem noted by watching
1874 Ian Oswald's video about textpad under win32 at
1887 Ian Oswald's video about textpad under win32 at
1875 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1888 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1876
1889
1877 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1890 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1878 describing magics (we haven't used @ for a loong time).
1891 describing magics (we haven't used @ for a loong time).
1879
1892
1880 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1893 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1881 contributed by marienz to close
1894 contributed by marienz to close
1882 http://www.scipy.net/roundup/ipython/issue53.
1895 http://www.scipy.net/roundup/ipython/issue53.
1883
1896
1884 2006-02-10 Ville Vainio <vivainio@gmail.com>
1897 2006-02-10 Ville Vainio <vivainio@gmail.com>
1885
1898
1886 * genutils.py: getoutput now works in win32 too
1899 * genutils.py: getoutput now works in win32 too
1887
1900
1888 * completer.py: alias and magic completion only invoked
1901 * completer.py: alias and magic completion only invoked
1889 at the first "item" in the line, to avoid "cd %store"
1902 at the first "item" in the line, to avoid "cd %store"
1890 nonsense.
1903 nonsense.
1891
1904
1892 2006-02-09 Ville Vainio <vivainio@gmail.com>
1905 2006-02-09 Ville Vainio <vivainio@gmail.com>
1893
1906
1894 * test/*: Added a unit testing framework (finally).
1907 * test/*: Added a unit testing framework (finally).
1895 '%run runtests.py' to run test_*.
1908 '%run runtests.py' to run test_*.
1896
1909
1897 * ipapi.py: Exposed runlines and set_custom_exc
1910 * ipapi.py: Exposed runlines and set_custom_exc
1898
1911
1899 2006-02-07 Ville Vainio <vivainio@gmail.com>
1912 2006-02-07 Ville Vainio <vivainio@gmail.com>
1900
1913
1901 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1914 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1902 instead use "f(1 2)" as before.
1915 instead use "f(1 2)" as before.
1903
1916
1904 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1917 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1905
1918
1906 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1919 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1907 facilities, for demos processed by the IPython input filter
1920 facilities, for demos processed by the IPython input filter
1908 (IPythonDemo), and for running a script one-line-at-a-time as a
1921 (IPythonDemo), and for running a script one-line-at-a-time as a
1909 demo, both for pure Python (LineDemo) and for IPython-processed
1922 demo, both for pure Python (LineDemo) and for IPython-processed
1910 input (IPythonLineDemo). After a request by Dave Kohel, from the
1923 input (IPythonLineDemo). After a request by Dave Kohel, from the
1911 SAGE team.
1924 SAGE team.
1912 (Demo.edit): added an edit() method to the demo objects, to edit
1925 (Demo.edit): added an edit() method to the demo objects, to edit
1913 the in-memory copy of the last executed block.
1926 the in-memory copy of the last executed block.
1914
1927
1915 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1928 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1916 processing to %edit, %macro and %save. These commands can now be
1929 processing to %edit, %macro and %save. These commands can now be
1917 invoked on the unprocessed input as it was typed by the user
1930 invoked on the unprocessed input as it was typed by the user
1918 (without any prefilters applied). After requests by the SAGE team
1931 (without any prefilters applied). After requests by the SAGE team
1919 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1932 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1920
1933
1921 2006-02-01 Ville Vainio <vivainio@gmail.com>
1934 2006-02-01 Ville Vainio <vivainio@gmail.com>
1922
1935
1923 * setup.py, eggsetup.py: easy_install ipython==dev works
1936 * setup.py, eggsetup.py: easy_install ipython==dev works
1924 correctly now (on Linux)
1937 correctly now (on Linux)
1925
1938
1926 * ipy_user_conf,ipmaker: user config changes, removed spurious
1939 * ipy_user_conf,ipmaker: user config changes, removed spurious
1927 warnings
1940 warnings
1928
1941
1929 * iplib: if rc.banner is string, use it as is.
1942 * iplib: if rc.banner is string, use it as is.
1930
1943
1931 * Magic: %pycat accepts a string argument and pages it's contents.
1944 * Magic: %pycat accepts a string argument and pages it's contents.
1932
1945
1933
1946
1934 2006-01-30 Ville Vainio <vivainio@gmail.com>
1947 2006-01-30 Ville Vainio <vivainio@gmail.com>
1935
1948
1936 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1949 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1937 Now %store and bookmarks work through PickleShare, meaning that
1950 Now %store and bookmarks work through PickleShare, meaning that
1938 concurrent access is possible and all ipython sessions see the
1951 concurrent access is possible and all ipython sessions see the
1939 same database situation all the time, instead of snapshot of
1952 same database situation all the time, instead of snapshot of
1940 the situation when the session was started. Hence, %bookmark
1953 the situation when the session was started. Hence, %bookmark
1941 results are immediately accessible from othes sessions. The database
1954 results are immediately accessible from othes sessions. The database
1942 is also available for use by user extensions. See:
1955 is also available for use by user extensions. See:
1943 http://www.python.org/pypi/pickleshare
1956 http://www.python.org/pypi/pickleshare
1944
1957
1945 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1958 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1946
1959
1947 * aliases can now be %store'd
1960 * aliases can now be %store'd
1948
1961
1949 * path.py moved to Extensions so that pickleshare does not need
1962 * path.py moved to Extensions so that pickleshare does not need
1950 IPython-specific import. Extensions added to pythonpath right
1963 IPython-specific import. Extensions added to pythonpath right
1951 at __init__.
1964 at __init__.
1952
1965
1953 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1966 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1954 called with _ip.system and the pre-transformed command string.
1967 called with _ip.system and the pre-transformed command string.
1955
1968
1956 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1969 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1957
1970
1958 * IPython/iplib.py (interact): Fix that we were not catching
1971 * IPython/iplib.py (interact): Fix that we were not catching
1959 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1972 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1960 logic here had to change, but it's fixed now.
1973 logic here had to change, but it's fixed now.
1961
1974
1962 2006-01-29 Ville Vainio <vivainio@gmail.com>
1975 2006-01-29 Ville Vainio <vivainio@gmail.com>
1963
1976
1964 * iplib.py: Try to import pyreadline on Windows.
1977 * iplib.py: Try to import pyreadline on Windows.
1965
1978
1966 2006-01-27 Ville Vainio <vivainio@gmail.com>
1979 2006-01-27 Ville Vainio <vivainio@gmail.com>
1967
1980
1968 * iplib.py: Expose ipapi as _ip in builtin namespace.
1981 * iplib.py: Expose ipapi as _ip in builtin namespace.
1969 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1982 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1970 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1983 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1971 syntax now produce _ip.* variant of the commands.
1984 syntax now produce _ip.* variant of the commands.
1972
1985
1973 * "_ip.options().autoedit_syntax = 2" automatically throws
1986 * "_ip.options().autoedit_syntax = 2" automatically throws
1974 user to editor for syntax error correction without prompting.
1987 user to editor for syntax error correction without prompting.
1975
1988
1976 2006-01-27 Ville Vainio <vivainio@gmail.com>
1989 2006-01-27 Ville Vainio <vivainio@gmail.com>
1977
1990
1978 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1991 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1979 'ipython' at argv[0]) executed through command line.
1992 'ipython' at argv[0]) executed through command line.
1980 NOTE: this DEPRECATES calling ipython with multiple scripts
1993 NOTE: this DEPRECATES calling ipython with multiple scripts
1981 ("ipython a.py b.py c.py")
1994 ("ipython a.py b.py c.py")
1982
1995
1983 * iplib.py, hooks.py: Added configurable input prefilter,
1996 * iplib.py, hooks.py: Added configurable input prefilter,
1984 named 'input_prefilter'. See ext_rescapture.py for example
1997 named 'input_prefilter'. See ext_rescapture.py for example
1985 usage.
1998 usage.
1986
1999
1987 * ext_rescapture.py, Magic.py: Better system command output capture
2000 * ext_rescapture.py, Magic.py: Better system command output capture
1988 through 'var = !ls' (deprecates user-visible %sc). Same notation
2001 through 'var = !ls' (deprecates user-visible %sc). Same notation
1989 applies for magics, 'var = %alias' assigns alias list to var.
2002 applies for magics, 'var = %alias' assigns alias list to var.
1990
2003
1991 * ipapi.py: added meta() for accessing extension-usable data store.
2004 * ipapi.py: added meta() for accessing extension-usable data store.
1992
2005
1993 * iplib.py: added InteractiveShell.getapi(). New magics should be
2006 * iplib.py: added InteractiveShell.getapi(). New magics should be
1994 written doing self.getapi() instead of using the shell directly.
2007 written doing self.getapi() instead of using the shell directly.
1995
2008
1996 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
2009 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1997 %store foo >> ~/myfoo.txt to store variables to files (in clean
2010 %store foo >> ~/myfoo.txt to store variables to files (in clean
1998 textual form, not a restorable pickle).
2011 textual form, not a restorable pickle).
1999
2012
2000 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
2013 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
2001
2014
2002 * usage.py, Magic.py: added %quickref
2015 * usage.py, Magic.py: added %quickref
2003
2016
2004 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
2017 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
2005
2018
2006 * GetoptErrors when invoking magics etc. with wrong args
2019 * GetoptErrors when invoking magics etc. with wrong args
2007 are now more helpful:
2020 are now more helpful:
2008 GetoptError: option -l not recognized (allowed: "qb" )
2021 GetoptError: option -l not recognized (allowed: "qb" )
2009
2022
2010 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
2023 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
2011
2024
2012 * IPython/demo.py (Demo.show): Flush stdout after each block, so
2025 * IPython/demo.py (Demo.show): Flush stdout after each block, so
2013 computationally intensive blocks don't appear to stall the demo.
2026 computationally intensive blocks don't appear to stall the demo.
2014
2027
2015 2006-01-24 Ville Vainio <vivainio@gmail.com>
2028 2006-01-24 Ville Vainio <vivainio@gmail.com>
2016
2029
2017 * iplib.py, hooks.py: 'result_display' hook can return a non-None
2030 * iplib.py, hooks.py: 'result_display' hook can return a non-None
2018 value to manipulate resulting history entry.
2031 value to manipulate resulting history entry.
2019
2032
2020 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2033 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2021 to instance methods of IPApi class, to make extending an embedded
2034 to instance methods of IPApi class, to make extending an embedded
2022 IPython feasible. See ext_rehashdir.py for example usage.
2035 IPython feasible. See ext_rehashdir.py for example usage.
2023
2036
2024 * Merged 1071-1076 from branches/0.7.1
2037 * Merged 1071-1076 from branches/0.7.1
2025
2038
2026
2039
2027 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2040 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2028
2041
2029 * tools/release (daystamp): Fix build tools to use the new
2042 * tools/release (daystamp): Fix build tools to use the new
2030 eggsetup.py script to build lightweight eggs.
2043 eggsetup.py script to build lightweight eggs.
2031
2044
2032 * Applied changesets 1062 and 1064 before 0.7.1 release.
2045 * Applied changesets 1062 and 1064 before 0.7.1 release.
2033
2046
2034 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2047 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2035 see the raw input history (without conversions like %ls ->
2048 see the raw input history (without conversions like %ls ->
2036 ipmagic("ls")). After a request from W. Stein, SAGE
2049 ipmagic("ls")). After a request from W. Stein, SAGE
2037 (http://modular.ucsd.edu/sage) developer. This information is
2050 (http://modular.ucsd.edu/sage) developer. This information is
2038 stored in the input_hist_raw attribute of the IPython instance, so
2051 stored in the input_hist_raw attribute of the IPython instance, so
2039 developers can access it if needed (it's an InputList instance).
2052 developers can access it if needed (it's an InputList instance).
2040
2053
2041 * Versionstring = 0.7.2.svn
2054 * Versionstring = 0.7.2.svn
2042
2055
2043 * eggsetup.py: A separate script for constructing eggs, creates
2056 * eggsetup.py: A separate script for constructing eggs, creates
2044 proper launch scripts even on Windows (an .exe file in
2057 proper launch scripts even on Windows (an .exe file in
2045 \python24\scripts).
2058 \python24\scripts).
2046
2059
2047 * ipapi.py: launch_new_instance, launch entry point needed for the
2060 * ipapi.py: launch_new_instance, launch entry point needed for the
2048 egg.
2061 egg.
2049
2062
2050 2006-01-23 Ville Vainio <vivainio@gmail.com>
2063 2006-01-23 Ville Vainio <vivainio@gmail.com>
2051
2064
2052 * Added %cpaste magic for pasting python code
2065 * Added %cpaste magic for pasting python code
2053
2066
2054 2006-01-22 Ville Vainio <vivainio@gmail.com>
2067 2006-01-22 Ville Vainio <vivainio@gmail.com>
2055
2068
2056 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2069 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2057
2070
2058 * Versionstring = 0.7.2.svn
2071 * Versionstring = 0.7.2.svn
2059
2072
2060 * eggsetup.py: A separate script for constructing eggs, creates
2073 * eggsetup.py: A separate script for constructing eggs, creates
2061 proper launch scripts even on Windows (an .exe file in
2074 proper launch scripts even on Windows (an .exe file in
2062 \python24\scripts).
2075 \python24\scripts).
2063
2076
2064 * ipapi.py: launch_new_instance, launch entry point needed for the
2077 * ipapi.py: launch_new_instance, launch entry point needed for the
2065 egg.
2078 egg.
2066
2079
2067 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2080 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2068
2081
2069 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2082 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2070 %pfile foo would print the file for foo even if it was a binary.
2083 %pfile foo would print the file for foo even if it was a binary.
2071 Now, extensions '.so' and '.dll' are skipped.
2084 Now, extensions '.so' and '.dll' are skipped.
2072
2085
2073 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2086 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2074 bug, where macros would fail in all threaded modes. I'm not 100%
2087 bug, where macros would fail in all threaded modes. I'm not 100%
2075 sure, so I'm going to put out an rc instead of making a release
2088 sure, so I'm going to put out an rc instead of making a release
2076 today, and wait for feedback for at least a few days.
2089 today, and wait for feedback for at least a few days.
2077
2090
2078 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2091 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2079 it...) the handling of pasting external code with autoindent on.
2092 it...) the handling of pasting external code with autoindent on.
2080 To get out of a multiline input, the rule will appear for most
2093 To get out of a multiline input, the rule will appear for most
2081 users unchanged: two blank lines or change the indent level
2094 users unchanged: two blank lines or change the indent level
2082 proposed by IPython. But there is a twist now: you can
2095 proposed by IPython. But there is a twist now: you can
2083 add/subtract only *one or two spaces*. If you add/subtract three
2096 add/subtract only *one or two spaces*. If you add/subtract three
2084 or more (unless you completely delete the line), IPython will
2097 or more (unless you completely delete the line), IPython will
2085 accept that line, and you'll need to enter a second one of pure
2098 accept that line, and you'll need to enter a second one of pure
2086 whitespace. I know it sounds complicated, but I can't find a
2099 whitespace. I know it sounds complicated, but I can't find a
2087 different solution that covers all the cases, with the right
2100 different solution that covers all the cases, with the right
2088 heuristics. Hopefully in actual use, nobody will really notice
2101 heuristics. Hopefully in actual use, nobody will really notice
2089 all these strange rules and things will 'just work'.
2102 all these strange rules and things will 'just work'.
2090
2103
2091 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2104 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2092
2105
2093 * IPython/iplib.py (interact): catch exceptions which can be
2106 * IPython/iplib.py (interact): catch exceptions which can be
2094 triggered asynchronously by signal handlers. Thanks to an
2107 triggered asynchronously by signal handlers. Thanks to an
2095 automatic crash report, submitted by Colin Kingsley
2108 automatic crash report, submitted by Colin Kingsley
2096 <tercel-AT-gentoo.org>.
2109 <tercel-AT-gentoo.org>.
2097
2110
2098 2006-01-20 Ville Vainio <vivainio@gmail.com>
2111 2006-01-20 Ville Vainio <vivainio@gmail.com>
2099
2112
2100 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2113 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2101 (%rehashdir, very useful, try it out) of how to extend ipython
2114 (%rehashdir, very useful, try it out) of how to extend ipython
2102 with new magics. Also added Extensions dir to pythonpath to make
2115 with new magics. Also added Extensions dir to pythonpath to make
2103 importing extensions easy.
2116 importing extensions easy.
2104
2117
2105 * %store now complains when trying to store interactively declared
2118 * %store now complains when trying to store interactively declared
2106 classes / instances of those classes.
2119 classes / instances of those classes.
2107
2120
2108 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2121 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2109 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2122 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2110 if they exist, and ipy_user_conf.py with some defaults is created for
2123 if they exist, and ipy_user_conf.py with some defaults is created for
2111 the user.
2124 the user.
2112
2125
2113 * Startup rehashing done by the config file, not InterpreterExec.
2126 * Startup rehashing done by the config file, not InterpreterExec.
2114 This means system commands are available even without selecting the
2127 This means system commands are available even without selecting the
2115 pysh profile. It's the sensible default after all.
2128 pysh profile. It's the sensible default after all.
2116
2129
2117 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2130 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2118
2131
2119 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2132 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2120 multiline code with autoindent on working. But I am really not
2133 multiline code with autoindent on working. But I am really not
2121 sure, so this needs more testing. Will commit a debug-enabled
2134 sure, so this needs more testing. Will commit a debug-enabled
2122 version for now, while I test it some more, so that Ville and
2135 version for now, while I test it some more, so that Ville and
2123 others may also catch any problems. Also made
2136 others may also catch any problems. Also made
2124 self.indent_current_str() a method, to ensure that there's no
2137 self.indent_current_str() a method, to ensure that there's no
2125 chance of the indent space count and the corresponding string
2138 chance of the indent space count and the corresponding string
2126 falling out of sync. All code needing the string should just call
2139 falling out of sync. All code needing the string should just call
2127 the method.
2140 the method.
2128
2141
2129 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2142 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2130
2143
2131 * IPython/Magic.py (magic_edit): fix check for when users don't
2144 * IPython/Magic.py (magic_edit): fix check for when users don't
2132 save their output files, the try/except was in the wrong section.
2145 save their output files, the try/except was in the wrong section.
2133
2146
2134 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2147 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2135
2148
2136 * IPython/Magic.py (magic_run): fix __file__ global missing from
2149 * IPython/Magic.py (magic_run): fix __file__ global missing from
2137 script's namespace when executed via %run. After a report by
2150 script's namespace when executed via %run. After a report by
2138 Vivian.
2151 Vivian.
2139
2152
2140 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2153 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2141 when using python 2.4. The parent constructor changed in 2.4, and
2154 when using python 2.4. The parent constructor changed in 2.4, and
2142 we need to track it directly (we can't call it, as it messes up
2155 we need to track it directly (we can't call it, as it messes up
2143 readline and tab-completion inside our pdb would stop working).
2156 readline and tab-completion inside our pdb would stop working).
2144 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2157 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2145
2158
2146 2006-01-16 Ville Vainio <vivainio@gmail.com>
2159 2006-01-16 Ville Vainio <vivainio@gmail.com>
2147
2160
2148 * Ipython/magic.py: Reverted back to old %edit functionality
2161 * Ipython/magic.py: Reverted back to old %edit functionality
2149 that returns file contents on exit.
2162 that returns file contents on exit.
2150
2163
2151 * IPython/path.py: Added Jason Orendorff's "path" module to
2164 * IPython/path.py: Added Jason Orendorff's "path" module to
2152 IPython tree, http://www.jorendorff.com/articles/python/path/.
2165 IPython tree, http://www.jorendorff.com/articles/python/path/.
2153 You can get path objects conveniently through %sc, and !!, e.g.:
2166 You can get path objects conveniently through %sc, and !!, e.g.:
2154 sc files=ls
2167 sc files=ls
2155 for p in files.paths: # or files.p
2168 for p in files.paths: # or files.p
2156 print p,p.mtime
2169 print p,p.mtime
2157
2170
2158 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2171 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2159 now work again without considering the exclusion regexp -
2172 now work again without considering the exclusion regexp -
2160 hence, things like ',foo my/path' turn to 'foo("my/path")'
2173 hence, things like ',foo my/path' turn to 'foo("my/path")'
2161 instead of syntax error.
2174 instead of syntax error.
2162
2175
2163
2176
2164 2006-01-14 Ville Vainio <vivainio@gmail.com>
2177 2006-01-14 Ville Vainio <vivainio@gmail.com>
2165
2178
2166 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2179 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2167 ipapi decorators for python 2.4 users, options() provides access to rc
2180 ipapi decorators for python 2.4 users, options() provides access to rc
2168 data.
2181 data.
2169
2182
2170 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2183 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2171 as path separators (even on Linux ;-). Space character after
2184 as path separators (even on Linux ;-). Space character after
2172 backslash (as yielded by tab completer) is still space;
2185 backslash (as yielded by tab completer) is still space;
2173 "%cd long\ name" works as expected.
2186 "%cd long\ name" works as expected.
2174
2187
2175 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2188 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2176 as "chain of command", with priority. API stays the same,
2189 as "chain of command", with priority. API stays the same,
2177 TryNext exception raised by a hook function signals that
2190 TryNext exception raised by a hook function signals that
2178 current hook failed and next hook should try handling it, as
2191 current hook failed and next hook should try handling it, as
2179 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2192 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2180 requested configurable display hook, which is now implemented.
2193 requested configurable display hook, which is now implemented.
2181
2194
2182 2006-01-13 Ville Vainio <vivainio@gmail.com>
2195 2006-01-13 Ville Vainio <vivainio@gmail.com>
2183
2196
2184 * IPython/platutils*.py: platform specific utility functions,
2197 * IPython/platutils*.py: platform specific utility functions,
2185 so far only set_term_title is implemented (change terminal
2198 so far only set_term_title is implemented (change terminal
2186 label in windowing systems). %cd now changes the title to
2199 label in windowing systems). %cd now changes the title to
2187 current dir.
2200 current dir.
2188
2201
2189 * IPython/Release.py: Added myself to "authors" list,
2202 * IPython/Release.py: Added myself to "authors" list,
2190 had to create new files.
2203 had to create new files.
2191
2204
2192 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2205 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2193 shell escape; not a known bug but had potential to be one in the
2206 shell escape; not a known bug but had potential to be one in the
2194 future.
2207 future.
2195
2208
2196 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2209 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2197 extension API for IPython! See the module for usage example. Fix
2210 extension API for IPython! See the module for usage example. Fix
2198 OInspect for docstring-less magic functions.
2211 OInspect for docstring-less magic functions.
2199
2212
2200
2213
2201 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2214 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2202
2215
2203 * IPython/iplib.py (raw_input): temporarily deactivate all
2216 * IPython/iplib.py (raw_input): temporarily deactivate all
2204 attempts at allowing pasting of code with autoindent on. It
2217 attempts at allowing pasting of code with autoindent on. It
2205 introduced bugs (reported by Prabhu) and I can't seem to find a
2218 introduced bugs (reported by Prabhu) and I can't seem to find a
2206 robust combination which works in all cases. Will have to revisit
2219 robust combination which works in all cases. Will have to revisit
2207 later.
2220 later.
2208
2221
2209 * IPython/genutils.py: remove isspace() function. We've dropped
2222 * IPython/genutils.py: remove isspace() function. We've dropped
2210 2.2 compatibility, so it's OK to use the string method.
2223 2.2 compatibility, so it's OK to use the string method.
2211
2224
2212 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2225 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2213
2226
2214 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2227 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2215 matching what NOT to autocall on, to include all python binary
2228 matching what NOT to autocall on, to include all python binary
2216 operators (including things like 'and', 'or', 'is' and 'in').
2229 operators (including things like 'and', 'or', 'is' and 'in').
2217 Prompted by a bug report on 'foo & bar', but I realized we had
2230 Prompted by a bug report on 'foo & bar', but I realized we had
2218 many more potential bug cases with other operators. The regexp is
2231 many more potential bug cases with other operators. The regexp is
2219 self.re_exclude_auto, it's fairly commented.
2232 self.re_exclude_auto, it's fairly commented.
2220
2233
2221 2006-01-12 Ville Vainio <vivainio@gmail.com>
2234 2006-01-12 Ville Vainio <vivainio@gmail.com>
2222
2235
2223 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2236 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2224 Prettified and hardened string/backslash quoting with ipsystem(),
2237 Prettified and hardened string/backslash quoting with ipsystem(),
2225 ipalias() and ipmagic(). Now even \ characters are passed to
2238 ipalias() and ipmagic(). Now even \ characters are passed to
2226 %magics, !shell escapes and aliases exactly as they are in the
2239 %magics, !shell escapes and aliases exactly as they are in the
2227 ipython command line. Should improve backslash experience,
2240 ipython command line. Should improve backslash experience,
2228 particularly in Windows (path delimiter for some commands that
2241 particularly in Windows (path delimiter for some commands that
2229 won't understand '/'), but Unix benefits as well (regexps). %cd
2242 won't understand '/'), but Unix benefits as well (regexps). %cd
2230 magic still doesn't support backslash path delimiters, though. Also
2243 magic still doesn't support backslash path delimiters, though. Also
2231 deleted all pretense of supporting multiline command strings in
2244 deleted all pretense of supporting multiline command strings in
2232 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2245 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2233
2246
2234 * doc/build_doc_instructions.txt added. Documentation on how to
2247 * doc/build_doc_instructions.txt added. Documentation on how to
2235 use doc/update_manual.py, added yesterday. Both files contributed
2248 use doc/update_manual.py, added yesterday. Both files contributed
2236 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2249 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2237 doc/*.sh for deprecation at a later date.
2250 doc/*.sh for deprecation at a later date.
2238
2251
2239 * /ipython.py Added ipython.py to root directory for
2252 * /ipython.py Added ipython.py to root directory for
2240 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2253 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2241 ipython.py) and development convenience (no need to keep doing
2254 ipython.py) and development convenience (no need to keep doing
2242 "setup.py install" between changes).
2255 "setup.py install" between changes).
2243
2256
2244 * Made ! and !! shell escapes work (again) in multiline expressions:
2257 * Made ! and !! shell escapes work (again) in multiline expressions:
2245 if 1:
2258 if 1:
2246 !ls
2259 !ls
2247 !!ls
2260 !!ls
2248
2261
2249 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2262 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2250
2263
2251 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2264 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2252 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2265 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2253 module in case-insensitive installation. Was causing crashes
2266 module in case-insensitive installation. Was causing crashes
2254 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2267 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2255
2268
2256 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2269 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2257 <marienz-AT-gentoo.org>, closes
2270 <marienz-AT-gentoo.org>, closes
2258 http://www.scipy.net/roundup/ipython/issue51.
2271 http://www.scipy.net/roundup/ipython/issue51.
2259
2272
2260 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2273 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2261
2274
2262 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2275 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2263 problem of excessive CPU usage under *nix and keyboard lag under
2276 problem of excessive CPU usage under *nix and keyboard lag under
2264 win32.
2277 win32.
2265
2278
2266 2006-01-10 *** Released version 0.7.0
2279 2006-01-10 *** Released version 0.7.0
2267
2280
2268 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2281 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2269
2282
2270 * IPython/Release.py (revision): tag version number to 0.7.0,
2283 * IPython/Release.py (revision): tag version number to 0.7.0,
2271 ready for release.
2284 ready for release.
2272
2285
2273 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2286 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2274 it informs the user of the name of the temp. file used. This can
2287 it informs the user of the name of the temp. file used. This can
2275 help if you decide later to reuse that same file, so you know
2288 help if you decide later to reuse that same file, so you know
2276 where to copy the info from.
2289 where to copy the info from.
2277
2290
2278 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2291 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2279
2292
2280 * setup_bdist_egg.py: little script to build an egg. Added
2293 * setup_bdist_egg.py: little script to build an egg. Added
2281 support in the release tools as well.
2294 support in the release tools as well.
2282
2295
2283 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2296 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2284
2297
2285 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2298 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2286 version selection (new -wxversion command line and ipythonrc
2299 version selection (new -wxversion command line and ipythonrc
2287 parameter). Patch contributed by Arnd Baecker
2300 parameter). Patch contributed by Arnd Baecker
2288 <arnd.baecker-AT-web.de>.
2301 <arnd.baecker-AT-web.de>.
2289
2302
2290 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2303 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2291 embedded instances, for variables defined at the interactive
2304 embedded instances, for variables defined at the interactive
2292 prompt of the embedded ipython. Reported by Arnd.
2305 prompt of the embedded ipython. Reported by Arnd.
2293
2306
2294 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2307 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2295 it can be used as a (stateful) toggle, or with a direct parameter.
2308 it can be used as a (stateful) toggle, or with a direct parameter.
2296
2309
2297 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2310 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2298 could be triggered in certain cases and cause the traceback
2311 could be triggered in certain cases and cause the traceback
2299 printer not to work.
2312 printer not to work.
2300
2313
2301 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2314 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2302
2315
2303 * IPython/iplib.py (_should_recompile): Small fix, closes
2316 * IPython/iplib.py (_should_recompile): Small fix, closes
2304 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2317 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2305
2318
2306 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2319 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2307
2320
2308 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2321 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2309 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2322 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2310 Moad for help with tracking it down.
2323 Moad for help with tracking it down.
2311
2324
2312 * IPython/iplib.py (handle_auto): fix autocall handling for
2325 * IPython/iplib.py (handle_auto): fix autocall handling for
2313 objects which support BOTH __getitem__ and __call__ (so that f [x]
2326 objects which support BOTH __getitem__ and __call__ (so that f [x]
2314 is left alone, instead of becoming f([x]) automatically).
2327 is left alone, instead of becoming f([x]) automatically).
2315
2328
2316 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2329 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2317 Ville's patch.
2330 Ville's patch.
2318
2331
2319 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2332 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2320
2333
2321 * IPython/iplib.py (handle_auto): changed autocall semantics to
2334 * IPython/iplib.py (handle_auto): changed autocall semantics to
2322 include 'smart' mode, where the autocall transformation is NOT
2335 include 'smart' mode, where the autocall transformation is NOT
2323 applied if there are no arguments on the line. This allows you to
2336 applied if there are no arguments on the line. This allows you to
2324 just type 'foo' if foo is a callable to see its internal form,
2337 just type 'foo' if foo is a callable to see its internal form,
2325 instead of having it called with no arguments (typically a
2338 instead of having it called with no arguments (typically a
2326 mistake). The old 'full' autocall still exists: for that, you
2339 mistake). The old 'full' autocall still exists: for that, you
2327 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2340 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2328
2341
2329 * IPython/completer.py (Completer.attr_matches): add
2342 * IPython/completer.py (Completer.attr_matches): add
2330 tab-completion support for Enthoughts' traits. After a report by
2343 tab-completion support for Enthoughts' traits. After a report by
2331 Arnd and a patch by Prabhu.
2344 Arnd and a patch by Prabhu.
2332
2345
2333 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2346 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2334
2347
2335 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2348 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2336 Schmolck's patch to fix inspect.getinnerframes().
2349 Schmolck's patch to fix inspect.getinnerframes().
2337
2350
2338 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2351 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2339 for embedded instances, regarding handling of namespaces and items
2352 for embedded instances, regarding handling of namespaces and items
2340 added to the __builtin__ one. Multiple embedded instances and
2353 added to the __builtin__ one. Multiple embedded instances and
2341 recursive embeddings should work better now (though I'm not sure
2354 recursive embeddings should work better now (though I'm not sure
2342 I've got all the corner cases fixed, that code is a bit of a brain
2355 I've got all the corner cases fixed, that code is a bit of a brain
2343 twister).
2356 twister).
2344
2357
2345 * IPython/Magic.py (magic_edit): added support to edit in-memory
2358 * IPython/Magic.py (magic_edit): added support to edit in-memory
2346 macros (automatically creates the necessary temp files). %edit
2359 macros (automatically creates the necessary temp files). %edit
2347 also doesn't return the file contents anymore, it's just noise.
2360 also doesn't return the file contents anymore, it's just noise.
2348
2361
2349 * IPython/completer.py (Completer.attr_matches): revert change to
2362 * IPython/completer.py (Completer.attr_matches): revert change to
2350 complete only on attributes listed in __all__. I realized it
2363 complete only on attributes listed in __all__. I realized it
2351 cripples the tab-completion system as a tool for exploring the
2364 cripples the tab-completion system as a tool for exploring the
2352 internals of unknown libraries (it renders any non-__all__
2365 internals of unknown libraries (it renders any non-__all__
2353 attribute off-limits). I got bit by this when trying to see
2366 attribute off-limits). I got bit by this when trying to see
2354 something inside the dis module.
2367 something inside the dis module.
2355
2368
2356 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2369 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2357
2370
2358 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2371 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2359 namespace for users and extension writers to hold data in. This
2372 namespace for users and extension writers to hold data in. This
2360 follows the discussion in
2373 follows the discussion in
2361 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2374 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2362
2375
2363 * IPython/completer.py (IPCompleter.complete): small patch to help
2376 * IPython/completer.py (IPCompleter.complete): small patch to help
2364 tab-completion under Emacs, after a suggestion by John Barnard
2377 tab-completion under Emacs, after a suggestion by John Barnard
2365 <barnarj-AT-ccf.org>.
2378 <barnarj-AT-ccf.org>.
2366
2379
2367 * IPython/Magic.py (Magic.extract_input_slices): added support for
2380 * IPython/Magic.py (Magic.extract_input_slices): added support for
2368 the slice notation in magics to use N-M to represent numbers N...M
2381 the slice notation in magics to use N-M to represent numbers N...M
2369 (closed endpoints). This is used by %macro and %save.
2382 (closed endpoints). This is used by %macro and %save.
2370
2383
2371 * IPython/completer.py (Completer.attr_matches): for modules which
2384 * IPython/completer.py (Completer.attr_matches): for modules which
2372 define __all__, complete only on those. After a patch by Jeffrey
2385 define __all__, complete only on those. After a patch by Jeffrey
2373 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2386 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2374 speed up this routine.
2387 speed up this routine.
2375
2388
2376 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2389 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2377 don't know if this is the end of it, but the behavior now is
2390 don't know if this is the end of it, but the behavior now is
2378 certainly much more correct. Note that coupled with macros,
2391 certainly much more correct. Note that coupled with macros,
2379 slightly surprising (at first) behavior may occur: a macro will in
2392 slightly surprising (at first) behavior may occur: a macro will in
2380 general expand to multiple lines of input, so upon exiting, the
2393 general expand to multiple lines of input, so upon exiting, the
2381 in/out counters will both be bumped by the corresponding amount
2394 in/out counters will both be bumped by the corresponding amount
2382 (as if the macro's contents had been typed interactively). Typing
2395 (as if the macro's contents had been typed interactively). Typing
2383 %hist will reveal the intermediate (silently processed) lines.
2396 %hist will reveal the intermediate (silently processed) lines.
2384
2397
2385 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2398 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2386 pickle to fail (%run was overwriting __main__ and not restoring
2399 pickle to fail (%run was overwriting __main__ and not restoring
2387 it, but pickle relies on __main__ to operate).
2400 it, but pickle relies on __main__ to operate).
2388
2401
2389 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2402 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2390 using properties, but forgot to make the main InteractiveShell
2403 using properties, but forgot to make the main InteractiveShell
2391 class a new-style class. Properties fail silently, and
2404 class a new-style class. Properties fail silently, and
2392 mysteriously, with old-style class (getters work, but
2405 mysteriously, with old-style class (getters work, but
2393 setters don't do anything).
2406 setters don't do anything).
2394
2407
2395 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2408 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2396
2409
2397 * IPython/Magic.py (magic_history): fix history reporting bug (I
2410 * IPython/Magic.py (magic_history): fix history reporting bug (I
2398 know some nasties are still there, I just can't seem to find a
2411 know some nasties are still there, I just can't seem to find a
2399 reproducible test case to track them down; the input history is
2412 reproducible test case to track them down; the input history is
2400 falling out of sync...)
2413 falling out of sync...)
2401
2414
2402 * IPython/iplib.py (handle_shell_escape): fix bug where both
2415 * IPython/iplib.py (handle_shell_escape): fix bug where both
2403 aliases and system accesses where broken for indented code (such
2416 aliases and system accesses where broken for indented code (such
2404 as loops).
2417 as loops).
2405
2418
2406 * IPython/genutils.py (shell): fix small but critical bug for
2419 * IPython/genutils.py (shell): fix small but critical bug for
2407 win32 system access.
2420 win32 system access.
2408
2421
2409 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2422 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2410
2423
2411 * IPython/iplib.py (showtraceback): remove use of the
2424 * IPython/iplib.py (showtraceback): remove use of the
2412 sys.last_{type/value/traceback} structures, which are non
2425 sys.last_{type/value/traceback} structures, which are non
2413 thread-safe.
2426 thread-safe.
2414 (_prefilter): change control flow to ensure that we NEVER
2427 (_prefilter): change control flow to ensure that we NEVER
2415 introspect objects when autocall is off. This will guarantee that
2428 introspect objects when autocall is off. This will guarantee that
2416 having an input line of the form 'x.y', where access to attribute
2429 having an input line of the form 'x.y', where access to attribute
2417 'y' has side effects, doesn't trigger the side effect TWICE. It
2430 'y' has side effects, doesn't trigger the side effect TWICE. It
2418 is important to note that, with autocall on, these side effects
2431 is important to note that, with autocall on, these side effects
2419 can still happen.
2432 can still happen.
2420 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2433 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2421 trio. IPython offers these three kinds of special calls which are
2434 trio. IPython offers these three kinds of special calls which are
2422 not python code, and it's a good thing to have their call method
2435 not python code, and it's a good thing to have their call method
2423 be accessible as pure python functions (not just special syntax at
2436 be accessible as pure python functions (not just special syntax at
2424 the command line). It gives us a better internal implementation
2437 the command line). It gives us a better internal implementation
2425 structure, as well as exposing these for user scripting more
2438 structure, as well as exposing these for user scripting more
2426 cleanly.
2439 cleanly.
2427
2440
2428 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2441 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2429 file. Now that they'll be more likely to be used with the
2442 file. Now that they'll be more likely to be used with the
2430 persistance system (%store), I want to make sure their module path
2443 persistance system (%store), I want to make sure their module path
2431 doesn't change in the future, so that we don't break things for
2444 doesn't change in the future, so that we don't break things for
2432 users' persisted data.
2445 users' persisted data.
2433
2446
2434 * IPython/iplib.py (autoindent_update): move indentation
2447 * IPython/iplib.py (autoindent_update): move indentation
2435 management into the _text_ processing loop, not the keyboard
2448 management into the _text_ processing loop, not the keyboard
2436 interactive one. This is necessary to correctly process non-typed
2449 interactive one. This is necessary to correctly process non-typed
2437 multiline input (such as macros).
2450 multiline input (such as macros).
2438
2451
2439 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2452 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2440 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2453 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2441 which was producing problems in the resulting manual.
2454 which was producing problems in the resulting manual.
2442 (magic_whos): improve reporting of instances (show their class,
2455 (magic_whos): improve reporting of instances (show their class,
2443 instead of simply printing 'instance' which isn't terribly
2456 instead of simply printing 'instance' which isn't terribly
2444 informative).
2457 informative).
2445
2458
2446 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2459 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2447 (minor mods) to support network shares under win32.
2460 (minor mods) to support network shares under win32.
2448
2461
2449 * IPython/winconsole.py (get_console_size): add new winconsole
2462 * IPython/winconsole.py (get_console_size): add new winconsole
2450 module and fixes to page_dumb() to improve its behavior under
2463 module and fixes to page_dumb() to improve its behavior under
2451 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2464 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2452
2465
2453 * IPython/Magic.py (Macro): simplified Macro class to just
2466 * IPython/Magic.py (Macro): simplified Macro class to just
2454 subclass list. We've had only 2.2 compatibility for a very long
2467 subclass list. We've had only 2.2 compatibility for a very long
2455 time, yet I was still avoiding subclassing the builtin types. No
2468 time, yet I was still avoiding subclassing the builtin types. No
2456 more (I'm also starting to use properties, though I won't shift to
2469 more (I'm also starting to use properties, though I won't shift to
2457 2.3-specific features quite yet).
2470 2.3-specific features quite yet).
2458 (magic_store): added Ville's patch for lightweight variable
2471 (magic_store): added Ville's patch for lightweight variable
2459 persistence, after a request on the user list by Matt Wilkie
2472 persistence, after a request on the user list by Matt Wilkie
2460 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2473 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2461 details.
2474 details.
2462
2475
2463 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2476 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2464 changed the default logfile name from 'ipython.log' to
2477 changed the default logfile name from 'ipython.log' to
2465 'ipython_log.py'. These logs are real python files, and now that
2478 'ipython_log.py'. These logs are real python files, and now that
2466 we have much better multiline support, people are more likely to
2479 we have much better multiline support, people are more likely to
2467 want to use them as such. Might as well name them correctly.
2480 want to use them as such. Might as well name them correctly.
2468
2481
2469 * IPython/Magic.py: substantial cleanup. While we can't stop
2482 * IPython/Magic.py: substantial cleanup. While we can't stop
2470 using magics as mixins, due to the existing customizations 'out
2483 using magics as mixins, due to the existing customizations 'out
2471 there' which rely on the mixin naming conventions, at least I
2484 there' which rely on the mixin naming conventions, at least I
2472 cleaned out all cross-class name usage. So once we are OK with
2485 cleaned out all cross-class name usage. So once we are OK with
2473 breaking compatibility, the two systems can be separated.
2486 breaking compatibility, the two systems can be separated.
2474
2487
2475 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2488 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2476 anymore, and the class is a fair bit less hideous as well. New
2489 anymore, and the class is a fair bit less hideous as well. New
2477 features were also introduced: timestamping of input, and logging
2490 features were also introduced: timestamping of input, and logging
2478 of output results. These are user-visible with the -t and -o
2491 of output results. These are user-visible with the -t and -o
2479 options to %logstart. Closes
2492 options to %logstart. Closes
2480 http://www.scipy.net/roundup/ipython/issue11 and a request by
2493 http://www.scipy.net/roundup/ipython/issue11 and a request by
2481 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2494 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2482
2495
2483 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2496 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2484
2497
2485 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2498 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2486 better handle backslashes in paths. See the thread 'More Windows
2499 better handle backslashes in paths. See the thread 'More Windows
2487 questions part 2 - \/ characters revisited' on the iypthon user
2500 questions part 2 - \/ characters revisited' on the iypthon user
2488 list:
2501 list:
2489 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2502 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2490
2503
2491 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2504 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2492
2505
2493 (InteractiveShell.__init__): change threaded shells to not use the
2506 (InteractiveShell.__init__): change threaded shells to not use the
2494 ipython crash handler. This was causing more problems than not,
2507 ipython crash handler. This was causing more problems than not,
2495 as exceptions in the main thread (GUI code, typically) would
2508 as exceptions in the main thread (GUI code, typically) would
2496 always show up as a 'crash', when they really weren't.
2509 always show up as a 'crash', when they really weren't.
2497
2510
2498 The colors and exception mode commands (%colors/%xmode) have been
2511 The colors and exception mode commands (%colors/%xmode) have been
2499 synchronized to also take this into account, so users can get
2512 synchronized to also take this into account, so users can get
2500 verbose exceptions for their threaded code as well. I also added
2513 verbose exceptions for their threaded code as well. I also added
2501 support for activating pdb inside this exception handler as well,
2514 support for activating pdb inside this exception handler as well,
2502 so now GUI authors can use IPython's enhanced pdb at runtime.
2515 so now GUI authors can use IPython's enhanced pdb at runtime.
2503
2516
2504 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2517 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2505 true by default, and add it to the shipped ipythonrc file. Since
2518 true by default, and add it to the shipped ipythonrc file. Since
2506 this asks the user before proceeding, I think it's OK to make it
2519 this asks the user before proceeding, I think it's OK to make it
2507 true by default.
2520 true by default.
2508
2521
2509 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2522 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2510 of the previous special-casing of input in the eval loop. I think
2523 of the previous special-casing of input in the eval loop. I think
2511 this is cleaner, as they really are commands and shouldn't have
2524 this is cleaner, as they really are commands and shouldn't have
2512 a special role in the middle of the core code.
2525 a special role in the middle of the core code.
2513
2526
2514 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2527 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2515
2528
2516 * IPython/iplib.py (edit_syntax_error): added support for
2529 * IPython/iplib.py (edit_syntax_error): added support for
2517 automatically reopening the editor if the file had a syntax error
2530 automatically reopening the editor if the file had a syntax error
2518 in it. Thanks to scottt who provided the patch at:
2531 in it. Thanks to scottt who provided the patch at:
2519 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2532 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2520 version committed).
2533 version committed).
2521
2534
2522 * IPython/iplib.py (handle_normal): add suport for multi-line
2535 * IPython/iplib.py (handle_normal): add suport for multi-line
2523 input with emtpy lines. This fixes
2536 input with emtpy lines. This fixes
2524 http://www.scipy.net/roundup/ipython/issue43 and a similar
2537 http://www.scipy.net/roundup/ipython/issue43 and a similar
2525 discussion on the user list.
2538 discussion on the user list.
2526
2539
2527 WARNING: a behavior change is necessarily introduced to support
2540 WARNING: a behavior change is necessarily introduced to support
2528 blank lines: now a single blank line with whitespace does NOT
2541 blank lines: now a single blank line with whitespace does NOT
2529 break the input loop, which means that when autoindent is on, by
2542 break the input loop, which means that when autoindent is on, by
2530 default hitting return on the next (indented) line does NOT exit.
2543 default hitting return on the next (indented) line does NOT exit.
2531
2544
2532 Instead, to exit a multiline input you can either have:
2545 Instead, to exit a multiline input you can either have:
2533
2546
2534 - TWO whitespace lines (just hit return again), or
2547 - TWO whitespace lines (just hit return again), or
2535 - a single whitespace line of a different length than provided
2548 - a single whitespace line of a different length than provided
2536 by the autoindent (add or remove a space).
2549 by the autoindent (add or remove a space).
2537
2550
2538 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2551 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2539 module to better organize all readline-related functionality.
2552 module to better organize all readline-related functionality.
2540 I've deleted FlexCompleter and put all completion clases here.
2553 I've deleted FlexCompleter and put all completion clases here.
2541
2554
2542 * IPython/iplib.py (raw_input): improve indentation management.
2555 * IPython/iplib.py (raw_input): improve indentation management.
2543 It is now possible to paste indented code with autoindent on, and
2556 It is now possible to paste indented code with autoindent on, and
2544 the code is interpreted correctly (though it still looks bad on
2557 the code is interpreted correctly (though it still looks bad on
2545 screen, due to the line-oriented nature of ipython).
2558 screen, due to the line-oriented nature of ipython).
2546 (MagicCompleter.complete): change behavior so that a TAB key on an
2559 (MagicCompleter.complete): change behavior so that a TAB key on an
2547 otherwise empty line actually inserts a tab, instead of completing
2560 otherwise empty line actually inserts a tab, instead of completing
2548 on the entire global namespace. This makes it easier to use the
2561 on the entire global namespace. This makes it easier to use the
2549 TAB key for indentation. After a request by Hans Meine
2562 TAB key for indentation. After a request by Hans Meine
2550 <hans_meine-AT-gmx.net>
2563 <hans_meine-AT-gmx.net>
2551 (_prefilter): add support so that typing plain 'exit' or 'quit'
2564 (_prefilter): add support so that typing plain 'exit' or 'quit'
2552 does a sensible thing. Originally I tried to deviate as little as
2565 does a sensible thing. Originally I tried to deviate as little as
2553 possible from the default python behavior, but even that one may
2566 possible from the default python behavior, but even that one may
2554 change in this direction (thread on python-dev to that effect).
2567 change in this direction (thread on python-dev to that effect).
2555 Regardless, ipython should do the right thing even if CPython's
2568 Regardless, ipython should do the right thing even if CPython's
2556 '>>>' prompt doesn't.
2569 '>>>' prompt doesn't.
2557 (InteractiveShell): removed subclassing code.InteractiveConsole
2570 (InteractiveShell): removed subclassing code.InteractiveConsole
2558 class. By now we'd overridden just about all of its methods: I've
2571 class. By now we'd overridden just about all of its methods: I've
2559 copied the remaining two over, and now ipython is a standalone
2572 copied the remaining two over, and now ipython is a standalone
2560 class. This will provide a clearer picture for the chainsaw
2573 class. This will provide a clearer picture for the chainsaw
2561 branch refactoring.
2574 branch refactoring.
2562
2575
2563 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2576 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2564
2577
2565 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2578 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2566 failures for objects which break when dir() is called on them.
2579 failures for objects which break when dir() is called on them.
2567
2580
2568 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2581 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2569 distinct local and global namespaces in the completer API. This
2582 distinct local and global namespaces in the completer API. This
2570 change allows us to properly handle completion with distinct
2583 change allows us to properly handle completion with distinct
2571 scopes, including in embedded instances (this had never really
2584 scopes, including in embedded instances (this had never really
2572 worked correctly).
2585 worked correctly).
2573
2586
2574 Note: this introduces a change in the constructor for
2587 Note: this introduces a change in the constructor for
2575 MagicCompleter, as a new global_namespace parameter is now the
2588 MagicCompleter, as a new global_namespace parameter is now the
2576 second argument (the others were bumped one position).
2589 second argument (the others were bumped one position).
2577
2590
2578 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2591 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2579
2592
2580 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2593 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2581 embedded instances (which can be done now thanks to Vivian's
2594 embedded instances (which can be done now thanks to Vivian's
2582 frame-handling fixes for pdb).
2595 frame-handling fixes for pdb).
2583 (InteractiveShell.__init__): Fix namespace handling problem in
2596 (InteractiveShell.__init__): Fix namespace handling problem in
2584 embedded instances. We were overwriting __main__ unconditionally,
2597 embedded instances. We were overwriting __main__ unconditionally,
2585 and this should only be done for 'full' (non-embedded) IPython;
2598 and this should only be done for 'full' (non-embedded) IPython;
2586 embedded instances must respect the caller's __main__. Thanks to
2599 embedded instances must respect the caller's __main__. Thanks to
2587 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2600 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2588
2601
2589 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2602 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2590
2603
2591 * setup.py: added download_url to setup(). This registers the
2604 * setup.py: added download_url to setup(). This registers the
2592 download address at PyPI, which is not only useful to humans
2605 download address at PyPI, which is not only useful to humans
2593 browsing the site, but is also picked up by setuptools (the Eggs
2606 browsing the site, but is also picked up by setuptools (the Eggs
2594 machinery). Thanks to Ville and R. Kern for the info/discussion
2607 machinery). Thanks to Ville and R. Kern for the info/discussion
2595 on this.
2608 on this.
2596
2609
2597 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2610 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2598
2611
2599 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2612 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2600 This brings a lot of nice functionality to the pdb mode, which now
2613 This brings a lot of nice functionality to the pdb mode, which now
2601 has tab-completion, syntax highlighting, and better stack handling
2614 has tab-completion, syntax highlighting, and better stack handling
2602 than before. Many thanks to Vivian De Smedt
2615 than before. Many thanks to Vivian De Smedt
2603 <vivian-AT-vdesmedt.com> for the original patches.
2616 <vivian-AT-vdesmedt.com> for the original patches.
2604
2617
2605 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2618 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2606
2619
2607 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2620 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2608 sequence to consistently accept the banner argument. The
2621 sequence to consistently accept the banner argument. The
2609 inconsistency was tripping SAGE, thanks to Gary Zablackis
2622 inconsistency was tripping SAGE, thanks to Gary Zablackis
2610 <gzabl-AT-yahoo.com> for the report.
2623 <gzabl-AT-yahoo.com> for the report.
2611
2624
2612 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2625 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2613
2626
2614 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2627 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2615 Fix bug where a naked 'alias' call in the ipythonrc file would
2628 Fix bug where a naked 'alias' call in the ipythonrc file would
2616 cause a crash. Bug reported by Jorgen Stenarson.
2629 cause a crash. Bug reported by Jorgen Stenarson.
2617
2630
2618 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2631 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2619
2632
2620 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2633 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2621 startup time.
2634 startup time.
2622
2635
2623 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2636 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2624 instances had introduced a bug with globals in normal code. Now
2637 instances had introduced a bug with globals in normal code. Now
2625 it's working in all cases.
2638 it's working in all cases.
2626
2639
2627 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2640 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2628 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2641 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2629 has been introduced to set the default case sensitivity of the
2642 has been introduced to set the default case sensitivity of the
2630 searches. Users can still select either mode at runtime on a
2643 searches. Users can still select either mode at runtime on a
2631 per-search basis.
2644 per-search basis.
2632
2645
2633 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2646 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2634
2647
2635 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2648 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2636 attributes in wildcard searches for subclasses. Modified version
2649 attributes in wildcard searches for subclasses. Modified version
2637 of a patch by Jorgen.
2650 of a patch by Jorgen.
2638
2651
2639 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2652 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2640
2653
2641 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2654 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2642 embedded instances. I added a user_global_ns attribute to the
2655 embedded instances. I added a user_global_ns attribute to the
2643 InteractiveShell class to handle this.
2656 InteractiveShell class to handle this.
2644
2657
2645 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2658 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2646
2659
2647 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2660 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2648 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2661 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2649 (reported under win32, but may happen also in other platforms).
2662 (reported under win32, but may happen also in other platforms).
2650 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2663 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2651
2664
2652 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2665 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2653
2666
2654 * IPython/Magic.py (magic_psearch): new support for wildcard
2667 * IPython/Magic.py (magic_psearch): new support for wildcard
2655 patterns. Now, typing ?a*b will list all names which begin with a
2668 patterns. Now, typing ?a*b will list all names which begin with a
2656 and end in b, for example. The %psearch magic has full
2669 and end in b, for example. The %psearch magic has full
2657 docstrings. Many thanks to JΓΆrgen Stenarson
2670 docstrings. Many thanks to JΓΆrgen Stenarson
2658 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2671 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2659 implementing this functionality.
2672 implementing this functionality.
2660
2673
2661 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2674 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2662
2675
2663 * Manual: fixed long-standing annoyance of double-dashes (as in
2676 * Manual: fixed long-standing annoyance of double-dashes (as in
2664 --prefix=~, for example) being stripped in the HTML version. This
2677 --prefix=~, for example) being stripped in the HTML version. This
2665 is a latex2html bug, but a workaround was provided. Many thanks
2678 is a latex2html bug, but a workaround was provided. Many thanks
2666 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2679 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2667 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2680 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2668 rolling. This seemingly small issue had tripped a number of users
2681 rolling. This seemingly small issue had tripped a number of users
2669 when first installing, so I'm glad to see it gone.
2682 when first installing, so I'm glad to see it gone.
2670
2683
2671 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2684 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2672
2685
2673 * IPython/Extensions/numeric_formats.py: fix missing import,
2686 * IPython/Extensions/numeric_formats.py: fix missing import,
2674 reported by Stephen Walton.
2687 reported by Stephen Walton.
2675
2688
2676 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2689 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2677
2690
2678 * IPython/demo.py: finish demo module, fully documented now.
2691 * IPython/demo.py: finish demo module, fully documented now.
2679
2692
2680 * IPython/genutils.py (file_read): simple little utility to read a
2693 * IPython/genutils.py (file_read): simple little utility to read a
2681 file and ensure it's closed afterwards.
2694 file and ensure it's closed afterwards.
2682
2695
2683 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2696 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2684
2697
2685 * IPython/demo.py (Demo.__init__): added support for individually
2698 * IPython/demo.py (Demo.__init__): added support for individually
2686 tagging blocks for automatic execution.
2699 tagging blocks for automatic execution.
2687
2700
2688 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2701 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2689 syntax-highlighted python sources, requested by John.
2702 syntax-highlighted python sources, requested by John.
2690
2703
2691 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2704 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2692
2705
2693 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2706 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2694 finishing.
2707 finishing.
2695
2708
2696 * IPython/genutils.py (shlex_split): moved from Magic to here,
2709 * IPython/genutils.py (shlex_split): moved from Magic to here,
2697 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2710 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2698
2711
2699 * IPython/demo.py (Demo.__init__): added support for silent
2712 * IPython/demo.py (Demo.__init__): added support for silent
2700 blocks, improved marks as regexps, docstrings written.
2713 blocks, improved marks as regexps, docstrings written.
2701 (Demo.__init__): better docstring, added support for sys.argv.
2714 (Demo.__init__): better docstring, added support for sys.argv.
2702
2715
2703 * IPython/genutils.py (marquee): little utility used by the demo
2716 * IPython/genutils.py (marquee): little utility used by the demo
2704 code, handy in general.
2717 code, handy in general.
2705
2718
2706 * IPython/demo.py (Demo.__init__): new class for interactive
2719 * IPython/demo.py (Demo.__init__): new class for interactive
2707 demos. Not documented yet, I just wrote it in a hurry for
2720 demos. Not documented yet, I just wrote it in a hurry for
2708 scipy'05. Will docstring later.
2721 scipy'05. Will docstring later.
2709
2722
2710 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2723 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2711
2724
2712 * IPython/Shell.py (sigint_handler): Drastic simplification which
2725 * IPython/Shell.py (sigint_handler): Drastic simplification which
2713 also seems to make Ctrl-C work correctly across threads! This is
2726 also seems to make Ctrl-C work correctly across threads! This is
2714 so simple, that I can't beleive I'd missed it before. Needs more
2727 so simple, that I can't beleive I'd missed it before. Needs more
2715 testing, though.
2728 testing, though.
2716 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2729 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2717 like this before...
2730 like this before...
2718
2731
2719 * IPython/genutils.py (get_home_dir): add protection against
2732 * IPython/genutils.py (get_home_dir): add protection against
2720 non-dirs in win32 registry.
2733 non-dirs in win32 registry.
2721
2734
2722 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2735 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2723 bug where dict was mutated while iterating (pysh crash).
2736 bug where dict was mutated while iterating (pysh crash).
2724
2737
2725 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2738 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2726
2739
2727 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2740 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2728 spurious newlines added by this routine. After a report by
2741 spurious newlines added by this routine. After a report by
2729 F. Mantegazza.
2742 F. Mantegazza.
2730
2743
2731 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2744 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2732
2745
2733 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2746 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2734 calls. These were a leftover from the GTK 1.x days, and can cause
2747 calls. These were a leftover from the GTK 1.x days, and can cause
2735 problems in certain cases (after a report by John Hunter).
2748 problems in certain cases (after a report by John Hunter).
2736
2749
2737 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2750 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2738 os.getcwd() fails at init time. Thanks to patch from David Remahl
2751 os.getcwd() fails at init time. Thanks to patch from David Remahl
2739 <chmod007-AT-mac.com>.
2752 <chmod007-AT-mac.com>.
2740 (InteractiveShell.__init__): prevent certain special magics from
2753 (InteractiveShell.__init__): prevent certain special magics from
2741 being shadowed by aliases. Closes
2754 being shadowed by aliases. Closes
2742 http://www.scipy.net/roundup/ipython/issue41.
2755 http://www.scipy.net/roundup/ipython/issue41.
2743
2756
2744 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2757 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2745
2758
2746 * IPython/iplib.py (InteractiveShell.complete): Added new
2759 * IPython/iplib.py (InteractiveShell.complete): Added new
2747 top-level completion method to expose the completion mechanism
2760 top-level completion method to expose the completion mechanism
2748 beyond readline-based environments.
2761 beyond readline-based environments.
2749
2762
2750 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2763 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2751
2764
2752 * tools/ipsvnc (svnversion): fix svnversion capture.
2765 * tools/ipsvnc (svnversion): fix svnversion capture.
2753
2766
2754 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2767 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2755 attribute to self, which was missing. Before, it was set by a
2768 attribute to self, which was missing. Before, it was set by a
2756 routine which in certain cases wasn't being called, so the
2769 routine which in certain cases wasn't being called, so the
2757 instance could end up missing the attribute. This caused a crash.
2770 instance could end up missing the attribute. This caused a crash.
2758 Closes http://www.scipy.net/roundup/ipython/issue40.
2771 Closes http://www.scipy.net/roundup/ipython/issue40.
2759
2772
2760 2005-08-16 Fernando Perez <fperez@colorado.edu>
2773 2005-08-16 Fernando Perez <fperez@colorado.edu>
2761
2774
2762 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2775 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2763 contains non-string attribute. Closes
2776 contains non-string attribute. Closes
2764 http://www.scipy.net/roundup/ipython/issue38.
2777 http://www.scipy.net/roundup/ipython/issue38.
2765
2778
2766 2005-08-14 Fernando Perez <fperez@colorado.edu>
2779 2005-08-14 Fernando Perez <fperez@colorado.edu>
2767
2780
2768 * tools/ipsvnc: Minor improvements, to add changeset info.
2781 * tools/ipsvnc: Minor improvements, to add changeset info.
2769
2782
2770 2005-08-12 Fernando Perez <fperez@colorado.edu>
2783 2005-08-12 Fernando Perez <fperez@colorado.edu>
2771
2784
2772 * IPython/iplib.py (runsource): remove self.code_to_run_src
2785 * IPython/iplib.py (runsource): remove self.code_to_run_src
2773 attribute. I realized this is nothing more than
2786 attribute. I realized this is nothing more than
2774 '\n'.join(self.buffer), and having the same data in two different
2787 '\n'.join(self.buffer), and having the same data in two different
2775 places is just asking for synchronization bugs. This may impact
2788 places is just asking for synchronization bugs. This may impact
2776 people who have custom exception handlers, so I need to warn
2789 people who have custom exception handlers, so I need to warn
2777 ipython-dev about it (F. Mantegazza may use them).
2790 ipython-dev about it (F. Mantegazza may use them).
2778
2791
2779 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2792 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2780
2793
2781 * IPython/genutils.py: fix 2.2 compatibility (generators)
2794 * IPython/genutils.py: fix 2.2 compatibility (generators)
2782
2795
2783 2005-07-18 Fernando Perez <fperez@colorado.edu>
2796 2005-07-18 Fernando Perez <fperez@colorado.edu>
2784
2797
2785 * IPython/genutils.py (get_home_dir): fix to help users with
2798 * IPython/genutils.py (get_home_dir): fix to help users with
2786 invalid $HOME under win32.
2799 invalid $HOME under win32.
2787
2800
2788 2005-07-17 Fernando Perez <fperez@colorado.edu>
2801 2005-07-17 Fernando Perez <fperez@colorado.edu>
2789
2802
2790 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2803 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2791 some old hacks and clean up a bit other routines; code should be
2804 some old hacks and clean up a bit other routines; code should be
2792 simpler and a bit faster.
2805 simpler and a bit faster.
2793
2806
2794 * IPython/iplib.py (interact): removed some last-resort attempts
2807 * IPython/iplib.py (interact): removed some last-resort attempts
2795 to survive broken stdout/stderr. That code was only making it
2808 to survive broken stdout/stderr. That code was only making it
2796 harder to abstract out the i/o (necessary for gui integration),
2809 harder to abstract out the i/o (necessary for gui integration),
2797 and the crashes it could prevent were extremely rare in practice
2810 and the crashes it could prevent were extremely rare in practice
2798 (besides being fully user-induced in a pretty violent manner).
2811 (besides being fully user-induced in a pretty violent manner).
2799
2812
2800 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2813 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2801 Nothing major yet, but the code is simpler to read; this should
2814 Nothing major yet, but the code is simpler to read; this should
2802 make it easier to do more serious modifications in the future.
2815 make it easier to do more serious modifications in the future.
2803
2816
2804 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2817 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2805 which broke in .15 (thanks to a report by Ville).
2818 which broke in .15 (thanks to a report by Ville).
2806
2819
2807 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2820 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2808 be quite correct, I know next to nothing about unicode). This
2821 be quite correct, I know next to nothing about unicode). This
2809 will allow unicode strings to be used in prompts, amongst other
2822 will allow unicode strings to be used in prompts, amongst other
2810 cases. It also will prevent ipython from crashing when unicode
2823 cases. It also will prevent ipython from crashing when unicode
2811 shows up unexpectedly in many places. If ascii encoding fails, we
2824 shows up unexpectedly in many places. If ascii encoding fails, we
2812 assume utf_8. Currently the encoding is not a user-visible
2825 assume utf_8. Currently the encoding is not a user-visible
2813 setting, though it could be made so if there is demand for it.
2826 setting, though it could be made so if there is demand for it.
2814
2827
2815 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2828 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2816
2829
2817 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2830 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2818
2831
2819 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2832 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2820
2833
2821 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2834 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2822 code can work transparently for 2.2/2.3.
2835 code can work transparently for 2.2/2.3.
2823
2836
2824 2005-07-16 Fernando Perez <fperez@colorado.edu>
2837 2005-07-16 Fernando Perez <fperez@colorado.edu>
2825
2838
2826 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2839 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2827 out of the color scheme table used for coloring exception
2840 out of the color scheme table used for coloring exception
2828 tracebacks. This allows user code to add new schemes at runtime.
2841 tracebacks. This allows user code to add new schemes at runtime.
2829 This is a minimally modified version of the patch at
2842 This is a minimally modified version of the patch at
2830 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2843 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2831 for the contribution.
2844 for the contribution.
2832
2845
2833 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2846 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2834 slightly modified version of the patch in
2847 slightly modified version of the patch in
2835 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2848 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2836 to remove the previous try/except solution (which was costlier).
2849 to remove the previous try/except solution (which was costlier).
2837 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2850 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2838
2851
2839 2005-06-08 Fernando Perez <fperez@colorado.edu>
2852 2005-06-08 Fernando Perez <fperez@colorado.edu>
2840
2853
2841 * IPython/iplib.py (write/write_err): Add methods to abstract all
2854 * IPython/iplib.py (write/write_err): Add methods to abstract all
2842 I/O a bit more.
2855 I/O a bit more.
2843
2856
2844 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2857 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2845 warning, reported by Aric Hagberg, fix by JD Hunter.
2858 warning, reported by Aric Hagberg, fix by JD Hunter.
2846
2859
2847 2005-06-02 *** Released version 0.6.15
2860 2005-06-02 *** Released version 0.6.15
2848
2861
2849 2005-06-01 Fernando Perez <fperez@colorado.edu>
2862 2005-06-01 Fernando Perez <fperez@colorado.edu>
2850
2863
2851 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2864 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2852 tab-completion of filenames within open-quoted strings. Note that
2865 tab-completion of filenames within open-quoted strings. Note that
2853 this requires that in ~/.ipython/ipythonrc, users change the
2866 this requires that in ~/.ipython/ipythonrc, users change the
2854 readline delimiters configuration to read:
2867 readline delimiters configuration to read:
2855
2868
2856 readline_remove_delims -/~
2869 readline_remove_delims -/~
2857
2870
2858
2871
2859 2005-05-31 *** Released version 0.6.14
2872 2005-05-31 *** Released version 0.6.14
2860
2873
2861 2005-05-29 Fernando Perez <fperez@colorado.edu>
2874 2005-05-29 Fernando Perez <fperez@colorado.edu>
2862
2875
2863 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2876 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2864 with files not on the filesystem. Reported by Eliyahu Sandler
2877 with files not on the filesystem. Reported by Eliyahu Sandler
2865 <eli@gondolin.net>
2878 <eli@gondolin.net>
2866
2879
2867 2005-05-22 Fernando Perez <fperez@colorado.edu>
2880 2005-05-22 Fernando Perez <fperez@colorado.edu>
2868
2881
2869 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2882 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2870 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2883 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2871
2884
2872 2005-05-19 Fernando Perez <fperez@colorado.edu>
2885 2005-05-19 Fernando Perez <fperez@colorado.edu>
2873
2886
2874 * IPython/iplib.py (safe_execfile): close a file which could be
2887 * IPython/iplib.py (safe_execfile): close a file which could be
2875 left open (causing problems in win32, which locks open files).
2888 left open (causing problems in win32, which locks open files).
2876 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2889 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2877
2890
2878 2005-05-18 Fernando Perez <fperez@colorado.edu>
2891 2005-05-18 Fernando Perez <fperez@colorado.edu>
2879
2892
2880 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2893 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2881 keyword arguments correctly to safe_execfile().
2894 keyword arguments correctly to safe_execfile().
2882
2895
2883 2005-05-13 Fernando Perez <fperez@colorado.edu>
2896 2005-05-13 Fernando Perez <fperez@colorado.edu>
2884
2897
2885 * ipython.1: Added info about Qt to manpage, and threads warning
2898 * ipython.1: Added info about Qt to manpage, and threads warning
2886 to usage page (invoked with --help).
2899 to usage page (invoked with --help).
2887
2900
2888 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2901 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2889 new matcher (it goes at the end of the priority list) to do
2902 new matcher (it goes at the end of the priority list) to do
2890 tab-completion on named function arguments. Submitted by George
2903 tab-completion on named function arguments. Submitted by George
2891 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2904 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2892 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2905 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2893 for more details.
2906 for more details.
2894
2907
2895 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2908 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2896 SystemExit exceptions in the script being run. Thanks to a report
2909 SystemExit exceptions in the script being run. Thanks to a report
2897 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2910 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2898 producing very annoying behavior when running unit tests.
2911 producing very annoying behavior when running unit tests.
2899
2912
2900 2005-05-12 Fernando Perez <fperez@colorado.edu>
2913 2005-05-12 Fernando Perez <fperez@colorado.edu>
2901
2914
2902 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2915 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2903 which I'd broken (again) due to a changed regexp. In the process,
2916 which I'd broken (again) due to a changed regexp. In the process,
2904 added ';' as an escape to auto-quote the whole line without
2917 added ';' as an escape to auto-quote the whole line without
2905 splitting its arguments. Thanks to a report by Jerry McRae
2918 splitting its arguments. Thanks to a report by Jerry McRae
2906 <qrs0xyc02-AT-sneakemail.com>.
2919 <qrs0xyc02-AT-sneakemail.com>.
2907
2920
2908 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2921 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2909 possible crashes caused by a TokenError. Reported by Ed Schofield
2922 possible crashes caused by a TokenError. Reported by Ed Schofield
2910 <schofield-AT-ftw.at>.
2923 <schofield-AT-ftw.at>.
2911
2924
2912 2005-05-06 Fernando Perez <fperez@colorado.edu>
2925 2005-05-06 Fernando Perez <fperez@colorado.edu>
2913
2926
2914 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2927 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2915
2928
2916 2005-04-29 Fernando Perez <fperez@colorado.edu>
2929 2005-04-29 Fernando Perez <fperez@colorado.edu>
2917
2930
2918 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2931 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2919 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2932 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2920 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2933 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2921 which provides support for Qt interactive usage (similar to the
2934 which provides support for Qt interactive usage (similar to the
2922 existing one for WX and GTK). This had been often requested.
2935 existing one for WX and GTK). This had been often requested.
2923
2936
2924 2005-04-14 *** Released version 0.6.13
2937 2005-04-14 *** Released version 0.6.13
2925
2938
2926 2005-04-08 Fernando Perez <fperez@colorado.edu>
2939 2005-04-08 Fernando Perez <fperez@colorado.edu>
2927
2940
2928 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2941 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2929 from _ofind, which gets called on almost every input line. Now,
2942 from _ofind, which gets called on almost every input line. Now,
2930 we only try to get docstrings if they are actually going to be
2943 we only try to get docstrings if they are actually going to be
2931 used (the overhead of fetching unnecessary docstrings can be
2944 used (the overhead of fetching unnecessary docstrings can be
2932 noticeable for certain objects, such as Pyro proxies).
2945 noticeable for certain objects, such as Pyro proxies).
2933
2946
2934 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2947 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2935 for completers. For some reason I had been passing them the state
2948 for completers. For some reason I had been passing them the state
2936 variable, which completers never actually need, and was in
2949 variable, which completers never actually need, and was in
2937 conflict with the rlcompleter API. Custom completers ONLY need to
2950 conflict with the rlcompleter API. Custom completers ONLY need to
2938 take the text parameter.
2951 take the text parameter.
2939
2952
2940 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2953 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2941 work correctly in pysh. I've also moved all the logic which used
2954 work correctly in pysh. I've also moved all the logic which used
2942 to be in pysh.py here, which will prevent problems with future
2955 to be in pysh.py here, which will prevent problems with future
2943 upgrades. However, this time I must warn users to update their
2956 upgrades. However, this time I must warn users to update their
2944 pysh profile to include the line
2957 pysh profile to include the line
2945
2958
2946 import_all IPython.Extensions.InterpreterExec
2959 import_all IPython.Extensions.InterpreterExec
2947
2960
2948 because otherwise things won't work for them. They MUST also
2961 because otherwise things won't work for them. They MUST also
2949 delete pysh.py and the line
2962 delete pysh.py and the line
2950
2963
2951 execfile pysh.py
2964 execfile pysh.py
2952
2965
2953 from their ipythonrc-pysh.
2966 from their ipythonrc-pysh.
2954
2967
2955 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2968 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2956 robust in the face of objects whose dir() returns non-strings
2969 robust in the face of objects whose dir() returns non-strings
2957 (which it shouldn't, but some broken libs like ITK do). Thanks to
2970 (which it shouldn't, but some broken libs like ITK do). Thanks to
2958 a patch by John Hunter (implemented differently, though). Also
2971 a patch by John Hunter (implemented differently, though). Also
2959 minor improvements by using .extend instead of + on lists.
2972 minor improvements by using .extend instead of + on lists.
2960
2973
2961 * pysh.py:
2974 * pysh.py:
2962
2975
2963 2005-04-06 Fernando Perez <fperez@colorado.edu>
2976 2005-04-06 Fernando Perez <fperez@colorado.edu>
2964
2977
2965 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2978 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2966 by default, so that all users benefit from it. Those who don't
2979 by default, so that all users benefit from it. Those who don't
2967 want it can still turn it off.
2980 want it can still turn it off.
2968
2981
2969 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2982 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2970 config file, I'd forgotten about this, so users were getting it
2983 config file, I'd forgotten about this, so users were getting it
2971 off by default.
2984 off by default.
2972
2985
2973 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2986 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2974 consistency. Now magics can be called in multiline statements,
2987 consistency. Now magics can be called in multiline statements,
2975 and python variables can be expanded in magic calls via $var.
2988 and python variables can be expanded in magic calls via $var.
2976 This makes the magic system behave just like aliases or !system
2989 This makes the magic system behave just like aliases or !system
2977 calls.
2990 calls.
2978
2991
2979 2005-03-28 Fernando Perez <fperez@colorado.edu>
2992 2005-03-28 Fernando Perez <fperez@colorado.edu>
2980
2993
2981 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2994 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2982 expensive string additions for building command. Add support for
2995 expensive string additions for building command. Add support for
2983 trailing ';' when autocall is used.
2996 trailing ';' when autocall is used.
2984
2997
2985 2005-03-26 Fernando Perez <fperez@colorado.edu>
2998 2005-03-26 Fernando Perez <fperez@colorado.edu>
2986
2999
2987 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
3000 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2988 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
3001 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2989 ipython.el robust against prompts with any number of spaces
3002 ipython.el robust against prompts with any number of spaces
2990 (including 0) after the ':' character.
3003 (including 0) after the ':' character.
2991
3004
2992 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
3005 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2993 continuation prompt, which misled users to think the line was
3006 continuation prompt, which misled users to think the line was
2994 already indented. Closes debian Bug#300847, reported to me by
3007 already indented. Closes debian Bug#300847, reported to me by
2995 Norbert Tretkowski <tretkowski-AT-inittab.de>.
3008 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2996
3009
2997 2005-03-23 Fernando Perez <fperez@colorado.edu>
3010 2005-03-23 Fernando Perez <fperez@colorado.edu>
2998
3011
2999 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
3012 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
3000 properly aligned if they have embedded newlines.
3013 properly aligned if they have embedded newlines.
3001
3014
3002 * IPython/iplib.py (runlines): Add a public method to expose
3015 * IPython/iplib.py (runlines): Add a public method to expose
3003 IPython's code execution machinery, so that users can run strings
3016 IPython's code execution machinery, so that users can run strings
3004 as if they had been typed at the prompt interactively.
3017 as if they had been typed at the prompt interactively.
3005 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
3018 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
3006 methods which can call the system shell, but with python variable
3019 methods which can call the system shell, but with python variable
3007 expansion. The three such methods are: __IPYTHON__.system,
3020 expansion. The three such methods are: __IPYTHON__.system,
3008 .getoutput and .getoutputerror. These need to be documented in a
3021 .getoutput and .getoutputerror. These need to be documented in a
3009 'public API' section (to be written) of the manual.
3022 'public API' section (to be written) of the manual.
3010
3023
3011 2005-03-20 Fernando Perez <fperez@colorado.edu>
3024 2005-03-20 Fernando Perez <fperez@colorado.edu>
3012
3025
3013 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
3026 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
3014 for custom exception handling. This is quite powerful, and it
3027 for custom exception handling. This is quite powerful, and it
3015 allows for user-installable exception handlers which can trap
3028 allows for user-installable exception handlers which can trap
3016 custom exceptions at runtime and treat them separately from
3029 custom exceptions at runtime and treat them separately from
3017 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
3030 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
3018 Mantegazza <mantegazza-AT-ill.fr>.
3031 Mantegazza <mantegazza-AT-ill.fr>.
3019 (InteractiveShell.set_custom_completer): public API function to
3032 (InteractiveShell.set_custom_completer): public API function to
3020 add new completers at runtime.
3033 add new completers at runtime.
3021
3034
3022 2005-03-19 Fernando Perez <fperez@colorado.edu>
3035 2005-03-19 Fernando Perez <fperez@colorado.edu>
3023
3036
3024 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3037 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3025 allow objects which provide their docstrings via non-standard
3038 allow objects which provide their docstrings via non-standard
3026 mechanisms (like Pyro proxies) to still be inspected by ipython's
3039 mechanisms (like Pyro proxies) to still be inspected by ipython's
3027 ? system.
3040 ? system.
3028
3041
3029 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3042 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3030 automatic capture system. I tried quite hard to make it work
3043 automatic capture system. I tried quite hard to make it work
3031 reliably, and simply failed. I tried many combinations with the
3044 reliably, and simply failed. I tried many combinations with the
3032 subprocess module, but eventually nothing worked in all needed
3045 subprocess module, but eventually nothing worked in all needed
3033 cases (not blocking stdin for the child, duplicating stdout
3046 cases (not blocking stdin for the child, duplicating stdout
3034 without blocking, etc). The new %sc/%sx still do capture to these
3047 without blocking, etc). The new %sc/%sx still do capture to these
3035 magical list/string objects which make shell use much more
3048 magical list/string objects which make shell use much more
3036 conveninent, so not all is lost.
3049 conveninent, so not all is lost.
3037
3050
3038 XXX - FIX MANUAL for the change above!
3051 XXX - FIX MANUAL for the change above!
3039
3052
3040 (runsource): I copied code.py's runsource() into ipython to modify
3053 (runsource): I copied code.py's runsource() into ipython to modify
3041 it a bit. Now the code object and source to be executed are
3054 it a bit. Now the code object and source to be executed are
3042 stored in ipython. This makes this info accessible to third-party
3055 stored in ipython. This makes this info accessible to third-party
3043 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
3056 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
3044 Mantegazza <mantegazza-AT-ill.fr>.
3057 Mantegazza <mantegazza-AT-ill.fr>.
3045
3058
3046 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3059 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3047 history-search via readline (like C-p/C-n). I'd wanted this for a
3060 history-search via readline (like C-p/C-n). I'd wanted this for a
3048 long time, but only recently found out how to do it. For users
3061 long time, but only recently found out how to do it. For users
3049 who already have their ipythonrc files made and want this, just
3062 who already have their ipythonrc files made and want this, just
3050 add:
3063 add:
3051
3064
3052 readline_parse_and_bind "\e[A": history-search-backward
3065 readline_parse_and_bind "\e[A": history-search-backward
3053 readline_parse_and_bind "\e[B": history-search-forward
3066 readline_parse_and_bind "\e[B": history-search-forward
3054
3067
3055 2005-03-18 Fernando Perez <fperez@colorado.edu>
3068 2005-03-18 Fernando Perez <fperez@colorado.edu>
3056
3069
3057 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3070 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3058 LSString and SList classes which allow transparent conversions
3071 LSString and SList classes which allow transparent conversions
3059 between list mode and whitespace-separated string.
3072 between list mode and whitespace-separated string.
3060 (magic_r): Fix recursion problem in %r.
3073 (magic_r): Fix recursion problem in %r.
3061
3074
3062 * IPython/genutils.py (LSString): New class to be used for
3075 * IPython/genutils.py (LSString): New class to be used for
3063 automatic storage of the results of all alias/system calls in _o
3076 automatic storage of the results of all alias/system calls in _o
3064 and _e (stdout/err). These provide a .l/.list attribute which
3077 and _e (stdout/err). These provide a .l/.list attribute which
3065 does automatic splitting on newlines. This means that for most
3078 does automatic splitting on newlines. This means that for most
3066 uses, you'll never need to do capturing of output with %sc/%sx
3079 uses, you'll never need to do capturing of output with %sc/%sx
3067 anymore, since ipython keeps this always done for you. Note that
3080 anymore, since ipython keeps this always done for you. Note that
3068 only the LAST results are stored, the _o/e variables are
3081 only the LAST results are stored, the _o/e variables are
3069 overwritten on each call. If you need to save their contents
3082 overwritten on each call. If you need to save their contents
3070 further, simply bind them to any other name.
3083 further, simply bind them to any other name.
3071
3084
3072 2005-03-17 Fernando Perez <fperez@colorado.edu>
3085 2005-03-17 Fernando Perez <fperez@colorado.edu>
3073
3086
3074 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3087 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3075 prompt namespace handling.
3088 prompt namespace handling.
3076
3089
3077 2005-03-16 Fernando Perez <fperez@colorado.edu>
3090 2005-03-16 Fernando Perez <fperez@colorado.edu>
3078
3091
3079 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3092 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3080 classic prompts to be '>>> ' (final space was missing, and it
3093 classic prompts to be '>>> ' (final space was missing, and it
3081 trips the emacs python mode).
3094 trips the emacs python mode).
3082 (BasePrompt.__str__): Added safe support for dynamic prompt
3095 (BasePrompt.__str__): Added safe support for dynamic prompt
3083 strings. Now you can set your prompt string to be '$x', and the
3096 strings. Now you can set your prompt string to be '$x', and the
3084 value of x will be printed from your interactive namespace. The
3097 value of x will be printed from your interactive namespace. The
3085 interpolation syntax includes the full Itpl support, so
3098 interpolation syntax includes the full Itpl support, so
3086 ${foo()+x+bar()} is a valid prompt string now, and the function
3099 ${foo()+x+bar()} is a valid prompt string now, and the function
3087 calls will be made at runtime.
3100 calls will be made at runtime.
3088
3101
3089 2005-03-15 Fernando Perez <fperez@colorado.edu>
3102 2005-03-15 Fernando Perez <fperez@colorado.edu>
3090
3103
3091 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3104 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3092 avoid name clashes in pylab. %hist still works, it just forwards
3105 avoid name clashes in pylab. %hist still works, it just forwards
3093 the call to %history.
3106 the call to %history.
3094
3107
3095 2005-03-02 *** Released version 0.6.12
3108 2005-03-02 *** Released version 0.6.12
3096
3109
3097 2005-03-02 Fernando Perez <fperez@colorado.edu>
3110 2005-03-02 Fernando Perez <fperez@colorado.edu>
3098
3111
3099 * IPython/iplib.py (handle_magic): log magic calls properly as
3112 * IPython/iplib.py (handle_magic): log magic calls properly as
3100 ipmagic() function calls.
3113 ipmagic() function calls.
3101
3114
3102 * IPython/Magic.py (magic_time): Improved %time to support
3115 * IPython/Magic.py (magic_time): Improved %time to support
3103 statements and provide wall-clock as well as CPU time.
3116 statements and provide wall-clock as well as CPU time.
3104
3117
3105 2005-02-27 Fernando Perez <fperez@colorado.edu>
3118 2005-02-27 Fernando Perez <fperez@colorado.edu>
3106
3119
3107 * IPython/hooks.py: New hooks module, to expose user-modifiable
3120 * IPython/hooks.py: New hooks module, to expose user-modifiable
3108 IPython functionality in a clean manner. For now only the editor
3121 IPython functionality in a clean manner. For now only the editor
3109 hook is actually written, and other thigns which I intend to turn
3122 hook is actually written, and other thigns which I intend to turn
3110 into proper hooks aren't yet there. The display and prefilter
3123 into proper hooks aren't yet there. The display and prefilter
3111 stuff, for example, should be hooks. But at least now the
3124 stuff, for example, should be hooks. But at least now the
3112 framework is in place, and the rest can be moved here with more
3125 framework is in place, and the rest can be moved here with more
3113 time later. IPython had had a .hooks variable for a long time for
3126 time later. IPython had had a .hooks variable for a long time for
3114 this purpose, but I'd never actually used it for anything.
3127 this purpose, but I'd never actually used it for anything.
3115
3128
3116 2005-02-26 Fernando Perez <fperez@colorado.edu>
3129 2005-02-26 Fernando Perez <fperez@colorado.edu>
3117
3130
3118 * IPython/ipmaker.py (make_IPython): make the default ipython
3131 * IPython/ipmaker.py (make_IPython): make the default ipython
3119 directory be called _ipython under win32, to follow more the
3132 directory be called _ipython under win32, to follow more the
3120 naming peculiarities of that platform (where buggy software like
3133 naming peculiarities of that platform (where buggy software like
3121 Visual Sourcesafe breaks with .named directories). Reported by
3134 Visual Sourcesafe breaks with .named directories). Reported by
3122 Ville Vainio.
3135 Ville Vainio.
3123
3136
3124 2005-02-23 Fernando Perez <fperez@colorado.edu>
3137 2005-02-23 Fernando Perez <fperez@colorado.edu>
3125
3138
3126 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3139 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3127 auto_aliases for win32 which were causing problems. Users can
3140 auto_aliases for win32 which were causing problems. Users can
3128 define the ones they personally like.
3141 define the ones they personally like.
3129
3142
3130 2005-02-21 Fernando Perez <fperez@colorado.edu>
3143 2005-02-21 Fernando Perez <fperez@colorado.edu>
3131
3144
3132 * IPython/Magic.py (magic_time): new magic to time execution of
3145 * IPython/Magic.py (magic_time): new magic to time execution of
3133 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3146 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3134
3147
3135 2005-02-19 Fernando Perez <fperez@colorado.edu>
3148 2005-02-19 Fernando Perez <fperez@colorado.edu>
3136
3149
3137 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3150 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3138 into keys (for prompts, for example).
3151 into keys (for prompts, for example).
3139
3152
3140 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3153 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3141 prompts in case users want them. This introduces a small behavior
3154 prompts in case users want them. This introduces a small behavior
3142 change: ipython does not automatically add a space to all prompts
3155 change: ipython does not automatically add a space to all prompts
3143 anymore. To get the old prompts with a space, users should add it
3156 anymore. To get the old prompts with a space, users should add it
3144 manually to their ipythonrc file, so for example prompt_in1 should
3157 manually to their ipythonrc file, so for example prompt_in1 should
3145 now read 'In [\#]: ' instead of 'In [\#]:'.
3158 now read 'In [\#]: ' instead of 'In [\#]:'.
3146 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3159 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3147 file) to control left-padding of secondary prompts.
3160 file) to control left-padding of secondary prompts.
3148
3161
3149 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3162 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3150 the profiler can't be imported. Fix for Debian, which removed
3163 the profiler can't be imported. Fix for Debian, which removed
3151 profile.py because of License issues. I applied a slightly
3164 profile.py because of License issues. I applied a slightly
3152 modified version of the original Debian patch at
3165 modified version of the original Debian patch at
3153 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3166 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3154
3167
3155 2005-02-17 Fernando Perez <fperez@colorado.edu>
3168 2005-02-17 Fernando Perez <fperez@colorado.edu>
3156
3169
3157 * IPython/genutils.py (native_line_ends): Fix bug which would
3170 * IPython/genutils.py (native_line_ends): Fix bug which would
3158 cause improper line-ends under win32 b/c I was not opening files
3171 cause improper line-ends under win32 b/c I was not opening files
3159 in binary mode. Bug report and fix thanks to Ville.
3172 in binary mode. Bug report and fix thanks to Ville.
3160
3173
3161 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3174 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3162 trying to catch spurious foo[1] autocalls. My fix actually broke
3175 trying to catch spurious foo[1] autocalls. My fix actually broke
3163 ',/' autoquote/call with explicit escape (bad regexp).
3176 ',/' autoquote/call with explicit escape (bad regexp).
3164
3177
3165 2005-02-15 *** Released version 0.6.11
3178 2005-02-15 *** Released version 0.6.11
3166
3179
3167 2005-02-14 Fernando Perez <fperez@colorado.edu>
3180 2005-02-14 Fernando Perez <fperez@colorado.edu>
3168
3181
3169 * IPython/background_jobs.py: New background job management
3182 * IPython/background_jobs.py: New background job management
3170 subsystem. This is implemented via a new set of classes, and
3183 subsystem. This is implemented via a new set of classes, and
3171 IPython now provides a builtin 'jobs' object for background job
3184 IPython now provides a builtin 'jobs' object for background job
3172 execution. A convenience %bg magic serves as a lightweight
3185 execution. A convenience %bg magic serves as a lightweight
3173 frontend for starting the more common type of calls. This was
3186 frontend for starting the more common type of calls. This was
3174 inspired by discussions with B. Granger and the BackgroundCommand
3187 inspired by discussions with B. Granger and the BackgroundCommand
3175 class described in the book Python Scripting for Computational
3188 class described in the book Python Scripting for Computational
3176 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3189 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3177 (although ultimately no code from this text was used, as IPython's
3190 (although ultimately no code from this text was used, as IPython's
3178 system is a separate implementation).
3191 system is a separate implementation).
3179
3192
3180 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3193 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3181 to control the completion of single/double underscore names
3194 to control the completion of single/double underscore names
3182 separately. As documented in the example ipytonrc file, the
3195 separately. As documented in the example ipytonrc file, the
3183 readline_omit__names variable can now be set to 2, to omit even
3196 readline_omit__names variable can now be set to 2, to omit even
3184 single underscore names. Thanks to a patch by Brian Wong
3197 single underscore names. Thanks to a patch by Brian Wong
3185 <BrianWong-AT-AirgoNetworks.Com>.
3198 <BrianWong-AT-AirgoNetworks.Com>.
3186 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3199 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3187 be autocalled as foo([1]) if foo were callable. A problem for
3200 be autocalled as foo([1]) if foo were callable. A problem for
3188 things which are both callable and implement __getitem__.
3201 things which are both callable and implement __getitem__.
3189 (init_readline): Fix autoindentation for win32. Thanks to a patch
3202 (init_readline): Fix autoindentation for win32. Thanks to a patch
3190 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3203 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3191
3204
3192 2005-02-12 Fernando Perez <fperez@colorado.edu>
3205 2005-02-12 Fernando Perez <fperez@colorado.edu>
3193
3206
3194 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3207 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3195 which I had written long ago to sort out user error messages which
3208 which I had written long ago to sort out user error messages which
3196 may occur during startup. This seemed like a good idea initially,
3209 may occur during startup. This seemed like a good idea initially,
3197 but it has proven a disaster in retrospect. I don't want to
3210 but it has proven a disaster in retrospect. I don't want to
3198 change much code for now, so my fix is to set the internal 'debug'
3211 change much code for now, so my fix is to set the internal 'debug'
3199 flag to true everywhere, whose only job was precisely to control
3212 flag to true everywhere, whose only job was precisely to control
3200 this subsystem. This closes issue 28 (as well as avoiding all
3213 this subsystem. This closes issue 28 (as well as avoiding all
3201 sorts of strange hangups which occur from time to time).
3214 sorts of strange hangups which occur from time to time).
3202
3215
3203 2005-02-07 Fernando Perez <fperez@colorado.edu>
3216 2005-02-07 Fernando Perez <fperez@colorado.edu>
3204
3217
3205 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3218 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3206 previous call produced a syntax error.
3219 previous call produced a syntax error.
3207
3220
3208 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3221 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3209 classes without constructor.
3222 classes without constructor.
3210
3223
3211 2005-02-06 Fernando Perez <fperez@colorado.edu>
3224 2005-02-06 Fernando Perez <fperez@colorado.edu>
3212
3225
3213 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3226 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3214 completions with the results of each matcher, so we return results
3227 completions with the results of each matcher, so we return results
3215 to the user from all namespaces. This breaks with ipython
3228 to the user from all namespaces. This breaks with ipython
3216 tradition, but I think it's a nicer behavior. Now you get all
3229 tradition, but I think it's a nicer behavior. Now you get all
3217 possible completions listed, from all possible namespaces (python,
3230 possible completions listed, from all possible namespaces (python,
3218 filesystem, magics...) After a request by John Hunter
3231 filesystem, magics...) After a request by John Hunter
3219 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3232 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3220
3233
3221 2005-02-05 Fernando Perez <fperez@colorado.edu>
3234 2005-02-05 Fernando Perez <fperez@colorado.edu>
3222
3235
3223 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3236 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3224 the call had quote characters in it (the quotes were stripped).
3237 the call had quote characters in it (the quotes were stripped).
3225
3238
3226 2005-01-31 Fernando Perez <fperez@colorado.edu>
3239 2005-01-31 Fernando Perez <fperez@colorado.edu>
3227
3240
3228 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3241 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3229 Itpl.itpl() to make the code more robust against psyco
3242 Itpl.itpl() to make the code more robust against psyco
3230 optimizations.
3243 optimizations.
3231
3244
3232 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3245 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3233 of causing an exception. Quicker, cleaner.
3246 of causing an exception. Quicker, cleaner.
3234
3247
3235 2005-01-28 Fernando Perez <fperez@colorado.edu>
3248 2005-01-28 Fernando Perez <fperez@colorado.edu>
3236
3249
3237 * scripts/ipython_win_post_install.py (install): hardcode
3250 * scripts/ipython_win_post_install.py (install): hardcode
3238 sys.prefix+'python.exe' as the executable path. It turns out that
3251 sys.prefix+'python.exe' as the executable path. It turns out that
3239 during the post-installation run, sys.executable resolves to the
3252 during the post-installation run, sys.executable resolves to the
3240 name of the binary installer! I should report this as a distutils
3253 name of the binary installer! I should report this as a distutils
3241 bug, I think. I updated the .10 release with this tiny fix, to
3254 bug, I think. I updated the .10 release with this tiny fix, to
3242 avoid annoying the lists further.
3255 avoid annoying the lists further.
3243
3256
3244 2005-01-27 *** Released version 0.6.10
3257 2005-01-27 *** Released version 0.6.10
3245
3258
3246 2005-01-27 Fernando Perez <fperez@colorado.edu>
3259 2005-01-27 Fernando Perez <fperez@colorado.edu>
3247
3260
3248 * IPython/numutils.py (norm): Added 'inf' as optional name for
3261 * IPython/numutils.py (norm): Added 'inf' as optional name for
3249 L-infinity norm, included references to mathworld.com for vector
3262 L-infinity norm, included references to mathworld.com for vector
3250 norm definitions.
3263 norm definitions.
3251 (amin/amax): added amin/amax for array min/max. Similar to what
3264 (amin/amax): added amin/amax for array min/max. Similar to what
3252 pylab ships with after the recent reorganization of names.
3265 pylab ships with after the recent reorganization of names.
3253 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3266 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3254
3267
3255 * ipython.el: committed Alex's recent fixes and improvements.
3268 * ipython.el: committed Alex's recent fixes and improvements.
3256 Tested with python-mode from CVS, and it looks excellent. Since
3269 Tested with python-mode from CVS, and it looks excellent. Since
3257 python-mode hasn't released anything in a while, I'm temporarily
3270 python-mode hasn't released anything in a while, I'm temporarily
3258 putting a copy of today's CVS (v 4.70) of python-mode in:
3271 putting a copy of today's CVS (v 4.70) of python-mode in:
3259 http://ipython.scipy.org/tmp/python-mode.el
3272 http://ipython.scipy.org/tmp/python-mode.el
3260
3273
3261 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3274 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3262 sys.executable for the executable name, instead of assuming it's
3275 sys.executable for the executable name, instead of assuming it's
3263 called 'python.exe' (the post-installer would have produced broken
3276 called 'python.exe' (the post-installer would have produced broken
3264 setups on systems with a differently named python binary).
3277 setups on systems with a differently named python binary).
3265
3278
3266 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3279 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3267 references to os.linesep, to make the code more
3280 references to os.linesep, to make the code more
3268 platform-independent. This is also part of the win32 coloring
3281 platform-independent. This is also part of the win32 coloring
3269 fixes.
3282 fixes.
3270
3283
3271 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3284 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3272 lines, which actually cause coloring bugs because the length of
3285 lines, which actually cause coloring bugs because the length of
3273 the line is very difficult to correctly compute with embedded
3286 the line is very difficult to correctly compute with embedded
3274 escapes. This was the source of all the coloring problems under
3287 escapes. This was the source of all the coloring problems under
3275 Win32. I think that _finally_, Win32 users have a properly
3288 Win32. I think that _finally_, Win32 users have a properly
3276 working ipython in all respects. This would never have happened
3289 working ipython in all respects. This would never have happened
3277 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3290 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3278
3291
3279 2005-01-26 *** Released version 0.6.9
3292 2005-01-26 *** Released version 0.6.9
3280
3293
3281 2005-01-25 Fernando Perez <fperez@colorado.edu>
3294 2005-01-25 Fernando Perez <fperez@colorado.edu>
3282
3295
3283 * setup.py: finally, we have a true Windows installer, thanks to
3296 * setup.py: finally, we have a true Windows installer, thanks to
3284 the excellent work of Viktor Ransmayr
3297 the excellent work of Viktor Ransmayr
3285 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3298 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3286 Windows users. The setup routine is quite a bit cleaner thanks to
3299 Windows users. The setup routine is quite a bit cleaner thanks to
3287 this, and the post-install script uses the proper functions to
3300 this, and the post-install script uses the proper functions to
3288 allow a clean de-installation using the standard Windows Control
3301 allow a clean de-installation using the standard Windows Control
3289 Panel.
3302 Panel.
3290
3303
3291 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3304 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3292 environment variable under all OSes (including win32) if
3305 environment variable under all OSes (including win32) if
3293 available. This will give consistency to win32 users who have set
3306 available. This will give consistency to win32 users who have set
3294 this variable for any reason. If os.environ['HOME'] fails, the
3307 this variable for any reason. If os.environ['HOME'] fails, the
3295 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3308 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3296
3309
3297 2005-01-24 Fernando Perez <fperez@colorado.edu>
3310 2005-01-24 Fernando Perez <fperez@colorado.edu>
3298
3311
3299 * IPython/numutils.py (empty_like): add empty_like(), similar to
3312 * IPython/numutils.py (empty_like): add empty_like(), similar to
3300 zeros_like() but taking advantage of the new empty() Numeric routine.
3313 zeros_like() but taking advantage of the new empty() Numeric routine.
3301
3314
3302 2005-01-23 *** Released version 0.6.8
3315 2005-01-23 *** Released version 0.6.8
3303
3316
3304 2005-01-22 Fernando Perez <fperez@colorado.edu>
3317 2005-01-22 Fernando Perez <fperez@colorado.edu>
3305
3318
3306 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3319 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3307 automatic show() calls. After discussing things with JDH, it
3320 automatic show() calls. After discussing things with JDH, it
3308 turns out there are too many corner cases where this can go wrong.
3321 turns out there are too many corner cases where this can go wrong.
3309 It's best not to try to be 'too smart', and simply have ipython
3322 It's best not to try to be 'too smart', and simply have ipython
3310 reproduce as much as possible the default behavior of a normal
3323 reproduce as much as possible the default behavior of a normal
3311 python shell.
3324 python shell.
3312
3325
3313 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3326 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3314 line-splitting regexp and _prefilter() to avoid calling getattr()
3327 line-splitting regexp and _prefilter() to avoid calling getattr()
3315 on assignments. This closes
3328 on assignments. This closes
3316 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3329 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3317 readline uses getattr(), so a simple <TAB> keypress is still
3330 readline uses getattr(), so a simple <TAB> keypress is still
3318 enough to trigger getattr() calls on an object.
3331 enough to trigger getattr() calls on an object.
3319
3332
3320 2005-01-21 Fernando Perez <fperez@colorado.edu>
3333 2005-01-21 Fernando Perez <fperez@colorado.edu>
3321
3334
3322 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3335 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3323 docstring under pylab so it doesn't mask the original.
3336 docstring under pylab so it doesn't mask the original.
3324
3337
3325 2005-01-21 *** Released version 0.6.7
3338 2005-01-21 *** Released version 0.6.7
3326
3339
3327 2005-01-21 Fernando Perez <fperez@colorado.edu>
3340 2005-01-21 Fernando Perez <fperez@colorado.edu>
3328
3341
3329 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3342 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3330 signal handling for win32 users in multithreaded mode.
3343 signal handling for win32 users in multithreaded mode.
3331
3344
3332 2005-01-17 Fernando Perez <fperez@colorado.edu>
3345 2005-01-17 Fernando Perez <fperez@colorado.edu>
3333
3346
3334 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3347 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3335 instances with no __init__. After a crash report by Norbert Nemec
3348 instances with no __init__. After a crash report by Norbert Nemec
3336 <Norbert-AT-nemec-online.de>.
3349 <Norbert-AT-nemec-online.de>.
3337
3350
3338 2005-01-14 Fernando Perez <fperez@colorado.edu>
3351 2005-01-14 Fernando Perez <fperez@colorado.edu>
3339
3352
3340 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3353 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3341 names for verbose exceptions, when multiple dotted names and the
3354 names for verbose exceptions, when multiple dotted names and the
3342 'parent' object were present on the same line.
3355 'parent' object were present on the same line.
3343
3356
3344 2005-01-11 Fernando Perez <fperez@colorado.edu>
3357 2005-01-11 Fernando Perez <fperez@colorado.edu>
3345
3358
3346 * IPython/genutils.py (flag_calls): new utility to trap and flag
3359 * IPython/genutils.py (flag_calls): new utility to trap and flag
3347 calls in functions. I need it to clean up matplotlib support.
3360 calls in functions. I need it to clean up matplotlib support.
3348 Also removed some deprecated code in genutils.
3361 Also removed some deprecated code in genutils.
3349
3362
3350 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3363 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3351 that matplotlib scripts called with %run, which don't call show()
3364 that matplotlib scripts called with %run, which don't call show()
3352 themselves, still have their plotting windows open.
3365 themselves, still have their plotting windows open.
3353
3366
3354 2005-01-05 Fernando Perez <fperez@colorado.edu>
3367 2005-01-05 Fernando Perez <fperez@colorado.edu>
3355
3368
3356 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3369 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3357 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3370 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3358
3371
3359 2004-12-19 Fernando Perez <fperez@colorado.edu>
3372 2004-12-19 Fernando Perez <fperez@colorado.edu>
3360
3373
3361 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3374 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3362 parent_runcode, which was an eyesore. The same result can be
3375 parent_runcode, which was an eyesore. The same result can be
3363 obtained with Python's regular superclass mechanisms.
3376 obtained with Python's regular superclass mechanisms.
3364
3377
3365 2004-12-17 Fernando Perez <fperez@colorado.edu>
3378 2004-12-17 Fernando Perez <fperez@colorado.edu>
3366
3379
3367 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3380 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3368 reported by Prabhu.
3381 reported by Prabhu.
3369 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3382 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3370 sys.stderr) instead of explicitly calling sys.stderr. This helps
3383 sys.stderr) instead of explicitly calling sys.stderr. This helps
3371 maintain our I/O abstractions clean, for future GUI embeddings.
3384 maintain our I/O abstractions clean, for future GUI embeddings.
3372
3385
3373 * IPython/genutils.py (info): added new utility for sys.stderr
3386 * IPython/genutils.py (info): added new utility for sys.stderr
3374 unified info message handling (thin wrapper around warn()).
3387 unified info message handling (thin wrapper around warn()).
3375
3388
3376 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3389 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3377 composite (dotted) names on verbose exceptions.
3390 composite (dotted) names on verbose exceptions.
3378 (VerboseTB.nullrepr): harden against another kind of errors which
3391 (VerboseTB.nullrepr): harden against another kind of errors which
3379 Python's inspect module can trigger, and which were crashing
3392 Python's inspect module can trigger, and which were crashing
3380 IPython. Thanks to a report by Marco Lombardi
3393 IPython. Thanks to a report by Marco Lombardi
3381 <mlombard-AT-ma010192.hq.eso.org>.
3394 <mlombard-AT-ma010192.hq.eso.org>.
3382
3395
3383 2004-12-13 *** Released version 0.6.6
3396 2004-12-13 *** Released version 0.6.6
3384
3397
3385 2004-12-12 Fernando Perez <fperez@colorado.edu>
3398 2004-12-12 Fernando Perez <fperez@colorado.edu>
3386
3399
3387 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3400 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3388 generated by pygtk upon initialization if it was built without
3401 generated by pygtk upon initialization if it was built without
3389 threads (for matplotlib users). After a crash reported by
3402 threads (for matplotlib users). After a crash reported by
3390 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3403 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3391
3404
3392 * IPython/ipmaker.py (make_IPython): fix small bug in the
3405 * IPython/ipmaker.py (make_IPython): fix small bug in the
3393 import_some parameter for multiple imports.
3406 import_some parameter for multiple imports.
3394
3407
3395 * IPython/iplib.py (ipmagic): simplified the interface of
3408 * IPython/iplib.py (ipmagic): simplified the interface of
3396 ipmagic() to take a single string argument, just as it would be
3409 ipmagic() to take a single string argument, just as it would be
3397 typed at the IPython cmd line.
3410 typed at the IPython cmd line.
3398 (ipalias): Added new ipalias() with an interface identical to
3411 (ipalias): Added new ipalias() with an interface identical to
3399 ipmagic(). This completes exposing a pure python interface to the
3412 ipmagic(). This completes exposing a pure python interface to the
3400 alias and magic system, which can be used in loops or more complex
3413 alias and magic system, which can be used in loops or more complex
3401 code where IPython's automatic line mangling is not active.
3414 code where IPython's automatic line mangling is not active.
3402
3415
3403 * IPython/genutils.py (timing): changed interface of timing to
3416 * IPython/genutils.py (timing): changed interface of timing to
3404 simply run code once, which is the most common case. timings()
3417 simply run code once, which is the most common case. timings()
3405 remains unchanged, for the cases where you want multiple runs.
3418 remains unchanged, for the cases where you want multiple runs.
3406
3419
3407 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3420 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3408 bug where Python2.2 crashes with exec'ing code which does not end
3421 bug where Python2.2 crashes with exec'ing code which does not end
3409 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3422 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3410 before.
3423 before.
3411
3424
3412 2004-12-10 Fernando Perez <fperez@colorado.edu>
3425 2004-12-10 Fernando Perez <fperez@colorado.edu>
3413
3426
3414 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3427 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3415 -t to -T, to accomodate the new -t flag in %run (the %run and
3428 -t to -T, to accomodate the new -t flag in %run (the %run and
3416 %prun options are kind of intermixed, and it's not easy to change
3429 %prun options are kind of intermixed, and it's not easy to change
3417 this with the limitations of python's getopt).
3430 this with the limitations of python's getopt).
3418
3431
3419 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3432 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3420 the execution of scripts. It's not as fine-tuned as timeit.py,
3433 the execution of scripts. It's not as fine-tuned as timeit.py,
3421 but it works from inside ipython (and under 2.2, which lacks
3434 but it works from inside ipython (and under 2.2, which lacks
3422 timeit.py). Optionally a number of runs > 1 can be given for
3435 timeit.py). Optionally a number of runs > 1 can be given for
3423 timing very short-running code.
3436 timing very short-running code.
3424
3437
3425 * IPython/genutils.py (uniq_stable): new routine which returns a
3438 * IPython/genutils.py (uniq_stable): new routine which returns a
3426 list of unique elements in any iterable, but in stable order of
3439 list of unique elements in any iterable, but in stable order of
3427 appearance. I needed this for the ultraTB fixes, and it's a handy
3440 appearance. I needed this for the ultraTB fixes, and it's a handy
3428 utility.
3441 utility.
3429
3442
3430 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3443 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3431 dotted names in Verbose exceptions. This had been broken since
3444 dotted names in Verbose exceptions. This had been broken since
3432 the very start, now x.y will properly be printed in a Verbose
3445 the very start, now x.y will properly be printed in a Verbose
3433 traceback, instead of x being shown and y appearing always as an
3446 traceback, instead of x being shown and y appearing always as an
3434 'undefined global'. Getting this to work was a bit tricky,
3447 'undefined global'. Getting this to work was a bit tricky,
3435 because by default python tokenizers are stateless. Saved by
3448 because by default python tokenizers are stateless. Saved by
3436 python's ability to easily add a bit of state to an arbitrary
3449 python's ability to easily add a bit of state to an arbitrary
3437 function (without needing to build a full-blown callable object).
3450 function (without needing to build a full-blown callable object).
3438
3451
3439 Also big cleanup of this code, which had horrendous runtime
3452 Also big cleanup of this code, which had horrendous runtime
3440 lookups of zillions of attributes for colorization. Moved all
3453 lookups of zillions of attributes for colorization. Moved all
3441 this code into a few templates, which make it cleaner and quicker.
3454 this code into a few templates, which make it cleaner and quicker.
3442
3455
3443 Printout quality was also improved for Verbose exceptions: one
3456 Printout quality was also improved for Verbose exceptions: one
3444 variable per line, and memory addresses are printed (this can be
3457 variable per line, and memory addresses are printed (this can be
3445 quite handy in nasty debugging situations, which is what Verbose
3458 quite handy in nasty debugging situations, which is what Verbose
3446 is for).
3459 is for).
3447
3460
3448 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3461 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3449 the command line as scripts to be loaded by embedded instances.
3462 the command line as scripts to be loaded by embedded instances.
3450 Doing so has the potential for an infinite recursion if there are
3463 Doing so has the potential for an infinite recursion if there are
3451 exceptions thrown in the process. This fixes a strange crash
3464 exceptions thrown in the process. This fixes a strange crash
3452 reported by Philippe MULLER <muller-AT-irit.fr>.
3465 reported by Philippe MULLER <muller-AT-irit.fr>.
3453
3466
3454 2004-12-09 Fernando Perez <fperez@colorado.edu>
3467 2004-12-09 Fernando Perez <fperez@colorado.edu>
3455
3468
3456 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3469 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3457 to reflect new names in matplotlib, which now expose the
3470 to reflect new names in matplotlib, which now expose the
3458 matlab-compatible interface via a pylab module instead of the
3471 matlab-compatible interface via a pylab module instead of the
3459 'matlab' name. The new code is backwards compatible, so users of
3472 'matlab' name. The new code is backwards compatible, so users of
3460 all matplotlib versions are OK. Patch by J. Hunter.
3473 all matplotlib versions are OK. Patch by J. Hunter.
3461
3474
3462 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3475 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3463 of __init__ docstrings for instances (class docstrings are already
3476 of __init__ docstrings for instances (class docstrings are already
3464 automatically printed). Instances with customized docstrings
3477 automatically printed). Instances with customized docstrings
3465 (indep. of the class) are also recognized and all 3 separate
3478 (indep. of the class) are also recognized and all 3 separate
3466 docstrings are printed (instance, class, constructor). After some
3479 docstrings are printed (instance, class, constructor). After some
3467 comments/suggestions by J. Hunter.
3480 comments/suggestions by J. Hunter.
3468
3481
3469 2004-12-05 Fernando Perez <fperez@colorado.edu>
3482 2004-12-05 Fernando Perez <fperez@colorado.edu>
3470
3483
3471 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3484 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3472 warnings when tab-completion fails and triggers an exception.
3485 warnings when tab-completion fails and triggers an exception.
3473
3486
3474 2004-12-03 Fernando Perez <fperez@colorado.edu>
3487 2004-12-03 Fernando Perez <fperez@colorado.edu>
3475
3488
3476 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3489 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3477 be triggered when using 'run -p'. An incorrect option flag was
3490 be triggered when using 'run -p'. An incorrect option flag was
3478 being set ('d' instead of 'D').
3491 being set ('d' instead of 'D').
3479 (manpage): fix missing escaped \- sign.
3492 (manpage): fix missing escaped \- sign.
3480
3493
3481 2004-11-30 *** Released version 0.6.5
3494 2004-11-30 *** Released version 0.6.5
3482
3495
3483 2004-11-30 Fernando Perez <fperez@colorado.edu>
3496 2004-11-30 Fernando Perez <fperez@colorado.edu>
3484
3497
3485 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3498 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3486 setting with -d option.
3499 setting with -d option.
3487
3500
3488 * setup.py (docfiles): Fix problem where the doc glob I was using
3501 * setup.py (docfiles): Fix problem where the doc glob I was using
3489 was COMPLETELY BROKEN. It was giving the right files by pure
3502 was COMPLETELY BROKEN. It was giving the right files by pure
3490 accident, but failed once I tried to include ipython.el. Note:
3503 accident, but failed once I tried to include ipython.el. Note:
3491 glob() does NOT allow you to do exclusion on multiple endings!
3504 glob() does NOT allow you to do exclusion on multiple endings!
3492
3505
3493 2004-11-29 Fernando Perez <fperez@colorado.edu>
3506 2004-11-29 Fernando Perez <fperez@colorado.edu>
3494
3507
3495 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3508 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3496 the manpage as the source. Better formatting & consistency.
3509 the manpage as the source. Better formatting & consistency.
3497
3510
3498 * IPython/Magic.py (magic_run): Added new -d option, to run
3511 * IPython/Magic.py (magic_run): Added new -d option, to run
3499 scripts under the control of the python pdb debugger. Note that
3512 scripts under the control of the python pdb debugger. Note that
3500 this required changing the %prun option -d to -D, to avoid a clash
3513 this required changing the %prun option -d to -D, to avoid a clash
3501 (since %run must pass options to %prun, and getopt is too dumb to
3514 (since %run must pass options to %prun, and getopt is too dumb to
3502 handle options with string values with embedded spaces). Thanks
3515 handle options with string values with embedded spaces). Thanks
3503 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3516 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3504 (magic_who_ls): added type matching to %who and %whos, so that one
3517 (magic_who_ls): added type matching to %who and %whos, so that one
3505 can filter their output to only include variables of certain
3518 can filter their output to only include variables of certain
3506 types. Another suggestion by Matthew.
3519 types. Another suggestion by Matthew.
3507 (magic_whos): Added memory summaries in kb and Mb for arrays.
3520 (magic_whos): Added memory summaries in kb and Mb for arrays.
3508 (magic_who): Improve formatting (break lines every 9 vars).
3521 (magic_who): Improve formatting (break lines every 9 vars).
3509
3522
3510 2004-11-28 Fernando Perez <fperez@colorado.edu>
3523 2004-11-28 Fernando Perez <fperez@colorado.edu>
3511
3524
3512 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3525 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3513 cache when empty lines were present.
3526 cache when empty lines were present.
3514
3527
3515 2004-11-24 Fernando Perez <fperez@colorado.edu>
3528 2004-11-24 Fernando Perez <fperez@colorado.edu>
3516
3529
3517 * IPython/usage.py (__doc__): document the re-activated threading
3530 * IPython/usage.py (__doc__): document the re-activated threading
3518 options for WX and GTK.
3531 options for WX and GTK.
3519
3532
3520 2004-11-23 Fernando Perez <fperez@colorado.edu>
3533 2004-11-23 Fernando Perez <fperez@colorado.edu>
3521
3534
3522 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3535 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3523 the -wthread and -gthread options, along with a new -tk one to try
3536 the -wthread and -gthread options, along with a new -tk one to try
3524 and coordinate Tk threading with wx/gtk. The tk support is very
3537 and coordinate Tk threading with wx/gtk. The tk support is very
3525 platform dependent, since it seems to require Tcl and Tk to be
3538 platform dependent, since it seems to require Tcl and Tk to be
3526 built with threads (Fedora1/2 appears NOT to have it, but in
3539 built with threads (Fedora1/2 appears NOT to have it, but in
3527 Prabhu's Debian boxes it works OK). But even with some Tk
3540 Prabhu's Debian boxes it works OK). But even with some Tk
3528 limitations, this is a great improvement.
3541 limitations, this is a great improvement.
3529
3542
3530 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3543 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3531 info in user prompts. Patch by Prabhu.
3544 info in user prompts. Patch by Prabhu.
3532
3545
3533 2004-11-18 Fernando Perez <fperez@colorado.edu>
3546 2004-11-18 Fernando Perez <fperez@colorado.edu>
3534
3547
3535 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3548 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3536 EOFErrors and bail, to avoid infinite loops if a non-terminating
3549 EOFErrors and bail, to avoid infinite loops if a non-terminating
3537 file is fed into ipython. Patch submitted in issue 19 by user,
3550 file is fed into ipython. Patch submitted in issue 19 by user,
3538 many thanks.
3551 many thanks.
3539
3552
3540 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3553 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3541 autoquote/parens in continuation prompts, which can cause lots of
3554 autoquote/parens in continuation prompts, which can cause lots of
3542 problems. Closes roundup issue 20.
3555 problems. Closes roundup issue 20.
3543
3556
3544 2004-11-17 Fernando Perez <fperez@colorado.edu>
3557 2004-11-17 Fernando Perez <fperez@colorado.edu>
3545
3558
3546 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3559 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3547 reported as debian bug #280505. I'm not sure my local changelog
3560 reported as debian bug #280505. I'm not sure my local changelog
3548 entry has the proper debian format (Jack?).
3561 entry has the proper debian format (Jack?).
3549
3562
3550 2004-11-08 *** Released version 0.6.4
3563 2004-11-08 *** Released version 0.6.4
3551
3564
3552 2004-11-08 Fernando Perez <fperez@colorado.edu>
3565 2004-11-08 Fernando Perez <fperez@colorado.edu>
3553
3566
3554 * IPython/iplib.py (init_readline): Fix exit message for Windows
3567 * IPython/iplib.py (init_readline): Fix exit message for Windows
3555 when readline is active. Thanks to a report by Eric Jones
3568 when readline is active. Thanks to a report by Eric Jones
3556 <eric-AT-enthought.com>.
3569 <eric-AT-enthought.com>.
3557
3570
3558 2004-11-07 Fernando Perez <fperez@colorado.edu>
3571 2004-11-07 Fernando Perez <fperez@colorado.edu>
3559
3572
3560 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3573 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3561 sometimes seen by win2k/cygwin users.
3574 sometimes seen by win2k/cygwin users.
3562
3575
3563 2004-11-06 Fernando Perez <fperez@colorado.edu>
3576 2004-11-06 Fernando Perez <fperez@colorado.edu>
3564
3577
3565 * IPython/iplib.py (interact): Change the handling of %Exit from
3578 * IPython/iplib.py (interact): Change the handling of %Exit from
3566 trying to propagate a SystemExit to an internal ipython flag.
3579 trying to propagate a SystemExit to an internal ipython flag.
3567 This is less elegant than using Python's exception mechanism, but
3580 This is less elegant than using Python's exception mechanism, but
3568 I can't get that to work reliably with threads, so under -pylab
3581 I can't get that to work reliably with threads, so under -pylab
3569 %Exit was hanging IPython. Cross-thread exception handling is
3582 %Exit was hanging IPython. Cross-thread exception handling is
3570 really a bitch. Thaks to a bug report by Stephen Walton
3583 really a bitch. Thaks to a bug report by Stephen Walton
3571 <stephen.walton-AT-csun.edu>.
3584 <stephen.walton-AT-csun.edu>.
3572
3585
3573 2004-11-04 Fernando Perez <fperez@colorado.edu>
3586 2004-11-04 Fernando Perez <fperez@colorado.edu>
3574
3587
3575 * IPython/iplib.py (raw_input_original): store a pointer to the
3588 * IPython/iplib.py (raw_input_original): store a pointer to the
3576 true raw_input to harden against code which can modify it
3589 true raw_input to harden against code which can modify it
3577 (wx.py.PyShell does this and would otherwise crash ipython).
3590 (wx.py.PyShell does this and would otherwise crash ipython).
3578 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3591 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3579
3592
3580 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3593 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3581 Ctrl-C problem, which does not mess up the input line.
3594 Ctrl-C problem, which does not mess up the input line.
3582
3595
3583 2004-11-03 Fernando Perez <fperez@colorado.edu>
3596 2004-11-03 Fernando Perez <fperez@colorado.edu>
3584
3597
3585 * IPython/Release.py: Changed licensing to BSD, in all files.
3598 * IPython/Release.py: Changed licensing to BSD, in all files.
3586 (name): lowercase name for tarball/RPM release.
3599 (name): lowercase name for tarball/RPM release.
3587
3600
3588 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3601 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3589 use throughout ipython.
3602 use throughout ipython.
3590
3603
3591 * IPython/Magic.py (Magic._ofind): Switch to using the new
3604 * IPython/Magic.py (Magic._ofind): Switch to using the new
3592 OInspect.getdoc() function.
3605 OInspect.getdoc() function.
3593
3606
3594 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3607 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3595 of the line currently being canceled via Ctrl-C. It's extremely
3608 of the line currently being canceled via Ctrl-C. It's extremely
3596 ugly, but I don't know how to do it better (the problem is one of
3609 ugly, but I don't know how to do it better (the problem is one of
3597 handling cross-thread exceptions).
3610 handling cross-thread exceptions).
3598
3611
3599 2004-10-28 Fernando Perez <fperez@colorado.edu>
3612 2004-10-28 Fernando Perez <fperez@colorado.edu>
3600
3613
3601 * IPython/Shell.py (signal_handler): add signal handlers to trap
3614 * IPython/Shell.py (signal_handler): add signal handlers to trap
3602 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3615 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3603 report by Francesc Alted.
3616 report by Francesc Alted.
3604
3617
3605 2004-10-21 Fernando Perez <fperez@colorado.edu>
3618 2004-10-21 Fernando Perez <fperez@colorado.edu>
3606
3619
3607 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3620 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3608 to % for pysh syntax extensions.
3621 to % for pysh syntax extensions.
3609
3622
3610 2004-10-09 Fernando Perez <fperez@colorado.edu>
3623 2004-10-09 Fernando Perez <fperez@colorado.edu>
3611
3624
3612 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3625 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3613 arrays to print a more useful summary, without calling str(arr).
3626 arrays to print a more useful summary, without calling str(arr).
3614 This avoids the problem of extremely lengthy computations which
3627 This avoids the problem of extremely lengthy computations which
3615 occur if arr is large, and appear to the user as a system lockup
3628 occur if arr is large, and appear to the user as a system lockup
3616 with 100% cpu activity. After a suggestion by Kristian Sandberg
3629 with 100% cpu activity. After a suggestion by Kristian Sandberg
3617 <Kristian.Sandberg@colorado.edu>.
3630 <Kristian.Sandberg@colorado.edu>.
3618 (Magic.__init__): fix bug in global magic escapes not being
3631 (Magic.__init__): fix bug in global magic escapes not being
3619 correctly set.
3632 correctly set.
3620
3633
3621 2004-10-08 Fernando Perez <fperez@colorado.edu>
3634 2004-10-08 Fernando Perez <fperez@colorado.edu>
3622
3635
3623 * IPython/Magic.py (__license__): change to absolute imports of
3636 * IPython/Magic.py (__license__): change to absolute imports of
3624 ipython's own internal packages, to start adapting to the absolute
3637 ipython's own internal packages, to start adapting to the absolute
3625 import requirement of PEP-328.
3638 import requirement of PEP-328.
3626
3639
3627 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3640 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3628 files, and standardize author/license marks through the Release
3641 files, and standardize author/license marks through the Release
3629 module instead of having per/file stuff (except for files with
3642 module instead of having per/file stuff (except for files with
3630 particular licenses, like the MIT/PSF-licensed codes).
3643 particular licenses, like the MIT/PSF-licensed codes).
3631
3644
3632 * IPython/Debugger.py: remove dead code for python 2.1
3645 * IPython/Debugger.py: remove dead code for python 2.1
3633
3646
3634 2004-10-04 Fernando Perez <fperez@colorado.edu>
3647 2004-10-04 Fernando Perez <fperez@colorado.edu>
3635
3648
3636 * IPython/iplib.py (ipmagic): New function for accessing magics
3649 * IPython/iplib.py (ipmagic): New function for accessing magics
3637 via a normal python function call.
3650 via a normal python function call.
3638
3651
3639 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3652 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3640 from '@' to '%', to accomodate the new @decorator syntax of python
3653 from '@' to '%', to accomodate the new @decorator syntax of python
3641 2.4.
3654 2.4.
3642
3655
3643 2004-09-29 Fernando Perez <fperez@colorado.edu>
3656 2004-09-29 Fernando Perez <fperez@colorado.edu>
3644
3657
3645 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3658 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3646 matplotlib.use to prevent running scripts which try to switch
3659 matplotlib.use to prevent running scripts which try to switch
3647 interactive backends from within ipython. This will just crash
3660 interactive backends from within ipython. This will just crash
3648 the python interpreter, so we can't allow it (but a detailed error
3661 the python interpreter, so we can't allow it (but a detailed error
3649 is given to the user).
3662 is given to the user).
3650
3663
3651 2004-09-28 Fernando Perez <fperez@colorado.edu>
3664 2004-09-28 Fernando Perez <fperez@colorado.edu>
3652
3665
3653 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3666 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3654 matplotlib-related fixes so that using @run with non-matplotlib
3667 matplotlib-related fixes so that using @run with non-matplotlib
3655 scripts doesn't pop up spurious plot windows. This requires
3668 scripts doesn't pop up spurious plot windows. This requires
3656 matplotlib >= 0.63, where I had to make some changes as well.
3669 matplotlib >= 0.63, where I had to make some changes as well.
3657
3670
3658 * IPython/ipmaker.py (make_IPython): update version requirement to
3671 * IPython/ipmaker.py (make_IPython): update version requirement to
3659 python 2.2.
3672 python 2.2.
3660
3673
3661 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3674 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3662 banner arg for embedded customization.
3675 banner arg for embedded customization.
3663
3676
3664 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3677 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3665 explicit uses of __IP as the IPython's instance name. Now things
3678 explicit uses of __IP as the IPython's instance name. Now things
3666 are properly handled via the shell.name value. The actual code
3679 are properly handled via the shell.name value. The actual code
3667 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3680 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3668 is much better than before. I'll clean things completely when the
3681 is much better than before. I'll clean things completely when the
3669 magic stuff gets a real overhaul.
3682 magic stuff gets a real overhaul.
3670
3683
3671 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3684 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3672 minor changes to debian dir.
3685 minor changes to debian dir.
3673
3686
3674 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3687 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3675 pointer to the shell itself in the interactive namespace even when
3688 pointer to the shell itself in the interactive namespace even when
3676 a user-supplied dict is provided. This is needed for embedding
3689 a user-supplied dict is provided. This is needed for embedding
3677 purposes (found by tests with Michel Sanner).
3690 purposes (found by tests with Michel Sanner).
3678
3691
3679 2004-09-27 Fernando Perez <fperez@colorado.edu>
3692 2004-09-27 Fernando Perez <fperez@colorado.edu>
3680
3693
3681 * IPython/UserConfig/ipythonrc: remove []{} from
3694 * IPython/UserConfig/ipythonrc: remove []{} from
3682 readline_remove_delims, so that things like [modname.<TAB> do
3695 readline_remove_delims, so that things like [modname.<TAB> do
3683 proper completion. This disables [].TAB, but that's a less common
3696 proper completion. This disables [].TAB, but that's a less common
3684 case than module names in list comprehensions, for example.
3697 case than module names in list comprehensions, for example.
3685 Thanks to a report by Andrea Riciputi.
3698 Thanks to a report by Andrea Riciputi.
3686
3699
3687 2004-09-09 Fernando Perez <fperez@colorado.edu>
3700 2004-09-09 Fernando Perez <fperez@colorado.edu>
3688
3701
3689 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3702 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3690 blocking problems in win32 and osx. Fix by John.
3703 blocking problems in win32 and osx. Fix by John.
3691
3704
3692 2004-09-08 Fernando Perez <fperez@colorado.edu>
3705 2004-09-08 Fernando Perez <fperez@colorado.edu>
3693
3706
3694 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3707 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3695 for Win32 and OSX. Fix by John Hunter.
3708 for Win32 and OSX. Fix by John Hunter.
3696
3709
3697 2004-08-30 *** Released version 0.6.3
3710 2004-08-30 *** Released version 0.6.3
3698
3711
3699 2004-08-30 Fernando Perez <fperez@colorado.edu>
3712 2004-08-30 Fernando Perez <fperez@colorado.edu>
3700
3713
3701 * setup.py (isfile): Add manpages to list of dependent files to be
3714 * setup.py (isfile): Add manpages to list of dependent files to be
3702 updated.
3715 updated.
3703
3716
3704 2004-08-27 Fernando Perez <fperez@colorado.edu>
3717 2004-08-27 Fernando Perez <fperez@colorado.edu>
3705
3718
3706 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3719 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3707 for now. They don't really work with standalone WX/GTK code
3720 for now. They don't really work with standalone WX/GTK code
3708 (though matplotlib IS working fine with both of those backends).
3721 (though matplotlib IS working fine with both of those backends).
3709 This will neeed much more testing. I disabled most things with
3722 This will neeed much more testing. I disabled most things with
3710 comments, so turning it back on later should be pretty easy.
3723 comments, so turning it back on later should be pretty easy.
3711
3724
3712 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3725 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3713 autocalling of expressions like r'foo', by modifying the line
3726 autocalling of expressions like r'foo', by modifying the line
3714 split regexp. Closes
3727 split regexp. Closes
3715 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3728 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3716 Riley <ipythonbugs-AT-sabi.net>.
3729 Riley <ipythonbugs-AT-sabi.net>.
3717 (InteractiveShell.mainloop): honor --nobanner with banner
3730 (InteractiveShell.mainloop): honor --nobanner with banner
3718 extensions.
3731 extensions.
3719
3732
3720 * IPython/Shell.py: Significant refactoring of all classes, so
3733 * IPython/Shell.py: Significant refactoring of all classes, so
3721 that we can really support ALL matplotlib backends and threading
3734 that we can really support ALL matplotlib backends and threading
3722 models (John spotted a bug with Tk which required this). Now we
3735 models (John spotted a bug with Tk which required this). Now we
3723 should support single-threaded, WX-threads and GTK-threads, both
3736 should support single-threaded, WX-threads and GTK-threads, both
3724 for generic code and for matplotlib.
3737 for generic code and for matplotlib.
3725
3738
3726 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3739 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3727 -pylab, to simplify things for users. Will also remove the pylab
3740 -pylab, to simplify things for users. Will also remove the pylab
3728 profile, since now all of matplotlib configuration is directly
3741 profile, since now all of matplotlib configuration is directly
3729 handled here. This also reduces startup time.
3742 handled here. This also reduces startup time.
3730
3743
3731 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3744 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3732 shell wasn't being correctly called. Also in IPShellWX.
3745 shell wasn't being correctly called. Also in IPShellWX.
3733
3746
3734 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3747 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3735 fine-tune banner.
3748 fine-tune banner.
3736
3749
3737 * IPython/numutils.py (spike): Deprecate these spike functions,
3750 * IPython/numutils.py (spike): Deprecate these spike functions,
3738 delete (long deprecated) gnuplot_exec handler.
3751 delete (long deprecated) gnuplot_exec handler.
3739
3752
3740 2004-08-26 Fernando Perez <fperez@colorado.edu>
3753 2004-08-26 Fernando Perez <fperez@colorado.edu>
3741
3754
3742 * ipython.1: Update for threading options, plus some others which
3755 * ipython.1: Update for threading options, plus some others which
3743 were missing.
3756 were missing.
3744
3757
3745 * IPython/ipmaker.py (__call__): Added -wthread option for
3758 * IPython/ipmaker.py (__call__): Added -wthread option for
3746 wxpython thread handling. Make sure threading options are only
3759 wxpython thread handling. Make sure threading options are only
3747 valid at the command line.
3760 valid at the command line.
3748
3761
3749 * scripts/ipython: moved shell selection into a factory function
3762 * scripts/ipython: moved shell selection into a factory function
3750 in Shell.py, to keep the starter script to a minimum.
3763 in Shell.py, to keep the starter script to a minimum.
3751
3764
3752 2004-08-25 Fernando Perez <fperez@colorado.edu>
3765 2004-08-25 Fernando Perez <fperez@colorado.edu>
3753
3766
3754 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3767 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3755 John. Along with some recent changes he made to matplotlib, the
3768 John. Along with some recent changes he made to matplotlib, the
3756 next versions of both systems should work very well together.
3769 next versions of both systems should work very well together.
3757
3770
3758 2004-08-24 Fernando Perez <fperez@colorado.edu>
3771 2004-08-24 Fernando Perez <fperez@colorado.edu>
3759
3772
3760 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3773 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3761 tried to switch the profiling to using hotshot, but I'm getting
3774 tried to switch the profiling to using hotshot, but I'm getting
3762 strange errors from prof.runctx() there. I may be misreading the
3775 strange errors from prof.runctx() there. I may be misreading the
3763 docs, but it looks weird. For now the profiling code will
3776 docs, but it looks weird. For now the profiling code will
3764 continue to use the standard profiler.
3777 continue to use the standard profiler.
3765
3778
3766 2004-08-23 Fernando Perez <fperez@colorado.edu>
3779 2004-08-23 Fernando Perez <fperez@colorado.edu>
3767
3780
3768 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3781 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3769 threaded shell, by John Hunter. It's not quite ready yet, but
3782 threaded shell, by John Hunter. It's not quite ready yet, but
3770 close.
3783 close.
3771
3784
3772 2004-08-22 Fernando Perez <fperez@colorado.edu>
3785 2004-08-22 Fernando Perez <fperez@colorado.edu>
3773
3786
3774 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3787 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3775 in Magic and ultraTB.
3788 in Magic and ultraTB.
3776
3789
3777 * ipython.1: document threading options in manpage.
3790 * ipython.1: document threading options in manpage.
3778
3791
3779 * scripts/ipython: Changed name of -thread option to -gthread,
3792 * scripts/ipython: Changed name of -thread option to -gthread,
3780 since this is GTK specific. I want to leave the door open for a
3793 since this is GTK specific. I want to leave the door open for a
3781 -wthread option for WX, which will most likely be necessary. This
3794 -wthread option for WX, which will most likely be necessary. This
3782 change affects usage and ipmaker as well.
3795 change affects usage and ipmaker as well.
3783
3796
3784 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3797 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3785 handle the matplotlib shell issues. Code by John Hunter
3798 handle the matplotlib shell issues. Code by John Hunter
3786 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3799 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3787 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3800 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3788 broken (and disabled for end users) for now, but it puts the
3801 broken (and disabled for end users) for now, but it puts the
3789 infrastructure in place.
3802 infrastructure in place.
3790
3803
3791 2004-08-21 Fernando Perez <fperez@colorado.edu>
3804 2004-08-21 Fernando Perez <fperez@colorado.edu>
3792
3805
3793 * ipythonrc-pylab: Add matplotlib support.
3806 * ipythonrc-pylab: Add matplotlib support.
3794
3807
3795 * matplotlib_config.py: new files for matplotlib support, part of
3808 * matplotlib_config.py: new files for matplotlib support, part of
3796 the pylab profile.
3809 the pylab profile.
3797
3810
3798 * IPython/usage.py (__doc__): documented the threading options.
3811 * IPython/usage.py (__doc__): documented the threading options.
3799
3812
3800 2004-08-20 Fernando Perez <fperez@colorado.edu>
3813 2004-08-20 Fernando Perez <fperez@colorado.edu>
3801
3814
3802 * ipython: Modified the main calling routine to handle the -thread
3815 * ipython: Modified the main calling routine to handle the -thread
3803 and -mpthread options. This needs to be done as a top-level hack,
3816 and -mpthread options. This needs to be done as a top-level hack,
3804 because it determines which class to instantiate for IPython
3817 because it determines which class to instantiate for IPython
3805 itself.
3818 itself.
3806
3819
3807 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3820 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3808 classes to support multithreaded GTK operation without blocking,
3821 classes to support multithreaded GTK operation without blocking,
3809 and matplotlib with all backends. This is a lot of still very
3822 and matplotlib with all backends. This is a lot of still very
3810 experimental code, and threads are tricky. So it may still have a
3823 experimental code, and threads are tricky. So it may still have a
3811 few rough edges... This code owes a lot to
3824 few rough edges... This code owes a lot to
3812 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3825 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3813 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3826 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3814 to John Hunter for all the matplotlib work.
3827 to John Hunter for all the matplotlib work.
3815
3828
3816 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3829 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3817 options for gtk thread and matplotlib support.
3830 options for gtk thread and matplotlib support.
3818
3831
3819 2004-08-16 Fernando Perez <fperez@colorado.edu>
3832 2004-08-16 Fernando Perez <fperez@colorado.edu>
3820
3833
3821 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3834 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3822 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3835 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3823 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3836 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3824
3837
3825 2004-08-11 Fernando Perez <fperez@colorado.edu>
3838 2004-08-11 Fernando Perez <fperez@colorado.edu>
3826
3839
3827 * setup.py (isfile): Fix build so documentation gets updated for
3840 * setup.py (isfile): Fix build so documentation gets updated for
3828 rpms (it was only done for .tgz builds).
3841 rpms (it was only done for .tgz builds).
3829
3842
3830 2004-08-10 Fernando Perez <fperez@colorado.edu>
3843 2004-08-10 Fernando Perez <fperez@colorado.edu>
3831
3844
3832 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3845 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3833
3846
3834 * iplib.py : Silence syntax error exceptions in tab-completion.
3847 * iplib.py : Silence syntax error exceptions in tab-completion.
3835
3848
3836 2004-08-05 Fernando Perez <fperez@colorado.edu>
3849 2004-08-05 Fernando Perez <fperez@colorado.edu>
3837
3850
3838 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3851 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3839 'color off' mark for continuation prompts. This was causing long
3852 'color off' mark for continuation prompts. This was causing long
3840 continuation lines to mis-wrap.
3853 continuation lines to mis-wrap.
3841
3854
3842 2004-08-01 Fernando Perez <fperez@colorado.edu>
3855 2004-08-01 Fernando Perez <fperez@colorado.edu>
3843
3856
3844 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3857 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3845 for building ipython to be a parameter. All this is necessary
3858 for building ipython to be a parameter. All this is necessary
3846 right now to have a multithreaded version, but this insane
3859 right now to have a multithreaded version, but this insane
3847 non-design will be cleaned up soon. For now, it's a hack that
3860 non-design will be cleaned up soon. For now, it's a hack that
3848 works.
3861 works.
3849
3862
3850 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3863 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3851 args in various places. No bugs so far, but it's a dangerous
3864 args in various places. No bugs so far, but it's a dangerous
3852 practice.
3865 practice.
3853
3866
3854 2004-07-31 Fernando Perez <fperez@colorado.edu>
3867 2004-07-31 Fernando Perez <fperez@colorado.edu>
3855
3868
3856 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3869 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3857 fix completion of files with dots in their names under most
3870 fix completion of files with dots in their names under most
3858 profiles (pysh was OK because the completion order is different).
3871 profiles (pysh was OK because the completion order is different).
3859
3872
3860 2004-07-27 Fernando Perez <fperez@colorado.edu>
3873 2004-07-27 Fernando Perez <fperez@colorado.edu>
3861
3874
3862 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3875 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3863 keywords manually, b/c the one in keyword.py was removed in python
3876 keywords manually, b/c the one in keyword.py was removed in python
3864 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3877 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3865 This is NOT a bug under python 2.3 and earlier.
3878 This is NOT a bug under python 2.3 and earlier.
3866
3879
3867 2004-07-26 Fernando Perez <fperez@colorado.edu>
3880 2004-07-26 Fernando Perez <fperez@colorado.edu>
3868
3881
3869 * IPython/ultraTB.py (VerboseTB.text): Add another
3882 * IPython/ultraTB.py (VerboseTB.text): Add another
3870 linecache.checkcache() call to try to prevent inspect.py from
3883 linecache.checkcache() call to try to prevent inspect.py from
3871 crashing under python 2.3. I think this fixes
3884 crashing under python 2.3. I think this fixes
3872 http://www.scipy.net/roundup/ipython/issue17.
3885 http://www.scipy.net/roundup/ipython/issue17.
3873
3886
3874 2004-07-26 *** Released version 0.6.2
3887 2004-07-26 *** Released version 0.6.2
3875
3888
3876 2004-07-26 Fernando Perez <fperez@colorado.edu>
3889 2004-07-26 Fernando Perez <fperez@colorado.edu>
3877
3890
3878 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3891 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3879 fail for any number.
3892 fail for any number.
3880 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3893 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3881 empty bookmarks.
3894 empty bookmarks.
3882
3895
3883 2004-07-26 *** Released version 0.6.1
3896 2004-07-26 *** Released version 0.6.1
3884
3897
3885 2004-07-26 Fernando Perez <fperez@colorado.edu>
3898 2004-07-26 Fernando Perez <fperez@colorado.edu>
3886
3899
3887 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3900 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3888
3901
3889 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3902 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3890 escaping '()[]{}' in filenames.
3903 escaping '()[]{}' in filenames.
3891
3904
3892 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3905 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3893 Python 2.2 users who lack a proper shlex.split.
3906 Python 2.2 users who lack a proper shlex.split.
3894
3907
3895 2004-07-19 Fernando Perez <fperez@colorado.edu>
3908 2004-07-19 Fernando Perez <fperez@colorado.edu>
3896
3909
3897 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3910 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3898 for reading readline's init file. I follow the normal chain:
3911 for reading readline's init file. I follow the normal chain:
3899 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3912 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3900 report by Mike Heeter. This closes
3913 report by Mike Heeter. This closes
3901 http://www.scipy.net/roundup/ipython/issue16.
3914 http://www.scipy.net/roundup/ipython/issue16.
3902
3915
3903 2004-07-18 Fernando Perez <fperez@colorado.edu>
3916 2004-07-18 Fernando Perez <fperez@colorado.edu>
3904
3917
3905 * IPython/iplib.py (__init__): Add better handling of '\' under
3918 * IPython/iplib.py (__init__): Add better handling of '\' under
3906 Win32 for filenames. After a patch by Ville.
3919 Win32 for filenames. After a patch by Ville.
3907
3920
3908 2004-07-17 Fernando Perez <fperez@colorado.edu>
3921 2004-07-17 Fernando Perez <fperez@colorado.edu>
3909
3922
3910 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3923 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3911 autocalling would be triggered for 'foo is bar' if foo is
3924 autocalling would be triggered for 'foo is bar' if foo is
3912 callable. I also cleaned up the autocall detection code to use a
3925 callable. I also cleaned up the autocall detection code to use a
3913 regexp, which is faster. Bug reported by Alexander Schmolck.
3926 regexp, which is faster. Bug reported by Alexander Schmolck.
3914
3927
3915 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3928 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3916 '?' in them would confuse the help system. Reported by Alex
3929 '?' in them would confuse the help system. Reported by Alex
3917 Schmolck.
3930 Schmolck.
3918
3931
3919 2004-07-16 Fernando Perez <fperez@colorado.edu>
3932 2004-07-16 Fernando Perez <fperez@colorado.edu>
3920
3933
3921 * IPython/GnuplotInteractive.py (__all__): added plot2.
3934 * IPython/GnuplotInteractive.py (__all__): added plot2.
3922
3935
3923 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3936 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3924 plotting dictionaries, lists or tuples of 1d arrays.
3937 plotting dictionaries, lists or tuples of 1d arrays.
3925
3938
3926 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3939 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3927 optimizations.
3940 optimizations.
3928
3941
3929 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3942 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3930 the information which was there from Janko's original IPP code:
3943 the information which was there from Janko's original IPP code:
3931
3944
3932 03.05.99 20:53 porto.ifm.uni-kiel.de
3945 03.05.99 20:53 porto.ifm.uni-kiel.de
3933 --Started changelog.
3946 --Started changelog.
3934 --make clear do what it say it does
3947 --make clear do what it say it does
3935 --added pretty output of lines from inputcache
3948 --added pretty output of lines from inputcache
3936 --Made Logger a mixin class, simplifies handling of switches
3949 --Made Logger a mixin class, simplifies handling of switches
3937 --Added own completer class. .string<TAB> expands to last history
3950 --Added own completer class. .string<TAB> expands to last history
3938 line which starts with string. The new expansion is also present
3951 line which starts with string. The new expansion is also present
3939 with Ctrl-r from the readline library. But this shows, who this
3952 with Ctrl-r from the readline library. But this shows, who this
3940 can be done for other cases.
3953 can be done for other cases.
3941 --Added convention that all shell functions should accept a
3954 --Added convention that all shell functions should accept a
3942 parameter_string This opens the door for different behaviour for
3955 parameter_string This opens the door for different behaviour for
3943 each function. @cd is a good example of this.
3956 each function. @cd is a good example of this.
3944
3957
3945 04.05.99 12:12 porto.ifm.uni-kiel.de
3958 04.05.99 12:12 porto.ifm.uni-kiel.de
3946 --added logfile rotation
3959 --added logfile rotation
3947 --added new mainloop method which freezes first the namespace
3960 --added new mainloop method which freezes first the namespace
3948
3961
3949 07.05.99 21:24 porto.ifm.uni-kiel.de
3962 07.05.99 21:24 porto.ifm.uni-kiel.de
3950 --added the docreader classes. Now there is a help system.
3963 --added the docreader classes. Now there is a help system.
3951 -This is only a first try. Currently it's not easy to put new
3964 -This is only a first try. Currently it's not easy to put new
3952 stuff in the indices. But this is the way to go. Info would be
3965 stuff in the indices. But this is the way to go. Info would be
3953 better, but HTML is every where and not everybody has an info
3966 better, but HTML is every where and not everybody has an info
3954 system installed and it's not so easy to change html-docs to info.
3967 system installed and it's not so easy to change html-docs to info.
3955 --added global logfile option
3968 --added global logfile option
3956 --there is now a hook for object inspection method pinfo needs to
3969 --there is now a hook for object inspection method pinfo needs to
3957 be provided for this. Can be reached by two '??'.
3970 be provided for this. Can be reached by two '??'.
3958
3971
3959 08.05.99 20:51 porto.ifm.uni-kiel.de
3972 08.05.99 20:51 porto.ifm.uni-kiel.de
3960 --added a README
3973 --added a README
3961 --bug in rc file. Something has changed so functions in the rc
3974 --bug in rc file. Something has changed so functions in the rc
3962 file need to reference the shell and not self. Not clear if it's a
3975 file need to reference the shell and not self. Not clear if it's a
3963 bug or feature.
3976 bug or feature.
3964 --changed rc file for new behavior
3977 --changed rc file for new behavior
3965
3978
3966 2004-07-15 Fernando Perez <fperez@colorado.edu>
3979 2004-07-15 Fernando Perez <fperez@colorado.edu>
3967
3980
3968 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3981 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3969 cache was falling out of sync in bizarre manners when multi-line
3982 cache was falling out of sync in bizarre manners when multi-line
3970 input was present. Minor optimizations and cleanup.
3983 input was present. Minor optimizations and cleanup.
3971
3984
3972 (Logger): Remove old Changelog info for cleanup. This is the
3985 (Logger): Remove old Changelog info for cleanup. This is the
3973 information which was there from Janko's original code:
3986 information which was there from Janko's original code:
3974
3987
3975 Changes to Logger: - made the default log filename a parameter
3988 Changes to Logger: - made the default log filename a parameter
3976
3989
3977 - put a check for lines beginning with !@? in log(). Needed
3990 - put a check for lines beginning with !@? in log(). Needed
3978 (even if the handlers properly log their lines) for mid-session
3991 (even if the handlers properly log their lines) for mid-session
3979 logging activation to work properly. Without this, lines logged
3992 logging activation to work properly. Without this, lines logged
3980 in mid session, which get read from the cache, would end up
3993 in mid session, which get read from the cache, would end up
3981 'bare' (with !@? in the open) in the log. Now they are caught
3994 'bare' (with !@? in the open) in the log. Now they are caught
3982 and prepended with a #.
3995 and prepended with a #.
3983
3996
3984 * IPython/iplib.py (InteractiveShell.init_readline): added check
3997 * IPython/iplib.py (InteractiveShell.init_readline): added check
3985 in case MagicCompleter fails to be defined, so we don't crash.
3998 in case MagicCompleter fails to be defined, so we don't crash.
3986
3999
3987 2004-07-13 Fernando Perez <fperez@colorado.edu>
4000 2004-07-13 Fernando Perez <fperez@colorado.edu>
3988
4001
3989 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
4002 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3990 of EPS if the requested filename ends in '.eps'.
4003 of EPS if the requested filename ends in '.eps'.
3991
4004
3992 2004-07-04 Fernando Perez <fperez@colorado.edu>
4005 2004-07-04 Fernando Perez <fperez@colorado.edu>
3993
4006
3994 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
4007 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3995 escaping of quotes when calling the shell.
4008 escaping of quotes when calling the shell.
3996
4009
3997 2004-07-02 Fernando Perez <fperez@colorado.edu>
4010 2004-07-02 Fernando Perez <fperez@colorado.edu>
3998
4011
3999 * IPython/Prompts.py (CachedOutput.update): Fix problem with
4012 * IPython/Prompts.py (CachedOutput.update): Fix problem with
4000 gettext not working because we were clobbering '_'. Fixes
4013 gettext not working because we were clobbering '_'. Fixes
4001 http://www.scipy.net/roundup/ipython/issue6.
4014 http://www.scipy.net/roundup/ipython/issue6.
4002
4015
4003 2004-07-01 Fernando Perez <fperez@colorado.edu>
4016 2004-07-01 Fernando Perez <fperez@colorado.edu>
4004
4017
4005 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
4018 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
4006 into @cd. Patch by Ville.
4019 into @cd. Patch by Ville.
4007
4020
4008 * IPython/iplib.py (InteractiveShell.post_config_initialization):
4021 * IPython/iplib.py (InteractiveShell.post_config_initialization):
4009 new function to store things after ipmaker runs. Patch by Ville.
4022 new function to store things after ipmaker runs. Patch by Ville.
4010 Eventually this will go away once ipmaker is removed and the class
4023 Eventually this will go away once ipmaker is removed and the class
4011 gets cleaned up, but for now it's ok. Key functionality here is
4024 gets cleaned up, but for now it's ok. Key functionality here is
4012 the addition of the persistent storage mechanism, a dict for
4025 the addition of the persistent storage mechanism, a dict for
4013 keeping data across sessions (for now just bookmarks, but more can
4026 keeping data across sessions (for now just bookmarks, but more can
4014 be implemented later).
4027 be implemented later).
4015
4028
4016 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
4029 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
4017 persistent across sections. Patch by Ville, I modified it
4030 persistent across sections. Patch by Ville, I modified it
4018 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
4031 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
4019 added a '-l' option to list all bookmarks.
4032 added a '-l' option to list all bookmarks.
4020
4033
4021 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4034 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4022 center for cleanup. Registered with atexit.register(). I moved
4035 center for cleanup. Registered with atexit.register(). I moved
4023 here the old exit_cleanup(). After a patch by Ville.
4036 here the old exit_cleanup(). After a patch by Ville.
4024
4037
4025 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4038 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4026 characters in the hacked shlex_split for python 2.2.
4039 characters in the hacked shlex_split for python 2.2.
4027
4040
4028 * IPython/iplib.py (file_matches): more fixes to filenames with
4041 * IPython/iplib.py (file_matches): more fixes to filenames with
4029 whitespace in them. It's not perfect, but limitations in python's
4042 whitespace in them. It's not perfect, but limitations in python's
4030 readline make it impossible to go further.
4043 readline make it impossible to go further.
4031
4044
4032 2004-06-29 Fernando Perez <fperez@colorado.edu>
4045 2004-06-29 Fernando Perez <fperez@colorado.edu>
4033
4046
4034 * IPython/iplib.py (file_matches): escape whitespace correctly in
4047 * IPython/iplib.py (file_matches): escape whitespace correctly in
4035 filename completions. Bug reported by Ville.
4048 filename completions. Bug reported by Ville.
4036
4049
4037 2004-06-28 Fernando Perez <fperez@colorado.edu>
4050 2004-06-28 Fernando Perez <fperez@colorado.edu>
4038
4051
4039 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4052 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4040 the history file will be called 'history-PROFNAME' (or just
4053 the history file will be called 'history-PROFNAME' (or just
4041 'history' if no profile is loaded). I was getting annoyed at
4054 'history' if no profile is loaded). I was getting annoyed at
4042 getting my Numerical work history clobbered by pysh sessions.
4055 getting my Numerical work history clobbered by pysh sessions.
4043
4056
4044 * IPython/iplib.py (InteractiveShell.__init__): Internal
4057 * IPython/iplib.py (InteractiveShell.__init__): Internal
4045 getoutputerror() function so that we can honor the system_verbose
4058 getoutputerror() function so that we can honor the system_verbose
4046 flag for _all_ system calls. I also added escaping of #
4059 flag for _all_ system calls. I also added escaping of #
4047 characters here to avoid confusing Itpl.
4060 characters here to avoid confusing Itpl.
4048
4061
4049 * IPython/Magic.py (shlex_split): removed call to shell in
4062 * IPython/Magic.py (shlex_split): removed call to shell in
4050 parse_options and replaced it with shlex.split(). The annoying
4063 parse_options and replaced it with shlex.split(). The annoying
4051 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4064 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4052 to backport it from 2.3, with several frail hacks (the shlex
4065 to backport it from 2.3, with several frail hacks (the shlex
4053 module is rather limited in 2.2). Thanks to a suggestion by Ville
4066 module is rather limited in 2.2). Thanks to a suggestion by Ville
4054 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4067 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4055 problem.
4068 problem.
4056
4069
4057 (Magic.magic_system_verbose): new toggle to print the actual
4070 (Magic.magic_system_verbose): new toggle to print the actual
4058 system calls made by ipython. Mainly for debugging purposes.
4071 system calls made by ipython. Mainly for debugging purposes.
4059
4072
4060 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4073 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4061 doesn't support persistence. Reported (and fix suggested) by
4074 doesn't support persistence. Reported (and fix suggested) by
4062 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4075 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4063
4076
4064 2004-06-26 Fernando Perez <fperez@colorado.edu>
4077 2004-06-26 Fernando Perez <fperez@colorado.edu>
4065
4078
4066 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4079 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4067 continue prompts.
4080 continue prompts.
4068
4081
4069 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4082 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4070 function (basically a big docstring) and a few more things here to
4083 function (basically a big docstring) and a few more things here to
4071 speedup startup. pysh.py is now very lightweight. We want because
4084 speedup startup. pysh.py is now very lightweight. We want because
4072 it gets execfile'd, while InterpreterExec gets imported, so
4085 it gets execfile'd, while InterpreterExec gets imported, so
4073 byte-compilation saves time.
4086 byte-compilation saves time.
4074
4087
4075 2004-06-25 Fernando Perez <fperez@colorado.edu>
4088 2004-06-25 Fernando Perez <fperez@colorado.edu>
4076
4089
4077 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4090 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4078 -NUM', which was recently broken.
4091 -NUM', which was recently broken.
4079
4092
4080 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4093 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4081 in multi-line input (but not !!, which doesn't make sense there).
4094 in multi-line input (but not !!, which doesn't make sense there).
4082
4095
4083 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4096 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4084 It's just too useful, and people can turn it off in the less
4097 It's just too useful, and people can turn it off in the less
4085 common cases where it's a problem.
4098 common cases where it's a problem.
4086
4099
4087 2004-06-24 Fernando Perez <fperez@colorado.edu>
4100 2004-06-24 Fernando Perez <fperez@colorado.edu>
4088
4101
4089 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4102 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4090 special syntaxes (like alias calling) is now allied in multi-line
4103 special syntaxes (like alias calling) is now allied in multi-line
4091 input. This is still _very_ experimental, but it's necessary for
4104 input. This is still _very_ experimental, but it's necessary for
4092 efficient shell usage combining python looping syntax with system
4105 efficient shell usage combining python looping syntax with system
4093 calls. For now it's restricted to aliases, I don't think it
4106 calls. For now it's restricted to aliases, I don't think it
4094 really even makes sense to have this for magics.
4107 really even makes sense to have this for magics.
4095
4108
4096 2004-06-23 Fernando Perez <fperez@colorado.edu>
4109 2004-06-23 Fernando Perez <fperez@colorado.edu>
4097
4110
4098 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4111 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4099 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4112 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4100
4113
4101 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4114 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4102 extensions under Windows (after code sent by Gary Bishop). The
4115 extensions under Windows (after code sent by Gary Bishop). The
4103 extensions considered 'executable' are stored in IPython's rc
4116 extensions considered 'executable' are stored in IPython's rc
4104 structure as win_exec_ext.
4117 structure as win_exec_ext.
4105
4118
4106 * IPython/genutils.py (shell): new function, like system() but
4119 * IPython/genutils.py (shell): new function, like system() but
4107 without return value. Very useful for interactive shell work.
4120 without return value. Very useful for interactive shell work.
4108
4121
4109 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4122 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4110 delete aliases.
4123 delete aliases.
4111
4124
4112 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4125 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4113 sure that the alias table doesn't contain python keywords.
4126 sure that the alias table doesn't contain python keywords.
4114
4127
4115 2004-06-21 Fernando Perez <fperez@colorado.edu>
4128 2004-06-21 Fernando Perez <fperez@colorado.edu>
4116
4129
4117 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4130 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4118 non-existent items are found in $PATH. Reported by Thorsten.
4131 non-existent items are found in $PATH. Reported by Thorsten.
4119
4132
4120 2004-06-20 Fernando Perez <fperez@colorado.edu>
4133 2004-06-20 Fernando Perez <fperez@colorado.edu>
4121
4134
4122 * IPython/iplib.py (complete): modified the completer so that the
4135 * IPython/iplib.py (complete): modified the completer so that the
4123 order of priorities can be easily changed at runtime.
4136 order of priorities can be easily changed at runtime.
4124
4137
4125 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4138 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4126 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4139 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4127
4140
4128 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4141 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4129 expand Python variables prepended with $ in all system calls. The
4142 expand Python variables prepended with $ in all system calls. The
4130 same was done to InteractiveShell.handle_shell_escape. Now all
4143 same was done to InteractiveShell.handle_shell_escape. Now all
4131 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4144 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4132 expansion of python variables and expressions according to the
4145 expansion of python variables and expressions according to the
4133 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4146 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4134
4147
4135 Though PEP-215 has been rejected, a similar (but simpler) one
4148 Though PEP-215 has been rejected, a similar (but simpler) one
4136 seems like it will go into Python 2.4, PEP-292 -
4149 seems like it will go into Python 2.4, PEP-292 -
4137 http://www.python.org/peps/pep-0292.html.
4150 http://www.python.org/peps/pep-0292.html.
4138
4151
4139 I'll keep the full syntax of PEP-215, since IPython has since the
4152 I'll keep the full syntax of PEP-215, since IPython has since the
4140 start used Ka-Ping Yee's reference implementation discussed there
4153 start used Ka-Ping Yee's reference implementation discussed there
4141 (Itpl), and I actually like the powerful semantics it offers.
4154 (Itpl), and I actually like the powerful semantics it offers.
4142
4155
4143 In order to access normal shell variables, the $ has to be escaped
4156 In order to access normal shell variables, the $ has to be escaped
4144 via an extra $. For example:
4157 via an extra $. For example:
4145
4158
4146 In [7]: PATH='a python variable'
4159 In [7]: PATH='a python variable'
4147
4160
4148 In [8]: !echo $PATH
4161 In [8]: !echo $PATH
4149 a python variable
4162 a python variable
4150
4163
4151 In [9]: !echo $$PATH
4164 In [9]: !echo $$PATH
4152 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4165 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4153
4166
4154 (Magic.parse_options): escape $ so the shell doesn't evaluate
4167 (Magic.parse_options): escape $ so the shell doesn't evaluate
4155 things prematurely.
4168 things prematurely.
4156
4169
4157 * IPython/iplib.py (InteractiveShell.call_alias): added the
4170 * IPython/iplib.py (InteractiveShell.call_alias): added the
4158 ability for aliases to expand python variables via $.
4171 ability for aliases to expand python variables via $.
4159
4172
4160 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4173 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4161 system, now there's a @rehash/@rehashx pair of magics. These work
4174 system, now there's a @rehash/@rehashx pair of magics. These work
4162 like the csh rehash command, and can be invoked at any time. They
4175 like the csh rehash command, and can be invoked at any time. They
4163 build a table of aliases to everything in the user's $PATH
4176 build a table of aliases to everything in the user's $PATH
4164 (@rehash uses everything, @rehashx is slower but only adds
4177 (@rehash uses everything, @rehashx is slower but only adds
4165 executable files). With this, the pysh.py-based shell profile can
4178 executable files). With this, the pysh.py-based shell profile can
4166 now simply call rehash upon startup, and full access to all
4179 now simply call rehash upon startup, and full access to all
4167 programs in the user's path is obtained.
4180 programs in the user's path is obtained.
4168
4181
4169 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4182 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4170 functionality is now fully in place. I removed the old dynamic
4183 functionality is now fully in place. I removed the old dynamic
4171 code generation based approach, in favor of a much lighter one
4184 code generation based approach, in favor of a much lighter one
4172 based on a simple dict. The advantage is that this allows me to
4185 based on a simple dict. The advantage is that this allows me to
4173 now have thousands of aliases with negligible cost (unthinkable
4186 now have thousands of aliases with negligible cost (unthinkable
4174 with the old system).
4187 with the old system).
4175
4188
4176 2004-06-19 Fernando Perez <fperez@colorado.edu>
4189 2004-06-19 Fernando Perez <fperez@colorado.edu>
4177
4190
4178 * IPython/iplib.py (__init__): extended MagicCompleter class to
4191 * IPython/iplib.py (__init__): extended MagicCompleter class to
4179 also complete (last in priority) on user aliases.
4192 also complete (last in priority) on user aliases.
4180
4193
4181 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4194 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4182 call to eval.
4195 call to eval.
4183 (ItplNS.__init__): Added a new class which functions like Itpl,
4196 (ItplNS.__init__): Added a new class which functions like Itpl,
4184 but allows configuring the namespace for the evaluation to occur
4197 but allows configuring the namespace for the evaluation to occur
4185 in.
4198 in.
4186
4199
4187 2004-06-18 Fernando Perez <fperez@colorado.edu>
4200 2004-06-18 Fernando Perez <fperez@colorado.edu>
4188
4201
4189 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4202 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4190 better message when 'exit' or 'quit' are typed (a common newbie
4203 better message when 'exit' or 'quit' are typed (a common newbie
4191 confusion).
4204 confusion).
4192
4205
4193 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4206 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4194 check for Windows users.
4207 check for Windows users.
4195
4208
4196 * IPython/iplib.py (InteractiveShell.user_setup): removed
4209 * IPython/iplib.py (InteractiveShell.user_setup): removed
4197 disabling of colors for Windows. I'll test at runtime and issue a
4210 disabling of colors for Windows. I'll test at runtime and issue a
4198 warning if Gary's readline isn't found, as to nudge users to
4211 warning if Gary's readline isn't found, as to nudge users to
4199 download it.
4212 download it.
4200
4213
4201 2004-06-16 Fernando Perez <fperez@colorado.edu>
4214 2004-06-16 Fernando Perez <fperez@colorado.edu>
4202
4215
4203 * IPython/genutils.py (Stream.__init__): changed to print errors
4216 * IPython/genutils.py (Stream.__init__): changed to print errors
4204 to sys.stderr. I had a circular dependency here. Now it's
4217 to sys.stderr. I had a circular dependency here. Now it's
4205 possible to run ipython as IDLE's shell (consider this pre-alpha,
4218 possible to run ipython as IDLE's shell (consider this pre-alpha,
4206 since true stdout things end up in the starting terminal instead
4219 since true stdout things end up in the starting terminal instead
4207 of IDLE's out).
4220 of IDLE's out).
4208
4221
4209 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4222 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4210 users who haven't # updated their prompt_in2 definitions. Remove
4223 users who haven't # updated their prompt_in2 definitions. Remove
4211 eventually.
4224 eventually.
4212 (multiple_replace): added credit to original ASPN recipe.
4225 (multiple_replace): added credit to original ASPN recipe.
4213
4226
4214 2004-06-15 Fernando Perez <fperez@colorado.edu>
4227 2004-06-15 Fernando Perez <fperez@colorado.edu>
4215
4228
4216 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4229 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4217 list of auto-defined aliases.
4230 list of auto-defined aliases.
4218
4231
4219 2004-06-13 Fernando Perez <fperez@colorado.edu>
4232 2004-06-13 Fernando Perez <fperez@colorado.edu>
4220
4233
4221 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4234 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4222 install was really requested (so setup.py can be used for other
4235 install was really requested (so setup.py can be used for other
4223 things under Windows).
4236 things under Windows).
4224
4237
4225 2004-06-10 Fernando Perez <fperez@colorado.edu>
4238 2004-06-10 Fernando Perez <fperez@colorado.edu>
4226
4239
4227 * IPython/Logger.py (Logger.create_log): Manually remove any old
4240 * IPython/Logger.py (Logger.create_log): Manually remove any old
4228 backup, since os.remove may fail under Windows. Fixes bug
4241 backup, since os.remove may fail under Windows. Fixes bug
4229 reported by Thorsten.
4242 reported by Thorsten.
4230
4243
4231 2004-06-09 Fernando Perez <fperez@colorado.edu>
4244 2004-06-09 Fernando Perez <fperez@colorado.edu>
4232
4245
4233 * examples/example-embed.py: fixed all references to %n (replaced
4246 * examples/example-embed.py: fixed all references to %n (replaced
4234 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4247 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4235 for all examples and the manual as well.
4248 for all examples and the manual as well.
4236
4249
4237 2004-06-08 Fernando Perez <fperez@colorado.edu>
4250 2004-06-08 Fernando Perez <fperez@colorado.edu>
4238
4251
4239 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4252 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4240 alignment and color management. All 3 prompt subsystems now
4253 alignment and color management. All 3 prompt subsystems now
4241 inherit from BasePrompt.
4254 inherit from BasePrompt.
4242
4255
4243 * tools/release: updates for windows installer build and tag rpms
4256 * tools/release: updates for windows installer build and tag rpms
4244 with python version (since paths are fixed).
4257 with python version (since paths are fixed).
4245
4258
4246 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4259 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4247 which will become eventually obsolete. Also fixed the default
4260 which will become eventually obsolete. Also fixed the default
4248 prompt_in2 to use \D, so at least new users start with the correct
4261 prompt_in2 to use \D, so at least new users start with the correct
4249 defaults.
4262 defaults.
4250 WARNING: Users with existing ipythonrc files will need to apply
4263 WARNING: Users with existing ipythonrc files will need to apply
4251 this fix manually!
4264 this fix manually!
4252
4265
4253 * setup.py: make windows installer (.exe). This is finally the
4266 * setup.py: make windows installer (.exe). This is finally the
4254 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4267 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4255 which I hadn't included because it required Python 2.3 (or recent
4268 which I hadn't included because it required Python 2.3 (or recent
4256 distutils).
4269 distutils).
4257
4270
4258 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4271 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4259 usage of new '\D' escape.
4272 usage of new '\D' escape.
4260
4273
4261 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4274 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4262 lacks os.getuid())
4275 lacks os.getuid())
4263 (CachedOutput.set_colors): Added the ability to turn coloring
4276 (CachedOutput.set_colors): Added the ability to turn coloring
4264 on/off with @colors even for manually defined prompt colors. It
4277 on/off with @colors even for manually defined prompt colors. It
4265 uses a nasty global, but it works safely and via the generic color
4278 uses a nasty global, but it works safely and via the generic color
4266 handling mechanism.
4279 handling mechanism.
4267 (Prompt2.__init__): Introduced new escape '\D' for continuation
4280 (Prompt2.__init__): Introduced new escape '\D' for continuation
4268 prompts. It represents the counter ('\#') as dots.
4281 prompts. It represents the counter ('\#') as dots.
4269 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4282 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4270 need to update their ipythonrc files and replace '%n' with '\D' in
4283 need to update their ipythonrc files and replace '%n' with '\D' in
4271 their prompt_in2 settings everywhere. Sorry, but there's
4284 their prompt_in2 settings everywhere. Sorry, but there's
4272 otherwise no clean way to get all prompts to properly align. The
4285 otherwise no clean way to get all prompts to properly align. The
4273 ipythonrc shipped with IPython has been updated.
4286 ipythonrc shipped with IPython has been updated.
4274
4287
4275 2004-06-07 Fernando Perez <fperez@colorado.edu>
4288 2004-06-07 Fernando Perez <fperez@colorado.edu>
4276
4289
4277 * setup.py (isfile): Pass local_icons option to latex2html, so the
4290 * setup.py (isfile): Pass local_icons option to latex2html, so the
4278 resulting HTML file is self-contained. Thanks to
4291 resulting HTML file is self-contained. Thanks to
4279 dryice-AT-liu.com.cn for the tip.
4292 dryice-AT-liu.com.cn for the tip.
4280
4293
4281 * pysh.py: I created a new profile 'shell', which implements a
4294 * pysh.py: I created a new profile 'shell', which implements a
4282 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4295 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4283 system shell, nor will it become one anytime soon. It's mainly
4296 system shell, nor will it become one anytime soon. It's mainly
4284 meant to illustrate the use of the new flexible bash-like prompts.
4297 meant to illustrate the use of the new flexible bash-like prompts.
4285 I guess it could be used by hardy souls for true shell management,
4298 I guess it could be used by hardy souls for true shell management,
4286 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4299 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4287 profile. This uses the InterpreterExec extension provided by
4300 profile. This uses the InterpreterExec extension provided by
4288 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4301 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4289
4302
4290 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4303 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4291 auto-align itself with the length of the previous input prompt
4304 auto-align itself with the length of the previous input prompt
4292 (taking into account the invisible color escapes).
4305 (taking into account the invisible color escapes).
4293 (CachedOutput.__init__): Large restructuring of this class. Now
4306 (CachedOutput.__init__): Large restructuring of this class. Now
4294 all three prompts (primary1, primary2, output) are proper objects,
4307 all three prompts (primary1, primary2, output) are proper objects,
4295 managed by the 'parent' CachedOutput class. The code is still a
4308 managed by the 'parent' CachedOutput class. The code is still a
4296 bit hackish (all prompts share state via a pointer to the cache),
4309 bit hackish (all prompts share state via a pointer to the cache),
4297 but it's overall far cleaner than before.
4310 but it's overall far cleaner than before.
4298
4311
4299 * IPython/genutils.py (getoutputerror): modified to add verbose,
4312 * IPython/genutils.py (getoutputerror): modified to add verbose,
4300 debug and header options. This makes the interface of all getout*
4313 debug and header options. This makes the interface of all getout*
4301 functions uniform.
4314 functions uniform.
4302 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4315 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4303
4316
4304 * IPython/Magic.py (Magic.default_option): added a function to
4317 * IPython/Magic.py (Magic.default_option): added a function to
4305 allow registering default options for any magic command. This
4318 allow registering default options for any magic command. This
4306 makes it easy to have profiles which customize the magics globally
4319 makes it easy to have profiles which customize the magics globally
4307 for a certain use. The values set through this function are
4320 for a certain use. The values set through this function are
4308 picked up by the parse_options() method, which all magics should
4321 picked up by the parse_options() method, which all magics should
4309 use to parse their options.
4322 use to parse their options.
4310
4323
4311 * IPython/genutils.py (warn): modified the warnings framework to
4324 * IPython/genutils.py (warn): modified the warnings framework to
4312 use the Term I/O class. I'm trying to slowly unify all of
4325 use the Term I/O class. I'm trying to slowly unify all of
4313 IPython's I/O operations to pass through Term.
4326 IPython's I/O operations to pass through Term.
4314
4327
4315 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4328 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4316 the secondary prompt to correctly match the length of the primary
4329 the secondary prompt to correctly match the length of the primary
4317 one for any prompt. Now multi-line code will properly line up
4330 one for any prompt. Now multi-line code will properly line up
4318 even for path dependent prompts, such as the new ones available
4331 even for path dependent prompts, such as the new ones available
4319 via the prompt_specials.
4332 via the prompt_specials.
4320
4333
4321 2004-06-06 Fernando Perez <fperez@colorado.edu>
4334 2004-06-06 Fernando Perez <fperez@colorado.edu>
4322
4335
4323 * IPython/Prompts.py (prompt_specials): Added the ability to have
4336 * IPython/Prompts.py (prompt_specials): Added the ability to have
4324 bash-like special sequences in the prompts, which get
4337 bash-like special sequences in the prompts, which get
4325 automatically expanded. Things like hostname, current working
4338 automatically expanded. Things like hostname, current working
4326 directory and username are implemented already, but it's easy to
4339 directory and username are implemented already, but it's easy to
4327 add more in the future. Thanks to a patch by W.J. van der Laan
4340 add more in the future. Thanks to a patch by W.J. van der Laan
4328 <gnufnork-AT-hetdigitalegat.nl>
4341 <gnufnork-AT-hetdigitalegat.nl>
4329 (prompt_specials): Added color support for prompt strings, so
4342 (prompt_specials): Added color support for prompt strings, so
4330 users can define arbitrary color setups for their prompts.
4343 users can define arbitrary color setups for their prompts.
4331
4344
4332 2004-06-05 Fernando Perez <fperez@colorado.edu>
4345 2004-06-05 Fernando Perez <fperez@colorado.edu>
4333
4346
4334 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4347 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4335 code to load Gary Bishop's readline and configure it
4348 code to load Gary Bishop's readline and configure it
4336 automatically. Thanks to Gary for help on this.
4349 automatically. Thanks to Gary for help on this.
4337
4350
4338 2004-06-01 Fernando Perez <fperez@colorado.edu>
4351 2004-06-01 Fernando Perez <fperez@colorado.edu>
4339
4352
4340 * IPython/Logger.py (Logger.create_log): fix bug for logging
4353 * IPython/Logger.py (Logger.create_log): fix bug for logging
4341 with no filename (previous fix was incomplete).
4354 with no filename (previous fix was incomplete).
4342
4355
4343 2004-05-25 Fernando Perez <fperez@colorado.edu>
4356 2004-05-25 Fernando Perez <fperez@colorado.edu>
4344
4357
4345 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4358 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4346 parens would get passed to the shell.
4359 parens would get passed to the shell.
4347
4360
4348 2004-05-20 Fernando Perez <fperez@colorado.edu>
4361 2004-05-20 Fernando Perez <fperez@colorado.edu>
4349
4362
4350 * IPython/Magic.py (Magic.magic_prun): changed default profile
4363 * IPython/Magic.py (Magic.magic_prun): changed default profile
4351 sort order to 'time' (the more common profiling need).
4364 sort order to 'time' (the more common profiling need).
4352
4365
4353 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4366 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4354 so that source code shown is guaranteed in sync with the file on
4367 so that source code shown is guaranteed in sync with the file on
4355 disk (also changed in psource). Similar fix to the one for
4368 disk (also changed in psource). Similar fix to the one for
4356 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4369 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4357 <yann.ledu-AT-noos.fr>.
4370 <yann.ledu-AT-noos.fr>.
4358
4371
4359 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4372 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4360 with a single option would not be correctly parsed. Closes
4373 with a single option would not be correctly parsed. Closes
4361 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4374 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4362 introduced in 0.6.0 (on 2004-05-06).
4375 introduced in 0.6.0 (on 2004-05-06).
4363
4376
4364 2004-05-13 *** Released version 0.6.0
4377 2004-05-13 *** Released version 0.6.0
4365
4378
4366 2004-05-13 Fernando Perez <fperez@colorado.edu>
4379 2004-05-13 Fernando Perez <fperez@colorado.edu>
4367
4380
4368 * debian/: Added debian/ directory to CVS, so that debian support
4381 * debian/: Added debian/ directory to CVS, so that debian support
4369 is publicly accessible. The debian package is maintained by Jack
4382 is publicly accessible. The debian package is maintained by Jack
4370 Moffit <jack-AT-xiph.org>.
4383 Moffit <jack-AT-xiph.org>.
4371
4384
4372 * Documentation: included the notes about an ipython-based system
4385 * Documentation: included the notes about an ipython-based system
4373 shell (the hypothetical 'pysh') into the new_design.pdf document,
4386 shell (the hypothetical 'pysh') into the new_design.pdf document,
4374 so that these ideas get distributed to users along with the
4387 so that these ideas get distributed to users along with the
4375 official documentation.
4388 official documentation.
4376
4389
4377 2004-05-10 Fernando Perez <fperez@colorado.edu>
4390 2004-05-10 Fernando Perez <fperez@colorado.edu>
4378
4391
4379 * IPython/Logger.py (Logger.create_log): fix recently introduced
4392 * IPython/Logger.py (Logger.create_log): fix recently introduced
4380 bug (misindented line) where logstart would fail when not given an
4393 bug (misindented line) where logstart would fail when not given an
4381 explicit filename.
4394 explicit filename.
4382
4395
4383 2004-05-09 Fernando Perez <fperez@colorado.edu>
4396 2004-05-09 Fernando Perez <fperez@colorado.edu>
4384
4397
4385 * IPython/Magic.py (Magic.parse_options): skip system call when
4398 * IPython/Magic.py (Magic.parse_options): skip system call when
4386 there are no options to look for. Faster, cleaner for the common
4399 there are no options to look for. Faster, cleaner for the common
4387 case.
4400 case.
4388
4401
4389 * Documentation: many updates to the manual: describing Windows
4402 * Documentation: many updates to the manual: describing Windows
4390 support better, Gnuplot updates, credits, misc small stuff. Also
4403 support better, Gnuplot updates, credits, misc small stuff. Also
4391 updated the new_design doc a bit.
4404 updated the new_design doc a bit.
4392
4405
4393 2004-05-06 *** Released version 0.6.0.rc1
4406 2004-05-06 *** Released version 0.6.0.rc1
4394
4407
4395 2004-05-06 Fernando Perez <fperez@colorado.edu>
4408 2004-05-06 Fernando Perez <fperez@colorado.edu>
4396
4409
4397 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4410 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4398 operations to use the vastly more efficient list/''.join() method.
4411 operations to use the vastly more efficient list/''.join() method.
4399 (FormattedTB.text): Fix
4412 (FormattedTB.text): Fix
4400 http://www.scipy.net/roundup/ipython/issue12 - exception source
4413 http://www.scipy.net/roundup/ipython/issue12 - exception source
4401 extract not updated after reload. Thanks to Mike Salib
4414 extract not updated after reload. Thanks to Mike Salib
4402 <msalib-AT-mit.edu> for pinning the source of the problem.
4415 <msalib-AT-mit.edu> for pinning the source of the problem.
4403 Fortunately, the solution works inside ipython and doesn't require
4416 Fortunately, the solution works inside ipython and doesn't require
4404 any changes to python proper.
4417 any changes to python proper.
4405
4418
4406 * IPython/Magic.py (Magic.parse_options): Improved to process the
4419 * IPython/Magic.py (Magic.parse_options): Improved to process the
4407 argument list as a true shell would (by actually using the
4420 argument list as a true shell would (by actually using the
4408 underlying system shell). This way, all @magics automatically get
4421 underlying system shell). This way, all @magics automatically get
4409 shell expansion for variables. Thanks to a comment by Alex
4422 shell expansion for variables. Thanks to a comment by Alex
4410 Schmolck.
4423 Schmolck.
4411
4424
4412 2004-04-04 Fernando Perez <fperez@colorado.edu>
4425 2004-04-04 Fernando Perez <fperez@colorado.edu>
4413
4426
4414 * IPython/iplib.py (InteractiveShell.interact): Added a special
4427 * IPython/iplib.py (InteractiveShell.interact): Added a special
4415 trap for a debugger quit exception, which is basically impossible
4428 trap for a debugger quit exception, which is basically impossible
4416 to handle by normal mechanisms, given what pdb does to the stack.
4429 to handle by normal mechanisms, given what pdb does to the stack.
4417 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4430 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4418
4431
4419 2004-04-03 Fernando Perez <fperez@colorado.edu>
4432 2004-04-03 Fernando Perez <fperez@colorado.edu>
4420
4433
4421 * IPython/genutils.py (Term): Standardized the names of the Term
4434 * IPython/genutils.py (Term): Standardized the names of the Term
4422 class streams to cin/cout/cerr, following C++ naming conventions
4435 class streams to cin/cout/cerr, following C++ naming conventions
4423 (I can't use in/out/err because 'in' is not a valid attribute
4436 (I can't use in/out/err because 'in' is not a valid attribute
4424 name).
4437 name).
4425
4438
4426 * IPython/iplib.py (InteractiveShell.interact): don't increment
4439 * IPython/iplib.py (InteractiveShell.interact): don't increment
4427 the prompt if there's no user input. By Daniel 'Dang' Griffith
4440 the prompt if there's no user input. By Daniel 'Dang' Griffith
4428 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4441 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4429 Francois Pinard.
4442 Francois Pinard.
4430
4443
4431 2004-04-02 Fernando Perez <fperez@colorado.edu>
4444 2004-04-02 Fernando Perez <fperez@colorado.edu>
4432
4445
4433 * IPython/genutils.py (Stream.__init__): Modified to survive at
4446 * IPython/genutils.py (Stream.__init__): Modified to survive at
4434 least importing in contexts where stdin/out/err aren't true file
4447 least importing in contexts where stdin/out/err aren't true file
4435 objects, such as PyCrust (they lack fileno() and mode). However,
4448 objects, such as PyCrust (they lack fileno() and mode). However,
4436 the recovery facilities which rely on these things existing will
4449 the recovery facilities which rely on these things existing will
4437 not work.
4450 not work.
4438
4451
4439 2004-04-01 Fernando Perez <fperez@colorado.edu>
4452 2004-04-01 Fernando Perez <fperez@colorado.edu>
4440
4453
4441 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4454 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4442 use the new getoutputerror() function, so it properly
4455 use the new getoutputerror() function, so it properly
4443 distinguishes stdout/err.
4456 distinguishes stdout/err.
4444
4457
4445 * IPython/genutils.py (getoutputerror): added a function to
4458 * IPython/genutils.py (getoutputerror): added a function to
4446 capture separately the standard output and error of a command.
4459 capture separately the standard output and error of a command.
4447 After a comment from dang on the mailing lists. This code is
4460 After a comment from dang on the mailing lists. This code is
4448 basically a modified version of commands.getstatusoutput(), from
4461 basically a modified version of commands.getstatusoutput(), from
4449 the standard library.
4462 the standard library.
4450
4463
4451 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4464 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4452 '!!' as a special syntax (shorthand) to access @sx.
4465 '!!' as a special syntax (shorthand) to access @sx.
4453
4466
4454 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4467 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4455 command and return its output as a list split on '\n'.
4468 command and return its output as a list split on '\n'.
4456
4469
4457 2004-03-31 Fernando Perez <fperez@colorado.edu>
4470 2004-03-31 Fernando Perez <fperez@colorado.edu>
4458
4471
4459 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4472 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4460 method to dictionaries used as FakeModule instances if they lack
4473 method to dictionaries used as FakeModule instances if they lack
4461 it. At least pydoc in python2.3 breaks for runtime-defined
4474 it. At least pydoc in python2.3 breaks for runtime-defined
4462 functions without this hack. At some point I need to _really_
4475 functions without this hack. At some point I need to _really_
4463 understand what FakeModule is doing, because it's a gross hack.
4476 understand what FakeModule is doing, because it's a gross hack.
4464 But it solves Arnd's problem for now...
4477 But it solves Arnd's problem for now...
4465
4478
4466 2004-02-27 Fernando Perez <fperez@colorado.edu>
4479 2004-02-27 Fernando Perez <fperez@colorado.edu>
4467
4480
4468 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4481 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4469 mode would behave erratically. Also increased the number of
4482 mode would behave erratically. Also increased the number of
4470 possible logs in rotate mod to 999. Thanks to Rod Holland
4483 possible logs in rotate mod to 999. Thanks to Rod Holland
4471 <rhh@StructureLABS.com> for the report and fixes.
4484 <rhh@StructureLABS.com> for the report and fixes.
4472
4485
4473 2004-02-26 Fernando Perez <fperez@colorado.edu>
4486 2004-02-26 Fernando Perez <fperez@colorado.edu>
4474
4487
4475 * IPython/genutils.py (page): Check that the curses module really
4488 * IPython/genutils.py (page): Check that the curses module really
4476 has the initscr attribute before trying to use it. For some
4489 has the initscr attribute before trying to use it. For some
4477 reason, the Solaris curses module is missing this. I think this
4490 reason, the Solaris curses module is missing this. I think this
4478 should be considered a Solaris python bug, but I'm not sure.
4491 should be considered a Solaris python bug, but I'm not sure.
4479
4492
4480 2004-01-17 Fernando Perez <fperez@colorado.edu>
4493 2004-01-17 Fernando Perez <fperez@colorado.edu>
4481
4494
4482 * IPython/genutils.py (Stream.__init__): Changes to try to make
4495 * IPython/genutils.py (Stream.__init__): Changes to try to make
4483 ipython robust against stdin/out/err being closed by the user.
4496 ipython robust against stdin/out/err being closed by the user.
4484 This is 'user error' (and blocks a normal python session, at least
4497 This is 'user error' (and blocks a normal python session, at least
4485 the stdout case). However, Ipython should be able to survive such
4498 the stdout case). However, Ipython should be able to survive such
4486 instances of abuse as gracefully as possible. To simplify the
4499 instances of abuse as gracefully as possible. To simplify the
4487 coding and maintain compatibility with Gary Bishop's Term
4500 coding and maintain compatibility with Gary Bishop's Term
4488 contributions, I've made use of classmethods for this. I think
4501 contributions, I've made use of classmethods for this. I think
4489 this introduces a dependency on python 2.2.
4502 this introduces a dependency on python 2.2.
4490
4503
4491 2004-01-13 Fernando Perez <fperez@colorado.edu>
4504 2004-01-13 Fernando Perez <fperez@colorado.edu>
4492
4505
4493 * IPython/numutils.py (exp_safe): simplified the code a bit and
4506 * IPython/numutils.py (exp_safe): simplified the code a bit and
4494 removed the need for importing the kinds module altogether.
4507 removed the need for importing the kinds module altogether.
4495
4508
4496 2004-01-06 Fernando Perez <fperez@colorado.edu>
4509 2004-01-06 Fernando Perez <fperez@colorado.edu>
4497
4510
4498 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4511 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4499 a magic function instead, after some community feedback. No
4512 a magic function instead, after some community feedback. No
4500 special syntax will exist for it, but its name is deliberately
4513 special syntax will exist for it, but its name is deliberately
4501 very short.
4514 very short.
4502
4515
4503 2003-12-20 Fernando Perez <fperez@colorado.edu>
4516 2003-12-20 Fernando Perez <fperez@colorado.edu>
4504
4517
4505 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4518 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4506 new functionality, to automagically assign the result of a shell
4519 new functionality, to automagically assign the result of a shell
4507 command to a variable. I'll solicit some community feedback on
4520 command to a variable. I'll solicit some community feedback on
4508 this before making it permanent.
4521 this before making it permanent.
4509
4522
4510 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4523 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4511 requested about callables for which inspect couldn't obtain a
4524 requested about callables for which inspect couldn't obtain a
4512 proper argspec. Thanks to a crash report sent by Etienne
4525 proper argspec. Thanks to a crash report sent by Etienne
4513 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4526 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4514
4527
4515 2003-12-09 Fernando Perez <fperez@colorado.edu>
4528 2003-12-09 Fernando Perez <fperez@colorado.edu>
4516
4529
4517 * IPython/genutils.py (page): patch for the pager to work across
4530 * IPython/genutils.py (page): patch for the pager to work across
4518 various versions of Windows. By Gary Bishop.
4531 various versions of Windows. By Gary Bishop.
4519
4532
4520 2003-12-04 Fernando Perez <fperez@colorado.edu>
4533 2003-12-04 Fernando Perez <fperez@colorado.edu>
4521
4534
4522 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4535 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4523 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4536 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4524 While I tested this and it looks ok, there may still be corner
4537 While I tested this and it looks ok, there may still be corner
4525 cases I've missed.
4538 cases I've missed.
4526
4539
4527 2003-12-01 Fernando Perez <fperez@colorado.edu>
4540 2003-12-01 Fernando Perez <fperez@colorado.edu>
4528
4541
4529 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4542 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4530 where a line like 'p,q=1,2' would fail because the automagic
4543 where a line like 'p,q=1,2' would fail because the automagic
4531 system would be triggered for @p.
4544 system would be triggered for @p.
4532
4545
4533 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4546 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4534 cleanups, code unmodified.
4547 cleanups, code unmodified.
4535
4548
4536 * IPython/genutils.py (Term): added a class for IPython to handle
4549 * IPython/genutils.py (Term): added a class for IPython to handle
4537 output. In most cases it will just be a proxy for stdout/err, but
4550 output. In most cases it will just be a proxy for stdout/err, but
4538 having this allows modifications to be made for some platforms,
4551 having this allows modifications to be made for some platforms,
4539 such as handling color escapes under Windows. All of this code
4552 such as handling color escapes under Windows. All of this code
4540 was contributed by Gary Bishop, with minor modifications by me.
4553 was contributed by Gary Bishop, with minor modifications by me.
4541 The actual changes affect many files.
4554 The actual changes affect many files.
4542
4555
4543 2003-11-30 Fernando Perez <fperez@colorado.edu>
4556 2003-11-30 Fernando Perez <fperez@colorado.edu>
4544
4557
4545 * IPython/iplib.py (file_matches): new completion code, courtesy
4558 * IPython/iplib.py (file_matches): new completion code, courtesy
4546 of Jeff Collins. This enables filename completion again under
4559 of Jeff Collins. This enables filename completion again under
4547 python 2.3, which disabled it at the C level.
4560 python 2.3, which disabled it at the C level.
4548
4561
4549 2003-11-11 Fernando Perez <fperez@colorado.edu>
4562 2003-11-11 Fernando Perez <fperez@colorado.edu>
4550
4563
4551 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4564 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4552 for Numeric.array(map(...)), but often convenient.
4565 for Numeric.array(map(...)), but often convenient.
4553
4566
4554 2003-11-05 Fernando Perez <fperez@colorado.edu>
4567 2003-11-05 Fernando Perez <fperez@colorado.edu>
4555
4568
4556 * IPython/numutils.py (frange): Changed a call from int() to
4569 * IPython/numutils.py (frange): Changed a call from int() to
4557 int(round()) to prevent a problem reported with arange() in the
4570 int(round()) to prevent a problem reported with arange() in the
4558 numpy list.
4571 numpy list.
4559
4572
4560 2003-10-06 Fernando Perez <fperez@colorado.edu>
4573 2003-10-06 Fernando Perez <fperez@colorado.edu>
4561
4574
4562 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4575 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4563 prevent crashes if sys lacks an argv attribute (it happens with
4576 prevent crashes if sys lacks an argv attribute (it happens with
4564 embedded interpreters which build a bare-bones sys module).
4577 embedded interpreters which build a bare-bones sys module).
4565 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4578 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4566
4579
4567 2003-09-24 Fernando Perez <fperez@colorado.edu>
4580 2003-09-24 Fernando Perez <fperez@colorado.edu>
4568
4581
4569 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4582 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4570 to protect against poorly written user objects where __getattr__
4583 to protect against poorly written user objects where __getattr__
4571 raises exceptions other than AttributeError. Thanks to a bug
4584 raises exceptions other than AttributeError. Thanks to a bug
4572 report by Oliver Sander <osander-AT-gmx.de>.
4585 report by Oliver Sander <osander-AT-gmx.de>.
4573
4586
4574 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4587 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4575 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4588 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4576
4589
4577 2003-09-09 Fernando Perez <fperez@colorado.edu>
4590 2003-09-09 Fernando Perez <fperez@colorado.edu>
4578
4591
4579 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4592 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4580 unpacking a list whith a callable as first element would
4593 unpacking a list whith a callable as first element would
4581 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4594 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4582 Collins.
4595 Collins.
4583
4596
4584 2003-08-25 *** Released version 0.5.0
4597 2003-08-25 *** Released version 0.5.0
4585
4598
4586 2003-08-22 Fernando Perez <fperez@colorado.edu>
4599 2003-08-22 Fernando Perez <fperez@colorado.edu>
4587
4600
4588 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4601 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4589 improperly defined user exceptions. Thanks to feedback from Mark
4602 improperly defined user exceptions. Thanks to feedback from Mark
4590 Russell <mrussell-AT-verio.net>.
4603 Russell <mrussell-AT-verio.net>.
4591
4604
4592 2003-08-20 Fernando Perez <fperez@colorado.edu>
4605 2003-08-20 Fernando Perez <fperez@colorado.edu>
4593
4606
4594 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4607 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4595 printing so that it would print multi-line string forms starting
4608 printing so that it would print multi-line string forms starting
4596 with a new line. This way the formatting is better respected for
4609 with a new line. This way the formatting is better respected for
4597 objects which work hard to make nice string forms.
4610 objects which work hard to make nice string forms.
4598
4611
4599 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4612 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4600 autocall would overtake data access for objects with both
4613 autocall would overtake data access for objects with both
4601 __getitem__ and __call__.
4614 __getitem__ and __call__.
4602
4615
4603 2003-08-19 *** Released version 0.5.0-rc1
4616 2003-08-19 *** Released version 0.5.0-rc1
4604
4617
4605 2003-08-19 Fernando Perez <fperez@colorado.edu>
4618 2003-08-19 Fernando Perez <fperez@colorado.edu>
4606
4619
4607 * IPython/deep_reload.py (load_tail): single tiny change here
4620 * IPython/deep_reload.py (load_tail): single tiny change here
4608 seems to fix the long-standing bug of dreload() failing to work
4621 seems to fix the long-standing bug of dreload() failing to work
4609 for dotted names. But this module is pretty tricky, so I may have
4622 for dotted names. But this module is pretty tricky, so I may have
4610 missed some subtlety. Needs more testing!.
4623 missed some subtlety. Needs more testing!.
4611
4624
4612 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4625 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4613 exceptions which have badly implemented __str__ methods.
4626 exceptions which have badly implemented __str__ methods.
4614 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4627 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4615 which I've been getting reports about from Python 2.3 users. I
4628 which I've been getting reports about from Python 2.3 users. I
4616 wish I had a simple test case to reproduce the problem, so I could
4629 wish I had a simple test case to reproduce the problem, so I could
4617 either write a cleaner workaround or file a bug report if
4630 either write a cleaner workaround or file a bug report if
4618 necessary.
4631 necessary.
4619
4632
4620 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4633 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4621 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4634 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4622 a bug report by Tjabo Kloppenburg.
4635 a bug report by Tjabo Kloppenburg.
4623
4636
4624 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4637 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4625 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4638 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4626 seems rather unstable. Thanks to a bug report by Tjabo
4639 seems rather unstable. Thanks to a bug report by Tjabo
4627 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4640 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4628
4641
4629 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4642 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4630 this out soon because of the critical fixes in the inner loop for
4643 this out soon because of the critical fixes in the inner loop for
4631 generators.
4644 generators.
4632
4645
4633 * IPython/Magic.py (Magic.getargspec): removed. This (and
4646 * IPython/Magic.py (Magic.getargspec): removed. This (and
4634 _get_def) have been obsoleted by OInspect for a long time, I
4647 _get_def) have been obsoleted by OInspect for a long time, I
4635 hadn't noticed that they were dead code.
4648 hadn't noticed that they were dead code.
4636 (Magic._ofind): restored _ofind functionality for a few literals
4649 (Magic._ofind): restored _ofind functionality for a few literals
4637 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4650 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4638 for things like "hello".capitalize?, since that would require a
4651 for things like "hello".capitalize?, since that would require a
4639 potentially dangerous eval() again.
4652 potentially dangerous eval() again.
4640
4653
4641 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4654 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4642 logic a bit more to clean up the escapes handling and minimize the
4655 logic a bit more to clean up the escapes handling and minimize the
4643 use of _ofind to only necessary cases. The interactive 'feel' of
4656 use of _ofind to only necessary cases. The interactive 'feel' of
4644 IPython should have improved quite a bit with the changes in
4657 IPython should have improved quite a bit with the changes in
4645 _prefilter and _ofind (besides being far safer than before).
4658 _prefilter and _ofind (besides being far safer than before).
4646
4659
4647 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4660 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4648 obscure, never reported). Edit would fail to find the object to
4661 obscure, never reported). Edit would fail to find the object to
4649 edit under some circumstances.
4662 edit under some circumstances.
4650 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4663 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4651 which were causing double-calling of generators. Those eval calls
4664 which were causing double-calling of generators. Those eval calls
4652 were _very_ dangerous, since code with side effects could be
4665 were _very_ dangerous, since code with side effects could be
4653 triggered. As they say, 'eval is evil'... These were the
4666 triggered. As they say, 'eval is evil'... These were the
4654 nastiest evals in IPython. Besides, _ofind is now far simpler,
4667 nastiest evals in IPython. Besides, _ofind is now far simpler,
4655 and it should also be quite a bit faster. Its use of inspect is
4668 and it should also be quite a bit faster. Its use of inspect is
4656 also safer, so perhaps some of the inspect-related crashes I've
4669 also safer, so perhaps some of the inspect-related crashes I've
4657 seen lately with Python 2.3 might be taken care of. That will
4670 seen lately with Python 2.3 might be taken care of. That will
4658 need more testing.
4671 need more testing.
4659
4672
4660 2003-08-17 Fernando Perez <fperez@colorado.edu>
4673 2003-08-17 Fernando Perez <fperez@colorado.edu>
4661
4674
4662 * IPython/iplib.py (InteractiveShell._prefilter): significant
4675 * IPython/iplib.py (InteractiveShell._prefilter): significant
4663 simplifications to the logic for handling user escapes. Faster
4676 simplifications to the logic for handling user escapes. Faster
4664 and simpler code.
4677 and simpler code.
4665
4678
4666 2003-08-14 Fernando Perez <fperez@colorado.edu>
4679 2003-08-14 Fernando Perez <fperez@colorado.edu>
4667
4680
4668 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4681 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4669 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4682 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4670 but it should be quite a bit faster. And the recursive version
4683 but it should be quite a bit faster. And the recursive version
4671 generated O(log N) intermediate storage for all rank>1 arrays,
4684 generated O(log N) intermediate storage for all rank>1 arrays,
4672 even if they were contiguous.
4685 even if they were contiguous.
4673 (l1norm): Added this function.
4686 (l1norm): Added this function.
4674 (norm): Added this function for arbitrary norms (including
4687 (norm): Added this function for arbitrary norms (including
4675 l-infinity). l1 and l2 are still special cases for convenience
4688 l-infinity). l1 and l2 are still special cases for convenience
4676 and speed.
4689 and speed.
4677
4690
4678 2003-08-03 Fernando Perez <fperez@colorado.edu>
4691 2003-08-03 Fernando Perez <fperez@colorado.edu>
4679
4692
4680 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4693 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4681 exceptions, which now raise PendingDeprecationWarnings in Python
4694 exceptions, which now raise PendingDeprecationWarnings in Python
4682 2.3. There were some in Magic and some in Gnuplot2.
4695 2.3. There were some in Magic and some in Gnuplot2.
4683
4696
4684 2003-06-30 Fernando Perez <fperez@colorado.edu>
4697 2003-06-30 Fernando Perez <fperez@colorado.edu>
4685
4698
4686 * IPython/genutils.py (page): modified to call curses only for
4699 * IPython/genutils.py (page): modified to call curses only for
4687 terminals where TERM=='xterm'. After problems under many other
4700 terminals where TERM=='xterm'. After problems under many other
4688 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4701 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4689
4702
4690 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4703 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4691 would be triggered when readline was absent. This was just an old
4704 would be triggered when readline was absent. This was just an old
4692 debugging statement I'd forgotten to take out.
4705 debugging statement I'd forgotten to take out.
4693
4706
4694 2003-06-20 Fernando Perez <fperez@colorado.edu>
4707 2003-06-20 Fernando Perez <fperez@colorado.edu>
4695
4708
4696 * IPython/genutils.py (clock): modified to return only user time
4709 * IPython/genutils.py (clock): modified to return only user time
4697 (not counting system time), after a discussion on scipy. While
4710 (not counting system time), after a discussion on scipy. While
4698 system time may be a useful quantity occasionally, it may much
4711 system time may be a useful quantity occasionally, it may much
4699 more easily be skewed by occasional swapping or other similar
4712 more easily be skewed by occasional swapping or other similar
4700 activity.
4713 activity.
4701
4714
4702 2003-06-05 Fernando Perez <fperez@colorado.edu>
4715 2003-06-05 Fernando Perez <fperez@colorado.edu>
4703
4716
4704 * IPython/numutils.py (identity): new function, for building
4717 * IPython/numutils.py (identity): new function, for building
4705 arbitrary rank Kronecker deltas (mostly backwards compatible with
4718 arbitrary rank Kronecker deltas (mostly backwards compatible with
4706 Numeric.identity)
4719 Numeric.identity)
4707
4720
4708 2003-06-03 Fernando Perez <fperez@colorado.edu>
4721 2003-06-03 Fernando Perez <fperez@colorado.edu>
4709
4722
4710 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4723 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4711 arguments passed to magics with spaces, to allow trailing '\' to
4724 arguments passed to magics with spaces, to allow trailing '\' to
4712 work normally (mainly for Windows users).
4725 work normally (mainly for Windows users).
4713
4726
4714 2003-05-29 Fernando Perez <fperez@colorado.edu>
4727 2003-05-29 Fernando Perez <fperez@colorado.edu>
4715
4728
4716 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4729 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4717 instead of pydoc.help. This fixes a bizarre behavior where
4730 instead of pydoc.help. This fixes a bizarre behavior where
4718 printing '%s' % locals() would trigger the help system. Now
4731 printing '%s' % locals() would trigger the help system. Now
4719 ipython behaves like normal python does.
4732 ipython behaves like normal python does.
4720
4733
4721 Note that if one does 'from pydoc import help', the bizarre
4734 Note that if one does 'from pydoc import help', the bizarre
4722 behavior returns, but this will also happen in normal python, so
4735 behavior returns, but this will also happen in normal python, so
4723 it's not an ipython bug anymore (it has to do with how pydoc.help
4736 it's not an ipython bug anymore (it has to do with how pydoc.help
4724 is implemented).
4737 is implemented).
4725
4738
4726 2003-05-22 Fernando Perez <fperez@colorado.edu>
4739 2003-05-22 Fernando Perez <fperez@colorado.edu>
4727
4740
4728 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4741 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4729 return [] instead of None when nothing matches, also match to end
4742 return [] instead of None when nothing matches, also match to end
4730 of line. Patch by Gary Bishop.
4743 of line. Patch by Gary Bishop.
4731
4744
4732 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4745 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4733 protection as before, for files passed on the command line. This
4746 protection as before, for files passed on the command line. This
4734 prevents the CrashHandler from kicking in if user files call into
4747 prevents the CrashHandler from kicking in if user files call into
4735 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4748 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4736 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4749 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4737
4750
4738 2003-05-20 *** Released version 0.4.0
4751 2003-05-20 *** Released version 0.4.0
4739
4752
4740 2003-05-20 Fernando Perez <fperez@colorado.edu>
4753 2003-05-20 Fernando Perez <fperez@colorado.edu>
4741
4754
4742 * setup.py: added support for manpages. It's a bit hackish b/c of
4755 * setup.py: added support for manpages. It's a bit hackish b/c of
4743 a bug in the way the bdist_rpm distutils target handles gzipped
4756 a bug in the way the bdist_rpm distutils target handles gzipped
4744 manpages, but it works. After a patch by Jack.
4757 manpages, but it works. After a patch by Jack.
4745
4758
4746 2003-05-19 Fernando Perez <fperez@colorado.edu>
4759 2003-05-19 Fernando Perez <fperez@colorado.edu>
4747
4760
4748 * IPython/numutils.py: added a mockup of the kinds module, since
4761 * IPython/numutils.py: added a mockup of the kinds module, since
4749 it was recently removed from Numeric. This way, numutils will
4762 it was recently removed from Numeric. This way, numutils will
4750 work for all users even if they are missing kinds.
4763 work for all users even if they are missing kinds.
4751
4764
4752 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4765 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4753 failure, which can occur with SWIG-wrapped extensions. After a
4766 failure, which can occur with SWIG-wrapped extensions. After a
4754 crash report from Prabhu.
4767 crash report from Prabhu.
4755
4768
4756 2003-05-16 Fernando Perez <fperez@colorado.edu>
4769 2003-05-16 Fernando Perez <fperez@colorado.edu>
4757
4770
4758 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4771 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4759 protect ipython from user code which may call directly
4772 protect ipython from user code which may call directly
4760 sys.excepthook (this looks like an ipython crash to the user, even
4773 sys.excepthook (this looks like an ipython crash to the user, even
4761 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4774 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4762 This is especially important to help users of WxWindows, but may
4775 This is especially important to help users of WxWindows, but may
4763 also be useful in other cases.
4776 also be useful in other cases.
4764
4777
4765 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4778 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4766 an optional tb_offset to be specified, and to preserve exception
4779 an optional tb_offset to be specified, and to preserve exception
4767 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4780 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4768
4781
4769 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4782 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4770
4783
4771 2003-05-15 Fernando Perez <fperez@colorado.edu>
4784 2003-05-15 Fernando Perez <fperez@colorado.edu>
4772
4785
4773 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4786 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4774 installing for a new user under Windows.
4787 installing for a new user under Windows.
4775
4788
4776 2003-05-12 Fernando Perez <fperez@colorado.edu>
4789 2003-05-12 Fernando Perez <fperez@colorado.edu>
4777
4790
4778 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4791 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4779 handler for Emacs comint-based lines. Currently it doesn't do
4792 handler for Emacs comint-based lines. Currently it doesn't do
4780 much (but importantly, it doesn't update the history cache). In
4793 much (but importantly, it doesn't update the history cache). In
4781 the future it may be expanded if Alex needs more functionality
4794 the future it may be expanded if Alex needs more functionality
4782 there.
4795 there.
4783
4796
4784 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4797 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4785 info to crash reports.
4798 info to crash reports.
4786
4799
4787 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4800 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4788 just like Python's -c. Also fixed crash with invalid -color
4801 just like Python's -c. Also fixed crash with invalid -color
4789 option value at startup. Thanks to Will French
4802 option value at startup. Thanks to Will French
4790 <wfrench-AT-bestweb.net> for the bug report.
4803 <wfrench-AT-bestweb.net> for the bug report.
4791
4804
4792 2003-05-09 Fernando Perez <fperez@colorado.edu>
4805 2003-05-09 Fernando Perez <fperez@colorado.edu>
4793
4806
4794 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4807 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4795 to EvalDict (it's a mapping, after all) and simplified its code
4808 to EvalDict (it's a mapping, after all) and simplified its code
4796 quite a bit, after a nice discussion on c.l.py where Gustavo
4809 quite a bit, after a nice discussion on c.l.py where Gustavo
4797 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4810 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4798
4811
4799 2003-04-30 Fernando Perez <fperez@colorado.edu>
4812 2003-04-30 Fernando Perez <fperez@colorado.edu>
4800
4813
4801 * IPython/genutils.py (timings_out): modified it to reduce its
4814 * IPython/genutils.py (timings_out): modified it to reduce its
4802 overhead in the common reps==1 case.
4815 overhead in the common reps==1 case.
4803
4816
4804 2003-04-29 Fernando Perez <fperez@colorado.edu>
4817 2003-04-29 Fernando Perez <fperez@colorado.edu>
4805
4818
4806 * IPython/genutils.py (timings_out): Modified to use the resource
4819 * IPython/genutils.py (timings_out): Modified to use the resource
4807 module, which avoids the wraparound problems of time.clock().
4820 module, which avoids the wraparound problems of time.clock().
4808
4821
4809 2003-04-17 *** Released version 0.2.15pre4
4822 2003-04-17 *** Released version 0.2.15pre4
4810
4823
4811 2003-04-17 Fernando Perez <fperez@colorado.edu>
4824 2003-04-17 Fernando Perez <fperez@colorado.edu>
4812
4825
4813 * setup.py (scriptfiles): Split windows-specific stuff over to a
4826 * setup.py (scriptfiles): Split windows-specific stuff over to a
4814 separate file, in an attempt to have a Windows GUI installer.
4827 separate file, in an attempt to have a Windows GUI installer.
4815 That didn't work, but part of the groundwork is done.
4828 That didn't work, but part of the groundwork is done.
4816
4829
4817 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4830 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4818 indent/unindent with 4 spaces. Particularly useful in combination
4831 indent/unindent with 4 spaces. Particularly useful in combination
4819 with the new auto-indent option.
4832 with the new auto-indent option.
4820
4833
4821 2003-04-16 Fernando Perez <fperez@colorado.edu>
4834 2003-04-16 Fernando Perez <fperez@colorado.edu>
4822
4835
4823 * IPython/Magic.py: various replacements of self.rc for
4836 * IPython/Magic.py: various replacements of self.rc for
4824 self.shell.rc. A lot more remains to be done to fully disentangle
4837 self.shell.rc. A lot more remains to be done to fully disentangle
4825 this class from the main Shell class.
4838 this class from the main Shell class.
4826
4839
4827 * IPython/GnuplotRuntime.py: added checks for mouse support so
4840 * IPython/GnuplotRuntime.py: added checks for mouse support so
4828 that we don't try to enable it if the current gnuplot doesn't
4841 that we don't try to enable it if the current gnuplot doesn't
4829 really support it. Also added checks so that we don't try to
4842 really support it. Also added checks so that we don't try to
4830 enable persist under Windows (where Gnuplot doesn't recognize the
4843 enable persist under Windows (where Gnuplot doesn't recognize the
4831 option).
4844 option).
4832
4845
4833 * IPython/iplib.py (InteractiveShell.interact): Added optional
4846 * IPython/iplib.py (InteractiveShell.interact): Added optional
4834 auto-indenting code, after a patch by King C. Shu
4847 auto-indenting code, after a patch by King C. Shu
4835 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4848 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4836 get along well with pasting indented code. If I ever figure out
4849 get along well with pasting indented code. If I ever figure out
4837 how to make that part go well, it will become on by default.
4850 how to make that part go well, it will become on by default.
4838
4851
4839 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4852 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4840 crash ipython if there was an unmatched '%' in the user's prompt
4853 crash ipython if there was an unmatched '%' in the user's prompt
4841 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4854 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4842
4855
4843 * IPython/iplib.py (InteractiveShell.interact): removed the
4856 * IPython/iplib.py (InteractiveShell.interact): removed the
4844 ability to ask the user whether he wants to crash or not at the
4857 ability to ask the user whether he wants to crash or not at the
4845 'last line' exception handler. Calling functions at that point
4858 'last line' exception handler. Calling functions at that point
4846 changes the stack, and the error reports would have incorrect
4859 changes the stack, and the error reports would have incorrect
4847 tracebacks.
4860 tracebacks.
4848
4861
4849 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4862 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4850 pass through a peger a pretty-printed form of any object. After a
4863 pass through a peger a pretty-printed form of any object. After a
4851 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4864 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4852
4865
4853 2003-04-14 Fernando Perez <fperez@colorado.edu>
4866 2003-04-14 Fernando Perez <fperez@colorado.edu>
4854
4867
4855 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4868 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4856 all files in ~ would be modified at first install (instead of
4869 all files in ~ would be modified at first install (instead of
4857 ~/.ipython). This could be potentially disastrous, as the
4870 ~/.ipython). This could be potentially disastrous, as the
4858 modification (make line-endings native) could damage binary files.
4871 modification (make line-endings native) could damage binary files.
4859
4872
4860 2003-04-10 Fernando Perez <fperez@colorado.edu>
4873 2003-04-10 Fernando Perez <fperez@colorado.edu>
4861
4874
4862 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4875 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4863 handle only lines which are invalid python. This now means that
4876 handle only lines which are invalid python. This now means that
4864 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4877 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4865 for the bug report.
4878 for the bug report.
4866
4879
4867 2003-04-01 Fernando Perez <fperez@colorado.edu>
4880 2003-04-01 Fernando Perez <fperez@colorado.edu>
4868
4881
4869 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4882 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4870 where failing to set sys.last_traceback would crash pdb.pm().
4883 where failing to set sys.last_traceback would crash pdb.pm().
4871 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4884 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4872 report.
4885 report.
4873
4886
4874 2003-03-25 Fernando Perez <fperez@colorado.edu>
4887 2003-03-25 Fernando Perez <fperez@colorado.edu>
4875
4888
4876 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4889 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4877 before printing it (it had a lot of spurious blank lines at the
4890 before printing it (it had a lot of spurious blank lines at the
4878 end).
4891 end).
4879
4892
4880 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4893 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4881 output would be sent 21 times! Obviously people don't use this
4894 output would be sent 21 times! Obviously people don't use this
4882 too often, or I would have heard about it.
4895 too often, or I would have heard about it.
4883
4896
4884 2003-03-24 Fernando Perez <fperez@colorado.edu>
4897 2003-03-24 Fernando Perez <fperez@colorado.edu>
4885
4898
4886 * setup.py (scriptfiles): renamed the data_files parameter from
4899 * setup.py (scriptfiles): renamed the data_files parameter from
4887 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4900 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4888 for the patch.
4901 for the patch.
4889
4902
4890 2003-03-20 Fernando Perez <fperez@colorado.edu>
4903 2003-03-20 Fernando Perez <fperez@colorado.edu>
4891
4904
4892 * IPython/genutils.py (error): added error() and fatal()
4905 * IPython/genutils.py (error): added error() and fatal()
4893 functions.
4906 functions.
4894
4907
4895 2003-03-18 *** Released version 0.2.15pre3
4908 2003-03-18 *** Released version 0.2.15pre3
4896
4909
4897 2003-03-18 Fernando Perez <fperez@colorado.edu>
4910 2003-03-18 Fernando Perez <fperez@colorado.edu>
4898
4911
4899 * setupext/install_data_ext.py
4912 * setupext/install_data_ext.py
4900 (install_data_ext.initialize_options): Class contributed by Jack
4913 (install_data_ext.initialize_options): Class contributed by Jack
4901 Moffit for fixing the old distutils hack. He is sending this to
4914 Moffit for fixing the old distutils hack. He is sending this to
4902 the distutils folks so in the future we may not need it as a
4915 the distutils folks so in the future we may not need it as a
4903 private fix.
4916 private fix.
4904
4917
4905 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4918 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4906 changes for Debian packaging. See his patch for full details.
4919 changes for Debian packaging. See his patch for full details.
4907 The old distutils hack of making the ipythonrc* files carry a
4920 The old distutils hack of making the ipythonrc* files carry a
4908 bogus .py extension is gone, at last. Examples were moved to a
4921 bogus .py extension is gone, at last. Examples were moved to a
4909 separate subdir under doc/, and the separate executable scripts
4922 separate subdir under doc/, and the separate executable scripts
4910 now live in their own directory. Overall a great cleanup. The
4923 now live in their own directory. Overall a great cleanup. The
4911 manual was updated to use the new files, and setup.py has been
4924 manual was updated to use the new files, and setup.py has been
4912 fixed for this setup.
4925 fixed for this setup.
4913
4926
4914 * IPython/PyColorize.py (Parser.usage): made non-executable and
4927 * IPython/PyColorize.py (Parser.usage): made non-executable and
4915 created a pycolor wrapper around it to be included as a script.
4928 created a pycolor wrapper around it to be included as a script.
4916
4929
4917 2003-03-12 *** Released version 0.2.15pre2
4930 2003-03-12 *** Released version 0.2.15pre2
4918
4931
4919 2003-03-12 Fernando Perez <fperez@colorado.edu>
4932 2003-03-12 Fernando Perez <fperez@colorado.edu>
4920
4933
4921 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4934 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4922 long-standing problem with garbage characters in some terminals.
4935 long-standing problem with garbage characters in some terminals.
4923 The issue was really that the \001 and \002 escapes must _only_ be
4936 The issue was really that the \001 and \002 escapes must _only_ be
4924 passed to input prompts (which call readline), but _never_ to
4937 passed to input prompts (which call readline), but _never_ to
4925 normal text to be printed on screen. I changed ColorANSI to have
4938 normal text to be printed on screen. I changed ColorANSI to have
4926 two classes: TermColors and InputTermColors, each with the
4939 two classes: TermColors and InputTermColors, each with the
4927 appropriate escapes for input prompts or normal text. The code in
4940 appropriate escapes for input prompts or normal text. The code in
4928 Prompts.py got slightly more complicated, but this very old and
4941 Prompts.py got slightly more complicated, but this very old and
4929 annoying bug is finally fixed.
4942 annoying bug is finally fixed.
4930
4943
4931 All the credit for nailing down the real origin of this problem
4944 All the credit for nailing down the real origin of this problem
4932 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4945 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4933 *Many* thanks to him for spending quite a bit of effort on this.
4946 *Many* thanks to him for spending quite a bit of effort on this.
4934
4947
4935 2003-03-05 *** Released version 0.2.15pre1
4948 2003-03-05 *** Released version 0.2.15pre1
4936
4949
4937 2003-03-03 Fernando Perez <fperez@colorado.edu>
4950 2003-03-03 Fernando Perez <fperez@colorado.edu>
4938
4951
4939 * IPython/FakeModule.py: Moved the former _FakeModule to a
4952 * IPython/FakeModule.py: Moved the former _FakeModule to a
4940 separate file, because it's also needed by Magic (to fix a similar
4953 separate file, because it's also needed by Magic (to fix a similar
4941 pickle-related issue in @run).
4954 pickle-related issue in @run).
4942
4955
4943 2003-03-02 Fernando Perez <fperez@colorado.edu>
4956 2003-03-02 Fernando Perez <fperez@colorado.edu>
4944
4957
4945 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4958 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4946 the autocall option at runtime.
4959 the autocall option at runtime.
4947 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4960 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4948 across Magic.py to start separating Magic from InteractiveShell.
4961 across Magic.py to start separating Magic from InteractiveShell.
4949 (Magic._ofind): Fixed to return proper namespace for dotted
4962 (Magic._ofind): Fixed to return proper namespace for dotted
4950 names. Before, a dotted name would always return 'not currently
4963 names. Before, a dotted name would always return 'not currently
4951 defined', because it would find the 'parent'. s.x would be found,
4964 defined', because it would find the 'parent'. s.x would be found,
4952 but since 'x' isn't defined by itself, it would get confused.
4965 but since 'x' isn't defined by itself, it would get confused.
4953 (Magic.magic_run): Fixed pickling problems reported by Ralf
4966 (Magic.magic_run): Fixed pickling problems reported by Ralf
4954 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4967 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4955 that I'd used when Mike Heeter reported similar issues at the
4968 that I'd used when Mike Heeter reported similar issues at the
4956 top-level, but now for @run. It boils down to injecting the
4969 top-level, but now for @run. It boils down to injecting the
4957 namespace where code is being executed with something that looks
4970 namespace where code is being executed with something that looks
4958 enough like a module to fool pickle.dump(). Since a pickle stores
4971 enough like a module to fool pickle.dump(). Since a pickle stores
4959 a named reference to the importing module, we need this for
4972 a named reference to the importing module, we need this for
4960 pickles to save something sensible.
4973 pickles to save something sensible.
4961
4974
4962 * IPython/ipmaker.py (make_IPython): added an autocall option.
4975 * IPython/ipmaker.py (make_IPython): added an autocall option.
4963
4976
4964 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4977 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4965 the auto-eval code. Now autocalling is an option, and the code is
4978 the auto-eval code. Now autocalling is an option, and the code is
4966 also vastly safer. There is no more eval() involved at all.
4979 also vastly safer. There is no more eval() involved at all.
4967
4980
4968 2003-03-01 Fernando Perez <fperez@colorado.edu>
4981 2003-03-01 Fernando Perez <fperez@colorado.edu>
4969
4982
4970 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4983 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4971 dict with named keys instead of a tuple.
4984 dict with named keys instead of a tuple.
4972
4985
4973 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4986 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4974
4987
4975 * setup.py (make_shortcut): Fixed message about directories
4988 * setup.py (make_shortcut): Fixed message about directories
4976 created during Windows installation (the directories were ok, just
4989 created during Windows installation (the directories were ok, just
4977 the printed message was misleading). Thanks to Chris Liechti
4990 the printed message was misleading). Thanks to Chris Liechti
4978 <cliechti-AT-gmx.net> for the heads up.
4991 <cliechti-AT-gmx.net> for the heads up.
4979
4992
4980 2003-02-21 Fernando Perez <fperez@colorado.edu>
4993 2003-02-21 Fernando Perez <fperez@colorado.edu>
4981
4994
4982 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4995 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4983 of ValueError exception when checking for auto-execution. This
4996 of ValueError exception when checking for auto-execution. This
4984 one is raised by things like Numeric arrays arr.flat when the
4997 one is raised by things like Numeric arrays arr.flat when the
4985 array is non-contiguous.
4998 array is non-contiguous.
4986
4999
4987 2003-01-31 Fernando Perez <fperez@colorado.edu>
5000 2003-01-31 Fernando Perez <fperez@colorado.edu>
4988
5001
4989 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
5002 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4990 not return any value at all (even though the command would get
5003 not return any value at all (even though the command would get
4991 executed).
5004 executed).
4992 (xsys): Flush stdout right after printing the command to ensure
5005 (xsys): Flush stdout right after printing the command to ensure
4993 proper ordering of commands and command output in the total
5006 proper ordering of commands and command output in the total
4994 output.
5007 output.
4995 (SystemExec/xsys/bq): Switched the names of xsys/bq and
5008 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4996 system/getoutput as defaults. The old ones are kept for
5009 system/getoutput as defaults. The old ones are kept for
4997 compatibility reasons, so no code which uses this library needs
5010 compatibility reasons, so no code which uses this library needs
4998 changing.
5011 changing.
4999
5012
5000 2003-01-27 *** Released version 0.2.14
5013 2003-01-27 *** Released version 0.2.14
5001
5014
5002 2003-01-25 Fernando Perez <fperez@colorado.edu>
5015 2003-01-25 Fernando Perez <fperez@colorado.edu>
5003
5016
5004 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
5017 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
5005 functions defined in previous edit sessions could not be re-edited
5018 functions defined in previous edit sessions could not be re-edited
5006 (because the temp files were immediately removed). Now temp files
5019 (because the temp files were immediately removed). Now temp files
5007 are removed only at IPython's exit.
5020 are removed only at IPython's exit.
5008 (Magic.magic_run): Improved @run to perform shell-like expansions
5021 (Magic.magic_run): Improved @run to perform shell-like expansions
5009 on its arguments (~users and $VARS). With this, @run becomes more
5022 on its arguments (~users and $VARS). With this, @run becomes more
5010 like a normal command-line.
5023 like a normal command-line.
5011
5024
5012 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
5025 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
5013 bugs related to embedding and cleaned up that code. A fairly
5026 bugs related to embedding and cleaned up that code. A fairly
5014 important one was the impossibility to access the global namespace
5027 important one was the impossibility to access the global namespace
5015 through the embedded IPython (only local variables were visible).
5028 through the embedded IPython (only local variables were visible).
5016
5029
5017 2003-01-14 Fernando Perez <fperez@colorado.edu>
5030 2003-01-14 Fernando Perez <fperez@colorado.edu>
5018
5031
5019 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
5032 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
5020 auto-calling to be a bit more conservative. Now it doesn't get
5033 auto-calling to be a bit more conservative. Now it doesn't get
5021 triggered if any of '!=()<>' are in the rest of the input line, to
5034 triggered if any of '!=()<>' are in the rest of the input line, to
5022 allow comparing callables. Thanks to Alex for the heads up.
5035 allow comparing callables. Thanks to Alex for the heads up.
5023
5036
5024 2003-01-07 Fernando Perez <fperez@colorado.edu>
5037 2003-01-07 Fernando Perez <fperez@colorado.edu>
5025
5038
5026 * IPython/genutils.py (page): fixed estimation of the number of
5039 * IPython/genutils.py (page): fixed estimation of the number of
5027 lines in a string to be paged to simply count newlines. This
5040 lines in a string to be paged to simply count newlines. This
5028 prevents over-guessing due to embedded escape sequences. A better
5041 prevents over-guessing due to embedded escape sequences. A better
5029 long-term solution would involve stripping out the control chars
5042 long-term solution would involve stripping out the control chars
5030 for the count, but it's potentially so expensive I just don't
5043 for the count, but it's potentially so expensive I just don't
5031 think it's worth doing.
5044 think it's worth doing.
5032
5045
5033 2002-12-19 *** Released version 0.2.14pre50
5046 2002-12-19 *** Released version 0.2.14pre50
5034
5047
5035 2002-12-19 Fernando Perez <fperez@colorado.edu>
5048 2002-12-19 Fernando Perez <fperez@colorado.edu>
5036
5049
5037 * tools/release (version): Changed release scripts to inform
5050 * tools/release (version): Changed release scripts to inform
5038 Andrea and build a NEWS file with a list of recent changes.
5051 Andrea and build a NEWS file with a list of recent changes.
5039
5052
5040 * IPython/ColorANSI.py (__all__): changed terminal detection
5053 * IPython/ColorANSI.py (__all__): changed terminal detection
5041 code. Seems to work better for xterms without breaking
5054 code. Seems to work better for xterms without breaking
5042 konsole. Will need more testing to determine if WinXP and Mac OSX
5055 konsole. Will need more testing to determine if WinXP and Mac OSX
5043 also work ok.
5056 also work ok.
5044
5057
5045 2002-12-18 *** Released version 0.2.14pre49
5058 2002-12-18 *** Released version 0.2.14pre49
5046
5059
5047 2002-12-18 Fernando Perez <fperez@colorado.edu>
5060 2002-12-18 Fernando Perez <fperez@colorado.edu>
5048
5061
5049 * Docs: added new info about Mac OSX, from Andrea.
5062 * Docs: added new info about Mac OSX, from Andrea.
5050
5063
5051 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5064 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5052 allow direct plotting of python strings whose format is the same
5065 allow direct plotting of python strings whose format is the same
5053 of gnuplot data files.
5066 of gnuplot data files.
5054
5067
5055 2002-12-16 Fernando Perez <fperez@colorado.edu>
5068 2002-12-16 Fernando Perez <fperez@colorado.edu>
5056
5069
5057 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5070 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5058 value of exit question to be acknowledged.
5071 value of exit question to be acknowledged.
5059
5072
5060 2002-12-03 Fernando Perez <fperez@colorado.edu>
5073 2002-12-03 Fernando Perez <fperez@colorado.edu>
5061
5074
5062 * IPython/ipmaker.py: removed generators, which had been added
5075 * IPython/ipmaker.py: removed generators, which had been added
5063 by mistake in an earlier debugging run. This was causing trouble
5076 by mistake in an earlier debugging run. This was causing trouble
5064 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5077 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5065 for pointing this out.
5078 for pointing this out.
5066
5079
5067 2002-11-17 Fernando Perez <fperez@colorado.edu>
5080 2002-11-17 Fernando Perez <fperez@colorado.edu>
5068
5081
5069 * Manual: updated the Gnuplot section.
5082 * Manual: updated the Gnuplot section.
5070
5083
5071 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5084 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5072 a much better split of what goes in Runtime and what goes in
5085 a much better split of what goes in Runtime and what goes in
5073 Interactive.
5086 Interactive.
5074
5087
5075 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5088 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5076 being imported from iplib.
5089 being imported from iplib.
5077
5090
5078 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5091 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5079 for command-passing. Now the global Gnuplot instance is called
5092 for command-passing. Now the global Gnuplot instance is called
5080 'gp' instead of 'g', which was really a far too fragile and
5093 'gp' instead of 'g', which was really a far too fragile and
5081 common name.
5094 common name.
5082
5095
5083 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5096 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5084 bounding boxes generated by Gnuplot for square plots.
5097 bounding boxes generated by Gnuplot for square plots.
5085
5098
5086 * IPython/genutils.py (popkey): new function added. I should
5099 * IPython/genutils.py (popkey): new function added. I should
5087 suggest this on c.l.py as a dict method, it seems useful.
5100 suggest this on c.l.py as a dict method, it seems useful.
5088
5101
5089 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5102 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5090 to transparently handle PostScript generation. MUCH better than
5103 to transparently handle PostScript generation. MUCH better than
5091 the previous plot_eps/replot_eps (which I removed now). The code
5104 the previous plot_eps/replot_eps (which I removed now). The code
5092 is also fairly clean and well documented now (including
5105 is also fairly clean and well documented now (including
5093 docstrings).
5106 docstrings).
5094
5107
5095 2002-11-13 Fernando Perez <fperez@colorado.edu>
5108 2002-11-13 Fernando Perez <fperez@colorado.edu>
5096
5109
5097 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5110 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5098 (inconsistent with options).
5111 (inconsistent with options).
5099
5112
5100 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5113 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5101 manually disabled, I don't know why. Fixed it.
5114 manually disabled, I don't know why. Fixed it.
5102 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5115 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5103 eps output.
5116 eps output.
5104
5117
5105 2002-11-12 Fernando Perez <fperez@colorado.edu>
5118 2002-11-12 Fernando Perez <fperez@colorado.edu>
5106
5119
5107 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5120 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5108 don't propagate up to caller. Fixes crash reported by François
5121 don't propagate up to caller. Fixes crash reported by François
5109 Pinard.
5122 Pinard.
5110
5123
5111 2002-11-09 Fernando Perez <fperez@colorado.edu>
5124 2002-11-09 Fernando Perez <fperez@colorado.edu>
5112
5125
5113 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5126 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5114 history file for new users.
5127 history file for new users.
5115 (make_IPython): fixed bug where initial install would leave the
5128 (make_IPython): fixed bug where initial install would leave the
5116 user running in the .ipython dir.
5129 user running in the .ipython dir.
5117 (make_IPython): fixed bug where config dir .ipython would be
5130 (make_IPython): fixed bug where config dir .ipython would be
5118 created regardless of the given -ipythondir option. Thanks to Cory
5131 created regardless of the given -ipythondir option. Thanks to Cory
5119 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5132 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5120
5133
5121 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5134 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5122 type confirmations. Will need to use it in all of IPython's code
5135 type confirmations. Will need to use it in all of IPython's code
5123 consistently.
5136 consistently.
5124
5137
5125 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5138 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5126 context to print 31 lines instead of the default 5. This will make
5139 context to print 31 lines instead of the default 5. This will make
5127 the crash reports extremely detailed in case the problem is in
5140 the crash reports extremely detailed in case the problem is in
5128 libraries I don't have access to.
5141 libraries I don't have access to.
5129
5142
5130 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5143 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5131 line of defense' code to still crash, but giving users fair
5144 line of defense' code to still crash, but giving users fair
5132 warning. I don't want internal errors to go unreported: if there's
5145 warning. I don't want internal errors to go unreported: if there's
5133 an internal problem, IPython should crash and generate a full
5146 an internal problem, IPython should crash and generate a full
5134 report.
5147 report.
5135
5148
5136 2002-11-08 Fernando Perez <fperez@colorado.edu>
5149 2002-11-08 Fernando Perez <fperez@colorado.edu>
5137
5150
5138 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5151 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5139 otherwise uncaught exceptions which can appear if people set
5152 otherwise uncaught exceptions which can appear if people set
5140 sys.stdout to something badly broken. Thanks to a crash report
5153 sys.stdout to something badly broken. Thanks to a crash report
5141 from henni-AT-mail.brainbot.com.
5154 from henni-AT-mail.brainbot.com.
5142
5155
5143 2002-11-04 Fernando Perez <fperez@colorado.edu>
5156 2002-11-04 Fernando Perez <fperez@colorado.edu>
5144
5157
5145 * IPython/iplib.py (InteractiveShell.interact): added
5158 * IPython/iplib.py (InteractiveShell.interact): added
5146 __IPYTHON__active to the builtins. It's a flag which goes on when
5159 __IPYTHON__active to the builtins. It's a flag which goes on when
5147 the interaction starts and goes off again when it stops. This
5160 the interaction starts and goes off again when it stops. This
5148 allows embedding code to detect being inside IPython. Before this
5161 allows embedding code to detect being inside IPython. Before this
5149 was done via __IPYTHON__, but that only shows that an IPython
5162 was done via __IPYTHON__, but that only shows that an IPython
5150 instance has been created.
5163 instance has been created.
5151
5164
5152 * IPython/Magic.py (Magic.magic_env): I realized that in a
5165 * IPython/Magic.py (Magic.magic_env): I realized that in a
5153 UserDict, instance.data holds the data as a normal dict. So I
5166 UserDict, instance.data holds the data as a normal dict. So I
5154 modified @env to return os.environ.data instead of rebuilding a
5167 modified @env to return os.environ.data instead of rebuilding a
5155 dict by hand.
5168 dict by hand.
5156
5169
5157 2002-11-02 Fernando Perez <fperez@colorado.edu>
5170 2002-11-02 Fernando Perez <fperez@colorado.edu>
5158
5171
5159 * IPython/genutils.py (warn): changed so that level 1 prints no
5172 * IPython/genutils.py (warn): changed so that level 1 prints no
5160 header. Level 2 is now the default (with 'WARNING' header, as
5173 header. Level 2 is now the default (with 'WARNING' header, as
5161 before). I think I tracked all places where changes were needed in
5174 before). I think I tracked all places where changes were needed in
5162 IPython, but outside code using the old level numbering may have
5175 IPython, but outside code using the old level numbering may have
5163 broken.
5176 broken.
5164
5177
5165 * IPython/iplib.py (InteractiveShell.runcode): added this to
5178 * IPython/iplib.py (InteractiveShell.runcode): added this to
5166 handle the tracebacks in SystemExit traps correctly. The previous
5179 handle the tracebacks in SystemExit traps correctly. The previous
5167 code (through interact) was printing more of the stack than
5180 code (through interact) was printing more of the stack than
5168 necessary, showing IPython internal code to the user.
5181 necessary, showing IPython internal code to the user.
5169
5182
5170 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5183 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5171 default. Now that the default at the confirmation prompt is yes,
5184 default. Now that the default at the confirmation prompt is yes,
5172 it's not so intrusive. François' argument that ipython sessions
5185 it's not so intrusive. François' argument that ipython sessions
5173 tend to be complex enough not to lose them from an accidental C-d,
5186 tend to be complex enough not to lose them from an accidental C-d,
5174 is a valid one.
5187 is a valid one.
5175
5188
5176 * IPython/iplib.py (InteractiveShell.interact): added a
5189 * IPython/iplib.py (InteractiveShell.interact): added a
5177 showtraceback() call to the SystemExit trap, and modified the exit
5190 showtraceback() call to the SystemExit trap, and modified the exit
5178 confirmation to have yes as the default.
5191 confirmation to have yes as the default.
5179
5192
5180 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5193 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5181 this file. It's been gone from the code for a long time, this was
5194 this file. It's been gone from the code for a long time, this was
5182 simply leftover junk.
5195 simply leftover junk.
5183
5196
5184 2002-11-01 Fernando Perez <fperez@colorado.edu>
5197 2002-11-01 Fernando Perez <fperez@colorado.edu>
5185
5198
5186 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5199 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5187 added. If set, IPython now traps EOF and asks for
5200 added. If set, IPython now traps EOF and asks for
5188 confirmation. After a request by François Pinard.
5201 confirmation. After a request by François Pinard.
5189
5202
5190 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5203 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5191 of @abort, and with a new (better) mechanism for handling the
5204 of @abort, and with a new (better) mechanism for handling the
5192 exceptions.
5205 exceptions.
5193
5206
5194 2002-10-27 Fernando Perez <fperez@colorado.edu>
5207 2002-10-27 Fernando Perez <fperez@colorado.edu>
5195
5208
5196 * IPython/usage.py (__doc__): updated the --help information and
5209 * IPython/usage.py (__doc__): updated the --help information and
5197 the ipythonrc file to indicate that -log generates
5210 the ipythonrc file to indicate that -log generates
5198 ./ipython.log. Also fixed the corresponding info in @logstart.
5211 ./ipython.log. Also fixed the corresponding info in @logstart.
5199 This and several other fixes in the manuals thanks to reports by
5212 This and several other fixes in the manuals thanks to reports by
5200 François Pinard <pinard-AT-iro.umontreal.ca>.
5213 François Pinard <pinard-AT-iro.umontreal.ca>.
5201
5214
5202 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5215 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5203 refer to @logstart (instead of @log, which doesn't exist).
5216 refer to @logstart (instead of @log, which doesn't exist).
5204
5217
5205 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5218 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5206 AttributeError crash. Thanks to Christopher Armstrong
5219 AttributeError crash. Thanks to Christopher Armstrong
5207 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5220 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5208 introduced recently (in 0.2.14pre37) with the fix to the eval
5221 introduced recently (in 0.2.14pre37) with the fix to the eval
5209 problem mentioned below.
5222 problem mentioned below.
5210
5223
5211 2002-10-17 Fernando Perez <fperez@colorado.edu>
5224 2002-10-17 Fernando Perez <fperez@colorado.edu>
5212
5225
5213 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5226 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5214 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5227 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5215
5228
5216 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5229 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5217 this function to fix a problem reported by Alex Schmolck. He saw
5230 this function to fix a problem reported by Alex Schmolck. He saw
5218 it with list comprehensions and generators, which were getting
5231 it with list comprehensions and generators, which were getting
5219 called twice. The real problem was an 'eval' call in testing for
5232 called twice. The real problem was an 'eval' call in testing for
5220 automagic which was evaluating the input line silently.
5233 automagic which was evaluating the input line silently.
5221
5234
5222 This is a potentially very nasty bug, if the input has side
5235 This is a potentially very nasty bug, if the input has side
5223 effects which must not be repeated. The code is much cleaner now,
5236 effects which must not be repeated. The code is much cleaner now,
5224 without any blanket 'except' left and with a regexp test for
5237 without any blanket 'except' left and with a regexp test for
5225 actual function names.
5238 actual function names.
5226
5239
5227 But an eval remains, which I'm not fully comfortable with. I just
5240 But an eval remains, which I'm not fully comfortable with. I just
5228 don't know how to find out if an expression could be a callable in
5241 don't know how to find out if an expression could be a callable in
5229 the user's namespace without doing an eval on the string. However
5242 the user's namespace without doing an eval on the string. However
5230 that string is now much more strictly checked so that no code
5243 that string is now much more strictly checked so that no code
5231 slips by, so the eval should only happen for things that can
5244 slips by, so the eval should only happen for things that can
5232 really be only function/method names.
5245 really be only function/method names.
5233
5246
5234 2002-10-15 Fernando Perez <fperez@colorado.edu>
5247 2002-10-15 Fernando Perez <fperez@colorado.edu>
5235
5248
5236 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5249 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5237 OSX information to main manual, removed README_Mac_OSX file from
5250 OSX information to main manual, removed README_Mac_OSX file from
5238 distribution. Also updated credits for recent additions.
5251 distribution. Also updated credits for recent additions.
5239
5252
5240 2002-10-10 Fernando Perez <fperez@colorado.edu>
5253 2002-10-10 Fernando Perez <fperez@colorado.edu>
5241
5254
5242 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5255 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5243 terminal-related issues. Many thanks to Andrea Riciputi
5256 terminal-related issues. Many thanks to Andrea Riciputi
5244 <andrea.riciputi-AT-libero.it> for writing it.
5257 <andrea.riciputi-AT-libero.it> for writing it.
5245
5258
5246 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5259 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5247 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5260 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5248
5261
5249 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5262 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5250 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5263 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5251 <syver-en-AT-online.no> who both submitted patches for this problem.
5264 <syver-en-AT-online.no> who both submitted patches for this problem.
5252
5265
5253 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5266 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5254 global embedding to make sure that things don't overwrite user
5267 global embedding to make sure that things don't overwrite user
5255 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5268 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5256
5269
5257 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5270 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5258 compatibility. Thanks to Hayden Callow
5271 compatibility. Thanks to Hayden Callow
5259 <h.callow-AT-elec.canterbury.ac.nz>
5272 <h.callow-AT-elec.canterbury.ac.nz>
5260
5273
5261 2002-10-04 Fernando Perez <fperez@colorado.edu>
5274 2002-10-04 Fernando Perez <fperez@colorado.edu>
5262
5275
5263 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5276 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5264 Gnuplot.File objects.
5277 Gnuplot.File objects.
5265
5278
5266 2002-07-23 Fernando Perez <fperez@colorado.edu>
5279 2002-07-23 Fernando Perez <fperez@colorado.edu>
5267
5280
5268 * IPython/genutils.py (timing): Added timings() and timing() for
5281 * IPython/genutils.py (timing): Added timings() and timing() for
5269 quick access to the most commonly needed data, the execution
5282 quick access to the most commonly needed data, the execution
5270 times. Old timing() renamed to timings_out().
5283 times. Old timing() renamed to timings_out().
5271
5284
5272 2002-07-18 Fernando Perez <fperez@colorado.edu>
5285 2002-07-18 Fernando Perez <fperez@colorado.edu>
5273
5286
5274 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5287 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5275 bug with nested instances disrupting the parent's tab completion.
5288 bug with nested instances disrupting the parent's tab completion.
5276
5289
5277 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5290 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5278 all_completions code to begin the emacs integration.
5291 all_completions code to begin the emacs integration.
5279
5292
5280 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5293 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5281 argument to allow titling individual arrays when plotting.
5294 argument to allow titling individual arrays when plotting.
5282
5295
5283 2002-07-15 Fernando Perez <fperez@colorado.edu>
5296 2002-07-15 Fernando Perez <fperez@colorado.edu>
5284
5297
5285 * setup.py (make_shortcut): changed to retrieve the value of
5298 * setup.py (make_shortcut): changed to retrieve the value of
5286 'Program Files' directory from the registry (this value changes in
5299 'Program Files' directory from the registry (this value changes in
5287 non-english versions of Windows). Thanks to Thomas Fanslau
5300 non-english versions of Windows). Thanks to Thomas Fanslau
5288 <tfanslau-AT-gmx.de> for the report.
5301 <tfanslau-AT-gmx.de> for the report.
5289
5302
5290 2002-07-10 Fernando Perez <fperez@colorado.edu>
5303 2002-07-10 Fernando Perez <fperez@colorado.edu>
5291
5304
5292 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5305 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5293 a bug in pdb, which crashes if a line with only whitespace is
5306 a bug in pdb, which crashes if a line with only whitespace is
5294 entered. Bug report submitted to sourceforge.
5307 entered. Bug report submitted to sourceforge.
5295
5308
5296 2002-07-09 Fernando Perez <fperez@colorado.edu>
5309 2002-07-09 Fernando Perez <fperez@colorado.edu>
5297
5310
5298 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5311 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5299 reporting exceptions (it's a bug in inspect.py, I just set a
5312 reporting exceptions (it's a bug in inspect.py, I just set a
5300 workaround).
5313 workaround).
5301
5314
5302 2002-07-08 Fernando Perez <fperez@colorado.edu>
5315 2002-07-08 Fernando Perez <fperez@colorado.edu>
5303
5316
5304 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5317 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5305 __IPYTHON__ in __builtins__ to show up in user_ns.
5318 __IPYTHON__ in __builtins__ to show up in user_ns.
5306
5319
5307 2002-07-03 Fernando Perez <fperez@colorado.edu>
5320 2002-07-03 Fernando Perez <fperez@colorado.edu>
5308
5321
5309 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5322 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5310 name from @gp_set_instance to @gp_set_default.
5323 name from @gp_set_instance to @gp_set_default.
5311
5324
5312 * IPython/ipmaker.py (make_IPython): default editor value set to
5325 * IPython/ipmaker.py (make_IPython): default editor value set to
5313 '0' (a string), to match the rc file. Otherwise will crash when
5326 '0' (a string), to match the rc file. Otherwise will crash when
5314 .strip() is called on it.
5327 .strip() is called on it.
5315
5328
5316
5329
5317 2002-06-28 Fernando Perez <fperez@colorado.edu>
5330 2002-06-28 Fernando Perez <fperez@colorado.edu>
5318
5331
5319 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5332 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5320 of files in current directory when a file is executed via
5333 of files in current directory when a file is executed via
5321 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5334 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5322
5335
5323 * setup.py (manfiles): fix for rpm builds, submitted by RA
5336 * setup.py (manfiles): fix for rpm builds, submitted by RA
5324 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5337 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5325
5338
5326 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5339 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5327 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5340 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5328 string!). A. Schmolck caught this one.
5341 string!). A. Schmolck caught this one.
5329
5342
5330 2002-06-27 Fernando Perez <fperez@colorado.edu>
5343 2002-06-27 Fernando Perez <fperez@colorado.edu>
5331
5344
5332 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5345 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5333 defined files at the cmd line. __name__ wasn't being set to
5346 defined files at the cmd line. __name__ wasn't being set to
5334 __main__.
5347 __main__.
5335
5348
5336 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5349 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5337 regular lists and tuples besides Numeric arrays.
5350 regular lists and tuples besides Numeric arrays.
5338
5351
5339 * IPython/Prompts.py (CachedOutput.__call__): Added output
5352 * IPython/Prompts.py (CachedOutput.__call__): Added output
5340 supression for input ending with ';'. Similar to Mathematica and
5353 supression for input ending with ';'. Similar to Mathematica and
5341 Matlab. The _* vars and Out[] list are still updated, just like
5354 Matlab. The _* vars and Out[] list are still updated, just like
5342 Mathematica behaves.
5355 Mathematica behaves.
5343
5356
5344 2002-06-25 Fernando Perez <fperez@colorado.edu>
5357 2002-06-25 Fernando Perez <fperez@colorado.edu>
5345
5358
5346 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5359 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5347 .ini extensions for profiels under Windows.
5360 .ini extensions for profiels under Windows.
5348
5361
5349 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5362 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5350 string form. Fix contributed by Alexander Schmolck
5363 string form. Fix contributed by Alexander Schmolck
5351 <a.schmolck-AT-gmx.net>
5364 <a.schmolck-AT-gmx.net>
5352
5365
5353 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5366 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5354 pre-configured Gnuplot instance.
5367 pre-configured Gnuplot instance.
5355
5368
5356 2002-06-21 Fernando Perez <fperez@colorado.edu>
5369 2002-06-21 Fernando Perez <fperez@colorado.edu>
5357
5370
5358 * IPython/numutils.py (exp_safe): new function, works around the
5371 * IPython/numutils.py (exp_safe): new function, works around the
5359 underflow problems in Numeric.
5372 underflow problems in Numeric.
5360 (log2): New fn. Safe log in base 2: returns exact integer answer
5373 (log2): New fn. Safe log in base 2: returns exact integer answer
5361 for exact integer powers of 2.
5374 for exact integer powers of 2.
5362
5375
5363 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5376 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5364 properly.
5377 properly.
5365
5378
5366 2002-06-20 Fernando Perez <fperez@colorado.edu>
5379 2002-06-20 Fernando Perez <fperez@colorado.edu>
5367
5380
5368 * IPython/genutils.py (timing): new function like
5381 * IPython/genutils.py (timing): new function like
5369 Mathematica's. Similar to time_test, but returns more info.
5382 Mathematica's. Similar to time_test, but returns more info.
5370
5383
5371 2002-06-18 Fernando Perez <fperez@colorado.edu>
5384 2002-06-18 Fernando Perez <fperez@colorado.edu>
5372
5385
5373 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5386 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5374 according to Mike Heeter's suggestions.
5387 according to Mike Heeter's suggestions.
5375
5388
5376 2002-06-16 Fernando Perez <fperez@colorado.edu>
5389 2002-06-16 Fernando Perez <fperez@colorado.edu>
5377
5390
5378 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5391 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5379 system. GnuplotMagic is gone as a user-directory option. New files
5392 system. GnuplotMagic is gone as a user-directory option. New files
5380 make it easier to use all the gnuplot stuff both from external
5393 make it easier to use all the gnuplot stuff both from external
5381 programs as well as from IPython. Had to rewrite part of
5394 programs as well as from IPython. Had to rewrite part of
5382 hardcopy() b/c of a strange bug: often the ps files simply don't
5395 hardcopy() b/c of a strange bug: often the ps files simply don't
5383 get created, and require a repeat of the command (often several
5396 get created, and require a repeat of the command (often several
5384 times).
5397 times).
5385
5398
5386 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5399 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5387 resolve output channel at call time, so that if sys.stderr has
5400 resolve output channel at call time, so that if sys.stderr has
5388 been redirected by user this gets honored.
5401 been redirected by user this gets honored.
5389
5402
5390 2002-06-13 Fernando Perez <fperez@colorado.edu>
5403 2002-06-13 Fernando Perez <fperez@colorado.edu>
5391
5404
5392 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5405 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5393 IPShell. Kept a copy with the old names to avoid breaking people's
5406 IPShell. Kept a copy with the old names to avoid breaking people's
5394 embedded code.
5407 embedded code.
5395
5408
5396 * IPython/ipython: simplified it to the bare minimum after
5409 * IPython/ipython: simplified it to the bare minimum after
5397 Holger's suggestions. Added info about how to use it in
5410 Holger's suggestions. Added info about how to use it in
5398 PYTHONSTARTUP.
5411 PYTHONSTARTUP.
5399
5412
5400 * IPython/Shell.py (IPythonShell): changed the options passing
5413 * IPython/Shell.py (IPythonShell): changed the options passing
5401 from a string with funky %s replacements to a straight list. Maybe
5414 from a string with funky %s replacements to a straight list. Maybe
5402 a bit more typing, but it follows sys.argv conventions, so there's
5415 a bit more typing, but it follows sys.argv conventions, so there's
5403 less special-casing to remember.
5416 less special-casing to remember.
5404
5417
5405 2002-06-12 Fernando Perez <fperez@colorado.edu>
5418 2002-06-12 Fernando Perez <fperez@colorado.edu>
5406
5419
5407 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5420 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5408 command. Thanks to a suggestion by Mike Heeter.
5421 command. Thanks to a suggestion by Mike Heeter.
5409 (Magic.magic_pfile): added behavior to look at filenames if given
5422 (Magic.magic_pfile): added behavior to look at filenames if given
5410 arg is not a defined object.
5423 arg is not a defined object.
5411 (Magic.magic_save): New @save function to save code snippets. Also
5424 (Magic.magic_save): New @save function to save code snippets. Also
5412 a Mike Heeter idea.
5425 a Mike Heeter idea.
5413
5426
5414 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5427 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5415 plot() and replot(). Much more convenient now, especially for
5428 plot() and replot(). Much more convenient now, especially for
5416 interactive use.
5429 interactive use.
5417
5430
5418 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5431 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5419 filenames.
5432 filenames.
5420
5433
5421 2002-06-02 Fernando Perez <fperez@colorado.edu>
5434 2002-06-02 Fernando Perez <fperez@colorado.edu>
5422
5435
5423 * IPython/Struct.py (Struct.__init__): modified to admit
5436 * IPython/Struct.py (Struct.__init__): modified to admit
5424 initialization via another struct.
5437 initialization via another struct.
5425
5438
5426 * IPython/genutils.py (SystemExec.__init__): New stateful
5439 * IPython/genutils.py (SystemExec.__init__): New stateful
5427 interface to xsys and bq. Useful for writing system scripts.
5440 interface to xsys and bq. Useful for writing system scripts.
5428
5441
5429 2002-05-30 Fernando Perez <fperez@colorado.edu>
5442 2002-05-30 Fernando Perez <fperez@colorado.edu>
5430
5443
5431 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5444 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5432 documents. This will make the user download smaller (it's getting
5445 documents. This will make the user download smaller (it's getting
5433 too big).
5446 too big).
5434
5447
5435 2002-05-29 Fernando Perez <fperez@colorado.edu>
5448 2002-05-29 Fernando Perez <fperez@colorado.edu>
5436
5449
5437 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5450 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5438 fix problems with shelve and pickle. Seems to work, but I don't
5451 fix problems with shelve and pickle. Seems to work, but I don't
5439 know if corner cases break it. Thanks to Mike Heeter
5452 know if corner cases break it. Thanks to Mike Heeter
5440 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5453 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5441
5454
5442 2002-05-24 Fernando Perez <fperez@colorado.edu>
5455 2002-05-24 Fernando Perez <fperez@colorado.edu>
5443
5456
5444 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5457 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5445 macros having broken.
5458 macros having broken.
5446
5459
5447 2002-05-21 Fernando Perez <fperez@colorado.edu>
5460 2002-05-21 Fernando Perez <fperez@colorado.edu>
5448
5461
5449 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5462 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5450 introduced logging bug: all history before logging started was
5463 introduced logging bug: all history before logging started was
5451 being written one character per line! This came from the redesign
5464 being written one character per line! This came from the redesign
5452 of the input history as a special list which slices to strings,
5465 of the input history as a special list which slices to strings,
5453 not to lists.
5466 not to lists.
5454
5467
5455 2002-05-20 Fernando Perez <fperez@colorado.edu>
5468 2002-05-20 Fernando Perez <fperez@colorado.edu>
5456
5469
5457 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5470 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5458 be an attribute of all classes in this module. The design of these
5471 be an attribute of all classes in this module. The design of these
5459 classes needs some serious overhauling.
5472 classes needs some serious overhauling.
5460
5473
5461 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5474 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5462 which was ignoring '_' in option names.
5475 which was ignoring '_' in option names.
5463
5476
5464 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5477 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5465 'Verbose_novars' to 'Context' and made it the new default. It's a
5478 'Verbose_novars' to 'Context' and made it the new default. It's a
5466 bit more readable and also safer than verbose.
5479 bit more readable and also safer than verbose.
5467
5480
5468 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5481 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5469 triple-quoted strings.
5482 triple-quoted strings.
5470
5483
5471 * IPython/OInspect.py (__all__): new module exposing the object
5484 * IPython/OInspect.py (__all__): new module exposing the object
5472 introspection facilities. Now the corresponding magics are dummy
5485 introspection facilities. Now the corresponding magics are dummy
5473 wrappers around this. Having this module will make it much easier
5486 wrappers around this. Having this module will make it much easier
5474 to put these functions into our modified pdb.
5487 to put these functions into our modified pdb.
5475 This new object inspector system uses the new colorizing module,
5488 This new object inspector system uses the new colorizing module,
5476 so source code and other things are nicely syntax highlighted.
5489 so source code and other things are nicely syntax highlighted.
5477
5490
5478 2002-05-18 Fernando Perez <fperez@colorado.edu>
5491 2002-05-18 Fernando Perez <fperez@colorado.edu>
5479
5492
5480 * IPython/ColorANSI.py: Split the coloring tools into a separate
5493 * IPython/ColorANSI.py: Split the coloring tools into a separate
5481 module so I can use them in other code easier (they were part of
5494 module so I can use them in other code easier (they were part of
5482 ultraTB).
5495 ultraTB).
5483
5496
5484 2002-05-17 Fernando Perez <fperez@colorado.edu>
5497 2002-05-17 Fernando Perez <fperez@colorado.edu>
5485
5498
5486 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5499 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5487 fixed it to set the global 'g' also to the called instance, as
5500 fixed it to set the global 'g' also to the called instance, as
5488 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5501 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5489 user's 'g' variables).
5502 user's 'g' variables).
5490
5503
5491 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5504 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5492 global variables (aliases to _ih,_oh) so that users which expect
5505 global variables (aliases to _ih,_oh) so that users which expect
5493 In[5] or Out[7] to work aren't unpleasantly surprised.
5506 In[5] or Out[7] to work aren't unpleasantly surprised.
5494 (InputList.__getslice__): new class to allow executing slices of
5507 (InputList.__getslice__): new class to allow executing slices of
5495 input history directly. Very simple class, complements the use of
5508 input history directly. Very simple class, complements the use of
5496 macros.
5509 macros.
5497
5510
5498 2002-05-16 Fernando Perez <fperez@colorado.edu>
5511 2002-05-16 Fernando Perez <fperez@colorado.edu>
5499
5512
5500 * setup.py (docdirbase): make doc directory be just doc/IPython
5513 * setup.py (docdirbase): make doc directory be just doc/IPython
5501 without version numbers, it will reduce clutter for users.
5514 without version numbers, it will reduce clutter for users.
5502
5515
5503 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5516 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5504 execfile call to prevent possible memory leak. See for details:
5517 execfile call to prevent possible memory leak. See for details:
5505 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5518 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5506
5519
5507 2002-05-15 Fernando Perez <fperez@colorado.edu>
5520 2002-05-15 Fernando Perez <fperez@colorado.edu>
5508
5521
5509 * IPython/Magic.py (Magic.magic_psource): made the object
5522 * IPython/Magic.py (Magic.magic_psource): made the object
5510 introspection names be more standard: pdoc, pdef, pfile and
5523 introspection names be more standard: pdoc, pdef, pfile and
5511 psource. They all print/page their output, and it makes
5524 psource. They all print/page their output, and it makes
5512 remembering them easier. Kept old names for compatibility as
5525 remembering them easier. Kept old names for compatibility as
5513 aliases.
5526 aliases.
5514
5527
5515 2002-05-14 Fernando Perez <fperez@colorado.edu>
5528 2002-05-14 Fernando Perez <fperez@colorado.edu>
5516
5529
5517 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5530 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5518 what the mouse problem was. The trick is to use gnuplot with temp
5531 what the mouse problem was. The trick is to use gnuplot with temp
5519 files and NOT with pipes (for data communication), because having
5532 files and NOT with pipes (for data communication), because having
5520 both pipes and the mouse on is bad news.
5533 both pipes and the mouse on is bad news.
5521
5534
5522 2002-05-13 Fernando Perez <fperez@colorado.edu>
5535 2002-05-13 Fernando Perez <fperez@colorado.edu>
5523
5536
5524 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5537 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5525 bug. Information would be reported about builtins even when
5538 bug. Information would be reported about builtins even when
5526 user-defined functions overrode them.
5539 user-defined functions overrode them.
5527
5540
5528 2002-05-11 Fernando Perez <fperez@colorado.edu>
5541 2002-05-11 Fernando Perez <fperez@colorado.edu>
5529
5542
5530 * IPython/__init__.py (__all__): removed FlexCompleter from
5543 * IPython/__init__.py (__all__): removed FlexCompleter from
5531 __all__ so that things don't fail in platforms without readline.
5544 __all__ so that things don't fail in platforms without readline.
5532
5545
5533 2002-05-10 Fernando Perez <fperez@colorado.edu>
5546 2002-05-10 Fernando Perez <fperez@colorado.edu>
5534
5547
5535 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5548 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5536 it requires Numeric, effectively making Numeric a dependency for
5549 it requires Numeric, effectively making Numeric a dependency for
5537 IPython.
5550 IPython.
5538
5551
5539 * Released 0.2.13
5552 * Released 0.2.13
5540
5553
5541 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5554 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5542 profiler interface. Now all the major options from the profiler
5555 profiler interface. Now all the major options from the profiler
5543 module are directly supported in IPython, both for single
5556 module are directly supported in IPython, both for single
5544 expressions (@prun) and for full programs (@run -p).
5557 expressions (@prun) and for full programs (@run -p).
5545
5558
5546 2002-05-09 Fernando Perez <fperez@colorado.edu>
5559 2002-05-09 Fernando Perez <fperez@colorado.edu>
5547
5560
5548 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5561 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5549 magic properly formatted for screen.
5562 magic properly formatted for screen.
5550
5563
5551 * setup.py (make_shortcut): Changed things to put pdf version in
5564 * setup.py (make_shortcut): Changed things to put pdf version in
5552 doc/ instead of doc/manual (had to change lyxport a bit).
5565 doc/ instead of doc/manual (had to change lyxport a bit).
5553
5566
5554 * IPython/Magic.py (Profile.string_stats): made profile runs go
5567 * IPython/Magic.py (Profile.string_stats): made profile runs go
5555 through pager (they are long and a pager allows searching, saving,
5568 through pager (they are long and a pager allows searching, saving,
5556 etc.)
5569 etc.)
5557
5570
5558 2002-05-08 Fernando Perez <fperez@colorado.edu>
5571 2002-05-08 Fernando Perez <fperez@colorado.edu>
5559
5572
5560 * Released 0.2.12
5573 * Released 0.2.12
5561
5574
5562 2002-05-06 Fernando Perez <fperez@colorado.edu>
5575 2002-05-06 Fernando Perez <fperez@colorado.edu>
5563
5576
5564 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5577 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5565 introduced); 'hist n1 n2' was broken.
5578 introduced); 'hist n1 n2' was broken.
5566 (Magic.magic_pdb): added optional on/off arguments to @pdb
5579 (Magic.magic_pdb): added optional on/off arguments to @pdb
5567 (Magic.magic_run): added option -i to @run, which executes code in
5580 (Magic.magic_run): added option -i to @run, which executes code in
5568 the IPython namespace instead of a clean one. Also added @irun as
5581 the IPython namespace instead of a clean one. Also added @irun as
5569 an alias to @run -i.
5582 an alias to @run -i.
5570
5583
5571 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5584 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5572 fixed (it didn't really do anything, the namespaces were wrong).
5585 fixed (it didn't really do anything, the namespaces were wrong).
5573
5586
5574 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5587 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5575
5588
5576 * IPython/__init__.py (__all__): Fixed package namespace, now
5589 * IPython/__init__.py (__all__): Fixed package namespace, now
5577 'import IPython' does give access to IPython.<all> as
5590 'import IPython' does give access to IPython.<all> as
5578 expected. Also renamed __release__ to Release.
5591 expected. Also renamed __release__ to Release.
5579
5592
5580 * IPython/Debugger.py (__license__): created new Pdb class which
5593 * IPython/Debugger.py (__license__): created new Pdb class which
5581 functions like a drop-in for the normal pdb.Pdb but does NOT
5594 functions like a drop-in for the normal pdb.Pdb but does NOT
5582 import readline by default. This way it doesn't muck up IPython's
5595 import readline by default. This way it doesn't muck up IPython's
5583 readline handling, and now tab-completion finally works in the
5596 readline handling, and now tab-completion finally works in the
5584 debugger -- sort of. It completes things globally visible, but the
5597 debugger -- sort of. It completes things globally visible, but the
5585 completer doesn't track the stack as pdb walks it. That's a bit
5598 completer doesn't track the stack as pdb walks it. That's a bit
5586 tricky, and I'll have to implement it later.
5599 tricky, and I'll have to implement it later.
5587
5600
5588 2002-05-05 Fernando Perez <fperez@colorado.edu>
5601 2002-05-05 Fernando Perez <fperez@colorado.edu>
5589
5602
5590 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5603 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5591 magic docstrings when printed via ? (explicit \'s were being
5604 magic docstrings when printed via ? (explicit \'s were being
5592 printed).
5605 printed).
5593
5606
5594 * IPython/ipmaker.py (make_IPython): fixed namespace
5607 * IPython/ipmaker.py (make_IPython): fixed namespace
5595 identification bug. Now variables loaded via logs or command-line
5608 identification bug. Now variables loaded via logs or command-line
5596 files are recognized in the interactive namespace by @who.
5609 files are recognized in the interactive namespace by @who.
5597
5610
5598 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5611 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5599 log replay system stemming from the string form of Structs.
5612 log replay system stemming from the string form of Structs.
5600
5613
5601 * IPython/Magic.py (Macro.__init__): improved macros to properly
5614 * IPython/Magic.py (Macro.__init__): improved macros to properly
5602 handle magic commands in them.
5615 handle magic commands in them.
5603 (Magic.magic_logstart): usernames are now expanded so 'logstart
5616 (Magic.magic_logstart): usernames are now expanded so 'logstart
5604 ~/mylog' now works.
5617 ~/mylog' now works.
5605
5618
5606 * IPython/iplib.py (complete): fixed bug where paths starting with
5619 * IPython/iplib.py (complete): fixed bug where paths starting with
5607 '/' would be completed as magic names.
5620 '/' would be completed as magic names.
5608
5621
5609 2002-05-04 Fernando Perez <fperez@colorado.edu>
5622 2002-05-04 Fernando Perez <fperez@colorado.edu>
5610
5623
5611 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5624 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5612 allow running full programs under the profiler's control.
5625 allow running full programs under the profiler's control.
5613
5626
5614 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5627 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5615 mode to report exceptions verbosely but without formatting
5628 mode to report exceptions verbosely but without formatting
5616 variables. This addresses the issue of ipython 'freezing' (it's
5629 variables. This addresses the issue of ipython 'freezing' (it's
5617 not frozen, but caught in an expensive formatting loop) when huge
5630 not frozen, but caught in an expensive formatting loop) when huge
5618 variables are in the context of an exception.
5631 variables are in the context of an exception.
5619 (VerboseTB.text): Added '--->' markers at line where exception was
5632 (VerboseTB.text): Added '--->' markers at line where exception was
5620 triggered. Much clearer to read, especially in NoColor modes.
5633 triggered. Much clearer to read, especially in NoColor modes.
5621
5634
5622 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5635 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5623 implemented in reverse when changing to the new parse_options().
5636 implemented in reverse when changing to the new parse_options().
5624
5637
5625 2002-05-03 Fernando Perez <fperez@colorado.edu>
5638 2002-05-03 Fernando Perez <fperez@colorado.edu>
5626
5639
5627 * IPython/Magic.py (Magic.parse_options): new function so that
5640 * IPython/Magic.py (Magic.parse_options): new function so that
5628 magics can parse options easier.
5641 magics can parse options easier.
5629 (Magic.magic_prun): new function similar to profile.run(),
5642 (Magic.magic_prun): new function similar to profile.run(),
5630 suggested by Chris Hart.
5643 suggested by Chris Hart.
5631 (Magic.magic_cd): fixed behavior so that it only changes if
5644 (Magic.magic_cd): fixed behavior so that it only changes if
5632 directory actually is in history.
5645 directory actually is in history.
5633
5646
5634 * IPython/usage.py (__doc__): added information about potential
5647 * IPython/usage.py (__doc__): added information about potential
5635 slowness of Verbose exception mode when there are huge data
5648 slowness of Verbose exception mode when there are huge data
5636 structures to be formatted (thanks to Archie Paulson).
5649 structures to be formatted (thanks to Archie Paulson).
5637
5650
5638 * IPython/ipmaker.py (make_IPython): Changed default logging
5651 * IPython/ipmaker.py (make_IPython): Changed default logging
5639 (when simply called with -log) to use curr_dir/ipython.log in
5652 (when simply called with -log) to use curr_dir/ipython.log in
5640 rotate mode. Fixed crash which was occuring with -log before
5653 rotate mode. Fixed crash which was occuring with -log before
5641 (thanks to Jim Boyle).
5654 (thanks to Jim Boyle).
5642
5655
5643 2002-05-01 Fernando Perez <fperez@colorado.edu>
5656 2002-05-01 Fernando Perez <fperez@colorado.edu>
5644
5657
5645 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5658 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5646 was nasty -- though somewhat of a corner case).
5659 was nasty -- though somewhat of a corner case).
5647
5660
5648 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5661 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5649 text (was a bug).
5662 text (was a bug).
5650
5663
5651 2002-04-30 Fernando Perez <fperez@colorado.edu>
5664 2002-04-30 Fernando Perez <fperez@colorado.edu>
5652
5665
5653 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5666 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5654 a print after ^D or ^C from the user so that the In[] prompt
5667 a print after ^D or ^C from the user so that the In[] prompt
5655 doesn't over-run the gnuplot one.
5668 doesn't over-run the gnuplot one.
5656
5669
5657 2002-04-29 Fernando Perez <fperez@colorado.edu>
5670 2002-04-29 Fernando Perez <fperez@colorado.edu>
5658
5671
5659 * Released 0.2.10
5672 * Released 0.2.10
5660
5673
5661 * IPython/__release__.py (version): get date dynamically.
5674 * IPython/__release__.py (version): get date dynamically.
5662
5675
5663 * Misc. documentation updates thanks to Arnd's comments. Also ran
5676 * Misc. documentation updates thanks to Arnd's comments. Also ran
5664 a full spellcheck on the manual (hadn't been done in a while).
5677 a full spellcheck on the manual (hadn't been done in a while).
5665
5678
5666 2002-04-27 Fernando Perez <fperez@colorado.edu>
5679 2002-04-27 Fernando Perez <fperez@colorado.edu>
5667
5680
5668 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5681 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5669 starting a log in mid-session would reset the input history list.
5682 starting a log in mid-session would reset the input history list.
5670
5683
5671 2002-04-26 Fernando Perez <fperez@colorado.edu>
5684 2002-04-26 Fernando Perez <fperez@colorado.edu>
5672
5685
5673 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5686 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5674 all files were being included in an update. Now anything in
5687 all files were being included in an update. Now anything in
5675 UserConfig that matches [A-Za-z]*.py will go (this excludes
5688 UserConfig that matches [A-Za-z]*.py will go (this excludes
5676 __init__.py)
5689 __init__.py)
5677
5690
5678 2002-04-25 Fernando Perez <fperez@colorado.edu>
5691 2002-04-25 Fernando Perez <fperez@colorado.edu>
5679
5692
5680 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5693 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5681 to __builtins__ so that any form of embedded or imported code can
5694 to __builtins__ so that any form of embedded or imported code can
5682 test for being inside IPython.
5695 test for being inside IPython.
5683
5696
5684 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5697 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5685 changed to GnuplotMagic because it's now an importable module,
5698 changed to GnuplotMagic because it's now an importable module,
5686 this makes the name follow that of the standard Gnuplot module.
5699 this makes the name follow that of the standard Gnuplot module.
5687 GnuplotMagic can now be loaded at any time in mid-session.
5700 GnuplotMagic can now be loaded at any time in mid-session.
5688
5701
5689 2002-04-24 Fernando Perez <fperez@colorado.edu>
5702 2002-04-24 Fernando Perez <fperez@colorado.edu>
5690
5703
5691 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5704 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5692 the globals (IPython has its own namespace) and the
5705 the globals (IPython has its own namespace) and the
5693 PhysicalQuantity stuff is much better anyway.
5706 PhysicalQuantity stuff is much better anyway.
5694
5707
5695 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5708 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5696 embedding example to standard user directory for
5709 embedding example to standard user directory for
5697 distribution. Also put it in the manual.
5710 distribution. Also put it in the manual.
5698
5711
5699 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5712 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5700 instance as first argument (so it doesn't rely on some obscure
5713 instance as first argument (so it doesn't rely on some obscure
5701 hidden global).
5714 hidden global).
5702
5715
5703 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5716 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5704 delimiters. While it prevents ().TAB from working, it allows
5717 delimiters. While it prevents ().TAB from working, it allows
5705 completions in open (... expressions. This is by far a more common
5718 completions in open (... expressions. This is by far a more common
5706 case.
5719 case.
5707
5720
5708 2002-04-23 Fernando Perez <fperez@colorado.edu>
5721 2002-04-23 Fernando Perez <fperez@colorado.edu>
5709
5722
5710 * IPython/Extensions/InterpreterPasteInput.py: new
5723 * IPython/Extensions/InterpreterPasteInput.py: new
5711 syntax-processing module for pasting lines with >>> or ... at the
5724 syntax-processing module for pasting lines with >>> or ... at the
5712 start.
5725 start.
5713
5726
5714 * IPython/Extensions/PhysicalQ_Interactive.py
5727 * IPython/Extensions/PhysicalQ_Interactive.py
5715 (PhysicalQuantityInteractive.__int__): fixed to work with either
5728 (PhysicalQuantityInteractive.__int__): fixed to work with either
5716 Numeric or math.
5729 Numeric or math.
5717
5730
5718 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5731 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5719 provided profiles. Now we have:
5732 provided profiles. Now we have:
5720 -math -> math module as * and cmath with its own namespace.
5733 -math -> math module as * and cmath with its own namespace.
5721 -numeric -> Numeric as *, plus gnuplot & grace
5734 -numeric -> Numeric as *, plus gnuplot & grace
5722 -physics -> same as before
5735 -physics -> same as before
5723
5736
5724 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5737 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5725 user-defined magics wouldn't be found by @magic if they were
5738 user-defined magics wouldn't be found by @magic if they were
5726 defined as class methods. Also cleaned up the namespace search
5739 defined as class methods. Also cleaned up the namespace search
5727 logic and the string building (to use %s instead of many repeated
5740 logic and the string building (to use %s instead of many repeated
5728 string adds).
5741 string adds).
5729
5742
5730 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5743 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5731 of user-defined magics to operate with class methods (cleaner, in
5744 of user-defined magics to operate with class methods (cleaner, in
5732 line with the gnuplot code).
5745 line with the gnuplot code).
5733
5746
5734 2002-04-22 Fernando Perez <fperez@colorado.edu>
5747 2002-04-22 Fernando Perez <fperez@colorado.edu>
5735
5748
5736 * setup.py: updated dependency list so that manual is updated when
5749 * setup.py: updated dependency list so that manual is updated when
5737 all included files change.
5750 all included files change.
5738
5751
5739 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5752 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5740 the delimiter removal option (the fix is ugly right now).
5753 the delimiter removal option (the fix is ugly right now).
5741
5754
5742 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5755 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5743 all of the math profile (quicker loading, no conflict between
5756 all of the math profile (quicker loading, no conflict between
5744 g-9.8 and g-gnuplot).
5757 g-9.8 and g-gnuplot).
5745
5758
5746 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5759 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5747 name of post-mortem files to IPython_crash_report.txt.
5760 name of post-mortem files to IPython_crash_report.txt.
5748
5761
5749 * Cleanup/update of the docs. Added all the new readline info and
5762 * Cleanup/update of the docs. Added all the new readline info and
5750 formatted all lists as 'real lists'.
5763 formatted all lists as 'real lists'.
5751
5764
5752 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5765 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5753 tab-completion options, since the full readline parse_and_bind is
5766 tab-completion options, since the full readline parse_and_bind is
5754 now accessible.
5767 now accessible.
5755
5768
5756 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5769 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5757 handling of readline options. Now users can specify any string to
5770 handling of readline options. Now users can specify any string to
5758 be passed to parse_and_bind(), as well as the delimiters to be
5771 be passed to parse_and_bind(), as well as the delimiters to be
5759 removed.
5772 removed.
5760 (InteractiveShell.__init__): Added __name__ to the global
5773 (InteractiveShell.__init__): Added __name__ to the global
5761 namespace so that things like Itpl which rely on its existence
5774 namespace so that things like Itpl which rely on its existence
5762 don't crash.
5775 don't crash.
5763 (InteractiveShell._prefilter): Defined the default with a _ so
5776 (InteractiveShell._prefilter): Defined the default with a _ so
5764 that prefilter() is easier to override, while the default one
5777 that prefilter() is easier to override, while the default one
5765 remains available.
5778 remains available.
5766
5779
5767 2002-04-18 Fernando Perez <fperez@colorado.edu>
5780 2002-04-18 Fernando Perez <fperez@colorado.edu>
5768
5781
5769 * Added information about pdb in the docs.
5782 * Added information about pdb in the docs.
5770
5783
5771 2002-04-17 Fernando Perez <fperez@colorado.edu>
5784 2002-04-17 Fernando Perez <fperez@colorado.edu>
5772
5785
5773 * IPython/ipmaker.py (make_IPython): added rc_override option to
5786 * IPython/ipmaker.py (make_IPython): added rc_override option to
5774 allow passing config options at creation time which may override
5787 allow passing config options at creation time which may override
5775 anything set in the config files or command line. This is
5788 anything set in the config files or command line. This is
5776 particularly useful for configuring embedded instances.
5789 particularly useful for configuring embedded instances.
5777
5790
5778 2002-04-15 Fernando Perez <fperez@colorado.edu>
5791 2002-04-15 Fernando Perez <fperez@colorado.edu>
5779
5792
5780 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5793 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5781 crash embedded instances because of the input cache falling out of
5794 crash embedded instances because of the input cache falling out of
5782 sync with the output counter.
5795 sync with the output counter.
5783
5796
5784 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5797 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5785 mode which calls pdb after an uncaught exception in IPython itself.
5798 mode which calls pdb after an uncaught exception in IPython itself.
5786
5799
5787 2002-04-14 Fernando Perez <fperez@colorado.edu>
5800 2002-04-14 Fernando Perez <fperez@colorado.edu>
5788
5801
5789 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5802 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5790 readline, fix it back after each call.
5803 readline, fix it back after each call.
5791
5804
5792 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5805 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5793 method to force all access via __call__(), which guarantees that
5806 method to force all access via __call__(), which guarantees that
5794 traceback references are properly deleted.
5807 traceback references are properly deleted.
5795
5808
5796 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5809 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5797 improve printing when pprint is in use.
5810 improve printing when pprint is in use.
5798
5811
5799 2002-04-13 Fernando Perez <fperez@colorado.edu>
5812 2002-04-13 Fernando Perez <fperez@colorado.edu>
5800
5813
5801 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5814 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5802 exceptions aren't caught anymore. If the user triggers one, he
5815 exceptions aren't caught anymore. If the user triggers one, he
5803 should know why he's doing it and it should go all the way up,
5816 should know why he's doing it and it should go all the way up,
5804 just like any other exception. So now @abort will fully kill the
5817 just like any other exception. So now @abort will fully kill the
5805 embedded interpreter and the embedding code (unless that happens
5818 embedded interpreter and the embedding code (unless that happens
5806 to catch SystemExit).
5819 to catch SystemExit).
5807
5820
5808 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5821 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5809 and a debugger() method to invoke the interactive pdb debugger
5822 and a debugger() method to invoke the interactive pdb debugger
5810 after printing exception information. Also added the corresponding
5823 after printing exception information. Also added the corresponding
5811 -pdb option and @pdb magic to control this feature, and updated
5824 -pdb option and @pdb magic to control this feature, and updated
5812 the docs. After a suggestion from Christopher Hart
5825 the docs. After a suggestion from Christopher Hart
5813 (hart-AT-caltech.edu).
5826 (hart-AT-caltech.edu).
5814
5827
5815 2002-04-12 Fernando Perez <fperez@colorado.edu>
5828 2002-04-12 Fernando Perez <fperez@colorado.edu>
5816
5829
5817 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5830 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5818 the exception handlers defined by the user (not the CrashHandler)
5831 the exception handlers defined by the user (not the CrashHandler)
5819 so that user exceptions don't trigger an ipython bug report.
5832 so that user exceptions don't trigger an ipython bug report.
5820
5833
5821 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5834 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5822 configurable (it should have always been so).
5835 configurable (it should have always been so).
5823
5836
5824 2002-03-26 Fernando Perez <fperez@colorado.edu>
5837 2002-03-26 Fernando Perez <fperez@colorado.edu>
5825
5838
5826 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5839 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5827 and there to fix embedding namespace issues. This should all be
5840 and there to fix embedding namespace issues. This should all be
5828 done in a more elegant way.
5841 done in a more elegant way.
5829
5842
5830 2002-03-25 Fernando Perez <fperez@colorado.edu>
5843 2002-03-25 Fernando Perez <fperez@colorado.edu>
5831
5844
5832 * IPython/genutils.py (get_home_dir): Try to make it work under
5845 * IPython/genutils.py (get_home_dir): Try to make it work under
5833 win9x also.
5846 win9x also.
5834
5847
5835 2002-03-20 Fernando Perez <fperez@colorado.edu>
5848 2002-03-20 Fernando Perez <fperez@colorado.edu>
5836
5849
5837 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5850 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5838 sys.displayhook untouched upon __init__.
5851 sys.displayhook untouched upon __init__.
5839
5852
5840 2002-03-19 Fernando Perez <fperez@colorado.edu>
5853 2002-03-19 Fernando Perez <fperez@colorado.edu>
5841
5854
5842 * Released 0.2.9 (for embedding bug, basically).
5855 * Released 0.2.9 (for embedding bug, basically).
5843
5856
5844 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5857 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5845 exceptions so that enclosing shell's state can be restored.
5858 exceptions so that enclosing shell's state can be restored.
5846
5859
5847 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5860 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5848 naming conventions in the .ipython/ dir.
5861 naming conventions in the .ipython/ dir.
5849
5862
5850 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5863 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5851 from delimiters list so filenames with - in them get expanded.
5864 from delimiters list so filenames with - in them get expanded.
5852
5865
5853 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5866 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5854 sys.displayhook not being properly restored after an embedded call.
5867 sys.displayhook not being properly restored after an embedded call.
5855
5868
5856 2002-03-18 Fernando Perez <fperez@colorado.edu>
5869 2002-03-18 Fernando Perez <fperez@colorado.edu>
5857
5870
5858 * Released 0.2.8
5871 * Released 0.2.8
5859
5872
5860 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5873 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5861 some files weren't being included in a -upgrade.
5874 some files weren't being included in a -upgrade.
5862 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5875 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5863 on' so that the first tab completes.
5876 on' so that the first tab completes.
5864 (InteractiveShell.handle_magic): fixed bug with spaces around
5877 (InteractiveShell.handle_magic): fixed bug with spaces around
5865 quotes breaking many magic commands.
5878 quotes breaking many magic commands.
5866
5879
5867 * setup.py: added note about ignoring the syntax error messages at
5880 * setup.py: added note about ignoring the syntax error messages at
5868 installation.
5881 installation.
5869
5882
5870 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5883 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5871 streamlining the gnuplot interface, now there's only one magic @gp.
5884 streamlining the gnuplot interface, now there's only one magic @gp.
5872
5885
5873 2002-03-17 Fernando Perez <fperez@colorado.edu>
5886 2002-03-17 Fernando Perez <fperez@colorado.edu>
5874
5887
5875 * IPython/UserConfig/magic_gnuplot.py: new name for the
5888 * IPython/UserConfig/magic_gnuplot.py: new name for the
5876 example-magic_pm.py file. Much enhanced system, now with a shell
5889 example-magic_pm.py file. Much enhanced system, now with a shell
5877 for communicating directly with gnuplot, one command at a time.
5890 for communicating directly with gnuplot, one command at a time.
5878
5891
5879 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5892 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5880 setting __name__=='__main__'.
5893 setting __name__=='__main__'.
5881
5894
5882 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5895 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5883 mini-shell for accessing gnuplot from inside ipython. Should
5896 mini-shell for accessing gnuplot from inside ipython. Should
5884 extend it later for grace access too. Inspired by Arnd's
5897 extend it later for grace access too. Inspired by Arnd's
5885 suggestion.
5898 suggestion.
5886
5899
5887 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5900 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5888 calling magic functions with () in their arguments. Thanks to Arnd
5901 calling magic functions with () in their arguments. Thanks to Arnd
5889 Baecker for pointing this to me.
5902 Baecker for pointing this to me.
5890
5903
5891 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5904 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5892 infinitely for integer or complex arrays (only worked with floats).
5905 infinitely for integer or complex arrays (only worked with floats).
5893
5906
5894 2002-03-16 Fernando Perez <fperez@colorado.edu>
5907 2002-03-16 Fernando Perez <fperez@colorado.edu>
5895
5908
5896 * setup.py: Merged setup and setup_windows into a single script
5909 * setup.py: Merged setup and setup_windows into a single script
5897 which properly handles things for windows users.
5910 which properly handles things for windows users.
5898
5911
5899 2002-03-15 Fernando Perez <fperez@colorado.edu>
5912 2002-03-15 Fernando Perez <fperez@colorado.edu>
5900
5913
5901 * Big change to the manual: now the magics are all automatically
5914 * Big change to the manual: now the magics are all automatically
5902 documented. This information is generated from their docstrings
5915 documented. This information is generated from their docstrings
5903 and put in a latex file included by the manual lyx file. This way
5916 and put in a latex file included by the manual lyx file. This way
5904 we get always up to date information for the magics. The manual
5917 we get always up to date information for the magics. The manual
5905 now also has proper version information, also auto-synced.
5918 now also has proper version information, also auto-synced.
5906
5919
5907 For this to work, an undocumented --magic_docstrings option was added.
5920 For this to work, an undocumented --magic_docstrings option was added.
5908
5921
5909 2002-03-13 Fernando Perez <fperez@colorado.edu>
5922 2002-03-13 Fernando Perez <fperez@colorado.edu>
5910
5923
5911 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5924 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5912 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5925 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5913
5926
5914 2002-03-12 Fernando Perez <fperez@colorado.edu>
5927 2002-03-12 Fernando Perez <fperez@colorado.edu>
5915
5928
5916 * IPython/ultraTB.py (TermColors): changed color escapes again to
5929 * IPython/ultraTB.py (TermColors): changed color escapes again to
5917 fix the (old, reintroduced) line-wrapping bug. Basically, if
5930 fix the (old, reintroduced) line-wrapping bug. Basically, if
5918 \001..\002 aren't given in the color escapes, lines get wrapped
5931 \001..\002 aren't given in the color escapes, lines get wrapped
5919 weirdly. But giving those screws up old xterms and emacs terms. So
5932 weirdly. But giving those screws up old xterms and emacs terms. So
5920 I added some logic for emacs terms to be ok, but I can't identify old
5933 I added some logic for emacs terms to be ok, but I can't identify old
5921 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5934 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5922
5935
5923 2002-03-10 Fernando Perez <fperez@colorado.edu>
5936 2002-03-10 Fernando Perez <fperez@colorado.edu>
5924
5937
5925 * IPython/usage.py (__doc__): Various documentation cleanups and
5938 * IPython/usage.py (__doc__): Various documentation cleanups and
5926 updates, both in usage docstrings and in the manual.
5939 updates, both in usage docstrings and in the manual.
5927
5940
5928 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5941 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5929 handling of caching. Set minimum acceptabe value for having a
5942 handling of caching. Set minimum acceptabe value for having a
5930 cache at 20 values.
5943 cache at 20 values.
5931
5944
5932 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5945 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5933 install_first_time function to a method, renamed it and added an
5946 install_first_time function to a method, renamed it and added an
5934 'upgrade' mode. Now people can update their config directory with
5947 'upgrade' mode. Now people can update their config directory with
5935 a simple command line switch (-upgrade, also new).
5948 a simple command line switch (-upgrade, also new).
5936
5949
5937 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5950 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5938 @file (convenient for automagic users under Python >= 2.2).
5951 @file (convenient for automagic users under Python >= 2.2).
5939 Removed @files (it seemed more like a plural than an abbrev. of
5952 Removed @files (it seemed more like a plural than an abbrev. of
5940 'file show').
5953 'file show').
5941
5954
5942 * IPython/iplib.py (install_first_time): Fixed crash if there were
5955 * IPython/iplib.py (install_first_time): Fixed crash if there were
5943 backup files ('~') in .ipython/ install directory.
5956 backup files ('~') in .ipython/ install directory.
5944
5957
5945 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5958 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5946 system. Things look fine, but these changes are fairly
5959 system. Things look fine, but these changes are fairly
5947 intrusive. Test them for a few days.
5960 intrusive. Test them for a few days.
5948
5961
5949 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5962 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5950 the prompts system. Now all in/out prompt strings are user
5963 the prompts system. Now all in/out prompt strings are user
5951 controllable. This is particularly useful for embedding, as one
5964 controllable. This is particularly useful for embedding, as one
5952 can tag embedded instances with particular prompts.
5965 can tag embedded instances with particular prompts.
5953
5966
5954 Also removed global use of sys.ps1/2, which now allows nested
5967 Also removed global use of sys.ps1/2, which now allows nested
5955 embeddings without any problems. Added command-line options for
5968 embeddings without any problems. Added command-line options for
5956 the prompt strings.
5969 the prompt strings.
5957
5970
5958 2002-03-08 Fernando Perez <fperez@colorado.edu>
5971 2002-03-08 Fernando Perez <fperez@colorado.edu>
5959
5972
5960 * IPython/UserConfig/example-embed-short.py (ipshell): added
5973 * IPython/UserConfig/example-embed-short.py (ipshell): added
5961 example file with the bare minimum code for embedding.
5974 example file with the bare minimum code for embedding.
5962
5975
5963 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5976 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5964 functionality for the embeddable shell to be activated/deactivated
5977 functionality for the embeddable shell to be activated/deactivated
5965 either globally or at each call.
5978 either globally or at each call.
5966
5979
5967 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5980 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5968 rewriting the prompt with '--->' for auto-inputs with proper
5981 rewriting the prompt with '--->' for auto-inputs with proper
5969 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5982 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5970 this is handled by the prompts class itself, as it should.
5983 this is handled by the prompts class itself, as it should.
5971
5984
5972 2002-03-05 Fernando Perez <fperez@colorado.edu>
5985 2002-03-05 Fernando Perez <fperez@colorado.edu>
5973
5986
5974 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5987 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5975 @logstart to avoid name clashes with the math log function.
5988 @logstart to avoid name clashes with the math log function.
5976
5989
5977 * Big updates to X/Emacs section of the manual.
5990 * Big updates to X/Emacs section of the manual.
5978
5991
5979 * Removed ipython_emacs. Milan explained to me how to pass
5992 * Removed ipython_emacs. Milan explained to me how to pass
5980 arguments to ipython through Emacs. Some day I'm going to end up
5993 arguments to ipython through Emacs. Some day I'm going to end up
5981 learning some lisp...
5994 learning some lisp...
5982
5995
5983 2002-03-04 Fernando Perez <fperez@colorado.edu>
5996 2002-03-04 Fernando Perez <fperez@colorado.edu>
5984
5997
5985 * IPython/ipython_emacs: Created script to be used as the
5998 * IPython/ipython_emacs: Created script to be used as the
5986 py-python-command Emacs variable so we can pass IPython
5999 py-python-command Emacs variable so we can pass IPython
5987 parameters. I can't figure out how to tell Emacs directly to pass
6000 parameters. I can't figure out how to tell Emacs directly to pass
5988 parameters to IPython, so a dummy shell script will do it.
6001 parameters to IPython, so a dummy shell script will do it.
5989
6002
5990 Other enhancements made for things to work better under Emacs'
6003 Other enhancements made for things to work better under Emacs'
5991 various types of terminals. Many thanks to Milan Zamazal
6004 various types of terminals. Many thanks to Milan Zamazal
5992 <pdm-AT-zamazal.org> for all the suggestions and pointers.
6005 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5993
6006
5994 2002-03-01 Fernando Perez <fperez@colorado.edu>
6007 2002-03-01 Fernando Perez <fperez@colorado.edu>
5995
6008
5996 * IPython/ipmaker.py (make_IPython): added a --readline! option so
6009 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5997 that loading of readline is now optional. This gives better
6010 that loading of readline is now optional. This gives better
5998 control to emacs users.
6011 control to emacs users.
5999
6012
6000 * IPython/ultraTB.py (__date__): Modified color escape sequences
6013 * IPython/ultraTB.py (__date__): Modified color escape sequences
6001 and now things work fine under xterm and in Emacs' term buffers
6014 and now things work fine under xterm and in Emacs' term buffers
6002 (though not shell ones). Well, in emacs you get colors, but all
6015 (though not shell ones). Well, in emacs you get colors, but all
6003 seem to be 'light' colors (no difference between dark and light
6016 seem to be 'light' colors (no difference between dark and light
6004 ones). But the garbage chars are gone, and also in xterms. It
6017 ones). But the garbage chars are gone, and also in xterms. It
6005 seems that now I'm using 'cleaner' ansi sequences.
6018 seems that now I'm using 'cleaner' ansi sequences.
6006
6019
6007 2002-02-21 Fernando Perez <fperez@colorado.edu>
6020 2002-02-21 Fernando Perez <fperez@colorado.edu>
6008
6021
6009 * Released 0.2.7 (mainly to publish the scoping fix).
6022 * Released 0.2.7 (mainly to publish the scoping fix).
6010
6023
6011 * IPython/Logger.py (Logger.logstate): added. A corresponding
6024 * IPython/Logger.py (Logger.logstate): added. A corresponding
6012 @logstate magic was created.
6025 @logstate magic was created.
6013
6026
6014 * IPython/Magic.py: fixed nested scoping problem under Python
6027 * IPython/Magic.py: fixed nested scoping problem under Python
6015 2.1.x (automagic wasn't working).
6028 2.1.x (automagic wasn't working).
6016
6029
6017 2002-02-20 Fernando Perez <fperez@colorado.edu>
6030 2002-02-20 Fernando Perez <fperez@colorado.edu>
6018
6031
6019 * Released 0.2.6.
6032 * Released 0.2.6.
6020
6033
6021 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6034 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6022 option so that logs can come out without any headers at all.
6035 option so that logs can come out without any headers at all.
6023
6036
6024 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6037 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6025 SciPy.
6038 SciPy.
6026
6039
6027 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6040 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6028 that embedded IPython calls don't require vars() to be explicitly
6041 that embedded IPython calls don't require vars() to be explicitly
6029 passed. Now they are extracted from the caller's frame (code
6042 passed. Now they are extracted from the caller's frame (code
6030 snatched from Eric Jones' weave). Added better documentation to
6043 snatched from Eric Jones' weave). Added better documentation to
6031 the section on embedding and the example file.
6044 the section on embedding and the example file.
6032
6045
6033 * IPython/genutils.py (page): Changed so that under emacs, it just
6046 * IPython/genutils.py (page): Changed so that under emacs, it just
6034 prints the string. You can then page up and down in the emacs
6047 prints the string. You can then page up and down in the emacs
6035 buffer itself. This is how the builtin help() works.
6048 buffer itself. This is how the builtin help() works.
6036
6049
6037 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6050 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6038 macro scoping: macros need to be executed in the user's namespace
6051 macro scoping: macros need to be executed in the user's namespace
6039 to work as if they had been typed by the user.
6052 to work as if they had been typed by the user.
6040
6053
6041 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6054 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6042 execute automatically (no need to type 'exec...'). They then
6055 execute automatically (no need to type 'exec...'). They then
6043 behave like 'true macros'. The printing system was also modified
6056 behave like 'true macros'. The printing system was also modified
6044 for this to work.
6057 for this to work.
6045
6058
6046 2002-02-19 Fernando Perez <fperez@colorado.edu>
6059 2002-02-19 Fernando Perez <fperez@colorado.edu>
6047
6060
6048 * IPython/genutils.py (page_file): new function for paging files
6061 * IPython/genutils.py (page_file): new function for paging files
6049 in an OS-independent way. Also necessary for file viewing to work
6062 in an OS-independent way. Also necessary for file viewing to work
6050 well inside Emacs buffers.
6063 well inside Emacs buffers.
6051 (page): Added checks for being in an emacs buffer.
6064 (page): Added checks for being in an emacs buffer.
6052 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6065 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6053 same bug in iplib.
6066 same bug in iplib.
6054
6067
6055 2002-02-18 Fernando Perez <fperez@colorado.edu>
6068 2002-02-18 Fernando Perez <fperez@colorado.edu>
6056
6069
6057 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6070 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6058 of readline so that IPython can work inside an Emacs buffer.
6071 of readline so that IPython can work inside an Emacs buffer.
6059
6072
6060 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6073 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6061 method signatures (they weren't really bugs, but it looks cleaner
6074 method signatures (they weren't really bugs, but it looks cleaner
6062 and keeps PyChecker happy).
6075 and keeps PyChecker happy).
6063
6076
6064 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6077 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6065 for implementing various user-defined hooks. Currently only
6078 for implementing various user-defined hooks. Currently only
6066 display is done.
6079 display is done.
6067
6080
6068 * IPython/Prompts.py (CachedOutput._display): changed display
6081 * IPython/Prompts.py (CachedOutput._display): changed display
6069 functions so that they can be dynamically changed by users easily.
6082 functions so that they can be dynamically changed by users easily.
6070
6083
6071 * IPython/Extensions/numeric_formats.py (num_display): added an
6084 * IPython/Extensions/numeric_formats.py (num_display): added an
6072 extension for printing NumPy arrays in flexible manners. It
6085 extension for printing NumPy arrays in flexible manners. It
6073 doesn't do anything yet, but all the structure is in
6086 doesn't do anything yet, but all the structure is in
6074 place. Ultimately the plan is to implement output format control
6087 place. Ultimately the plan is to implement output format control
6075 like in Octave.
6088 like in Octave.
6076
6089
6077 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6090 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6078 methods are found at run-time by all the automatic machinery.
6091 methods are found at run-time by all the automatic machinery.
6079
6092
6080 2002-02-17 Fernando Perez <fperez@colorado.edu>
6093 2002-02-17 Fernando Perez <fperez@colorado.edu>
6081
6094
6082 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6095 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6083 whole file a little.
6096 whole file a little.
6084
6097
6085 * ToDo: closed this document. Now there's a new_design.lyx
6098 * ToDo: closed this document. Now there's a new_design.lyx
6086 document for all new ideas. Added making a pdf of it for the
6099 document for all new ideas. Added making a pdf of it for the
6087 end-user distro.
6100 end-user distro.
6088
6101
6089 * IPython/Logger.py (Logger.switch_log): Created this to replace
6102 * IPython/Logger.py (Logger.switch_log): Created this to replace
6090 logon() and logoff(). It also fixes a nasty crash reported by
6103 logon() and logoff(). It also fixes a nasty crash reported by
6091 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6104 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6092
6105
6093 * IPython/iplib.py (complete): got auto-completion to work with
6106 * IPython/iplib.py (complete): got auto-completion to work with
6094 automagic (I had wanted this for a long time).
6107 automagic (I had wanted this for a long time).
6095
6108
6096 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6109 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6097 to @file, since file() is now a builtin and clashes with automagic
6110 to @file, since file() is now a builtin and clashes with automagic
6098 for @file.
6111 for @file.
6099
6112
6100 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6113 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6101 of this was previously in iplib, which had grown to more than 2000
6114 of this was previously in iplib, which had grown to more than 2000
6102 lines, way too long. No new functionality, but it makes managing
6115 lines, way too long. No new functionality, but it makes managing
6103 the code a bit easier.
6116 the code a bit easier.
6104
6117
6105 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6118 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6106 information to crash reports.
6119 information to crash reports.
6107
6120
6108 2002-02-12 Fernando Perez <fperez@colorado.edu>
6121 2002-02-12 Fernando Perez <fperez@colorado.edu>
6109
6122
6110 * Released 0.2.5.
6123 * Released 0.2.5.
6111
6124
6112 2002-02-11 Fernando Perez <fperez@colorado.edu>
6125 2002-02-11 Fernando Perez <fperez@colorado.edu>
6113
6126
6114 * Wrote a relatively complete Windows installer. It puts
6127 * Wrote a relatively complete Windows installer. It puts
6115 everything in place, creates Start Menu entries and fixes the
6128 everything in place, creates Start Menu entries and fixes the
6116 color issues. Nothing fancy, but it works.
6129 color issues. Nothing fancy, but it works.
6117
6130
6118 2002-02-10 Fernando Perez <fperez@colorado.edu>
6131 2002-02-10 Fernando Perez <fperez@colorado.edu>
6119
6132
6120 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6133 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6121 os.path.expanduser() call so that we can type @run ~/myfile.py and
6134 os.path.expanduser() call so that we can type @run ~/myfile.py and
6122 have thigs work as expected.
6135 have thigs work as expected.
6123
6136
6124 * IPython/genutils.py (page): fixed exception handling so things
6137 * IPython/genutils.py (page): fixed exception handling so things
6125 work both in Unix and Windows correctly. Quitting a pager triggers
6138 work both in Unix and Windows correctly. Quitting a pager triggers
6126 an IOError/broken pipe in Unix, and in windows not finding a pager
6139 an IOError/broken pipe in Unix, and in windows not finding a pager
6127 is also an IOError, so I had to actually look at the return value
6140 is also an IOError, so I had to actually look at the return value
6128 of the exception, not just the exception itself. Should be ok now.
6141 of the exception, not just the exception itself. Should be ok now.
6129
6142
6130 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6143 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6131 modified to allow case-insensitive color scheme changes.
6144 modified to allow case-insensitive color scheme changes.
6132
6145
6133 2002-02-09 Fernando Perez <fperez@colorado.edu>
6146 2002-02-09 Fernando Perez <fperez@colorado.edu>
6134
6147
6135 * IPython/genutils.py (native_line_ends): new function to leave
6148 * IPython/genutils.py (native_line_ends): new function to leave
6136 user config files with os-native line-endings.
6149 user config files with os-native line-endings.
6137
6150
6138 * README and manual updates.
6151 * README and manual updates.
6139
6152
6140 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6153 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6141 instead of StringType to catch Unicode strings.
6154 instead of StringType to catch Unicode strings.
6142
6155
6143 * IPython/genutils.py (filefind): fixed bug for paths with
6156 * IPython/genutils.py (filefind): fixed bug for paths with
6144 embedded spaces (very common in Windows).
6157 embedded spaces (very common in Windows).
6145
6158
6146 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6159 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6147 files under Windows, so that they get automatically associated
6160 files under Windows, so that they get automatically associated
6148 with a text editor. Windows makes it a pain to handle
6161 with a text editor. Windows makes it a pain to handle
6149 extension-less files.
6162 extension-less files.
6150
6163
6151 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6164 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6152 warning about readline only occur for Posix. In Windows there's no
6165 warning about readline only occur for Posix. In Windows there's no
6153 way to get readline, so why bother with the warning.
6166 way to get readline, so why bother with the warning.
6154
6167
6155 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6168 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6156 for __str__ instead of dir(self), since dir() changed in 2.2.
6169 for __str__ instead of dir(self), since dir() changed in 2.2.
6157
6170
6158 * Ported to Windows! Tested on XP, I suspect it should work fine
6171 * Ported to Windows! Tested on XP, I suspect it should work fine
6159 on NT/2000, but I don't think it will work on 98 et al. That
6172 on NT/2000, but I don't think it will work on 98 et al. That
6160 series of Windows is such a piece of junk anyway that I won't try
6173 series of Windows is such a piece of junk anyway that I won't try
6161 porting it there. The XP port was straightforward, showed a few
6174 porting it there. The XP port was straightforward, showed a few
6162 bugs here and there (fixed all), in particular some string
6175 bugs here and there (fixed all), in particular some string
6163 handling stuff which required considering Unicode strings (which
6176 handling stuff which required considering Unicode strings (which
6164 Windows uses). This is good, but hasn't been too tested :) No
6177 Windows uses). This is good, but hasn't been too tested :) No
6165 fancy installer yet, I'll put a note in the manual so people at
6178 fancy installer yet, I'll put a note in the manual so people at
6166 least make manually a shortcut.
6179 least make manually a shortcut.
6167
6180
6168 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6181 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6169 into a single one, "colors". This now controls both prompt and
6182 into a single one, "colors". This now controls both prompt and
6170 exception color schemes, and can be changed both at startup
6183 exception color schemes, and can be changed both at startup
6171 (either via command-line switches or via ipythonrc files) and at
6184 (either via command-line switches or via ipythonrc files) and at
6172 runtime, with @colors.
6185 runtime, with @colors.
6173 (Magic.magic_run): renamed @prun to @run and removed the old
6186 (Magic.magic_run): renamed @prun to @run and removed the old
6174 @run. The two were too similar to warrant keeping both.
6187 @run. The two were too similar to warrant keeping both.
6175
6188
6176 2002-02-03 Fernando Perez <fperez@colorado.edu>
6189 2002-02-03 Fernando Perez <fperez@colorado.edu>
6177
6190
6178 * IPython/iplib.py (install_first_time): Added comment on how to
6191 * IPython/iplib.py (install_first_time): Added comment on how to
6179 configure the color options for first-time users. Put a <return>
6192 configure the color options for first-time users. Put a <return>
6180 request at the end so that small-terminal users get a chance to
6193 request at the end so that small-terminal users get a chance to
6181 read the startup info.
6194 read the startup info.
6182
6195
6183 2002-01-23 Fernando Perez <fperez@colorado.edu>
6196 2002-01-23 Fernando Perez <fperez@colorado.edu>
6184
6197
6185 * IPython/iplib.py (CachedOutput.update): Changed output memory
6198 * IPython/iplib.py (CachedOutput.update): Changed output memory
6186 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6199 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6187 input history we still use _i. Did this b/c these variable are
6200 input history we still use _i. Did this b/c these variable are
6188 very commonly used in interactive work, so the less we need to
6201 very commonly used in interactive work, so the less we need to
6189 type the better off we are.
6202 type the better off we are.
6190 (Magic.magic_prun): updated @prun to better handle the namespaces
6203 (Magic.magic_prun): updated @prun to better handle the namespaces
6191 the file will run in, including a fix for __name__ not being set
6204 the file will run in, including a fix for __name__ not being set
6192 before.
6205 before.
6193
6206
6194 2002-01-20 Fernando Perez <fperez@colorado.edu>
6207 2002-01-20 Fernando Perez <fperez@colorado.edu>
6195
6208
6196 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6209 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6197 extra garbage for Python 2.2. Need to look more carefully into
6210 extra garbage for Python 2.2. Need to look more carefully into
6198 this later.
6211 this later.
6199
6212
6200 2002-01-19 Fernando Perez <fperez@colorado.edu>
6213 2002-01-19 Fernando Perez <fperez@colorado.edu>
6201
6214
6202 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6215 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6203 display SyntaxError exceptions properly formatted when they occur
6216 display SyntaxError exceptions properly formatted when they occur
6204 (they can be triggered by imported code).
6217 (they can be triggered by imported code).
6205
6218
6206 2002-01-18 Fernando Perez <fperez@colorado.edu>
6219 2002-01-18 Fernando Perez <fperez@colorado.edu>
6207
6220
6208 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6221 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6209 SyntaxError exceptions are reported nicely formatted, instead of
6222 SyntaxError exceptions are reported nicely formatted, instead of
6210 spitting out only offset information as before.
6223 spitting out only offset information as before.
6211 (Magic.magic_prun): Added the @prun function for executing
6224 (Magic.magic_prun): Added the @prun function for executing
6212 programs with command line args inside IPython.
6225 programs with command line args inside IPython.
6213
6226
6214 2002-01-16 Fernando Perez <fperez@colorado.edu>
6227 2002-01-16 Fernando Perez <fperez@colorado.edu>
6215
6228
6216 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6229 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6217 to *not* include the last item given in a range. This brings their
6230 to *not* include the last item given in a range. This brings their
6218 behavior in line with Python's slicing:
6231 behavior in line with Python's slicing:
6219 a[n1:n2] -> a[n1]...a[n2-1]
6232 a[n1:n2] -> a[n1]...a[n2-1]
6220 It may be a bit less convenient, but I prefer to stick to Python's
6233 It may be a bit less convenient, but I prefer to stick to Python's
6221 conventions *everywhere*, so users never have to wonder.
6234 conventions *everywhere*, so users never have to wonder.
6222 (Magic.magic_macro): Added @macro function to ease the creation of
6235 (Magic.magic_macro): Added @macro function to ease the creation of
6223 macros.
6236 macros.
6224
6237
6225 2002-01-05 Fernando Perez <fperez@colorado.edu>
6238 2002-01-05 Fernando Perez <fperez@colorado.edu>
6226
6239
6227 * Released 0.2.4.
6240 * Released 0.2.4.
6228
6241
6229 * IPython/iplib.py (Magic.magic_pdef):
6242 * IPython/iplib.py (Magic.magic_pdef):
6230 (InteractiveShell.safe_execfile): report magic lines and error
6243 (InteractiveShell.safe_execfile): report magic lines and error
6231 lines without line numbers so one can easily copy/paste them for
6244 lines without line numbers so one can easily copy/paste them for
6232 re-execution.
6245 re-execution.
6233
6246
6234 * Updated manual with recent changes.
6247 * Updated manual with recent changes.
6235
6248
6236 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6249 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6237 docstring printing when class? is called. Very handy for knowing
6250 docstring printing when class? is called. Very handy for knowing
6238 how to create class instances (as long as __init__ is well
6251 how to create class instances (as long as __init__ is well
6239 documented, of course :)
6252 documented, of course :)
6240 (Magic.magic_doc): print both class and constructor docstrings.
6253 (Magic.magic_doc): print both class and constructor docstrings.
6241 (Magic.magic_pdef): give constructor info if passed a class and
6254 (Magic.magic_pdef): give constructor info if passed a class and
6242 __call__ info for callable object instances.
6255 __call__ info for callable object instances.
6243
6256
6244 2002-01-04 Fernando Perez <fperez@colorado.edu>
6257 2002-01-04 Fernando Perez <fperez@colorado.edu>
6245
6258
6246 * Made deep_reload() off by default. It doesn't always work
6259 * Made deep_reload() off by default. It doesn't always work
6247 exactly as intended, so it's probably safer to have it off. It's
6260 exactly as intended, so it's probably safer to have it off. It's
6248 still available as dreload() anyway, so nothing is lost.
6261 still available as dreload() anyway, so nothing is lost.
6249
6262
6250 2002-01-02 Fernando Perez <fperez@colorado.edu>
6263 2002-01-02 Fernando Perez <fperez@colorado.edu>
6251
6264
6252 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6265 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6253 so I wanted an updated release).
6266 so I wanted an updated release).
6254
6267
6255 2001-12-27 Fernando Perez <fperez@colorado.edu>
6268 2001-12-27 Fernando Perez <fperez@colorado.edu>
6256
6269
6257 * IPython/iplib.py (InteractiveShell.interact): Added the original
6270 * IPython/iplib.py (InteractiveShell.interact): Added the original
6258 code from 'code.py' for this module in order to change the
6271 code from 'code.py' for this module in order to change the
6259 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6272 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6260 the history cache would break when the user hit Ctrl-C, and
6273 the history cache would break when the user hit Ctrl-C, and
6261 interact() offers no way to add any hooks to it.
6274 interact() offers no way to add any hooks to it.
6262
6275
6263 2001-12-23 Fernando Perez <fperez@colorado.edu>
6276 2001-12-23 Fernando Perez <fperez@colorado.edu>
6264
6277
6265 * setup.py: added check for 'MANIFEST' before trying to remove
6278 * setup.py: added check for 'MANIFEST' before trying to remove
6266 it. Thanks to Sean Reifschneider.
6279 it. Thanks to Sean Reifschneider.
6267
6280
6268 2001-12-22 Fernando Perez <fperez@colorado.edu>
6281 2001-12-22 Fernando Perez <fperez@colorado.edu>
6269
6282
6270 * Released 0.2.2.
6283 * Released 0.2.2.
6271
6284
6272 * Finished (reasonably) writing the manual. Later will add the
6285 * Finished (reasonably) writing the manual. Later will add the
6273 python-standard navigation stylesheets, but for the time being
6286 python-standard navigation stylesheets, but for the time being
6274 it's fairly complete. Distribution will include html and pdf
6287 it's fairly complete. Distribution will include html and pdf
6275 versions.
6288 versions.
6276
6289
6277 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6290 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6278 (MayaVi author).
6291 (MayaVi author).
6279
6292
6280 2001-12-21 Fernando Perez <fperez@colorado.edu>
6293 2001-12-21 Fernando Perez <fperez@colorado.edu>
6281
6294
6282 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6295 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6283 good public release, I think (with the manual and the distutils
6296 good public release, I think (with the manual and the distutils
6284 installer). The manual can use some work, but that can go
6297 installer). The manual can use some work, but that can go
6285 slowly. Otherwise I think it's quite nice for end users. Next
6298 slowly. Otherwise I think it's quite nice for end users. Next
6286 summer, rewrite the guts of it...
6299 summer, rewrite the guts of it...
6287
6300
6288 * Changed format of ipythonrc files to use whitespace as the
6301 * Changed format of ipythonrc files to use whitespace as the
6289 separator instead of an explicit '='. Cleaner.
6302 separator instead of an explicit '='. Cleaner.
6290
6303
6291 2001-12-20 Fernando Perez <fperez@colorado.edu>
6304 2001-12-20 Fernando Perez <fperez@colorado.edu>
6292
6305
6293 * Started a manual in LyX. For now it's just a quick merge of the
6306 * Started a manual in LyX. For now it's just a quick merge of the
6294 various internal docstrings and READMEs. Later it may grow into a
6307 various internal docstrings and READMEs. Later it may grow into a
6295 nice, full-blown manual.
6308 nice, full-blown manual.
6296
6309
6297 * Set up a distutils based installer. Installation should now be
6310 * Set up a distutils based installer. Installation should now be
6298 trivially simple for end-users.
6311 trivially simple for end-users.
6299
6312
6300 2001-12-11 Fernando Perez <fperez@colorado.edu>
6313 2001-12-11 Fernando Perez <fperez@colorado.edu>
6301
6314
6302 * Released 0.2.0. First public release, announced it at
6315 * Released 0.2.0. First public release, announced it at
6303 comp.lang.python. From now on, just bugfixes...
6316 comp.lang.python. From now on, just bugfixes...
6304
6317
6305 * Went through all the files, set copyright/license notices and
6318 * Went through all the files, set copyright/license notices and
6306 cleaned up things. Ready for release.
6319 cleaned up things. Ready for release.
6307
6320
6308 2001-12-10 Fernando Perez <fperez@colorado.edu>
6321 2001-12-10 Fernando Perez <fperez@colorado.edu>
6309
6322
6310 * Changed the first-time installer not to use tarfiles. It's more
6323 * Changed the first-time installer not to use tarfiles. It's more
6311 robust now and less unix-dependent. Also makes it easier for
6324 robust now and less unix-dependent. Also makes it easier for
6312 people to later upgrade versions.
6325 people to later upgrade versions.
6313
6326
6314 * Changed @exit to @abort to reflect the fact that it's pretty
6327 * Changed @exit to @abort to reflect the fact that it's pretty
6315 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6328 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6316 becomes significant only when IPyhton is embedded: in that case,
6329 becomes significant only when IPyhton is embedded: in that case,
6317 C-D closes IPython only, but @abort kills the enclosing program
6330 C-D closes IPython only, but @abort kills the enclosing program
6318 too (unless it had called IPython inside a try catching
6331 too (unless it had called IPython inside a try catching
6319 SystemExit).
6332 SystemExit).
6320
6333
6321 * Created Shell module which exposes the actuall IPython Shell
6334 * Created Shell module which exposes the actuall IPython Shell
6322 classes, currently the normal and the embeddable one. This at
6335 classes, currently the normal and the embeddable one. This at
6323 least offers a stable interface we won't need to change when
6336 least offers a stable interface we won't need to change when
6324 (later) the internals are rewritten. That rewrite will be confined
6337 (later) the internals are rewritten. That rewrite will be confined
6325 to iplib and ipmaker, but the Shell interface should remain as is.
6338 to iplib and ipmaker, but the Shell interface should remain as is.
6326
6339
6327 * Added embed module which offers an embeddable IPShell object,
6340 * Added embed module which offers an embeddable IPShell object,
6328 useful to fire up IPython *inside* a running program. Great for
6341 useful to fire up IPython *inside* a running program. Great for
6329 debugging or dynamical data analysis.
6342 debugging or dynamical data analysis.
6330
6343
6331 2001-12-08 Fernando Perez <fperez@colorado.edu>
6344 2001-12-08 Fernando Perez <fperez@colorado.edu>
6332
6345
6333 * Fixed small bug preventing seeing info from methods of defined
6346 * Fixed small bug preventing seeing info from methods of defined
6334 objects (incorrect namespace in _ofind()).
6347 objects (incorrect namespace in _ofind()).
6335
6348
6336 * Documentation cleanup. Moved the main usage docstrings to a
6349 * Documentation cleanup. Moved the main usage docstrings to a
6337 separate file, usage.py (cleaner to maintain, and hopefully in the
6350 separate file, usage.py (cleaner to maintain, and hopefully in the
6338 future some perlpod-like way of producing interactive, man and
6351 future some perlpod-like way of producing interactive, man and
6339 html docs out of it will be found).
6352 html docs out of it will be found).
6340
6353
6341 * Added @profile to see your profile at any time.
6354 * Added @profile to see your profile at any time.
6342
6355
6343 * Added @p as an alias for 'print'. It's especially convenient if
6356 * Added @p as an alias for 'print'. It's especially convenient if
6344 using automagic ('p x' prints x).
6357 using automagic ('p x' prints x).
6345
6358
6346 * Small cleanups and fixes after a pychecker run.
6359 * Small cleanups and fixes after a pychecker run.
6347
6360
6348 * Changed the @cd command to handle @cd - and @cd -<n> for
6361 * Changed the @cd command to handle @cd - and @cd -<n> for
6349 visiting any directory in _dh.
6362 visiting any directory in _dh.
6350
6363
6351 * Introduced _dh, a history of visited directories. @dhist prints
6364 * Introduced _dh, a history of visited directories. @dhist prints
6352 it out with numbers.
6365 it out with numbers.
6353
6366
6354 2001-12-07 Fernando Perez <fperez@colorado.edu>
6367 2001-12-07 Fernando Perez <fperez@colorado.edu>
6355
6368
6356 * Released 0.1.22
6369 * Released 0.1.22
6357
6370
6358 * Made initialization a bit more robust against invalid color
6371 * Made initialization a bit more robust against invalid color
6359 options in user input (exit, not traceback-crash).
6372 options in user input (exit, not traceback-crash).
6360
6373
6361 * Changed the bug crash reporter to write the report only in the
6374 * Changed the bug crash reporter to write the report only in the
6362 user's .ipython directory. That way IPython won't litter people's
6375 user's .ipython directory. That way IPython won't litter people's
6363 hard disks with crash files all over the place. Also print on
6376 hard disks with crash files all over the place. Also print on
6364 screen the necessary mail command.
6377 screen the necessary mail command.
6365
6378
6366 * With the new ultraTB, implemented LightBG color scheme for light
6379 * With the new ultraTB, implemented LightBG color scheme for light
6367 background terminals. A lot of people like white backgrounds, so I
6380 background terminals. A lot of people like white backgrounds, so I
6368 guess we should at least give them something readable.
6381 guess we should at least give them something readable.
6369
6382
6370 2001-12-06 Fernando Perez <fperez@colorado.edu>
6383 2001-12-06 Fernando Perez <fperez@colorado.edu>
6371
6384
6372 * Modified the structure of ultraTB. Now there's a proper class
6385 * Modified the structure of ultraTB. Now there's a proper class
6373 for tables of color schemes which allow adding schemes easily and
6386 for tables of color schemes which allow adding schemes easily and
6374 switching the active scheme without creating a new instance every
6387 switching the active scheme without creating a new instance every
6375 time (which was ridiculous). The syntax for creating new schemes
6388 time (which was ridiculous). The syntax for creating new schemes
6376 is also cleaner. I think ultraTB is finally done, with a clean
6389 is also cleaner. I think ultraTB is finally done, with a clean
6377 class structure. Names are also much cleaner (now there's proper
6390 class structure. Names are also much cleaner (now there's proper
6378 color tables, no need for every variable to also have 'color' in
6391 color tables, no need for every variable to also have 'color' in
6379 its name).
6392 its name).
6380
6393
6381 * Broke down genutils into separate files. Now genutils only
6394 * Broke down genutils into separate files. Now genutils only
6382 contains utility functions, and classes have been moved to their
6395 contains utility functions, and classes have been moved to their
6383 own files (they had enough independent functionality to warrant
6396 own files (they had enough independent functionality to warrant
6384 it): ConfigLoader, OutputTrap, Struct.
6397 it): ConfigLoader, OutputTrap, Struct.
6385
6398
6386 2001-12-05 Fernando Perez <fperez@colorado.edu>
6399 2001-12-05 Fernando Perez <fperez@colorado.edu>
6387
6400
6388 * IPython turns 21! Released version 0.1.21, as a candidate for
6401 * IPython turns 21! Released version 0.1.21, as a candidate for
6389 public consumption. If all goes well, release in a few days.
6402 public consumption. If all goes well, release in a few days.
6390
6403
6391 * Fixed path bug (files in Extensions/ directory wouldn't be found
6404 * Fixed path bug (files in Extensions/ directory wouldn't be found
6392 unless IPython/ was explicitly in sys.path).
6405 unless IPython/ was explicitly in sys.path).
6393
6406
6394 * Extended the FlexCompleter class as MagicCompleter to allow
6407 * Extended the FlexCompleter class as MagicCompleter to allow
6395 completion of @-starting lines.
6408 completion of @-starting lines.
6396
6409
6397 * Created __release__.py file as a central repository for release
6410 * Created __release__.py file as a central repository for release
6398 info that other files can read from.
6411 info that other files can read from.
6399
6412
6400 * Fixed small bug in logging: when logging was turned on in
6413 * Fixed small bug in logging: when logging was turned on in
6401 mid-session, old lines with special meanings (!@?) were being
6414 mid-session, old lines with special meanings (!@?) were being
6402 logged without the prepended comment, which is necessary since
6415 logged without the prepended comment, which is necessary since
6403 they are not truly valid python syntax. This should make session
6416 they are not truly valid python syntax. This should make session
6404 restores produce less errors.
6417 restores produce less errors.
6405
6418
6406 * The namespace cleanup forced me to make a FlexCompleter class
6419 * The namespace cleanup forced me to make a FlexCompleter class
6407 which is nothing but a ripoff of rlcompleter, but with selectable
6420 which is nothing but a ripoff of rlcompleter, but with selectable
6408 namespace (rlcompleter only works in __main__.__dict__). I'll try
6421 namespace (rlcompleter only works in __main__.__dict__). I'll try
6409 to submit a note to the authors to see if this change can be
6422 to submit a note to the authors to see if this change can be
6410 incorporated in future rlcompleter releases (Dec.6: done)
6423 incorporated in future rlcompleter releases (Dec.6: done)
6411
6424
6412 * More fixes to namespace handling. It was a mess! Now all
6425 * More fixes to namespace handling. It was a mess! Now all
6413 explicit references to __main__.__dict__ are gone (except when
6426 explicit references to __main__.__dict__ are gone (except when
6414 really needed) and everything is handled through the namespace
6427 really needed) and everything is handled through the namespace
6415 dicts in the IPython instance. We seem to be getting somewhere
6428 dicts in the IPython instance. We seem to be getting somewhere
6416 with this, finally...
6429 with this, finally...
6417
6430
6418 * Small documentation updates.
6431 * Small documentation updates.
6419
6432
6420 * Created the Extensions directory under IPython (with an
6433 * Created the Extensions directory under IPython (with an
6421 __init__.py). Put the PhysicalQ stuff there. This directory should
6434 __init__.py). Put the PhysicalQ stuff there. This directory should
6422 be used for all special-purpose extensions.
6435 be used for all special-purpose extensions.
6423
6436
6424 * File renaming:
6437 * File renaming:
6425 ipythonlib --> ipmaker
6438 ipythonlib --> ipmaker
6426 ipplib --> iplib
6439 ipplib --> iplib
6427 This makes a bit more sense in terms of what these files actually do.
6440 This makes a bit more sense in terms of what these files actually do.
6428
6441
6429 * Moved all the classes and functions in ipythonlib to ipplib, so
6442 * Moved all the classes and functions in ipythonlib to ipplib, so
6430 now ipythonlib only has make_IPython(). This will ease up its
6443 now ipythonlib only has make_IPython(). This will ease up its
6431 splitting in smaller functional chunks later.
6444 splitting in smaller functional chunks later.
6432
6445
6433 * Cleaned up (done, I think) output of @whos. Better column
6446 * Cleaned up (done, I think) output of @whos. Better column
6434 formatting, and now shows str(var) for as much as it can, which is
6447 formatting, and now shows str(var) for as much as it can, which is
6435 typically what one gets with a 'print var'.
6448 typically what one gets with a 'print var'.
6436
6449
6437 2001-12-04 Fernando Perez <fperez@colorado.edu>
6450 2001-12-04 Fernando Perez <fperez@colorado.edu>
6438
6451
6439 * Fixed namespace problems. Now builtin/IPyhton/user names get
6452 * Fixed namespace problems. Now builtin/IPyhton/user names get
6440 properly reported in their namespace. Internal namespace handling
6453 properly reported in their namespace. Internal namespace handling
6441 is finally getting decent (not perfect yet, but much better than
6454 is finally getting decent (not perfect yet, but much better than
6442 the ad-hoc mess we had).
6455 the ad-hoc mess we had).
6443
6456
6444 * Removed -exit option. If people just want to run a python
6457 * Removed -exit option. If people just want to run a python
6445 script, that's what the normal interpreter is for. Less
6458 script, that's what the normal interpreter is for. Less
6446 unnecessary options, less chances for bugs.
6459 unnecessary options, less chances for bugs.
6447
6460
6448 * Added a crash handler which generates a complete post-mortem if
6461 * Added a crash handler which generates a complete post-mortem if
6449 IPython crashes. This will help a lot in tracking bugs down the
6462 IPython crashes. This will help a lot in tracking bugs down the
6450 road.
6463 road.
6451
6464
6452 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6465 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6453 which were boud to functions being reassigned would bypass the
6466 which were boud to functions being reassigned would bypass the
6454 logger, breaking the sync of _il with the prompt counter. This
6467 logger, breaking the sync of _il with the prompt counter. This
6455 would then crash IPython later when a new line was logged.
6468 would then crash IPython later when a new line was logged.
6456
6469
6457 2001-12-02 Fernando Perez <fperez@colorado.edu>
6470 2001-12-02 Fernando Perez <fperez@colorado.edu>
6458
6471
6459 * Made IPython a package. This means people don't have to clutter
6472 * Made IPython a package. This means people don't have to clutter
6460 their sys.path with yet another directory. Changed the INSTALL
6473 their sys.path with yet another directory. Changed the INSTALL
6461 file accordingly.
6474 file accordingly.
6462
6475
6463 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6476 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6464 sorts its output (so @who shows it sorted) and @whos formats the
6477 sorts its output (so @who shows it sorted) and @whos formats the
6465 table according to the width of the first column. Nicer, easier to
6478 table according to the width of the first column. Nicer, easier to
6466 read. Todo: write a generic table_format() which takes a list of
6479 read. Todo: write a generic table_format() which takes a list of
6467 lists and prints it nicely formatted, with optional row/column
6480 lists and prints it nicely formatted, with optional row/column
6468 separators and proper padding and justification.
6481 separators and proper padding and justification.
6469
6482
6470 * Released 0.1.20
6483 * Released 0.1.20
6471
6484
6472 * Fixed bug in @log which would reverse the inputcache list (a
6485 * Fixed bug in @log which would reverse the inputcache list (a
6473 copy operation was missing).
6486 copy operation was missing).
6474
6487
6475 * Code cleanup. @config was changed to use page(). Better, since
6488 * Code cleanup. @config was changed to use page(). Better, since
6476 its output is always quite long.
6489 its output is always quite long.
6477
6490
6478 * Itpl is back as a dependency. I was having too many problems
6491 * Itpl is back as a dependency. I was having too many problems
6479 getting the parametric aliases to work reliably, and it's just
6492 getting the parametric aliases to work reliably, and it's just
6480 easier to code weird string operations with it than playing %()s
6493 easier to code weird string operations with it than playing %()s
6481 games. It's only ~6k, so I don't think it's too big a deal.
6494 games. It's only ~6k, so I don't think it's too big a deal.
6482
6495
6483 * Found (and fixed) a very nasty bug with history. !lines weren't
6496 * Found (and fixed) a very nasty bug with history. !lines weren't
6484 getting cached, and the out of sync caches would crash
6497 getting cached, and the out of sync caches would crash
6485 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6498 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6486 division of labor a bit better. Bug fixed, cleaner structure.
6499 division of labor a bit better. Bug fixed, cleaner structure.
6487
6500
6488 2001-12-01 Fernando Perez <fperez@colorado.edu>
6501 2001-12-01 Fernando Perez <fperez@colorado.edu>
6489
6502
6490 * Released 0.1.19
6503 * Released 0.1.19
6491
6504
6492 * Added option -n to @hist to prevent line number printing. Much
6505 * Added option -n to @hist to prevent line number printing. Much
6493 easier to copy/paste code this way.
6506 easier to copy/paste code this way.
6494
6507
6495 * Created global _il to hold the input list. Allows easy
6508 * Created global _il to hold the input list. Allows easy
6496 re-execution of blocks of code by slicing it (inspired by Janko's
6509 re-execution of blocks of code by slicing it (inspired by Janko's
6497 comment on 'macros').
6510 comment on 'macros').
6498
6511
6499 * Small fixes and doc updates.
6512 * Small fixes and doc updates.
6500
6513
6501 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6514 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6502 much too fragile with automagic. Handles properly multi-line
6515 much too fragile with automagic. Handles properly multi-line
6503 statements and takes parameters.
6516 statements and takes parameters.
6504
6517
6505 2001-11-30 Fernando Perez <fperez@colorado.edu>
6518 2001-11-30 Fernando Perez <fperez@colorado.edu>
6506
6519
6507 * Version 0.1.18 released.
6520 * Version 0.1.18 released.
6508
6521
6509 * Fixed nasty namespace bug in initial module imports.
6522 * Fixed nasty namespace bug in initial module imports.
6510
6523
6511 * Added copyright/license notes to all code files (except
6524 * Added copyright/license notes to all code files (except
6512 DPyGetOpt). For the time being, LGPL. That could change.
6525 DPyGetOpt). For the time being, LGPL. That could change.
6513
6526
6514 * Rewrote a much nicer README, updated INSTALL, cleaned up
6527 * Rewrote a much nicer README, updated INSTALL, cleaned up
6515 ipythonrc-* samples.
6528 ipythonrc-* samples.
6516
6529
6517 * Overall code/documentation cleanup. Basically ready for
6530 * Overall code/documentation cleanup. Basically ready for
6518 release. Only remaining thing: licence decision (LGPL?).
6531 release. Only remaining thing: licence decision (LGPL?).
6519
6532
6520 * Converted load_config to a class, ConfigLoader. Now recursion
6533 * Converted load_config to a class, ConfigLoader. Now recursion
6521 control is better organized. Doesn't include the same file twice.
6534 control is better organized. Doesn't include the same file twice.
6522
6535
6523 2001-11-29 Fernando Perez <fperez@colorado.edu>
6536 2001-11-29 Fernando Perez <fperez@colorado.edu>
6524
6537
6525 * Got input history working. Changed output history variables from
6538 * Got input history working. Changed output history variables from
6526 _p to _o so that _i is for input and _o for output. Just cleaner
6539 _p to _o so that _i is for input and _o for output. Just cleaner
6527 convention.
6540 convention.
6528
6541
6529 * Implemented parametric aliases. This pretty much allows the
6542 * Implemented parametric aliases. This pretty much allows the
6530 alias system to offer full-blown shell convenience, I think.
6543 alias system to offer full-blown shell convenience, I think.
6531
6544
6532 * Version 0.1.17 released, 0.1.18 opened.
6545 * Version 0.1.17 released, 0.1.18 opened.
6533
6546
6534 * dot_ipython/ipythonrc (alias): added documentation.
6547 * dot_ipython/ipythonrc (alias): added documentation.
6535 (xcolor): Fixed small bug (xcolors -> xcolor)
6548 (xcolor): Fixed small bug (xcolors -> xcolor)
6536
6549
6537 * Changed the alias system. Now alias is a magic command to define
6550 * Changed the alias system. Now alias is a magic command to define
6538 aliases just like the shell. Rationale: the builtin magics should
6551 aliases just like the shell. Rationale: the builtin magics should
6539 be there for things deeply connected to IPython's
6552 be there for things deeply connected to IPython's
6540 architecture. And this is a much lighter system for what I think
6553 architecture. And this is a much lighter system for what I think
6541 is the really important feature: allowing users to define quickly
6554 is the really important feature: allowing users to define quickly
6542 magics that will do shell things for them, so they can customize
6555 magics that will do shell things for them, so they can customize
6543 IPython easily to match their work habits. If someone is really
6556 IPython easily to match their work habits. If someone is really
6544 desperate to have another name for a builtin alias, they can
6557 desperate to have another name for a builtin alias, they can
6545 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6558 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6546 works.
6559 works.
6547
6560
6548 2001-11-28 Fernando Perez <fperez@colorado.edu>
6561 2001-11-28 Fernando Perez <fperez@colorado.edu>
6549
6562
6550 * Changed @file so that it opens the source file at the proper
6563 * Changed @file so that it opens the source file at the proper
6551 line. Since it uses less, if your EDITOR environment is
6564 line. Since it uses less, if your EDITOR environment is
6552 configured, typing v will immediately open your editor of choice
6565 configured, typing v will immediately open your editor of choice
6553 right at the line where the object is defined. Not as quick as
6566 right at the line where the object is defined. Not as quick as
6554 having a direct @edit command, but for all intents and purposes it
6567 having a direct @edit command, but for all intents and purposes it
6555 works. And I don't have to worry about writing @edit to deal with
6568 works. And I don't have to worry about writing @edit to deal with
6556 all the editors, less does that.
6569 all the editors, less does that.
6557
6570
6558 * Version 0.1.16 released, 0.1.17 opened.
6571 * Version 0.1.16 released, 0.1.17 opened.
6559
6572
6560 * Fixed some nasty bugs in the page/page_dumb combo that could
6573 * Fixed some nasty bugs in the page/page_dumb combo that could
6561 crash IPython.
6574 crash IPython.
6562
6575
6563 2001-11-27 Fernando Perez <fperez@colorado.edu>
6576 2001-11-27 Fernando Perez <fperez@colorado.edu>
6564
6577
6565 * Version 0.1.15 released, 0.1.16 opened.
6578 * Version 0.1.15 released, 0.1.16 opened.
6566
6579
6567 * Finally got ? and ?? to work for undefined things: now it's
6580 * Finally got ? and ?? to work for undefined things: now it's
6568 possible to type {}.get? and get information about the get method
6581 possible to type {}.get? and get information about the get method
6569 of dicts, or os.path? even if only os is defined (so technically
6582 of dicts, or os.path? even if only os is defined (so technically
6570 os.path isn't). Works at any level. For example, after import os,
6583 os.path isn't). Works at any level. For example, after import os,
6571 os?, os.path?, os.path.abspath? all work. This is great, took some
6584 os?, os.path?, os.path.abspath? all work. This is great, took some
6572 work in _ofind.
6585 work in _ofind.
6573
6586
6574 * Fixed more bugs with logging. The sanest way to do it was to add
6587 * Fixed more bugs with logging. The sanest way to do it was to add
6575 to @log a 'mode' parameter. Killed two in one shot (this mode
6588 to @log a 'mode' parameter. Killed two in one shot (this mode
6576 option was a request of Janko's). I think it's finally clean
6589 option was a request of Janko's). I think it's finally clean
6577 (famous last words).
6590 (famous last words).
6578
6591
6579 * Added a page_dumb() pager which does a decent job of paging on
6592 * Added a page_dumb() pager which does a decent job of paging on
6580 screen, if better things (like less) aren't available. One less
6593 screen, if better things (like less) aren't available. One less
6581 unix dependency (someday maybe somebody will port this to
6594 unix dependency (someday maybe somebody will port this to
6582 windows).
6595 windows).
6583
6596
6584 * Fixed problem in magic_log: would lock of logging out if log
6597 * Fixed problem in magic_log: would lock of logging out if log
6585 creation failed (because it would still think it had succeeded).
6598 creation failed (because it would still think it had succeeded).
6586
6599
6587 * Improved the page() function using curses to auto-detect screen
6600 * Improved the page() function using curses to auto-detect screen
6588 size. Now it can make a much better decision on whether to print
6601 size. Now it can make a much better decision on whether to print
6589 or page a string. Option screen_length was modified: a value 0
6602 or page a string. Option screen_length was modified: a value 0
6590 means auto-detect, and that's the default now.
6603 means auto-detect, and that's the default now.
6591
6604
6592 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6605 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6593 go out. I'll test it for a few days, then talk to Janko about
6606 go out. I'll test it for a few days, then talk to Janko about
6594 licences and announce it.
6607 licences and announce it.
6595
6608
6596 * Fixed the length of the auto-generated ---> prompt which appears
6609 * Fixed the length of the auto-generated ---> prompt which appears
6597 for auto-parens and auto-quotes. Getting this right isn't trivial,
6610 for auto-parens and auto-quotes. Getting this right isn't trivial,
6598 with all the color escapes, different prompt types and optional
6611 with all the color escapes, different prompt types and optional
6599 separators. But it seems to be working in all the combinations.
6612 separators. But it seems to be working in all the combinations.
6600
6613
6601 2001-11-26 Fernando Perez <fperez@colorado.edu>
6614 2001-11-26 Fernando Perez <fperez@colorado.edu>
6602
6615
6603 * Wrote a regexp filter to get option types from the option names
6616 * Wrote a regexp filter to get option types from the option names
6604 string. This eliminates the need to manually keep two duplicate
6617 string. This eliminates the need to manually keep two duplicate
6605 lists.
6618 lists.
6606
6619
6607 * Removed the unneeded check_option_names. Now options are handled
6620 * Removed the unneeded check_option_names. Now options are handled
6608 in a much saner manner and it's easy to visually check that things
6621 in a much saner manner and it's easy to visually check that things
6609 are ok.
6622 are ok.
6610
6623
6611 * Updated version numbers on all files I modified to carry a
6624 * Updated version numbers on all files I modified to carry a
6612 notice so Janko and Nathan have clear version markers.
6625 notice so Janko and Nathan have clear version markers.
6613
6626
6614 * Updated docstring for ultraTB with my changes. I should send
6627 * Updated docstring for ultraTB with my changes. I should send
6615 this to Nathan.
6628 this to Nathan.
6616
6629
6617 * Lots of small fixes. Ran everything through pychecker again.
6630 * Lots of small fixes. Ran everything through pychecker again.
6618
6631
6619 * Made loading of deep_reload an cmd line option. If it's not too
6632 * Made loading of deep_reload an cmd line option. If it's not too
6620 kosher, now people can just disable it. With -nodeep_reload it's
6633 kosher, now people can just disable it. With -nodeep_reload it's
6621 still available as dreload(), it just won't overwrite reload().
6634 still available as dreload(), it just won't overwrite reload().
6622
6635
6623 * Moved many options to the no| form (-opt and -noopt
6636 * Moved many options to the no| form (-opt and -noopt
6624 accepted). Cleaner.
6637 accepted). Cleaner.
6625
6638
6626 * Changed magic_log so that if called with no parameters, it uses
6639 * Changed magic_log so that if called with no parameters, it uses
6627 'rotate' mode. That way auto-generated logs aren't automatically
6640 'rotate' mode. That way auto-generated logs aren't automatically
6628 over-written. For normal logs, now a backup is made if it exists
6641 over-written. For normal logs, now a backup is made if it exists
6629 (only 1 level of backups). A new 'backup' mode was added to the
6642 (only 1 level of backups). A new 'backup' mode was added to the
6630 Logger class to support this. This was a request by Janko.
6643 Logger class to support this. This was a request by Janko.
6631
6644
6632 * Added @logoff/@logon to stop/restart an active log.
6645 * Added @logoff/@logon to stop/restart an active log.
6633
6646
6634 * Fixed a lot of bugs in log saving/replay. It was pretty
6647 * Fixed a lot of bugs in log saving/replay. It was pretty
6635 broken. Now special lines (!@,/) appear properly in the command
6648 broken. Now special lines (!@,/) appear properly in the command
6636 history after a log replay.
6649 history after a log replay.
6637
6650
6638 * Tried and failed to implement full session saving via pickle. My
6651 * Tried and failed to implement full session saving via pickle. My
6639 idea was to pickle __main__.__dict__, but modules can't be
6652 idea was to pickle __main__.__dict__, but modules can't be
6640 pickled. This would be a better alternative to replaying logs, but
6653 pickled. This would be a better alternative to replaying logs, but
6641 seems quite tricky to get to work. Changed -session to be called
6654 seems quite tricky to get to work. Changed -session to be called
6642 -logplay, which more accurately reflects what it does. And if we
6655 -logplay, which more accurately reflects what it does. And if we
6643 ever get real session saving working, -session is now available.
6656 ever get real session saving working, -session is now available.
6644
6657
6645 * Implemented color schemes for prompts also. As for tracebacks,
6658 * Implemented color schemes for prompts also. As for tracebacks,
6646 currently only NoColor and Linux are supported. But now the
6659 currently only NoColor and Linux are supported. But now the
6647 infrastructure is in place, based on a generic ColorScheme
6660 infrastructure is in place, based on a generic ColorScheme
6648 class. So writing and activating new schemes both for the prompts
6661 class. So writing and activating new schemes both for the prompts
6649 and the tracebacks should be straightforward.
6662 and the tracebacks should be straightforward.
6650
6663
6651 * Version 0.1.13 released, 0.1.14 opened.
6664 * Version 0.1.13 released, 0.1.14 opened.
6652
6665
6653 * Changed handling of options for output cache. Now counter is
6666 * Changed handling of options for output cache. Now counter is
6654 hardwired starting at 1 and one specifies the maximum number of
6667 hardwired starting at 1 and one specifies the maximum number of
6655 entries *in the outcache* (not the max prompt counter). This is
6668 entries *in the outcache* (not the max prompt counter). This is
6656 much better, since many statements won't increase the cache
6669 much better, since many statements won't increase the cache
6657 count. It also eliminated some confusing options, now there's only
6670 count. It also eliminated some confusing options, now there's only
6658 one: cache_size.
6671 one: cache_size.
6659
6672
6660 * Added 'alias' magic function and magic_alias option in the
6673 * Added 'alias' magic function and magic_alias option in the
6661 ipythonrc file. Now the user can easily define whatever names he
6674 ipythonrc file. Now the user can easily define whatever names he
6662 wants for the magic functions without having to play weird
6675 wants for the magic functions without having to play weird
6663 namespace games. This gives IPython a real shell-like feel.
6676 namespace games. This gives IPython a real shell-like feel.
6664
6677
6665 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6678 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6666 @ or not).
6679 @ or not).
6667
6680
6668 This was one of the last remaining 'visible' bugs (that I know
6681 This was one of the last remaining 'visible' bugs (that I know
6669 of). I think if I can clean up the session loading so it works
6682 of). I think if I can clean up the session loading so it works
6670 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6683 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6671 about licensing).
6684 about licensing).
6672
6685
6673 2001-11-25 Fernando Perez <fperez@colorado.edu>
6686 2001-11-25 Fernando Perez <fperez@colorado.edu>
6674
6687
6675 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6688 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6676 there's a cleaner distinction between what ? and ?? show.
6689 there's a cleaner distinction between what ? and ?? show.
6677
6690
6678 * Added screen_length option. Now the user can define his own
6691 * Added screen_length option. Now the user can define his own
6679 screen size for page() operations.
6692 screen size for page() operations.
6680
6693
6681 * Implemented magic shell-like functions with automatic code
6694 * Implemented magic shell-like functions with automatic code
6682 generation. Now adding another function is just a matter of adding
6695 generation. Now adding another function is just a matter of adding
6683 an entry to a dict, and the function is dynamically generated at
6696 an entry to a dict, and the function is dynamically generated at
6684 run-time. Python has some really cool features!
6697 run-time. Python has some really cool features!
6685
6698
6686 * Renamed many options to cleanup conventions a little. Now all
6699 * Renamed many options to cleanup conventions a little. Now all
6687 are lowercase, and only underscores where needed. Also in the code
6700 are lowercase, and only underscores where needed. Also in the code
6688 option name tables are clearer.
6701 option name tables are clearer.
6689
6702
6690 * Changed prompts a little. Now input is 'In [n]:' instead of
6703 * Changed prompts a little. Now input is 'In [n]:' instead of
6691 'In[n]:='. This allows it the numbers to be aligned with the
6704 'In[n]:='. This allows it the numbers to be aligned with the
6692 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6705 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6693 Python (it was a Mathematica thing). The '...' continuation prompt
6706 Python (it was a Mathematica thing). The '...' continuation prompt
6694 was also changed a little to align better.
6707 was also changed a little to align better.
6695
6708
6696 * Fixed bug when flushing output cache. Not all _p<n> variables
6709 * Fixed bug when flushing output cache. Not all _p<n> variables
6697 exist, so their deletion needs to be wrapped in a try:
6710 exist, so their deletion needs to be wrapped in a try:
6698
6711
6699 * Figured out how to properly use inspect.formatargspec() (it
6712 * Figured out how to properly use inspect.formatargspec() (it
6700 requires the args preceded by *). So I removed all the code from
6713 requires the args preceded by *). So I removed all the code from
6701 _get_pdef in Magic, which was just replicating that.
6714 _get_pdef in Magic, which was just replicating that.
6702
6715
6703 * Added test to prefilter to allow redefining magic function names
6716 * Added test to prefilter to allow redefining magic function names
6704 as variables. This is ok, since the @ form is always available,
6717 as variables. This is ok, since the @ form is always available,
6705 but whe should allow the user to define a variable called 'ls' if
6718 but whe should allow the user to define a variable called 'ls' if
6706 he needs it.
6719 he needs it.
6707
6720
6708 * Moved the ToDo information from README into a separate ToDo.
6721 * Moved the ToDo information from README into a separate ToDo.
6709
6722
6710 * General code cleanup and small bugfixes. I think it's close to a
6723 * General code cleanup and small bugfixes. I think it's close to a
6711 state where it can be released, obviously with a big 'beta'
6724 state where it can be released, obviously with a big 'beta'
6712 warning on it.
6725 warning on it.
6713
6726
6714 * Got the magic function split to work. Now all magics are defined
6727 * Got the magic function split to work. Now all magics are defined
6715 in a separate class. It just organizes things a bit, and now
6728 in a separate class. It just organizes things a bit, and now
6716 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6729 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6717 was too long).
6730 was too long).
6718
6731
6719 * Changed @clear to @reset to avoid potential confusions with
6732 * Changed @clear to @reset to avoid potential confusions with
6720 the shell command clear. Also renamed @cl to @clear, which does
6733 the shell command clear. Also renamed @cl to @clear, which does
6721 exactly what people expect it to from their shell experience.
6734 exactly what people expect it to from their shell experience.
6722
6735
6723 Added a check to the @reset command (since it's so
6736 Added a check to the @reset command (since it's so
6724 destructive, it's probably a good idea to ask for confirmation).
6737 destructive, it's probably a good idea to ask for confirmation).
6725 But now reset only works for full namespace resetting. Since the
6738 But now reset only works for full namespace resetting. Since the
6726 del keyword is already there for deleting a few specific
6739 del keyword is already there for deleting a few specific
6727 variables, I don't see the point of having a redundant magic
6740 variables, I don't see the point of having a redundant magic
6728 function for the same task.
6741 function for the same task.
6729
6742
6730 2001-11-24 Fernando Perez <fperez@colorado.edu>
6743 2001-11-24 Fernando Perez <fperez@colorado.edu>
6731
6744
6732 * Updated the builtin docs (esp. the ? ones).
6745 * Updated the builtin docs (esp. the ? ones).
6733
6746
6734 * Ran all the code through pychecker. Not terribly impressed with
6747 * Ran all the code through pychecker. Not terribly impressed with
6735 it: lots of spurious warnings and didn't really find anything of
6748 it: lots of spurious warnings and didn't really find anything of
6736 substance (just a few modules being imported and not used).
6749 substance (just a few modules being imported and not used).
6737
6750
6738 * Implemented the new ultraTB functionality into IPython. New
6751 * Implemented the new ultraTB functionality into IPython. New
6739 option: xcolors. This chooses color scheme. xmode now only selects
6752 option: xcolors. This chooses color scheme. xmode now only selects
6740 between Plain and Verbose. Better orthogonality.
6753 between Plain and Verbose. Better orthogonality.
6741
6754
6742 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6755 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6743 mode and color scheme for the exception handlers. Now it's
6756 mode and color scheme for the exception handlers. Now it's
6744 possible to have the verbose traceback with no coloring.
6757 possible to have the verbose traceback with no coloring.
6745
6758
6746 2001-11-23 Fernando Perez <fperez@colorado.edu>
6759 2001-11-23 Fernando Perez <fperez@colorado.edu>
6747
6760
6748 * Version 0.1.12 released, 0.1.13 opened.
6761 * Version 0.1.12 released, 0.1.13 opened.
6749
6762
6750 * Removed option to set auto-quote and auto-paren escapes by
6763 * Removed option to set auto-quote and auto-paren escapes by
6751 user. The chances of breaking valid syntax are just too high. If
6764 user. The chances of breaking valid syntax are just too high. If
6752 someone *really* wants, they can always dig into the code.
6765 someone *really* wants, they can always dig into the code.
6753
6766
6754 * Made prompt separators configurable.
6767 * Made prompt separators configurable.
6755
6768
6756 2001-11-22 Fernando Perez <fperez@colorado.edu>
6769 2001-11-22 Fernando Perez <fperez@colorado.edu>
6757
6770
6758 * Small bugfixes in many places.
6771 * Small bugfixes in many places.
6759
6772
6760 * Removed the MyCompleter class from ipplib. It seemed redundant
6773 * Removed the MyCompleter class from ipplib. It seemed redundant
6761 with the C-p,C-n history search functionality. Less code to
6774 with the C-p,C-n history search functionality. Less code to
6762 maintain.
6775 maintain.
6763
6776
6764 * Moved all the original ipython.py code into ipythonlib.py. Right
6777 * Moved all the original ipython.py code into ipythonlib.py. Right
6765 now it's just one big dump into a function called make_IPython, so
6778 now it's just one big dump into a function called make_IPython, so
6766 no real modularity has been gained. But at least it makes the
6779 no real modularity has been gained. But at least it makes the
6767 wrapper script tiny, and since ipythonlib is a module, it gets
6780 wrapper script tiny, and since ipythonlib is a module, it gets
6768 compiled and startup is much faster.
6781 compiled and startup is much faster.
6769
6782
6770 This is a reasobably 'deep' change, so we should test it for a
6783 This is a reasobably 'deep' change, so we should test it for a
6771 while without messing too much more with the code.
6784 while without messing too much more with the code.
6772
6785
6773 2001-11-21 Fernando Perez <fperez@colorado.edu>
6786 2001-11-21 Fernando Perez <fperez@colorado.edu>
6774
6787
6775 * Version 0.1.11 released, 0.1.12 opened for further work.
6788 * Version 0.1.11 released, 0.1.12 opened for further work.
6776
6789
6777 * Removed dependency on Itpl. It was only needed in one place. It
6790 * Removed dependency on Itpl. It was only needed in one place. It
6778 would be nice if this became part of python, though. It makes life
6791 would be nice if this became part of python, though. It makes life
6779 *a lot* easier in some cases.
6792 *a lot* easier in some cases.
6780
6793
6781 * Simplified the prefilter code a bit. Now all handlers are
6794 * Simplified the prefilter code a bit. Now all handlers are
6782 expected to explicitly return a value (at least a blank string).
6795 expected to explicitly return a value (at least a blank string).
6783
6796
6784 * Heavy edits in ipplib. Removed the help system altogether. Now
6797 * Heavy edits in ipplib. Removed the help system altogether. Now
6785 obj?/?? is used for inspecting objects, a magic @doc prints
6798 obj?/?? is used for inspecting objects, a magic @doc prints
6786 docstrings, and full-blown Python help is accessed via the 'help'
6799 docstrings, and full-blown Python help is accessed via the 'help'
6787 keyword. This cleans up a lot of code (less to maintain) and does
6800 keyword. This cleans up a lot of code (less to maintain) and does
6788 the job. Since 'help' is now a standard Python component, might as
6801 the job. Since 'help' is now a standard Python component, might as
6789 well use it and remove duplicate functionality.
6802 well use it and remove duplicate functionality.
6790
6803
6791 Also removed the option to use ipplib as a standalone program. By
6804 Also removed the option to use ipplib as a standalone program. By
6792 now it's too dependent on other parts of IPython to function alone.
6805 now it's too dependent on other parts of IPython to function alone.
6793
6806
6794 * Fixed bug in genutils.pager. It would crash if the pager was
6807 * Fixed bug in genutils.pager. It would crash if the pager was
6795 exited immediately after opening (broken pipe).
6808 exited immediately after opening (broken pipe).
6796
6809
6797 * Trimmed down the VerboseTB reporting a little. The header is
6810 * Trimmed down the VerboseTB reporting a little. The header is
6798 much shorter now and the repeated exception arguments at the end
6811 much shorter now and the repeated exception arguments at the end
6799 have been removed. For interactive use the old header seemed a bit
6812 have been removed. For interactive use the old header seemed a bit
6800 excessive.
6813 excessive.
6801
6814
6802 * Fixed small bug in output of @whos for variables with multi-word
6815 * Fixed small bug in output of @whos for variables with multi-word
6803 types (only first word was displayed).
6816 types (only first word was displayed).
6804
6817
6805 2001-11-17 Fernando Perez <fperez@colorado.edu>
6818 2001-11-17 Fernando Perez <fperez@colorado.edu>
6806
6819
6807 * Version 0.1.10 released, 0.1.11 opened for further work.
6820 * Version 0.1.10 released, 0.1.11 opened for further work.
6808
6821
6809 * Modified dirs and friends. dirs now *returns* the stack (not
6822 * Modified dirs and friends. dirs now *returns* the stack (not
6810 prints), so one can manipulate it as a variable. Convenient to
6823 prints), so one can manipulate it as a variable. Convenient to
6811 travel along many directories.
6824 travel along many directories.
6812
6825
6813 * Fixed bug in magic_pdef: would only work with functions with
6826 * Fixed bug in magic_pdef: would only work with functions with
6814 arguments with default values.
6827 arguments with default values.
6815
6828
6816 2001-11-14 Fernando Perez <fperez@colorado.edu>
6829 2001-11-14 Fernando Perez <fperez@colorado.edu>
6817
6830
6818 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6831 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6819 example with IPython. Various other minor fixes and cleanups.
6832 example with IPython. Various other minor fixes and cleanups.
6820
6833
6821 * Version 0.1.9 released, 0.1.10 opened for further work.
6834 * Version 0.1.9 released, 0.1.10 opened for further work.
6822
6835
6823 * Added sys.path to the list of directories searched in the
6836 * Added sys.path to the list of directories searched in the
6824 execfile= option. It used to be the current directory and the
6837 execfile= option. It used to be the current directory and the
6825 user's IPYTHONDIR only.
6838 user's IPYTHONDIR only.
6826
6839
6827 2001-11-13 Fernando Perez <fperez@colorado.edu>
6840 2001-11-13 Fernando Perez <fperez@colorado.edu>
6828
6841
6829 * Reinstated the raw_input/prefilter separation that Janko had
6842 * Reinstated the raw_input/prefilter separation that Janko had
6830 initially. This gives a more convenient setup for extending the
6843 initially. This gives a more convenient setup for extending the
6831 pre-processor from the outside: raw_input always gets a string,
6844 pre-processor from the outside: raw_input always gets a string,
6832 and prefilter has to process it. We can then redefine prefilter
6845 and prefilter has to process it. We can then redefine prefilter
6833 from the outside and implement extensions for special
6846 from the outside and implement extensions for special
6834 purposes.
6847 purposes.
6835
6848
6836 Today I got one for inputting PhysicalQuantity objects
6849 Today I got one for inputting PhysicalQuantity objects
6837 (from Scientific) without needing any function calls at
6850 (from Scientific) without needing any function calls at
6838 all. Extremely convenient, and it's all done as a user-level
6851 all. Extremely convenient, and it's all done as a user-level
6839 extension (no IPython code was touched). Now instead of:
6852 extension (no IPython code was touched). Now instead of:
6840 a = PhysicalQuantity(4.2,'m/s**2')
6853 a = PhysicalQuantity(4.2,'m/s**2')
6841 one can simply say
6854 one can simply say
6842 a = 4.2 m/s**2
6855 a = 4.2 m/s**2
6843 or even
6856 or even
6844 a = 4.2 m/s^2
6857 a = 4.2 m/s^2
6845
6858
6846 I use this, but it's also a proof of concept: IPython really is
6859 I use this, but it's also a proof of concept: IPython really is
6847 fully user-extensible, even at the level of the parsing of the
6860 fully user-extensible, even at the level of the parsing of the
6848 command line. It's not trivial, but it's perfectly doable.
6861 command line. It's not trivial, but it's perfectly doable.
6849
6862
6850 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6863 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6851 the problem of modules being loaded in the inverse order in which
6864 the problem of modules being loaded in the inverse order in which
6852 they were defined in
6865 they were defined in
6853
6866
6854 * Version 0.1.8 released, 0.1.9 opened for further work.
6867 * Version 0.1.8 released, 0.1.9 opened for further work.
6855
6868
6856 * Added magics pdef, source and file. They respectively show the
6869 * Added magics pdef, source and file. They respectively show the
6857 definition line ('prototype' in C), source code and full python
6870 definition line ('prototype' in C), source code and full python
6858 file for any callable object. The object inspector oinfo uses
6871 file for any callable object. The object inspector oinfo uses
6859 these to show the same information.
6872 these to show the same information.
6860
6873
6861 * Version 0.1.7 released, 0.1.8 opened for further work.
6874 * Version 0.1.7 released, 0.1.8 opened for further work.
6862
6875
6863 * Separated all the magic functions into a class called Magic. The
6876 * Separated all the magic functions into a class called Magic. The
6864 InteractiveShell class was becoming too big for Xemacs to handle
6877 InteractiveShell class was becoming too big for Xemacs to handle
6865 (de-indenting a line would lock it up for 10 seconds while it
6878 (de-indenting a line would lock it up for 10 seconds while it
6866 backtracked on the whole class!)
6879 backtracked on the whole class!)
6867
6880
6868 FIXME: didn't work. It can be done, but right now namespaces are
6881 FIXME: didn't work. It can be done, but right now namespaces are
6869 all messed up. Do it later (reverted it for now, so at least
6882 all messed up. Do it later (reverted it for now, so at least
6870 everything works as before).
6883 everything works as before).
6871
6884
6872 * Got the object introspection system (magic_oinfo) working! I
6885 * Got the object introspection system (magic_oinfo) working! I
6873 think this is pretty much ready for release to Janko, so he can
6886 think this is pretty much ready for release to Janko, so he can
6874 test it for a while and then announce it. Pretty much 100% of what
6887 test it for a while and then announce it. Pretty much 100% of what
6875 I wanted for the 'phase 1' release is ready. Happy, tired.
6888 I wanted for the 'phase 1' release is ready. Happy, tired.
6876
6889
6877 2001-11-12 Fernando Perez <fperez@colorado.edu>
6890 2001-11-12 Fernando Perez <fperez@colorado.edu>
6878
6891
6879 * Version 0.1.6 released, 0.1.7 opened for further work.
6892 * Version 0.1.6 released, 0.1.7 opened for further work.
6880
6893
6881 * Fixed bug in printing: it used to test for truth before
6894 * Fixed bug in printing: it used to test for truth before
6882 printing, so 0 wouldn't print. Now checks for None.
6895 printing, so 0 wouldn't print. Now checks for None.
6883
6896
6884 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6897 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6885 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6898 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6886 reaches by hand into the outputcache. Think of a better way to do
6899 reaches by hand into the outputcache. Think of a better way to do
6887 this later.
6900 this later.
6888
6901
6889 * Various small fixes thanks to Nathan's comments.
6902 * Various small fixes thanks to Nathan's comments.
6890
6903
6891 * Changed magic_pprint to magic_Pprint. This way it doesn't
6904 * Changed magic_pprint to magic_Pprint. This way it doesn't
6892 collide with pprint() and the name is consistent with the command
6905 collide with pprint() and the name is consistent with the command
6893 line option.
6906 line option.
6894
6907
6895 * Changed prompt counter behavior to be fully like
6908 * Changed prompt counter behavior to be fully like
6896 Mathematica's. That is, even input that doesn't return a result
6909 Mathematica's. That is, even input that doesn't return a result
6897 raises the prompt counter. The old behavior was kind of confusing
6910 raises the prompt counter. The old behavior was kind of confusing
6898 (getting the same prompt number several times if the operation
6911 (getting the same prompt number several times if the operation
6899 didn't return a result).
6912 didn't return a result).
6900
6913
6901 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6914 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6902
6915
6903 * Fixed -Classic mode (wasn't working anymore).
6916 * Fixed -Classic mode (wasn't working anymore).
6904
6917
6905 * Added colored prompts using Nathan's new code. Colors are
6918 * Added colored prompts using Nathan's new code. Colors are
6906 currently hardwired, they can be user-configurable. For
6919 currently hardwired, they can be user-configurable. For
6907 developers, they can be chosen in file ipythonlib.py, at the
6920 developers, they can be chosen in file ipythonlib.py, at the
6908 beginning of the CachedOutput class def.
6921 beginning of the CachedOutput class def.
6909
6922
6910 2001-11-11 Fernando Perez <fperez@colorado.edu>
6923 2001-11-11 Fernando Perez <fperez@colorado.edu>
6911
6924
6912 * Version 0.1.5 released, 0.1.6 opened for further work.
6925 * Version 0.1.5 released, 0.1.6 opened for further work.
6913
6926
6914 * Changed magic_env to *return* the environment as a dict (not to
6927 * Changed magic_env to *return* the environment as a dict (not to
6915 print it). This way it prints, but it can also be processed.
6928 print it). This way it prints, but it can also be processed.
6916
6929
6917 * Added Verbose exception reporting to interactive
6930 * Added Verbose exception reporting to interactive
6918 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6931 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6919 traceback. Had to make some changes to the ultraTB file. This is
6932 traceback. Had to make some changes to the ultraTB file. This is
6920 probably the last 'big' thing in my mental todo list. This ties
6933 probably the last 'big' thing in my mental todo list. This ties
6921 in with the next entry:
6934 in with the next entry:
6922
6935
6923 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6936 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6924 has to specify is Plain, Color or Verbose for all exception
6937 has to specify is Plain, Color or Verbose for all exception
6925 handling.
6938 handling.
6926
6939
6927 * Removed ShellServices option. All this can really be done via
6940 * Removed ShellServices option. All this can really be done via
6928 the magic system. It's easier to extend, cleaner and has automatic
6941 the magic system. It's easier to extend, cleaner and has automatic
6929 namespace protection and documentation.
6942 namespace protection and documentation.
6930
6943
6931 2001-11-09 Fernando Perez <fperez@colorado.edu>
6944 2001-11-09 Fernando Perez <fperez@colorado.edu>
6932
6945
6933 * Fixed bug in output cache flushing (missing parameter to
6946 * Fixed bug in output cache flushing (missing parameter to
6934 __init__). Other small bugs fixed (found using pychecker).
6947 __init__). Other small bugs fixed (found using pychecker).
6935
6948
6936 * Version 0.1.4 opened for bugfixing.
6949 * Version 0.1.4 opened for bugfixing.
6937
6950
6938 2001-11-07 Fernando Perez <fperez@colorado.edu>
6951 2001-11-07 Fernando Perez <fperez@colorado.edu>
6939
6952
6940 * Version 0.1.3 released, mainly because of the raw_input bug.
6953 * Version 0.1.3 released, mainly because of the raw_input bug.
6941
6954
6942 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6955 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6943 and when testing for whether things were callable, a call could
6956 and when testing for whether things were callable, a call could
6944 actually be made to certain functions. They would get called again
6957 actually be made to certain functions. They would get called again
6945 once 'really' executed, with a resulting double call. A disaster
6958 once 'really' executed, with a resulting double call. A disaster
6946 in many cases (list.reverse() would never work!).
6959 in many cases (list.reverse() would never work!).
6947
6960
6948 * Removed prefilter() function, moved its code to raw_input (which
6961 * Removed prefilter() function, moved its code to raw_input (which
6949 after all was just a near-empty caller for prefilter). This saves
6962 after all was just a near-empty caller for prefilter). This saves
6950 a function call on every prompt, and simplifies the class a tiny bit.
6963 a function call on every prompt, and simplifies the class a tiny bit.
6951
6964
6952 * Fix _ip to __ip name in magic example file.
6965 * Fix _ip to __ip name in magic example file.
6953
6966
6954 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6967 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6955 work with non-gnu versions of tar.
6968 work with non-gnu versions of tar.
6956
6969
6957 2001-11-06 Fernando Perez <fperez@colorado.edu>
6970 2001-11-06 Fernando Perez <fperez@colorado.edu>
6958
6971
6959 * Version 0.1.2. Just to keep track of the recent changes.
6972 * Version 0.1.2. Just to keep track of the recent changes.
6960
6973
6961 * Fixed nasty bug in output prompt routine. It used to check 'if
6974 * Fixed nasty bug in output prompt routine. It used to check 'if
6962 arg != None...'. Problem is, this fails if arg implements a
6975 arg != None...'. Problem is, this fails if arg implements a
6963 special comparison (__cmp__) which disallows comparing to
6976 special comparison (__cmp__) which disallows comparing to
6964 None. Found it when trying to use the PhysicalQuantity module from
6977 None. Found it when trying to use the PhysicalQuantity module from
6965 ScientificPython.
6978 ScientificPython.
6966
6979
6967 2001-11-05 Fernando Perez <fperez@colorado.edu>
6980 2001-11-05 Fernando Perez <fperez@colorado.edu>
6968
6981
6969 * Also added dirs. Now the pushd/popd/dirs family functions
6982 * Also added dirs. Now the pushd/popd/dirs family functions
6970 basically like the shell, with the added convenience of going home
6983 basically like the shell, with the added convenience of going home
6971 when called with no args.
6984 when called with no args.
6972
6985
6973 * pushd/popd slightly modified to mimic shell behavior more
6986 * pushd/popd slightly modified to mimic shell behavior more
6974 closely.
6987 closely.
6975
6988
6976 * Added env,pushd,popd from ShellServices as magic functions. I
6989 * Added env,pushd,popd from ShellServices as magic functions. I
6977 think the cleanest will be to port all desired functions from
6990 think the cleanest will be to port all desired functions from
6978 ShellServices as magics and remove ShellServices altogether. This
6991 ShellServices as magics and remove ShellServices altogether. This
6979 will provide a single, clean way of adding functionality
6992 will provide a single, clean way of adding functionality
6980 (shell-type or otherwise) to IP.
6993 (shell-type or otherwise) to IP.
6981
6994
6982 2001-11-04 Fernando Perez <fperez@colorado.edu>
6995 2001-11-04 Fernando Perez <fperez@colorado.edu>
6983
6996
6984 * Added .ipython/ directory to sys.path. This way users can keep
6997 * Added .ipython/ directory to sys.path. This way users can keep
6985 customizations there and access them via import.
6998 customizations there and access them via import.
6986
6999
6987 2001-11-03 Fernando Perez <fperez@colorado.edu>
7000 2001-11-03 Fernando Perez <fperez@colorado.edu>
6988
7001
6989 * Opened version 0.1.1 for new changes.
7002 * Opened version 0.1.1 for new changes.
6990
7003
6991 * Changed version number to 0.1.0: first 'public' release, sent to
7004 * Changed version number to 0.1.0: first 'public' release, sent to
6992 Nathan and Janko.
7005 Nathan and Janko.
6993
7006
6994 * Lots of small fixes and tweaks.
7007 * Lots of small fixes and tweaks.
6995
7008
6996 * Minor changes to whos format. Now strings are shown, snipped if
7009 * Minor changes to whos format. Now strings are shown, snipped if
6997 too long.
7010 too long.
6998
7011
6999 * Changed ShellServices to work on __main__ so they show up in @who
7012 * Changed ShellServices to work on __main__ so they show up in @who
7000
7013
7001 * Help also works with ? at the end of a line:
7014 * Help also works with ? at the end of a line:
7002 ?sin and sin?
7015 ?sin and sin?
7003 both produce the same effect. This is nice, as often I use the
7016 both produce the same effect. This is nice, as often I use the
7004 tab-complete to find the name of a method, but I used to then have
7017 tab-complete to find the name of a method, but I used to then have
7005 to go to the beginning of the line to put a ? if I wanted more
7018 to go to the beginning of the line to put a ? if I wanted more
7006 info. Now I can just add the ? and hit return. Convenient.
7019 info. Now I can just add the ? and hit return. Convenient.
7007
7020
7008 2001-11-02 Fernando Perez <fperez@colorado.edu>
7021 2001-11-02 Fernando Perez <fperez@colorado.edu>
7009
7022
7010 * Python version check (>=2.1) added.
7023 * Python version check (>=2.1) added.
7011
7024
7012 * Added LazyPython documentation. At this point the docs are quite
7025 * Added LazyPython documentation. At this point the docs are quite
7013 a mess. A cleanup is in order.
7026 a mess. A cleanup is in order.
7014
7027
7015 * Auto-installer created. For some bizarre reason, the zipfiles
7028 * Auto-installer created. For some bizarre reason, the zipfiles
7016 module isn't working on my system. So I made a tar version
7029 module isn't working on my system. So I made a tar version
7017 (hopefully the command line options in various systems won't kill
7030 (hopefully the command line options in various systems won't kill
7018 me).
7031 me).
7019
7032
7020 * Fixes to Struct in genutils. Now all dictionary-like methods are
7033 * Fixes to Struct in genutils. Now all dictionary-like methods are
7021 protected (reasonably).
7034 protected (reasonably).
7022
7035
7023 * Added pager function to genutils and changed ? to print usage
7036 * Added pager function to genutils and changed ? to print usage
7024 note through it (it was too long).
7037 note through it (it was too long).
7025
7038
7026 * Added the LazyPython functionality. Works great! I changed the
7039 * Added the LazyPython functionality. Works great! I changed the
7027 auto-quote escape to ';', it's on home row and next to '. But
7040 auto-quote escape to ';', it's on home row and next to '. But
7028 both auto-quote and auto-paren (still /) escapes are command-line
7041 both auto-quote and auto-paren (still /) escapes are command-line
7029 parameters.
7042 parameters.
7030
7043
7031
7044
7032 2001-11-01 Fernando Perez <fperez@colorado.edu>
7045 2001-11-01 Fernando Perez <fperez@colorado.edu>
7033
7046
7034 * Version changed to 0.0.7. Fairly large change: configuration now
7047 * Version changed to 0.0.7. Fairly large change: configuration now
7035 is all stored in a directory, by default .ipython. There, all
7048 is all stored in a directory, by default .ipython. There, all
7036 config files have normal looking names (not .names)
7049 config files have normal looking names (not .names)
7037
7050
7038 * Version 0.0.6 Released first to Lucas and Archie as a test
7051 * Version 0.0.6 Released first to Lucas and Archie as a test
7039 run. Since it's the first 'semi-public' release, change version to
7052 run. Since it's the first 'semi-public' release, change version to
7040 > 0.0.6 for any changes now.
7053 > 0.0.6 for any changes now.
7041
7054
7042 * Stuff I had put in the ipplib.py changelog:
7055 * Stuff I had put in the ipplib.py changelog:
7043
7056
7044 Changes to InteractiveShell:
7057 Changes to InteractiveShell:
7045
7058
7046 - Made the usage message a parameter.
7059 - Made the usage message a parameter.
7047
7060
7048 - Require the name of the shell variable to be given. It's a bit
7061 - Require the name of the shell variable to be given. It's a bit
7049 of a hack, but allows the name 'shell' not to be hardwired in the
7062 of a hack, but allows the name 'shell' not to be hardwired in the
7050 magic (@) handler, which is problematic b/c it requires
7063 magic (@) handler, which is problematic b/c it requires
7051 polluting the global namespace with 'shell'. This in turn is
7064 polluting the global namespace with 'shell'. This in turn is
7052 fragile: if a user redefines a variable called shell, things
7065 fragile: if a user redefines a variable called shell, things
7053 break.
7066 break.
7054
7067
7055 - magic @: all functions available through @ need to be defined
7068 - magic @: all functions available through @ need to be defined
7056 as magic_<name>, even though they can be called simply as
7069 as magic_<name>, even though they can be called simply as
7057 @<name>. This allows the special command @magic to gather
7070 @<name>. This allows the special command @magic to gather
7058 information automatically about all existing magic functions,
7071 information automatically about all existing magic functions,
7059 even if they are run-time user extensions, by parsing the shell
7072 even if they are run-time user extensions, by parsing the shell
7060 instance __dict__ looking for special magic_ names.
7073 instance __dict__ looking for special magic_ names.
7061
7074
7062 - mainloop: added *two* local namespace parameters. This allows
7075 - mainloop: added *two* local namespace parameters. This allows
7063 the class to differentiate between parameters which were there
7076 the class to differentiate between parameters which were there
7064 before and after command line initialization was processed. This
7077 before and after command line initialization was processed. This
7065 way, later @who can show things loaded at startup by the
7078 way, later @who can show things loaded at startup by the
7066 user. This trick was necessary to make session saving/reloading
7079 user. This trick was necessary to make session saving/reloading
7067 really work: ideally after saving/exiting/reloading a session,
7080 really work: ideally after saving/exiting/reloading a session,
7068 *everything* should look the same, including the output of @who. I
7081 *everything* should look the same, including the output of @who. I
7069 was only able to make this work with this double namespace
7082 was only able to make this work with this double namespace
7070 trick.
7083 trick.
7071
7084
7072 - added a header to the logfile which allows (almost) full
7085 - added a header to the logfile which allows (almost) full
7073 session restoring.
7086 session restoring.
7074
7087
7075 - prepend lines beginning with @ or !, with a and log
7088 - prepend lines beginning with @ or !, with a and log
7076 them. Why? !lines: may be useful to know what you did @lines:
7089 them. Why? !lines: may be useful to know what you did @lines:
7077 they may affect session state. So when restoring a session, at
7090 they may affect session state. So when restoring a session, at
7078 least inform the user of their presence. I couldn't quite get
7091 least inform the user of their presence. I couldn't quite get
7079 them to properly re-execute, but at least the user is warned.
7092 them to properly re-execute, but at least the user is warned.
7080
7093
7081 * Started ChangeLog.
7094 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now